]> git.sur5r.net Git - i3/i3/blobdiff - i3-nagbar/Makefile
Merge branch 'next'
[i3/i3] / i3-nagbar / Makefile
index fed223db221325500a94497853d4357cc9ef16ff..05a5b911c3f40224d13c33f61012b6f8fa0638ee 100644 (file)
@@ -3,6 +3,8 @@ TOPDIR=..
 
 include $(TOPDIR)/common.mk
 
+CPPFLAGS += -I$(TOPDIR)/include
+
 # 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)
@@ -14,9 +16,12 @@ HEADERS=$(wildcard *.h)
 
 all: i3-nagbar
 
-i3-nagbar: ${FILES}
+i3-nagbar: $(TOPDIR)/libi3/libi3.a ${FILES}
        echo "[i3-nagbar] LINK i3-nagbar"
-       $(CC) $(LDFLAGS) -o $@ ${FILES} $(LIBS)
+       $(CC) $(LDFLAGS) -o $@ $(filter-out libi3/libi3.a,$^) $(LIBS)
+
+$(TOPDIR)/libi3/%.a: $(TOPDIR)/libi3/*.c
+       $(MAKE) -C $(TOPDIR)/libi3
 
 install: all
        echo "[i3-nagbar] INSTALL"