]> git.sur5r.net Git - i3/i3/blobdiff - i3-msg/Makefile
Merge branch 'master' into next
[i3/i3] / i3-msg / Makefile
index a5e15b6e49d0aad96826f4a2397398b1de4c3d55..1b7c1c04a9bb092660f958af71ab52f2eb306603 100644 (file)
@@ -3,6 +3,8 @@ TOPDIR=..
 
 include $(TOPDIR)/common.mk
 
+CFLAGS += -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)
@@ -10,16 +12,18 @@ HEADERS=$(wildcard *.h)
 # Depend on the specific file (.c for each .o) and on all headers
 %.o: %.c ${HEADERS}
        echo "CC $<"
-       $(CC) $(CFLAGS) -c -o $@ $<
+       $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
+
+all: i3-msg
 
-all: ${FILES}
+i3-msg: ${FILES}
        echo "LINK i3-msg"
-       $(CC) -o i3-msg ${FILES} $(LDFLAGS)
+       $(CC) $(LDFLAGS) -o i3-msg ${FILES} $(LIBS)
 
 install: all
        echo "INSTALL"
-       $(INSTALL) -d -m 0755 $(DESTDIR)/usr/bin
-       $(INSTALL) -m 0755 i3-msg $(DESTDIR)/usr/bin/
+       $(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
+       $(INSTALL) -m 0755 i3-msg $(DESTDIR)$(PREFIX)/bin/
 
 clean:
        rm -f *.o