From: Quentin Glidic Date: Sun, 17 Jun 2012 12:37:07 +0000 (+0200) Subject: Add stub Makefiles to allow subdir make calls X-Git-Tag: 4.3~177 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e452acb30e8253a3a4b53233f22b31460cb02aec;p=i3%2Fi3 Add stub Makefiles to allow subdir make calls --- diff --git a/docs/Makefile b/docs/Makefile index fc41236f..d6e670c9 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,36 +1,7 @@ -# To pass additional parameters for asciidoc -ASCIIDOC=asciidoc - -ASCIIDOC_TARGETS:=hacking-howto.html debugging.html debugging-release-version.html userguide.html ipc.html multi-monitor.html wsbar.html testsuite.html i3bar-protocol.html - -all: ${ASCIIDOC_TARGETS} - -hacking-howto.html: hacking-howto - $(ASCIIDOC) -a toc -n $< - -i3bar-protocol.html: i3bar-protocol - $(ASCIIDOC) -a toc -n $< - -debugging.html: debugging - $(ASCIIDOC) -n $< - -debugging-release-version.html: debugging-release-version - $(ASCIIDOC) -n $< - -userguide.html: userguide - $(ASCIIDOC) -a toc -n $< - -testsuite.html: testsuite - $(ASCIIDOC) -a toc -n $< - -ipc.html: ipc - $(ASCIIDOC) -a toc -n $< - -multi-monitor.html: multi-monitor - $(ASCIIDOC) -a toc -n $< - -wsbar.html: wsbar - $(ASCIIDOC) -a toc -n $< +all: + $(MAKE) -C .. docs clean: - rm -f ${ASCIIDOC_TARGETS} + $(MAKE) -C .. clean-docs + +.PHONY: all clean diff --git a/i3-config-wizard/Makefile b/i3-config-wizard/Makefile index 75d4684f..d5ac18c6 100644 --- a/i3-config-wizard/Makefile +++ b/i3-config-wizard/Makefile @@ -1,47 +1,10 @@ -# Default value so one can compile i3-input standalone -TOPDIR=.. +all: + $(MAKE) -C .. i3-config-wizard/i3-config-wizard -include $(TOPDIR)/common.mk - -# Depend on the object files of all source-files in src/*.c and on all header files -AUTOGENERATED:=cfgparse.tab.c cfgparse.yy.c -FILES:=$(patsubst %.c,%.o,$(filter-out $(AUTOGENERATED),$(wildcard *.c))) -HEADERS:=$(wildcard *.h) - -CPPFLAGS += -I$(TOPDIR)/include - -# Depend on the specific file (.c for each .o) and on all headers -%.o: %.c ${HEADERS} - echo "[i3-config-wizard] CC $<" - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< - -all: i3-config-wizard - -i3-config-wizard: $(TOPDIR)/libi3/libi3.a cfgparse.y.o cfgparse.yy.o ${FILES} - echo "[i3-config-wizard] LINK i3-config-wizard" - $(CC) $(LDFLAGS) -o $@ $(filter-out libi3/libi3.a,$^) $(LIBS) - -$(TOPDIR)/libi3/%.a: $(TOPDIR)/libi3/*.c - $(MAKE) -C $(TOPDIR)/libi3 - -cfgparse.yy.o: cfgparse.l cfgparse.y.o ${HEADERS} - echo "[i3-config-wizard] LEX $<" - $(FLEX) -i -o$(@:.o=.c) $< - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $(@:.o=.c) - -cfgparse.y.o: cfgparse.y ${HEADERS} - echo "[i3-config-wizard] YACC $<" - $(BISON) --debug --verbose -b $(basename $< .y) -d $< - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $(<:.y=.tab.c) - - -install: all - echo "[i3-config-wizard] INSTALL" - $(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin - $(INSTALL) -m 0755 i3-config-wizard $(DESTDIR)$(PREFIX)/bin/ +install: + $(MAKE) -C .. install-i3-config-wizard clean: - rm -f *.o cfgparse.tab.{c,h} cfgparse.output cfgparse.yy.c + $(MAKE) -C .. clean-i3-config-wizard -distclean: clean - rm -f i3-config-wizard +.PHONY: all install clean diff --git a/i3-dump-log/Makefile b/i3-dump-log/Makefile index 18076e51..2b9e4fe9 100644 --- a/i3-dump-log/Makefile +++ b/i3-dump-log/Makefile @@ -1,32 +1,10 @@ -# Default value so one can compile i3-dump-log standalone -TOPDIR=.. +all: + $(MAKE) -C .. i3-dump-log/i3-dump-log -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) - -# Depend on the specific file (.c for each .o) and on all headers -%.o: %.c ${HEADERS} - echo "[i3-dump-log] CC $<" - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< - -all: i3-dump-log - -i3-dump-log: ${FILES} - echo "[i3-dump-log] LINK i3-dump-log" - $(CC) $(LDFLAGS) -o i3-dump-log ${FILES} $(LIBS) - -install: all - echo "[i3-dump-log] INSTALL" - $(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin - $(INSTALL) -m 0755 i3-dump-log $(DESTDIR)$(PREFIX)/bin/ +install: + $(MAKE) -C .. install-i3-dump-log clean: - rm -f *.o + $(MAKE) -C .. clean-i3-dump-log -distclean: clean - rm -f i3-dump-log +.PHONY: all install clean diff --git a/i3-input/Makefile b/i3-input/Makefile index 493df784..e1c8eae5 100644 --- a/i3-input/Makefile +++ b/i3-input/Makefile @@ -1,35 +1,10 @@ -# Default value so one can compile i3-input standalone -TOPDIR=.. +all: + $(MAKE) -C .. i3-input/i3-input -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) - -# Depend on the specific file (.c for each .o) and on all headers -%.o: %.c ${HEADERS} - echo "[i3-input] CC $<" - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< - -all: i3-input - -i3-input: $(TOPDIR)/libi3/libi3.a ${FILES} - echo "[i3-input] LINK i3-input" - $(CC) $(LDFLAGS) -o $@ $(filter-out libi3/libi3.a,$^) $(LIBS) - -$(TOPDIR)/libi3/%.a: $(TOPDIR)/libi3/*.c - $(MAKE) -C $(TOPDIR)/libi3 - -install: all - echo "[i3-input] INSTALL" - $(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin - $(INSTALL) -m 0755 i3-input $(DESTDIR)$(PREFIX)/bin/ +install: + $(MAKE) -C .. install-i3-input clean: - rm -f *.o + $(MAKE) -C .. clean-i3-input -distclean: clean - rm -f i3-input +.PHONY: all install clean diff --git a/i3-msg/Makefile b/i3-msg/Makefile index 617df932..fedb31e7 100644 --- a/i3-msg/Makefile +++ b/i3-msg/Makefile @@ -1,32 +1,10 @@ -# Default value so one can compile i3-msg standalone -TOPDIR=.. +all: + $(MAKE) -C .. i3-msg/i3-msg -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) - -# Depend on the specific file (.c for each .o) and on all headers -%.o: %.c ${HEADERS} - echo "[i3-msg] CC $<" - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< - -all: i3-msg - -i3-msg: ${FILES} - echo "[i3-msg] LINK i3-msg" - $(CC) $(LDFLAGS) -o i3-msg ${FILES} $(LIBS) - -install: all - echo "[i3-msg] INSTALL" - $(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin - $(INSTALL) -m 0755 i3-msg $(DESTDIR)$(PREFIX)/bin/ +install: + $(MAKE) -C .. install-i3-msg clean: - rm -f *.o + $(MAKE) -C .. clean-i3-msg -distclean: clean - rm -f i3-msg +.PHONY: all install clean diff --git a/i3-nagbar/Makefile b/i3-nagbar/Makefile index 05a5b911..12748e21 100644 --- a/i3-nagbar/Makefile +++ b/i3-nagbar/Makefile @@ -1,35 +1,10 @@ -# Default value so one can compile i3-nagbar standalone -TOPDIR=.. +all: + $(MAKE) -C .. i3-nagbar/i3-nagbar -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) - -# Depend on the specific file (.c for each .o) and on all headers -%.o: %.c ${HEADERS} - echo "[i3-nagbar] CC $<" - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< - -all: i3-nagbar - -i3-nagbar: $(TOPDIR)/libi3/libi3.a ${FILES} - echo "[i3-nagbar] LINK i3-nagbar" - $(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" - $(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin - $(INSTALL) -m 0755 i3-nagbar $(DESTDIR)$(PREFIX)/bin/ +install: + $(MAKE) -C .. install-i3-nagbar clean: - rm -f *.o + $(MAKE) -C .. clean-i3-nagbar -distclean: clean - rm -f i3-nagbar +.PHONY: all install clean diff --git a/i3bar/Makefile b/i3bar/Makefile index 79d0e7cd..cd23cd81 100644 --- a/i3bar/Makefile +++ b/i3bar/Makefile @@ -1,42 +1,10 @@ -TOPDIR=.. +all: + $(MAKE) -C .. i3bar/i3bar -include $(TOPDIR)/common.mk - -FILES:=$(wildcard src/*.c) -FILES:=$(FILES:.c=.o) -HEADERS:=$(wildcard include/*.h) - -CPPFLAGS += -I$(TOPDIR)/include - -all: i3bar doc - -i3bar: $(TOPDIR)/libi3/libi3.a ${FILES} - echo "[i3bar] LINK" - $(CC) $(LDFLAGS) -o $@ $(filter-out libi3/libi3.a,$^) $(LIBS) - -$(TOPDIR)/libi3/%.a: $(TOPDIR)/libi3/*.c - $(MAKE) -C $(TOPDIR)/libi3 - -doc: - echo "" - echo "[i3bar] SUBDIR doc" - $(MAKE) -C doc - -src/%.o: src/%.c ${HEADERS} - echo "[i3bar] CC $<" - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< - -install: all - echo "[i3bar] INSTALL" - $(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin - $(INSTALL) -m 0755 i3bar $(DESTDIR)$(PREFIX)/bin +install: + $(MAKE) -C .. install-i3bar clean: - rm -f src/*.o - $(MAKE) -C doc clean - -distclean: clean - rm -f i3bar - $(MAKE) -C doc distclean + $(MAKE) -C .. clean-i3bar -.PHONY: install clean distclean doc +.PHONY: all install clean diff --git a/libi3/Makefile b/libi3/Makefile new file mode 100644 index 00000000..2c2f68ad --- /dev/null +++ b/libi3/Makefile @@ -0,0 +1,7 @@ +all: + $(MAKE) -C .. libi3.a + +clean: + $(MAKE) -C .. clean-libi3 + +.PHONY: all clean diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 00000000..6a37f56c --- /dev/null +++ b/src/Makefile @@ -0,0 +1,10 @@ +all: + $(MAKE) -C .. i3 + +install: + $(MAKE) -C .. install-i3 + +clean: + $(MAKE) -C .. clean-i3 + +.PHONY: all install clean