2009-09-20 15:44:14 +02:00
|
|
|
# Default value so one can compile i3-input standalone
|
|
|
|
TOPDIR=..
|
|
|
|
|
|
|
|
include $(TOPDIR)/common.mk
|
|
|
|
|
2011-10-23 14:15:20 +02:00
|
|
|
CPPFLAGS += -I$(TOPDIR)/include
|
|
|
|
|
2009-09-20 15:44:14 +02:00
|
|
|
# Depend on the object files of all source-files in src/*.c and on all header files
|
|
|
|
FILES=$(patsubst %.c,%.o,$(wildcard *.c))
|
|
|
|
HEADERS=$(wildcard *.h)
|
|
|
|
|
|
|
|
# Depend on the specific file (.c for each .o) and on all headers
|
|
|
|
%.o: %.c ${HEADERS}
|
2011-10-02 17:04:18 +02:00
|
|
|
echo "[i3-input] CC $<"
|
2011-07-13 13:22:15 +02:00
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
|
2009-09-20 15:44:14 +02:00
|
|
|
|
2011-07-25 00:31:35 +02:00
|
|
|
all: i3-input
|
|
|
|
|
2011-10-23 14:15:20 +02:00
|
|
|
i3-input: $(TOPDIR)/libi3/libi3.a ${FILES}
|
2011-10-02 17:04:18 +02:00
|
|
|
echo "[i3-input] LINK i3-input"
|
2011-10-23 14:15:20 +02:00
|
|
|
$(CC) $(LDFLAGS) -o $@ $(filter-out libi3/libi3.a,$^) $(LIBS)
|
|
|
|
|
|
|
|
$(TOPDIR)/libi3/%.a: $(TOPDIR)/libi3/*.c
|
|
|
|
$(MAKE) -C $(TOPDIR)/libi3
|
2009-09-20 15:44:14 +02:00
|
|
|
|
|
|
|
install: all
|
2011-10-02 17:04:18 +02:00
|
|
|
echo "[i3-input] INSTALL"
|
2010-03-16 00:08:54 +01:00
|
|
|
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
|
|
|
|
$(INSTALL) -m 0755 i3-input $(DESTDIR)$(PREFIX)/bin/
|
2009-09-20 15:44:14 +02:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f *.o
|
|
|
|
|
|
|
|
distclean: clean
|
|
|
|
rm -f i3-input
|