Add stub Makefiles to allow subdir make calls

This commit is contained in:
Quentin Glidic 2012-06-17 14:37:07 +02:00
parent 66adb62e1f
commit e452acb30e
9 changed files with 58 additions and 233 deletions

View File

@ -1,36 +1,7 @@
# To pass additional parameters for asciidoc all:
ASCIIDOC=asciidoc $(MAKE) -C .. docs
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 $<
clean: clean:
rm -f ${ASCIIDOC_TARGETS} $(MAKE) -C .. clean-docs
.PHONY: all clean

View File

@ -1,47 +1,10 @@
# Default value so one can compile i3-input standalone all:
TOPDIR=.. $(MAKE) -C .. i3-config-wizard/i3-config-wizard
include $(TOPDIR)/common.mk install:
$(MAKE) -C .. install-i3-config-wizard
# 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/
clean: clean:
rm -f *.o cfgparse.tab.{c,h} cfgparse.output cfgparse.yy.c $(MAKE) -C .. clean-i3-config-wizard
distclean: clean .PHONY: all install clean
rm -f i3-config-wizard

View File

@ -1,32 +1,10 @@
# Default value so one can compile i3-dump-log standalone all:
TOPDIR=.. $(MAKE) -C .. i3-dump-log/i3-dump-log
include $(TOPDIR)/common.mk install:
$(MAKE) -C .. install-i3-dump-log
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/
clean: clean:
rm -f *.o $(MAKE) -C .. clean-i3-dump-log
distclean: clean .PHONY: all install clean
rm -f i3-dump-log

View File

@ -1,35 +1,10 @@
# Default value so one can compile i3-input standalone all:
TOPDIR=.. $(MAKE) -C .. i3-input/i3-input
include $(TOPDIR)/common.mk install:
$(MAKE) -C .. install-i3-input
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/
clean: clean:
rm -f *.o $(MAKE) -C .. clean-i3-input
distclean: clean .PHONY: all install clean
rm -f i3-input

View File

@ -1,32 +1,10 @@
# Default value so one can compile i3-msg standalone all:
TOPDIR=.. $(MAKE) -C .. i3-msg/i3-msg
include $(TOPDIR)/common.mk install:
$(MAKE) -C .. install-i3-msg
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/
clean: clean:
rm -f *.o $(MAKE) -C .. clean-i3-msg
distclean: clean .PHONY: all install clean
rm -f i3-msg

View File

@ -1,35 +1,10 @@
# Default value so one can compile i3-nagbar standalone all:
TOPDIR=.. $(MAKE) -C .. i3-nagbar/i3-nagbar
include $(TOPDIR)/common.mk install:
$(MAKE) -C .. install-i3-nagbar
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/
clean: clean:
rm -f *.o $(MAKE) -C .. clean-i3-nagbar
distclean: clean .PHONY: all install clean
rm -f i3-nagbar

View File

@ -1,42 +1,10 @@
TOPDIR=.. all:
$(MAKE) -C .. i3bar/i3bar
include $(TOPDIR)/common.mk install:
$(MAKE) -C .. install-i3bar
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
clean: clean:
rm -f src/*.o $(MAKE) -C .. clean-i3bar
$(MAKE) -C doc clean
distclean: clean .PHONY: all install clean
rm -f i3bar
$(MAKE) -C doc distclean
.PHONY: install clean distclean doc

7
libi3/Makefile Normal file
View File

@ -0,0 +1,7 @@
all:
$(MAKE) -C .. libi3.a
clean:
$(MAKE) -C .. clean-libi3
.PHONY: all clean

10
src/Makefile Normal file
View File

@ -0,0 +1,10 @@
all:
$(MAKE) -C .. i3
install:
$(MAKE) -C .. install-i3
clean:
$(MAKE) -C .. clean-i3
.PHONY: all install clean