diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2016-02-21 10:45:42 +0100 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2016-02-21 10:45:42 +0100 |
commit | 522a82bba38670d8a052d80c13714c8978f1e072 (patch) | |
tree | 7be2a47671c43c49f1d754d7a9e5ba54096b1c1b | |
parent | bdc9dc727b0464bc17bed002d2a701cfc34b777a (diff) | |
download | pianobar-522a82bba38670d8a052d80c13714c8978f1e072.tar.gz pianobar-522a82bba38670d8a052d80c13714c8978f1e072.tar.bz2 pianobar-522a82bba38670d8a052d80c13714c8978f1e072.zip |
Makefile: Provide a way to disable silent rules
Fixes #571
-rw-r--r-- | Makefile | 40 |
1 files changed, 24 insertions, 16 deletions
@@ -69,26 +69,34 @@ ALL_LDFLAGS:=${LDFLAGS} -lpthread -lm \ ${LIBGCRYPT_LDFLAGS} ${LIBJSONC_LDFLAGS} \ ${LIBAO_LDFLAGS} +# Be verbose if V=1 (gnu autotools’ --disable-silent-rules) +SILENTCMD:=@ +SILENTECHO:=@echo +ifeq (${V},1) + SILENTCMD:= + SILENTECHO:=@true +endif + # build pianobar ifeq (${DYNLINK},1) pianobar: ${PIANOBAR_OBJ} libpiano.so.0 - @echo " LINK $@" - @${CC} -o $@ ${PIANOBAR_OBJ} -L. -lpiano ${ALL_LDFLAGS} + ${SILENTECHO} " LINK $@" + ${SILENTCMD}${CC} -o $@ ${PIANOBAR_OBJ} -L. -lpiano ${ALL_LDFLAGS} else pianobar: ${PIANOBAR_OBJ} ${LIBPIANO_OBJ} - @echo " LINK $@" - @${CC} -o $@ ${PIANOBAR_OBJ} ${LIBPIANO_OBJ} ${ALL_LDFLAGS} + ${SILENTECHO} " LINK $@" + ${SILENTCMD}${CC} -o $@ ${PIANOBAR_OBJ} ${LIBPIANO_OBJ} ${ALL_LDFLAGS} endif # build shared and static libpiano libpiano.so.0: ${LIBPIANO_RELOBJ} ${LIBPIANO_OBJ} - @echo " LINK $@" - @${CC} -shared -Wl,-soname,libpiano.so.0 -o libpiano.so.0.0.0 \ + ${SILENTECHO} " LINK $@" + ${SILENTCMD}${CC} -shared -Wl,-soname,libpiano.so.0 -o libpiano.so.0.0.0 \ ${LIBPIANO_RELOBJ} ${ALL_LDFLAGS} - @ln -fs libpiano.so.0.0.0 libpiano.so.0 - @ln -fs libpiano.so.0 libpiano.so - @echo " AR libpiano.a" - @${AR} rcs libpiano.a ${LIBPIANO_OBJ} + ${SILENTCMD}ln -fs libpiano.so.0.0.0 libpiano.so.0 + ${SILENTCMD}ln -fs libpiano.so.0 libpiano.so + ${SILENTECHO} " AR libpiano.a" + ${SILENTCMD}${AR} rcs libpiano.a ${LIBPIANO_OBJ} -include $(PIANOBAR_SRC:.c=.d) @@ -96,17 +104,17 @@ libpiano.so.0: ${LIBPIANO_RELOBJ} ${LIBPIANO_OBJ} # build standard object files %.o: %.c - @echo " CC $<" - @${CC} -c -o $@ ${ALL_CFLAGS} -MMD -MF $*.d -MP $< + ${SILENTECHO} " CC $<" + ${SILENTCMD}${CC} -c -o $@ ${ALL_CFLAGS} -MMD -MF $*.d -MP $< # create position independent code (for shared libraries) %.lo: %.c - @echo " CC $< (PIC)" - @${CC} -c -fPIC -o $@ ${ALL_CFLAGS} -MMD -MF $*.d -MP $< + ${SILENTECHO} " CC $< (PIC)" + ${SILENTCMD}${CC} -c -fPIC -o $@ ${ALL_CFLAGS} -MMD -MF $*.d -MP $< clean: - @echo " CLEAN" - @${RM} ${PIANOBAR_OBJ} ${LIBPIANO_OBJ} \ + ${SILENTECHO} " CLEAN" + ${SILENTCMD}${RM} ${PIANOBAR_OBJ} ${LIBPIANO_OBJ} \ ${LIBPIANO_RELOBJ} pianobar libpiano.so* \ libpiano.a $(PIANOBAR_SRC:.c=.d) $(LIBPIANO_SRC:.c=.d) |