2009-09-20 09:44:14 -04:00
|
|
|
# Default value so one can compile i3-input standalone
|
|
|
|
TOPDIR=..
|
|
|
|
|
|
|
|
include $(TOPDIR)/common.mk
|
|
|
|
|
2011-10-23 08:15:20 -04:00
|
|
|
CPPFLAGS += -I$(TOPDIR)/include
|
|
|
|
|
2009-09-20 09:44:14 -04: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 11:04:18 -04:00
|
|
|
echo "[i3-input] CC $<"
|
2011-07-13 07:22:15 -04:00
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
|
2009-09-20 09:44:14 -04:00
|
|
|
|
2011-07-24 18:31:35 -04:00
|
|
|
all: i3-input
|
|
|
|
|
2011-10-23 08:15:20 -04:00
|
|
|
i3-input: $(TOPDIR)/libi3/libi3.a ${FILES}
|
2011-10-02 11:04:18 -04:00
|
|
|
echo "[i3-input] LINK i3-input"
|
2011-10-23 08:15:20 -04:00
|
|
|
$(CC) $(LDFLAGS) -o $@ $(filter-out libi3/libi3.a,$^) $(LIBS)
|
|
|
|
|
|
|
|
$(TOPDIR)/libi3/%.a: $(TOPDIR)/libi3/*.c
|
|
|
|
$(MAKE) -C $(TOPDIR)/libi3
|
2009-09-20 09:44:14 -04:00
|
|
|
|
|
|
|
install: all
|
2011-10-02 11:04:18 -04:00
|
|
|
echo "[i3-input] INSTALL"
|
2010-03-15 19:08:54 -04:00
|
|
|
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
|
|
|
|
$(INSTALL) -m 0755 i3-input $(DESTDIR)$(PREFIX)/bin/
|
2009-09-20 09:44:14 -04:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f *.o
|
|
|
|
|
|
|
|
distclean: clean
|
|
|
|
rm -f i3-input
|