From b6d3ec05059de1c366a595306dded4fbe52f971f Mon Sep 17 00:00:00 2001 From: Bart Trojanowski Date: Sat, 28 Mar 2009 22:37:11 -0400 Subject: [PATCH] use V=1 to make Makefile verbose --- Makefile | 26 ++++++++++++---------- Makefile.ext | 19 +++++++++------- Makefile.rules | 5 +++++ src/Makefile | 55 ++++++++++++++++++++++++----------------------- src/luaeventloop/Makefile | 19 +++++++++------- src/luaixp/Makefile | 19 +++++++++------- 6 files changed, 81 insertions(+), 62 deletions(-) create mode 100644 Makefile.rules diff --git a/Makefile b/Makefile index 730bb87..87fb608 100644 --- a/Makefile +++ b/Makefile @@ -9,9 +9,10 @@ default: all ifneq ($(MAKECMDGOALS),gitclean) include config.mk +endif include Makefile.ext include Makefile.check -endif +include Makefile.rules # ------------------------------------------------------------------------ # main targets @@ -19,11 +20,13 @@ endif .PHONY: all help docs clean distclean gitclean tags all clean distclean docs install install-user: - ${MAKE} -C src $@ + @echo Running '$@' in src... + ${Q} ${MAKE} -C src $@ gitclean: + @echo GITCLEAN $(if $(wildcard .git/config),,$(error this is not a git repository)) - git clean -d -x -f + ${Q} git clean -d -x -f # ------------------------------------------------------------------------ # help @@ -49,7 +52,8 @@ help: # config config.mk: config.mk.dist - if test -f $@ ; then \ + @echo Updating $@ + ${Q} if test -f $@ ; then \ touch $@ ; \ else \ cp $< $@ ; \ @@ -62,12 +66,12 @@ config.mk: config.mk.dist clean: lcl-clean lcl-clean: - -rm -f *~ */*~ - -rm -f cscope.files cscope.out tags + -${Q} rm -f *~ + -${Q} rm -f cscope.files cscope.out tags distclean: lcl-distclean lcl-distclean: clean - -rm -f config.mk + -${Q} rm -f config.mk .PHONY: @@ -81,13 +85,13 @@ install-user: install-user-variable-check .PHONY: cscope tags cscope.files:: - find . -name '*.[ch]' -o -name '*.lua' | grep -v -e CVS -e SCCS > cscope.files + ${Q} find . -name '*.[ch]' -o -name '*.lua' | grep -v -e CVS -e SCCS > cscope.files cscope: cscope.out cscope.out: cscope.files - -cscope -P`pwd` -b + -${Q} cscope -P`pwd` -b tags: cscope.out - rm -f tags - xargs -n 50 ctags -a < cscope.files + ${Q} rm -f tags + ${Q} xargs -n 50 ctags -a < cscope.files diff --git a/Makefile.ext b/Makefile.ext index 63ece26..f4db18d 100644 --- a/Makefile.ext +++ b/Makefile.ext @@ -31,12 +31,12 @@ EXT_SM_COUNT = $(shell echo ${EXT_SM_NAMES} | wc -w) ext-check: @echo "Checking git submodules..." - @if ! test ${EXT_SM_COUNT} = $$(git config --get-regexp "${EXT_SM_REGEXP}" | wc -l) ; then \ + ${Q} if ! test ${EXT_SM_COUNT} = $$(git config --get-regexp "${EXT_SM_REGEXP}" | wc -l) ; then \ echo "ERROR: submodules not initialized, run:" >&2 ; \ echo " make update" >&2 ; \ $(if ${NOCHECK},true,false) ; \ fi - @if (git submodule status | grep '^[+-]' 2>/dev/null) ; then \ + ${Q} if (git submodule status | grep '^[+-]' 2>/dev/null) ; then \ echo "ERROR: submodules out of date, run:" >&2 ; \ echo " make update" >&2 ; \ $(if ${NOCHECK},true,false) ; \ @@ -46,10 +46,10 @@ ext-check: update: ext-update: @echo "Updating git submodules..." - @if ! test ${EXT_SM_COUNT} = $$(git config --get-regexp "${EXT_SM_REGEXP}" | wc -l) ; then \ + ${Q} if ! test ${EXT_SM_COUNT} = $$(git config --get-regexp "${EXT_SM_REGEXP}" | wc -l) ; then \ git submodule init ; \ fi - @if (git submodule status | grep '^[+-]' 2>/dev/null) ; then \ + ${Q} if (git submodule status | grep '^[+-]' 2>/dev/null) ; then \ git submodule update ; \ fi @echo "UPDATE OK" @@ -93,13 +93,13 @@ ext-build-helper: ext-check $(if ${BUILD_RULE},,$(error $@ is an internal rule)) # @echo ${BUILD_STR} libixp - ${MAKE} -C ${EXT_DIR}/libixp ${BUILD_RULE} \ + ${Q} ${MAKE} -C ${EXT_DIR}/libixp ${BUILD_RULE} \ "CC=${CCPIC}" \ "PREFIX=${BUILD_PREFIX}" \ ${BUILD_BASE_RULE} # @echo ${BUILD_STR} wmii - ${MAKE} -C ${EXT_DIR}/wmii ${BUILD_RULE} \ + ${Q} ${MAKE} -C ${EXT_DIR}/wmii ${BUILD_RULE} \ "INCLUDE=${PWD}/${EXT_DIR}/libixp/include:${INCLUDE}" \ "LIBIXP=${PWD}/${EXT_DIR}/libixp/lib/libixp.a" "CC=${CCPIC}" \ "PREFIX=${BUILD_PREFIX}" \ @@ -115,6 +115,9 @@ ext-build-helper: ext-check .PHONY: lcl-gitclean gitclean: lcl-gitclean lcl-gitclean: - -cd ${EXT_DIR}/libixp && git clean -d -x -f - -cd ${EXT_DIR}/wmii && git clean -d -x -f + @echo GITCLEAN libixp + -${Q} cd ${EXT_DIR}/libixp && git clean -d -x -f + # + @echo GITCLEAN wmii + -${Q} cd ${EXT_DIR}/wmii && git clean -d -x -f diff --git a/Makefile.rules b/Makefile.rules new file mode 100644 index 0000000..f4ff797 --- /dev/null +++ b/Makefile.rules @@ -0,0 +1,5 @@ +# this file is meant for useful constructs + +# run make V=1 to see all commands +Q = $(if ${V},,@) + diff --git a/src/Makefile b/src/Makefile index 7d9d149..5001171 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2,6 +2,7 @@ TOP = .. CONFIG_MK = ${TOP}/config.mk include ${CONFIG_MK} +include ${TOP}/Makefile.rules MAN = wmii.3lua @@ -32,12 +33,12 @@ help: libs: luaeventloop luaixp luaeventloop luaixp: - ${MAKE} -C $@ + ${Q} ${MAKE} -C $@ docs: man man: ${MAN} ${MAN}: core/wmii.lua - ${POD2MAN} \ + ${Q} ${POD2MAN} \ --name=wmii \ --center="WMII Lua Integration" \ --section=3lua \ @@ -48,11 +49,11 @@ ${MAN}: core/wmii.lua # cleaning clean: - -rm -f *~ */*~ - -rm -f wmii.3lua - -rm -f cscope.files cscope.out tags - -${MAKE} -C luaixp clean - -${MAKE} -C luaeventloop clean + -${Q} rm -f *~ */*~ + -${Q} rm -f wmii.3lua + -${Q} rm -f cscope.files cscope.out tags + -${Q} ${MAKE} -C luaixp clean + -${Q} ${MAKE} -C luaeventloop clean distclean: clean @@ -64,26 +65,26 @@ distclean: clean # install: ${MAN} install-variable-check # create directories - ${INSTALL} -d ${ALL_INSTALL_DIRS} + ${Q} ${INSTALL} -d ${ALL_INSTALL_DIRS} # # install libraries - ${MAKE} -C luaixp install - ${MAKE} -C luaeventloop install + ${Q} ${MAKE} -C luaixp install + ${Q} ${MAKE} -C luaeventloop install # # install core and plugin lua scripts - ${INSTALL} -m 0644 -t ${CORE_LUA_DIR} core/*.lua - ${INSTALL} -m 0644 -t ${PLUGIN_LUA_DIR} plugins/*.lua + ${Q} ${INSTALL} -m 0644 -t ${CORE_LUA_DIR} core/*.lua + ${Q} ${INSTALL} -m 0644 -t ${PLUGIN_LUA_DIR} plugins/*.lua # # install new config file - ${INSTALL} -m 0755 -t ${RC_DIR} wmiirc.lua - ${INSTALL} -m 0644 -t ${XS_DIR} wmii-lua.desktop + ${Q} ${INSTALL} -m 0755 -t ${RC_DIR} wmiirc.lua + ${Q} ${INSTALL} -m 0644 -t ${XS_DIR} wmii-lua.desktop # # install man page - ${INSTALL} -m 0644 -t ${MAN_DIR} ${MAN} + ${Q} ${INSTALL} -m 0644 -t ${MAN_DIR} ${MAN} # # install scripts - ${INSTALL} -m 0755 -t ${BIN_DIR} install-wmiirc-lua - ${INSTALL} -m 0755 -t ${BIN_DIR} wmii-lua + ${Q} ${INSTALL} -m 0755 -t ${BIN_DIR} install-wmiirc-lua + ${Q} ${INSTALL} -m 0755 -t ${BIN_DIR} wmii-lua # # install in user directory @@ -92,20 +93,20 @@ install-user: install-user-variable-check ifeq ($(shell pwd),$(wildcard ~/.wmii-3.5)) @echo "You're already in the ~/.wmii-3.5/ directory" else - ${INSTALL} -d ${ALL_HOME_DIRS} - @if test -f ${HOME_WMII}/wmiirc ; then \ + ${Q} ${INSTALL} -d ${ALL_HOME_DIRS} + ${Q} if test -f ${HOME_WMII}/wmiirc ; then \ echo "NOTE: you might want to look at ${HOME_WMII}/wmiirc.dist" ; \ ${INSTALL} -T -m 0744 -b wmiirc.lua ${HOME_WMII}/wmiirc.dist ; \ else \ echo "Installing new ${HOME_WMII}/wmiirc" ; \ ${INSTALL} -T -m 0744 -b wmiirc.lua ${HOME_WMII}/wmiirc ; \ fi - ${INSTALL} -m 0644 -b -t ${HOME_CORE} core/*.lua - ${INSTALL} -m 0644 -b -t ${HOME_PLUGINS} plugins/*.lua - ${INSTALL} -m 0644 -b -t ${HOME_WMII} ${MAN} - ${INSTALL} -m 0744 -t ${HOME_BIN_DIR} wmii-lua - ${MAKE} -C luaixp install-user - ${MAKE} -C luaeventloop install-user + ${Q} ${INSTALL} -m 0644 -b -t ${HOME_CORE} core/*.lua + ${Q} ${INSTALL} -m 0644 -b -t ${HOME_PLUGINS} plugins/*.lua + ${Q} ${INSTALL} -m 0644 -b -t ${HOME_WMII} ${MAN} + ${Q} ${INSTALL} -m 0744 -t ${HOME_BIN_DIR} wmii-lua + ${Q} ${MAKE} -C luaixp install-user + ${Q} ${MAKE} -C luaeventloop install-user install-user: ${MAN} endif @@ -117,8 +118,8 @@ endif .PHONY: install-variable-check install-user-variable-check tags cscope ${CONFIG_MK}: - ${MAKE} -C $(dir ${CONFIG_MK}) $(notdir ${CONFIG_MK}) + ${Q} ${MAKE} -C $(dir ${CONFIG_MK}) $(notdir ${CONFIG_MK}) install-variable-check install-user-variable-check tags cscope: - ${MAKE} -C ${TOP} $@ + ${Q} ${MAKE} -C ${TOP} $@ diff --git a/src/luaeventloop/Makefile b/src/luaeventloop/Makefile index 5aa59cf..47fc587 100644 --- a/src/luaeventloop/Makefile +++ b/src/luaeventloop/Makefile @@ -1,6 +1,7 @@ TOP = ../.. CONFIG_MK = ${TOP}/config.mk include ${CONFIG_MK} +include ${TOP}/Makefile.rules SRCS = lel_main.c lel_debug.c lel_util.c lel_instance.c OBJS = $(SRCS:.c=.o) @@ -16,22 +17,24 @@ TARGET = eventloop.so all: ${TARGET} ${TARGET}: ${OBJS} - $(CC) ${CFLAGS} -o $@ -shared $^ $(LIBS) + @echo " LINK $@" + ${Q} $(CC) ${CFLAGS} -o $@ -shared $^ $(LIBS) ${OBJS}: %.o: %.c Makefile - ${CC} ${CFLAGS} -o $@ -c $< + @echo " CC $@" + ${Q} ${CC} ${CFLAGS} -o $@ -c $< test: ${TARGET} ./test.lua clean: - -rm -f ${TARGET} ${OBJS} - -rm -f *.o *.so *~ + -${Q} rm -f ${TARGET} ${OBJS} + -${Q} rm -f *.o *.so *~ install: ${TARGET} - ${INSTALL} -d ${CORE_LIB_DIR} - ${INSTALL} -b -t ${CORE_LIB_DIR} ${TARGET} + ${Q} ${INSTALL} -d ${CORE_LIB_DIR} + ${Q} ${INSTALL} -b -t ${CORE_LIB_DIR} ${TARGET} install-user: ${TARGET} - ${INSTALL} -d ${HOME_CORE} - ${INSTALL} -m 0744 -b -t ${HOME_CORE} ${TARGET} + ${Q} ${INSTALL} -d ${HOME_CORE} + ${Q} ${INSTALL} -m 0744 -b -t ${HOME_CORE} ${TARGET} diff --git a/src/luaixp/Makefile b/src/luaixp/Makefile index 9004fd5..1d5e639 100644 --- a/src/luaixp/Makefile +++ b/src/luaixp/Makefile @@ -1,6 +1,7 @@ TOP = ../.. CONFIG_MK = ${TOP}/config.mk include ${CONFIG_MK} +include ${TOP}/Makefile.rules SRCS = lixp_main.c lixp_debug.c lixp_util.c lixp_instance.c OBJS = $(SRCS:.c=.o) @@ -16,22 +17,24 @@ TARGET = ixp.so all: ${TARGET} ${TARGET}: ${OBJS} - $(CC) ${CFLAGS} -o $@ -shared $^ $(LIBS) + @echo " LINK $@" + ${Q} $(CC) ${CFLAGS} -o $@ -shared $^ $(LIBS) ${OBJS}: %.o: %.c Makefile - ${CC} ${CFLAGS} -o $@ -c $< + @echo " CC $@" + ${Q} ${CC} ${CFLAGS} -o $@ -c $< test: ${TARGET} ./test.lua clean: - -rm -f ${TARGET} ${OBJS} - -rm -f *.o *.so *~ + -${Q} rm -f ${TARGET} ${OBJS} + -${Q} rm -f *.o *.so *~ install: ${TARGET} - ${INSTALL} -d ${CORE_LIB_DIR} - ${INSTALL} -b -t ${CORE_LIB_DIR} ${TARGET} + ${Q} ${INSTALL} -d ${CORE_LIB_DIR} + ${Q} ${INSTALL} -b -t ${CORE_LIB_DIR} ${TARGET} install-user: ${TARGET} - ${INSTALL} -d ${HOME_CORE} - ${INSTALL} -m 0744 -b -t ${HOME_CORE} ${TARGET} + ${Q} ${INSTALL} -d ${HOME_CORE} + ${Q} ${INSTALL} -m 0744 -b -t ${HOME_CORE} ${TARGET} -- 2.11.4.GIT