]> git.sur5r.net Git - i3/i3/blob - i3-input/Makefile
makefiles: build subdirs (Thanks Kacper)
[i3/i3] / i3-input / Makefile
1 # Default value so one can compile i3-input standalone
2 TOPDIR=..
3
4 include $(TOPDIR)/common.mk
5
6 # Depend on the object files of all source-files in src/*.c and on all header files
7 FILES=$(patsubst %.c,%.o,$(wildcard *.c))
8 HEADERS=$(wildcard *.h)
9
10 # Depend on the specific file (.c for each .o) and on all headers
11 %.o: %.c ${HEADERS}
12         echo "CC $<"
13         $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
14
15 all: i3-input
16
17 i3-input: ${FILES}
18         echo "LINK i3-input"
19         $(CC) $(LDFLAGS) -o $@ ${FILES} $(LIBS)
20
21 install: all
22         echo "INSTALL"
23         $(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
24         $(INSTALL) -m 0755 i3-input $(DESTDIR)$(PREFIX)/bin/
25
26 clean:
27         rm -f *.o
28
29 distclean: clean
30         rm -f i3-input