1 # Default value so one can compile i3-input standalone
4 include $(TOPDIR)/common.mk
6 # Depend on the object files of all source-files in src/*.c and on all header files
7 AUTOGENERATED:=cfgparse.tab.c cfgparse.yy.c
8 FILES:=$(patsubst %.c,%.o,$(filter-out $(AUTOGENERATED),$(wildcard *.c)))
9 HEADERS:=$(wildcard *.h)
11 CPPFLAGS += -I$(TOPDIR)/include
13 # Depend on the specific file (.c for each .o) and on all headers
15 echo "[i3-config-wizard] CC $<"
16 $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
20 i3-config-wizard: $(TOPDIR)/libi3/libi3.a cfgparse.y.o cfgparse.yy.o ${FILES}
21 echo "[i3-config-wizard] LINK i3-config-wizard"
22 $(CC) $(LDFLAGS) -o $@ $(filter-out libi3/libi3.a,$^) $(LIBS)
24 $(TOPDIR)/libi3/%.a: $(TOPDIR)/libi3/*.c
25 $(MAKE) -C $(TOPDIR)/libi3
27 cfgparse.yy.o: cfgparse.l cfgparse.y.o ${HEADERS}
28 echo "[i3-config-wizard] LEX $<"
29 $(FLEX) -i -o$(@:.o=.c) $<
30 $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $(@:.o=.c)
32 cfgparse.y.o: cfgparse.y ${HEADERS}
33 echo "[i3-config-wizard] YACC $<"
34 $(BISON) --debug --verbose -b $(basename $< .y) -d $<
35 $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $(<:.y=.tab.c)
39 echo "[i3-config-wizard] INSTALL"
40 $(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
41 $(INSTALL) -m 0755 i3-config-wizard $(DESTDIR)$(PREFIX)/bin/
44 rm -f *.o cfgparse.tab.{c,h} cfgparse.output cfgparse.yy.c
47 rm -f i3-config-wizard