Makefiles: prefix compilation messages (for parallel builds)

This commit is contained in:
Michael Stapelberg 2011-10-02 16:04:18 +01:00
parent e73812802c
commit 4f6e58e250
5 changed files with 21 additions and 21 deletions

View File

@ -22,7 +22,7 @@ SUBDIRS:=i3-msg i3-input i3-nagbar i3-config-wizard i3bar
# Depend on the specific file (.c for each .o) and on all headers
src/%.o: src/%.c ${HEADERS}
echo "CC $<"
echo "[i3] CC $<"
$(CC) $(CPPFLAGS) $(CFLAGS) -DLOGLEVEL="((uint64_t)1 << $(shell awk '/$(shell basename $< .c)/ { print NR; exit 0; }' loglevels.tmp))" -c -o $@ $<
all: i3 subdirs
@ -39,7 +39,7 @@ subdirs:
done
loglevels.h:
echo "LOGLEVELS"
echo "[i3] LOGLEVELS"
for file in $$(ls src/*.c src/*.y src/*.l | grep -v 'cfgparse.\(tab\|yy\).c'); \
do \
echo $$(basename $$file .c); \
@ -51,29 +51,29 @@ loglevels.h:
echo "};") > include/loglevels.h;
src/cfgparse.yy.o: src/cfgparse.l src/cfgparse.y.o ${HEADERS}
echo "LEX $<"
echo "[i3] LEX $<"
flex -i -o$(@:.o=.c) $<
$(CC) $(CPPFLAGS) $(CFLAGS) -DLOGLEVEL="(1 << $(shell awk '/cfgparse.l/ { print NR }' loglevels.tmp))" -c -o $@ $(@:.o=.c)
src/cmdparse.yy.o: src/cmdparse.l src/cmdparse.y.o ${HEADERS}
echo "LEX $<"
echo "[i3] LEX $<"
flex -Pcmdyy -i -o$(@:.o=.c) $<
$(CC) $(CPPFLAGS) $(CFLAGS) -DLOGLEVEL="(1 << $(shell awk '/cmdparse.l/ { print NR }' loglevels.tmp))" -c -o $@ $(@:.o=.c)
src/cfgparse.y.o: src/cfgparse.y ${HEADERS}
echo "YACC $<"
echo "[i3] YACC $<"
bison --debug --verbose -b $(basename $< .y) -d $<
$(CC) $(CPPFLAGS) $(CFLAGS) -DLOGLEVEL="(1 << $(shell awk '/cfgparse.y/ { print NR }' loglevels.tmp))" -c -o $@ $(<:.y=.tab.c)
src/cmdparse.y.o: src/cmdparse.y ${HEADERS}
echo "YACC $<"
echo "[i3] YACC $<"
bison -p cmdyy --debug --verbose -b $(basename $< .y) -d $<
$(CC) $(CPPFLAGS) $(CFLAGS) -DLOGLEVEL="(1 << $(shell awk '/cmdparse.y/ { print NR }' loglevels.tmp))" -c -o $@ $(<:.y=.tab.c)
install: all
echo "INSTALL"
echo "[i3] INSTALL"
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
$(INSTALL) -d -m 0755 $(DESTDIR)$(SYSCONFDIR)/i3
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/include/i3

View File

@ -10,28 +10,28 @@ HEADERS:=$(wildcard *.h)
# Depend on the specific file (.c for each .o) and on all headers
%.o: %.c ${HEADERS}
echo "CC $<"
echo "[i3-config-wizard] CC $<"
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
all: i3-config-wizard
i3-config-wizard: cfgparse.y.o cfgparse.yy.o ${FILES}
echo "LINK i3-config-wizard"
echo "[i3-config-wizard] LINK i3-config-wizard"
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
cfgparse.yy.o: cfgparse.l cfgparse.y.o ${HEADERS}
echo "LEX $<"
echo "[i3-config-wizard] LEX $<"
flex -i -o$(@:.o=.c) $<
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $(@:.o=.c)
cfgparse.y.o: cfgparse.y ${HEADERS}
echo "YACC $<"
echo "[i3-config-wizard] YACC $<"
bison --debug --verbose -b $(basename $< .y) -d $<
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $(<:.y=.tab.c)
install: all
echo "INSTALL"
echo "[i3-config-wizard] INSTALL"
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
$(INSTALL) -m 0755 i3-config-wizard $(DESTDIR)$(PREFIX)/bin/

View File

@ -9,17 +9,17 @@ HEADERS=$(wildcard *.h)
# Depend on the specific file (.c for each .o) and on all headers
%.o: %.c ${HEADERS}
echo "CC $<"
echo "[i3-input] CC $<"
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
all: i3-input
i3-input: ${FILES}
echo "LINK i3-input"
echo "[i3-input] LINK i3-input"
$(CC) $(LDFLAGS) -o $@ ${FILES} $(LIBS)
install: all
echo "INSTALL"
echo "[i3-input] INSTALL"
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
$(INSTALL) -m 0755 i3-input $(DESTDIR)$(PREFIX)/bin/

View File

@ -11,17 +11,17 @@ HEADERS=$(wildcard *.h)
# Depend on the specific file (.c for each .o) and on all headers
%.o: %.c ${HEADERS}
echo "CC $<"
echo "[i3-msg] CC $<"
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
all: i3-msg
i3-msg: ${FILES}
echo "LINK i3-msg"
echo "[i3-msg] LINK i3-msg"
$(CC) $(LDFLAGS) -o i3-msg ${FILES} $(LIBS)
install: all
echo "INSTALL"
echo "[i3-msg] INSTALL"
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
$(INSTALL) -m 0755 i3-msg $(DESTDIR)$(PREFIX)/bin/

View File

@ -9,17 +9,17 @@ HEADERS=$(wildcard *.h)
# Depend on the specific file (.c for each .o) and on all headers
%.o: %.c ${HEADERS}
echo "CC $<"
echo "[i3-nagbar] CC $<"
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
all: i3-nagbar
i3-nagbar: ${FILES}
echo "LINK i3-nagbar"
echo "[i3-nagbar] LINK i3-nagbar"
$(CC) $(LDFLAGS) -o $@ ${FILES} $(LIBS)
install: all
echo "INSTALL"
echo "[i3-nagbar] INSTALL"
$(INSTALL) -d -m 0755 $(DESTDIR)$(PREFIX)/bin
$(INSTALL) -m 0755 i3-nagbar $(DESTDIR)$(PREFIX)/bin/