improve VERBOSE handling
authorFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 19 Oct 2012 22:59:50 +0000 (00:59 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 19 Oct 2012 22:59:50 +0000 (00:59 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
36 files changed:
Makefile
Makefile.inc
android/regex/Makefile
lib/arprefresh/Makefile
lib/bmf/Makefile
lib/dot_draw/Makefile
lib/dyn_gw/Makefile
lib/dyn_gw_plain/Makefile
lib/httpinfo/Makefile
lib/jsoninfo/Makefile
lib/mdns/Makefile
lib/mini/Makefile
lib/nameservice/Makefile
lib/p2pd/Makefile
lib/pgraph/Makefile
lib/pud/Makefile
lib/pud/doc/Makefile
lib/pud/nmealib/Makefile
lib/pud/nmealib/Makefile.inc
lib/pud/nmealib/doc/Makefile
lib/pud/nmealib/samples/Makefile
lib/pud/wireformat-java/Makefile
lib/pud/wireformat-java/doc/Makefile
lib/pud/wireformat/Makefile
lib/pud/wireformat/doc/Makefile
lib/quagga/Makefile
lib/secure/Makefile
lib/sgwdynspeed/Makefile
lib/sgwdynspeed/doc/Makefile
lib/tas/Makefile
lib/txtinfo/Makefile
lib/watchdog/Makefile
make/Makefile.android
src/cfgparser/Makefile
src/cfgparser/local.mk
src/olsr_switch/Makefile

index 31fde33..c6124dd 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -65,24 +65,23 @@ default_target: $(EXENAME)
 $(EXENAME):    $(OBJS) src/builddata.o
 ifeq ($(VERBOSE),0)
                @echo "[LD] $@"
-               @$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
-else
-               $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
 endif
+               $(MAKECMDPREFIX)$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
+
 cfgparser:     $(CFGDEPS) src/builddata.o
                $(MAKE) -C $(CFGDIR)
 
 switch:                
-       @$(MAKECMD) -C $(SWITCHDIR)
+       $(MAKECMDPREFIX)$(MAKECMD) -C $(SWITCHDIR)
 
 # generate it always
 .PHONY: src/builddata.c
 src/builddata.c:
-       @$(RM) "$@"
-       @echo "#include \"defs.h\"" >> "$@" 
-       @echo "const char olsrd_version[] = \"olsr.org -  $(VERS)-git_`git log -1 --pretty=%h`-hash_`./make/hash_source.sh`\";"  >> "$@"
-       @date +"const char build_date[] = \"%Y-%m-%d %H:%M:%S\";" >> "$@" 
-       @echo "const char build_host[] = \"$(shell hostname)\";" >> "$@" 
+       $(MAKECMDPREFIX)$(RM) "$@"
+       $(MAKECMDPREFIX)echo "#include \"defs.h\"" >> "$@" 
+       $(MAKECMDPREFIX)echo "const char olsrd_version[] = \"olsr.org -  $(VERS)-git_`git log -1 --pretty=%h`-hash_`./make/hash_source.sh`\";"  >> "$@"
+       $(MAKECMDPREFIX)date +"const char build_date[] = \"%Y-%m-%d %H:%M:%S\";" >> "$@" 
+       $(MAKECMDPREFIX)echo "const char build_host[] = \"$(shell hostname)\";" >> "$@" 
 
 
 .PHONY: help libs clean_libs libs_clean clean distclean uberclean install_libs uninstall_libs libs_install libs_uninstall install_bin uninstall_bin install_olsrd uninstall_olsrd install uninstall build_all install_all uninstall_all clean_all 
@@ -104,8 +103,8 @@ uberclean:  clean clean_libs clean_gui
        -rm -f $(TAGFILE)
 #      BSD-xargs has no "--no-run-if-empty" aka "-r"
        find . \( -name '*.[od]' -o -name '*~' \) -not -path "*/.hg*" -type f -print0 | xargs -0 rm -f
-       @$(MAKECMD) -C $(SWITCHDIR) clean
-       @$(MAKECMD) -C $(CFGDIR) clean
+       $(MAKECMDPREFIX)$(MAKECMD) -C $(SWITCHDIR) clean
+       $(MAKECMDPREFIX)$(MAKECMD) -C $(CFGDIR) clean
 
 install: install_olsrd
 
@@ -131,7 +130,7 @@ install_olsrd:      install_bin
                @echo can be found at files/olsrd.conf.default.lq
                @echo ==========================================================
                mkdir -p $(ETCDIR)
-               @if [ -e $(CFGFILE) ]; then \
+               $(MAKECMDPREFIX)if [ -e $(CFGFILE) ]; then \
                        cp -f files/olsrd.conf.default.lq $(CFGFILE).new; \
                        echo "Configuration file was saved as $(CFGFILE).new"; \
                else \
@@ -162,11 +161,11 @@ tags:
                $(TAGCMD) -o $(TAGFILE) $(TAG_SRCS)
 
 rpm:
-               @$(RM) olsrd-current.tar.bz2
-               @echo "Creating olsrd-current.tar.bz2 ..."
-               @./list-excludes.sh | tar  --exclude-from=- --exclude="olsrd-current.tar.bz2" -C .. -cjf olsrd-current.tar.bz2 olsrd-current
-               @echo "Building RPMs..."
-               @rpmbuild -ta olsrd-current.tar.bz2
+               $(MAKECMDPREFIX)$(RM) olsrd-current.tar.bz2
+               $(MAKECMDPREFIX)echo "Creating olsrd-current.tar.bz2 ..."
+               $(MAKECMDPREFIX)./list-excludes.sh | tar  --exclude-from=- --exclude="olsrd-current.tar.bz2" -C .. -cjf olsrd-current.tar.bz2 olsrd-current
+               $(MAKECMDPREFIX)echo "Building RPMs..."
+               $(MAKECMDPREFIX)rpmbuild -ta olsrd-current.tar.bz2
 #
 # PLUGINS
 #
@@ -187,16 +186,16 @@ endif
 endif
 
 libs:
-               @set -e;for dir in $(SUBDIRS);do $(MAKECMD) -C lib/$$dir LIBDIR=$(LIBDIR);done
+               $(MAKECMDPREFIX)set -e;for dir in $(SUBDIRS);do $(MAKECMD) -C lib/$$dir LIBDIR=$(LIBDIR);done
 
 libs_clean clean_libs:
                -for dir in $(SUBDIRS);do $(MAKECMD) -C lib/$$dir LIBDIR=$(LIBDIR) clean;rm -f lib/$$dir/*.so lib/$$dir/*.dll;done
 
 libs_install install_libs:
-               @set -e;for dir in $(SUBDIRS);do $(MAKECMD) -C lib/$$dir LIBDIR=$(LIBDIR) install;done
+               $(MAKECMDPREFIX)set -e;for dir in $(SUBDIRS);do $(MAKECMD) -C lib/$$dir LIBDIR=$(LIBDIR) install;done
 
 libs_uninstall uninstall_libs:
-               @set -e;for dir in $(SUBDIRS);do $(MAKECMD) -C lib/$$dir LIBDIR=$(LIBDIR) uninstall;done
+               $(MAKECMDPREFIX)set -e;for dir in $(SUBDIRS);do $(MAKECMD) -C lib/$$dir LIBDIR=$(LIBDIR) uninstall;done
                rmdir -p --ignore-fail-on-non-empty $(LIBDIR)
 
 #
@@ -204,100 +203,100 @@ libs_uninstall uninstall_libs:
 #
 
 arprefresh:
-               @$(MAKECMD) -C lib/arprefresh
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/arprefresh
 
 arprefresh_clean:
-               @$(MAKECMD) -C lib/arprefresh DESTDIR=$(DESTDIR) clean
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/arprefresh DESTDIR=$(DESTDIR) clean
 
 arprefresh_install:
-               @$(MAKECMD) -C lib/arprefresh DESTDIR=$(DESTDIR) install
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/arprefresh DESTDIR=$(DESTDIR) install
 
 arprefresh_uninstall:
-               @$(MAKECMD) -C lib/arprefresh DESTDIR=$(DESTDIR) uninstall
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/arprefresh DESTDIR=$(DESTDIR) uninstall
 
 bmf:
-               @$(MAKECMD) -C lib/bmf
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/bmf
 
 bmf_clean:
-               @$(MAKECMD) -C lib/bmf DESTDIR=$(DESTDIR) clean
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/bmf DESTDIR=$(DESTDIR) clean
 
 bmf_install:
-               @$(MAKECMD) -C lib/bmf DESTDIR=$(DESTDIR) install
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/bmf DESTDIR=$(DESTDIR) install
 
 bmf_uninstall:
-               @$(MAKECMD) -C lib/bmf DESTDIR=$(DESTDIR) uninstall
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/bmf DESTDIR=$(DESTDIR) uninstall
 
 dot_draw:
-               @$(MAKECMD) -C lib/dot_draw
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/dot_draw
 
 dot_draw_clean:
-               @$(MAKECMD) -C lib/dot_draw DESTDIR=$(DESTDIR) clean
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/dot_draw DESTDIR=$(DESTDIR) clean
 
 dot_draw_install:
-               @$(MAKECMD) -C lib/dot_draw DESTDIR=$(DESTDIR) install
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/dot_draw DESTDIR=$(DESTDIR) install
 
 dot_draw_uninstall:
-               @$(MAKECMD) -C lib/dot_draw DESTDIR=$(DESTDIR) uninstall
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/dot_draw DESTDIR=$(DESTDIR) uninstall
 
 dyn_gw:
-               @$(MAKECMD) -C lib/dyn_gw
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/dyn_gw
 
 dyn_gw_clean:
-               @$(MAKECMD) -C lib/dyn_gw DESTDIR=$(DESTDIR) clean
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/dyn_gw DESTDIR=$(DESTDIR) clean
 
 dyn_gw_install:
-               @$(MAKECMD) -C lib/dyn_gw DESTDIR=$(DESTDIR) install
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/dyn_gw DESTDIR=$(DESTDIR) install
 
 dyn_gw_uninstall:
-               @$(MAKECMD) -C lib/dyn_gw DESTDIR=$(DESTDIR) uninstall
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/dyn_gw DESTDIR=$(DESTDIR) uninstall
 
 dyn_gw_plain:
-               @$(MAKECMD) -C lib/dyn_gw_plain
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/dyn_gw_plain
 
 dyn_gw_plain_clean:
-               @$(MAKECMD) -C lib/dyn_gw_plain DESTDIR=$(DESTDIR) clean
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/dyn_gw_plain DESTDIR=$(DESTDIR) clean
 
 dyn_gw_plain_install:
-               @$(MAKECMD) -C lib/dyn_gw_plain DESTDIR=$(DESTDIR) install
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/dyn_gw_plain DESTDIR=$(DESTDIR) install
 
 dyn_gw_plain_uninstall:
-               @$(MAKECMD) -C lib/dyn_gw_plain DESTDIR=$(DESTDIR) uninstall
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/dyn_gw_plain DESTDIR=$(DESTDIR) uninstall
 
 httpinfo:
-               @$(MAKECMD) -C lib/httpinfo
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/httpinfo
 
 httpinfo_clean:
-               @$(MAKECMD) -C lib/httpinfo DESTDIR=$(DESTDIR) clean
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/httpinfo DESTDIR=$(DESTDIR) clean
 
 httpinfo_install:
-               @$(MAKECMD) -C lib/httpinfo DESTDIR=$(DESTDIR) install
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/httpinfo DESTDIR=$(DESTDIR) install
 
 httpinfo_uninstall:
-               @$(MAKECMD) -C lib/httpinfo DESTDIR=$(DESTDIR) uninstall
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/httpinfo DESTDIR=$(DESTDIR) uninstall
 
 jsoninfo:
-               @$(MAKECMD) -C lib/jsoninfo
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/jsoninfo
 
 jsoninfo_clean:
-               @$(MAKECMD) -C lib/jsoninfo DESTDIR=$(DESTDIR) clean
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/jsoninfo DESTDIR=$(DESTDIR) clean
 
 jsoninfo_install:
-               @$(MAKECMD) -C lib/jsoninfo DESTDIR=$(DESTDIR) install
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/jsoninfo DESTDIR=$(DESTDIR) install
 
 jsoninfo_uninstall:
-               @$(MAKECMD) -C lib/jsoninfo DESTDIR=$(DESTDIR) uninstall
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/jsoninfo DESTDIR=$(DESTDIR) uninstall
 
 mdns:
-               @$(MAKECMD) -C lib/mdns
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/mdns
 
 mdns_clean:
-               @$(MAKECMD) -C lib/mdns DESTDIR=$(DESTDIR) clean
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/mdns DESTDIR=$(DESTDIR) clean
 
 mdns_install:
-               @$(MAKECMD) -C lib/mdns DESTDIR=$(DESTDIR) install
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/mdns DESTDIR=$(DESTDIR) install
 
 mdns_uninstall:
-               @$(MAKECMD) -C lib/mdns DESTDIR=$(DESTDIR) uninstall
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/mdns DESTDIR=$(DESTDIR) uninstall
 
 #
 # no targets for mini: it's an example plugin
@@ -307,125 +306,125 @@ mdns_uninstall:
 # Android, $(REGEX_OBJS) will have all of the files needed, on all
 # other platforms, it'll be empty and therefore ignored.
 nameservice:
-               @$(MAKECMD) -C lib/nameservice clean
-               @$(MAKECMD) -C lib/nameservice
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/nameservice clean
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/nameservice
 
 nameservice_clean:
-               @$(MAKECMD) -C lib/nameservice DESTDIR=$(DESTDIR) clean
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/nameservice DESTDIR=$(DESTDIR) clean
 
 nameservice_install:
-               @$(MAKECMD) -C lib/nameservice DESTDIR=$(DESTDIR) install
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/nameservice DESTDIR=$(DESTDIR) install
 
 nameservice_uninstall:
-               @$(MAKECMD) -C lib/nameservice DESTDIR=$(DESTDIR) uninstall
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/nameservice DESTDIR=$(DESTDIR) uninstall
 
 p2pd:
-               @$(MAKECMD) -C lib/p2pd
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/p2pd
 
 p2pd_clean:
-               @$(MAKECMD) -C lib/p2pd DESTDIR=$(DESTDIR) clean
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/p2pd DESTDIR=$(DESTDIR) clean
 
 p2pd_install:
-               @$(MAKECMD) -C lib/p2pd DESTDIR=$(DESTDIR) install
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/p2pd DESTDIR=$(DESTDIR) install
 
 p2pd_uninstall:
-               @$(MAKECMD) -C lib/p2pd DESTDIR=$(DESTDIR) uninstall
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/p2pd DESTDIR=$(DESTDIR) uninstall
 
 pgraph:
-               @$(MAKECMD) -C lib/pgraph
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/pgraph
 
 pgraph_clean:
-               @$(MAKECMD) -C lib/pgraph DESTDIR=$(DESTDIR) clean
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/pgraph DESTDIR=$(DESTDIR) clean
 
 pgraph_install:
-               @$(MAKECMD) -C lib/pgraph DESTDIR=$(DESTDIR) install
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/pgraph DESTDIR=$(DESTDIR) install
 
 pgraph_uninstall:
-               @$(MAKECMD) -C lib/pgraph DESTDIR=$(DESTDIR) uninstall
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/pgraph DESTDIR=$(DESTDIR) uninstall
 
 pud:
-               @$(MAKECMD) -C lib/pud
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/pud
 
 pud_clean:
-               @$(MAKECMD) -C lib/pud DESTDIR=$(DESTDIR) clean
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/pud DESTDIR=$(DESTDIR) clean
 
 pud_install:
-               @$(MAKECMD) -C lib/pud DESTDIR=$(DESTDIR) install
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/pud DESTDIR=$(DESTDIR) install
 
 pud_uninstall:
-               @$(MAKECMD) -C lib/pud DESTDIR=$(DESTDIR) uninstall
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/pud DESTDIR=$(DESTDIR) uninstall
 
 quagga:
-               @$(MAKECMD) -C lib/quagga
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/quagga
 
 quagga_clean:
-               @$(MAKECMD) -C lib/quagga DESTDIR=$(DESTDIR) clean
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/quagga DESTDIR=$(DESTDIR) clean
 
 quagga_install:
-               @$(MAKECMD) -C lib/quagga DESTDIR=$(DESTDIR) install
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/quagga DESTDIR=$(DESTDIR) install
 
 quagga_uninstall:
-               @$(MAKECMD) -C lib/quagga DESTDIR=$(DESTDIR) uninstall
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/quagga DESTDIR=$(DESTDIR) uninstall
 
 secure:
-               @$(MAKECMD) -C lib/secure
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/secure
 
 secure_clean:
-               @$(MAKECMD) -C lib/secure DESTDIR=$(DESTDIR) clean
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/secure DESTDIR=$(DESTDIR) clean
 
 secure_install:
-               @$(MAKECMD) -C lib/secure DESTDIR=$(DESTDIR) install
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/secure DESTDIR=$(DESTDIR) install
 
 secure_uninstall:
-               @$(MAKECMD) -C lib/secure DESTDIR=$(DESTDIR) uninstall
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/secure DESTDIR=$(DESTDIR) uninstall
 
 sgwdynspeed:
-               @$(MAKECMD) -C lib/sgwdynspeed
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/sgwdynspeed
 
 sgwdynspeed_clean:
-               @$(MAKECMD) -C lib/sgwdynspeed DESTDIR=$(DESTDIR) clean
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/sgwdynspeed DESTDIR=$(DESTDIR) clean
 
 sgwdynspeed_install:
-               @$(MAKECMD) -C lib/sgwdynspeed DESTDIR=$(DESTDIR) install
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/sgwdynspeed DESTDIR=$(DESTDIR) install
 
 sgwdynspeed_uninstall:
-               @$(MAKECMD) -C lib/sgwdynspeed DESTDIR=$(DESTDIR) uninstall
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/sgwdynspeed DESTDIR=$(DESTDIR) uninstall
 
 tas:
-               @$(MAKECMD) -C lib/tas
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/tas
 
 tas_clean:
-               @$(MAKECMD) -C lib/tas DESTDIR=$(DESTDIR) clean
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/tas DESTDIR=$(DESTDIR) clean
 
 tas_install:
-               @$(MAKECMD) -C lib/tas DESTDIR=$(DESTDIR) install
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/tas DESTDIR=$(DESTDIR) install
 
 tas_uninstall:
-               @$(MAKECMD) -C lib/tas DESTDIR=$(DESTDIR) uninstall
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/tas DESTDIR=$(DESTDIR) uninstall
 
 txtinfo:
-               @$(MAKECMD) -C lib/txtinfo
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/txtinfo
 
 txtinfo_clean:
-               @$(MAKECMD) -C lib/txtinfo DESTDIR=$(DESTDIR) clean
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/txtinfo DESTDIR=$(DESTDIR) clean
 
 txtinfo_install:
-               @$(MAKECMD) -C lib/txtinfo DESTDIR=$(DESTDIR) install
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/txtinfo DESTDIR=$(DESTDIR) install
 
 txtinfo_uninstall:
-               @$(MAKECMD) -C lib/txtinfo DESTDIR=$(DESTDIR) uninstall
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/txtinfo DESTDIR=$(DESTDIR) uninstall
 
 watchdog:
-               @$(MAKECMD) -C lib/watchdog
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/watchdog
 
 watchdog_clean:
-               @$(MAKECMD) -C lib/watchdog DESTDIR=$(DESTDIR) clean
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/watchdog DESTDIR=$(DESTDIR) clean
 
 watchdog_install:
-               @$(MAKECMD) -C lib/watchdog DESTDIR=$(DESTDIR) install
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/watchdog DESTDIR=$(DESTDIR) install
 
 watchdog_uninstall:
-               @$(MAKECMD) -C lib/watchdog DESTDIR=$(DESTDIR) uninstall
+               $(MAKECMDPREFIX)$(MAKECMD) -C lib/watchdog DESTDIR=$(DESTDIR) uninstall
 
 
 build_all:     all switch libs
index 7199963..9ef9881 100644 (file)
@@ -20,6 +20,12 @@ MUDFLAP ?= 0
 # shows full compiler/linker calls if activated
 VERBOSE ?= 0
 
+ifeq ($(VERBOSE),0)
+MAKECMDPREFIX = @
+else
+MAKECMDPREFIX =
+endif
+
 # OS detection
 ifeq ($(OS),Windows_NT)
 OS := win32
@@ -231,15 +237,13 @@ quote = $(subst .,\.,$(subst /,\/,$1))
 
 # fully automatic and working dependency generation
 %.d: %.c
-       @$(filter-out $(CCACHE),$(CC)) -M $(strip $(CPPFLAGS)) "$<" | sed -e '1s/\($(call quote,$(*F))\.o\)[ :]*/$(call quote,$(*D)/\1 $@: Makefile $(TOPDIR)$(if $(TOPDIR),/)Makefile.inc) /g' >"$@"
+       $(MAKECMDPREFIX)$(filter-out $(CCACHE),$(CC)) -M $(strip $(CPPFLAGS)) "$<" | sed -e '1s/\($(call quote,$(*F))\.o\)[ :]*/$(call quote,$(*D)/\1 $@: Makefile $(TOPDIR)$(if $(TOPDIR),/)Makefile.inc) /g' >"$@"
 
 %.o: %.c
 ifeq ($(VERBOSE),0)
        @echo "[CC] $<"
-       @$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
-else
-       $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
 endif
+       $(MAKECMDPREFIX)$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
 
 # we always need the includes and defines
 # for legacy since now
index 74c7315..5ba4b61 100644 (file)
@@ -10,13 +10,14 @@ all: $(REGEX_LIB)
 .c.o:
 ifeq ($(VERBOSE),0)
        @echo "[CC] $<"
-       @$(CC) $(INCLUDES) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
-else
-       $(CC) $(INCLUDES) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
 endif
+       $(MAKECMDPREFIX)$(CC) $(INCLUDES) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
 
 $(REGEX_LIB): $(OBJ)
-       $(AR) rcs $(REGEX_LIB) $(OBJ)
+ifeq ($(VERBOSE),0)
+       @echo "[AR] $<"
+endif
+       $(MAKECMDPREFIX)$(AR) rcs $(REGEX_LIB) $(OBJ)
 
 clean:
        rm -f $(OBJ) $(REGEX_LIB)
index c860182..5acf344 100644 (file)
@@ -47,8 +47,10 @@ include $(TOPDIR)/Makefile.inc
 default_target: $(PLUGIN_FULLNAME)
 
 $(PLUGIN_FULLNAME): $(OBJS) version-script.txt
+ifeq ($(VERBOSE),0)
                @echo "[LD] $@"
-               @$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
+endif
+               $(MAKECMDPREFIX)$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
 
 install:       $(PLUGIN_FULLNAME)
                $(STRIP) $(PLUGIN_FULLNAME)
index f7fc0c8..cff7b70 100644 (file)
@@ -46,8 +46,10 @@ ifeq ($(OS),$(filter $(OS),linux android))
 default_target: $(PLUGIN_FULLNAME)
 
 $(PLUGIN_FULLNAME): $(OBJS) version-script.txt
+ifeq ($(VERBOSE),0)
                @echo "[LD] $@"
-               @$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
+endif
+               $(MAKECMDPREFIX)$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
 
 install:       $(PLUGIN_FULLNAME)
                $(STRIP) $(PLUGIN_FULLNAME)
index 3364318..5c5e429 100644 (file)
@@ -46,8 +46,10 @@ include $(TOPDIR)/Makefile.inc
 default_target: $(PLUGIN_FULLNAME)
 
 $(PLUGIN_FULLNAME): $(OBJS) version-script.txt
+ifeq ($(VERBOSE),0)
                @echo "[LD] $@"
-               @$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
+endif
+               $(MAKECMDPREFIX)$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
 
 install:       $(PLUGIN_FULLNAME)
                $(STRIP) $(PLUGIN_FULLNAME)
index 9246c42..35dbe76 100644 (file)
@@ -48,8 +48,10 @@ LIBS +=              $(OS_LIB_PTHREAD)
 default_target: $(PLUGIN_FULLNAME)
 
 $(PLUGIN_FULLNAME): $(OBJS) version-script.txt
+ifeq ($(VERBOSE),0)
                @echo "[LD] $@"
-               @$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
+endif
+               $(MAKECMDPREFIX)$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
 
 install:       $(PLUGIN_FULLNAME)
                $(STRIP) $(PLUGIN_FULLNAME)
index f1cbe5e..4f1073c 100644 (file)
@@ -46,8 +46,10 @@ include $(TOPDIR)/Makefile.inc
 default_target: $(PLUGIN_FULLNAME)
 
 $(PLUGIN_FULLNAME): $(OBJS) version-script.txt
+ifeq ($(VERBOSE),0)
                @echo "[LD] $@"
-               @$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
+endif
+               $(MAKECMDPREFIX)$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
 
 install:       $(PLUGIN_FULLNAME)
                $(STRIP) $(PLUGIN_FULLNAME)
index 7e388d6..3a8d65e 100644 (file)
@@ -55,8 +55,10 @@ ifdef ADMIN_INTERFACE
 endif
 
 $(PLUGIN_FULLNAME): $(OBJS) version-script.txt
+ifeq ($(VERBOSE),0)
                @echo "[LD] $@"
-               @$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
+endif
+               $(MAKECMDPREFIX)$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
 
 install:       $(PLUGIN_FULLNAME)
                $(STRIP) $(PLUGIN_FULLNAME)
index 2c714a4..2ba8ac5 100644 (file)
@@ -46,8 +46,10 @@ include $(TOPDIR)/Makefile.inc
 default_target: $(PLUGIN_FULLNAME)
 
 $(PLUGIN_FULLNAME): $(OBJS) version-script.txt
+ifeq ($(VERBOSE),0)
                @echo "[LD] $@"
-               @$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
+endif
+               $(MAKECMDPREFIX)$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
 
 install:       $(PLUGIN_FULLNAME)
                $(STRIP) $(PLUGIN_FULLNAME)
index d714473..b27f007 100644 (file)
@@ -21,8 +21,10 @@ else
 default_target: $(PLUGIN_FULLNAME)
 
 $(PLUGIN_FULLNAME): $(OBJS) version-script.txt
+ifeq ($(VERBOSE),0)
                @echo "[LD] $@"
-               @$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
+endif
+               $(MAKECMDPREFIX)$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
 
 install:       $(PLUGIN_FULLNAME)
                $(STRIP) $(PLUGIN_FULLNAME)
index 4bf26dd..e8671d3 100644 (file)
@@ -46,8 +46,10 @@ include $(TOPDIR)/Makefile.inc
 default_target: $(PLUGIN_FULLNAME)
 
 $(PLUGIN_FULLNAME): $(OBJS) version-script.txt
+ifeq ($(VERBOSE),0)
                @echo "[LD] $@"
-               @$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
+endif
+               $(MAKECMDPREFIX)$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
 
 install:       $(PLUGIN_FULLNAME)
                $(STRIP) $(PLUGIN_FULLNAME)
index 3abc369..a6ab59a 100644 (file)
@@ -58,8 +58,10 @@ endif
 default_target: $(PLUGIN_FULLNAME)
 
 $(PLUGIN_FULLNAME): $(OBJS) version-script.txt
+ifeq ($(VERBOSE),0)
                @echo "[LD] $@"
-               @$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
+endif
+               $(MAKECMDPREFIX)$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
 
 install:       $(PLUGIN_FULLNAME)
                $(STRIP) $(PLUGIN_FULLNAME)
index c61d560..b6dc775 100644 (file)
@@ -21,8 +21,10 @@ else
 default_target: $(PLUGIN_FULLNAME)
 
 $(PLUGIN_FULLNAME): $(OBJS) version-script.txt
+ifeq ($(VERBOSE),0)
                @echo "[LD] $@"
-               @$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
+endif
+               $(MAKECMDPREFIX)$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
 
 install:       $(PLUGIN_FULLNAME)
                $(STRIP) $(PLUGIN_FULLNAME)
index af42ab1..f490138 100644 (file)
@@ -46,8 +46,10 @@ include $(TOPDIR)/Makefile.inc
 default_target: $(PLUGIN_FULLNAME)
 
 $(PLUGIN_FULLNAME): $(OBJS) version-script.txt
+ifeq ($(VERBOSE),0)
                @echo "[LD] $@"
-               @$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
+endif
+               $(MAKECMDPREFIX)$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
 
 install:       $(PLUGIN_FULLNAME)
                $(STRIP) $(PLUGIN_FULLNAME)
index 41b5ccd..38a2c37 100644 (file)
@@ -63,65 +63,71 @@ default_target: nmealib library $(PLUGIN_FULLNAME)
 
 # repeat from toplevel Makefile.inc, and adjust: we need the library includes
 %.d: %.c
-       @$(filter-out $(CCACHE),$(CC)) -M $(strip $(CPPFLAGS)) -I $(NMEALIB_INC) -I $(LIBRARY_INC) "$<" | sed -e '1s/\($(call quote,$(*F))\.o\)[ :]*/$(call quote,$(*D)/\1 $@: Makefile $(TOPDIR)$(if $(TOPDIR),/)Makefile.inc) /g' >"$@"
+       $(MAKECMDPREFIX)$(filter-out $(CCACHE),$(CC)) -M $(strip $(CPPFLAGS)) -I $(NMEALIB_INC) -I $(LIBRARY_INC) "$<" | sed -e '1s/\($(call quote,$(*F))\.o\)[ :]*/$(call quote,$(*D)/\1 $@: Makefile $(TOPDIR)$(if $(TOPDIR),/)Makefile.inc) /g' >"$@"
 
 $(PLUGIN_FULLNAME): $(OBJS) version-script.txt
 ifeq ($(PUD_NMEALIB_STATICALLY_LINKED),)
+ifeq ($(VERBOSE),0)
        @echo "[LD] $@ (nmealib dynamically linked)"
-       @$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
+endif
+       $(MAKECMDPREFIX)$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
 else
+ifeq ($(VERBOSE),0)
        @echo "[LD] $@ (nmealib statically linked)"
-       @$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(NMEALIB_LIB_STATIC) $(LIBS)
+endif
+       $(MAKECMDPREFIX)$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(NMEALIB_LIB_STATIC) $(LIBS)
 endif
 
 install: all
-       @$(MAKE) -C "$(NMEALIB_PATH)" DESTDIR="$(DESTDIR)" install
-       @$(MAKE) -C "$(LIBRARY_PATH)" DESTDIR="$(DESTDIR)" install
+       $(MAKECMDPREFIX)$(MAKE) -C "$(NMEALIB_PATH)" DESTDIR="$(DESTDIR)" install
+       $(MAKECMDPREFIX)$(MAKE) -C "$(LIBRARY_PATH)" DESTDIR="$(DESTDIR)" install
        $(INSTALL_LIB)
        mkdir -p "$(DOCDIR_OLSRD)"
        cp "$(RESOURCESDIR)/olsrd.pud.position.conf" "$(DOCDIR_OLSRD)"
        $(STRIP) "$(LIBDIR)/$(PLUGIN_FULLNAME)"
 
 uninstall:
-       @$(MAKE) -C "$(NMEALIB_PATH)" DESTDIR="$(DESTDIR)" uninstall
-       @$(MAKE) -C "$(LIBRARY_PATH)" DESTDIR="$(DESTDIR)" uninstall
+       $(MAKECMDPREFIX)$(MAKE) -C "$(NMEALIB_PATH)" DESTDIR="$(DESTDIR)" uninstall
+       $(MAKECMDPREFIX)$(MAKE) -C "$(LIBRARY_PATH)" DESTDIR="$(DESTDIR)" uninstall
        rm -f "$(LIBDIR)/lib$(PLUGIN_NAME).so" "$(LIBDIR)/$(PLUGIN_NAME)" "$(DOCDIR_OLSRD)/olsrd.pud.position.conf"
        $(UNINSTALL_LIB)
        rmdir -v -p --ignore-fail-on-non-empty "$(LIBDIR)" "$(DOCDIR_OLSRD)"
 
 clean:
+ifeq ($(VERBOSE),0)
        @echo "[$@]"
-       @rm -f $(OBJS) $(SRCS:%.c=%.d) "$(PLUGIN_FULLNAME)"
-       @$(MAKE) -C doc clean
-       @$(MAKE) -C "$(NMEALIB_PATH)" clean
-       @$(MAKE) -C "$(LIBRARY_PATH)" clean
-       @$(MAKE) -C "$(JAVA_PATH)" clean
+endif
+       $(MAKECMDPREFIX)rm -f $(OBJS) $(SRCS:%.c=%.d) "$(PLUGIN_FULLNAME)"
+       $(MAKECMDPREFIX)$(MAKE) -C doc clean
+       $(MAKECMDPREFIX)$(MAKE) -C "$(NMEALIB_PATH)" clean
+       $(MAKECMDPREFIX)$(MAKE) -C "$(LIBRARY_PATH)" clean
+       $(MAKECMDPREFIX)$(MAKE) -C "$(JAVA_PATH)" clean
 
 doc:
-       @$(MAKE) -C doc all
-       @$(MAKE) -C "$(NMEALIB_PATH)" doc
-       @$(MAKE) -C "$(LIBRARY_PATH)" doc
-       @$(MAKE) -C "$(JAVA_PATH)" doc
+       $(MAKECMDPREFIX)$(MAKE) -C doc all
+       $(MAKECMDPREFIX)$(MAKE) -C "$(NMEALIB_PATH)" doc
+       $(MAKECMDPREFIX)$(MAKE) -C "$(LIBRARY_PATH)" doc
+       $(MAKECMDPREFIX)$(MAKE) -C "$(JAVA_PATH)" doc
 
 doc-clean:
-       @$(MAKE) -C doc clean
-       @$(MAKE) -C "$(NMEALIB_PATH)" doc clean
-       @$(MAKE) -C "$(LIBRARY_PATH)" doc clean
-       @$(MAKE) -C "$(JAVA_PATH)" doc clean
+       $(MAKECMDPREFIX)$(MAKE) -C doc clean
+       $(MAKECMDPREFIX)$(MAKE) -C "$(NMEALIB_PATH)" doc clean
+       $(MAKECMDPREFIX)$(MAKE) -C "$(LIBRARY_PATH)" doc clean
+       $(MAKECMDPREFIX)$(MAKE) -C "$(JAVA_PATH)" doc clean
 
 nmealib:
-       @$(MAKE) -C "$(NMEALIB_PATH)" all
+       $(MAKECMDPREFIX)$(MAKE) -C "$(NMEALIB_PATH)" all
 
 library:
-       @$(MAKE) -C "$(LIBRARY_PATH)" all
+       $(MAKECMDPREFIX)$(MAKE) -C "$(LIBRARY_PATH)" all
 
 java:
-       @$(MAKE) -C "$(JAVA_PATH)" all
+       $(MAKECMDPREFIX)$(MAKE) -C "$(JAVA_PATH)" all
 
 java-install: java
-       @$(MAKE) -C "$(JAVA_PATH)" DESTDIR="$(DESTDIR)" install
+       $(MAKECMDPREFIX)$(MAKE) -C "$(JAVA_PATH)" DESTDIR="$(DESTDIR)" install
 
 java-uninstall:
-       @$(MAKE) -C "$(JAVA_PATH)" DESTDIR="$(DESTDIR)" uninstall
+       $(MAKECMDPREFIX)$(MAKE) -C "$(JAVA_PATH)" DESTDIR="$(DESTDIR)" uninstall
 
 endif
index 262d89a..8ecd78a 100644 (file)
@@ -10,25 +10,31 @@ TMP_DOX_FILE = $(DOX_FILE).temp
 .PHONY: .gitignore all clean
 
 .gitignore:
+ifeq ($(VERBOSE),0)
        @echo "[$@] doc"
-       @echo "/$(HTML_DIR)/" > $@
-       @echo "/$(MAN_DIR)/" >> $@
-       @echo "/$(LATEX_DIR)/" >> $@
-       @echo "/$(TMP_DOX_FILE)" >> $@
-       @echo "/$(PDF_NAME)" >> $@
+endif
+       $(MAKECMDPREFIX)echo "/$(HTML_DIR)/" > $@
+       $(MAKECMDPREFIX)echo "/$(MAN_DIR)/" >> $@
+       $(MAKECMDPREFIX)echo "/$(LATEX_DIR)/" >> $@
+       $(MAKECMDPREFIX)echo "/$(TMP_DOX_FILE)" >> $@
+       $(MAKECMDPREFIX)echo "/$(PDF_NAME)" >> $@
 
 clean:
+ifeq ($(VERBOSE),0)
        @echo "[$@] doc"
-       @rm -fr "$(TMP_DOX_FILE)" "$(HTML_DIR)" "$(LATEX_DIR)" "$(MAN_DIR)" "$(PDF_NAME)"
+endif
+       $(MAKECMDPREFIX)rm -fr "$(TMP_DOX_FILE)" "$(HTML_DIR)" "$(LATEX_DIR)" "$(MAN_DIR)" "$(PDF_NAME)"
 
 all: clean $(DOX_FILE)
+ifeq ($(VERBOSE),0)
        @echo "[$@] doc"
-       @sed \
+endif
+       $(MAKECMDPREFIX)sed \
          -e "s/__PLUGIN_VER__/$(PLUGIN_VER)/" \
          -e "s/__LIBNAME__/$(PLUGIN_NAME)/" \
          "$(DOX_FILE)" > "$(TMP_DOX_FILE)"
-       @doxygen "$(TMP_DOX_FILE)"
-       @rm "$(TMP_DOX_FILE)"
-       @$(MAKE) -s -C $(LATEX_DIR) all > /dev/null 2>&1
-       @mv "$(LATEX_DIR)/refman.pdf" "$(PDF_NAME)"
-       @rm -fr "$(LATEX_DIR)"
+       $(MAKECMDPREFIX)doxygen "$(TMP_DOX_FILE)"
+       $(MAKECMDPREFIX)rm "$(TMP_DOX_FILE)"
+       $(MAKECMDPREFIX)$(MAKE) -s -C $(LATEX_DIR) all > /dev/null 2>&1
+       $(MAKECMDPREFIX)mv "$(LATEX_DIR)/refman.pdf" "$(PDF_NAME)"
+       $(MAKECMDPREFIX)rm -fr "$(LATEX_DIR)"
index 5faf5c6..0288a6e 100644 (file)
@@ -38,19 +38,25 @@ default_target: all-before lib/$(LIBNAMESTATIC) lib/$(LIBNAME)
 remake: clean all
 
 lib/$(LIBNAMESTATIC): $(OBJ)
+ifeq ($(VERBOSE),0)
        @echo "[AR] $@"
-       @ar rcs "$@" $(OBJ)
+endif
+       $(MAKECMDPREFIX)ar rcs "$@" $(OBJ)
 
 lib/$(LIBNAME): $(OBJ)
+ifeq ($(VERBOSE),0)
        @echo "[LD] $@"
-       @$(CC) -shared -Wl,-soname=$(LIBNAME) -o "$@" $(LIBRARIES) $(OBJ)
+endif
+       $(MAKECMDPREFIX)$(CC) -shared -Wl,-soname=$(LIBNAME) -o "$@" $(LIBRARIES) $(OBJ)
 
 build/%.o: src/%.c Makefile Makefile.inc
+ifeq ($(VERBOSE),0)
        @echo "[CC] $<"
-       @$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
+endif
+       $(MAKECMDPREFIX)$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
 
 samples: all
-       @$(MAKE) -C samples all
+       $(MAKECMDPREFIX)$(MAKE) -C samples all
 
 
 #
@@ -60,35 +66,35 @@ samples: all
 .PHONY: all default_target all-before clean doc install install-headers uninstall uninstall-headers
 
 all-before:
-       @mkdir -p build lib
+       $(MAKECMDPREFIX)mkdir -p build lib
 
 clean:
-       @$(MAKE) -C doc clean
-       @$(MAKE) -C samples clean
-       @rm -frv build lib
+       $(MAKECMDPREFIX)$(MAKE) -C doc clean
+       $(MAKECMDPREFIX)$(MAKE) -C samples clean
+       $(MAKECMDPREFIX)rm -frv build lib
 
 doc:
-       @$(MAKE) -C doc all
+       $(MAKECMDPREFIX)$(MAKE) -C doc all
 
 doc-clean:
-       @$(MAKE) -C doc clean
+       $(MAKECMDPREFIX)$(MAKE) -C doc clean
 
 install: all
-       @mkdir -v -p "$(LIBDIR)"
-       @cp -v "lib/$(LIBNAME)" "$(LIBDIR)/$(LIBNAME).$(VERSION)"
-       @$(STRIP) "$(LIBDIR)/$(LIBNAME).$(VERSION)"
-       @/sbin/ldconfig -n "$(LIBDIR)"
+       $(MAKECMDPREFIX)mkdir -v -p "$(LIBDIR)"
+       $(MAKECMDPREFIX)cp -v "lib/$(LIBNAME)" "$(LIBDIR)/$(LIBNAME).$(VERSION)"
+       $(MAKECMDPREFIX)$(STRIP) "$(LIBDIR)/$(LIBNAME).$(VERSION)"
+       $(MAKECMDPREFIX)/sbin/ldconfig -n "$(LIBDIR)"
 
 install-headers: all
-       @mkdir -v -p "$(INCLUDEDIR)"
-       @rm -fr "$(INCLUDEDIR)/nmea"
-       @cp -rv include/nmea "$(INCLUDEDIR)"
+       $(MAKECMDPREFIX)mkdir -v -p "$(INCLUDEDIR)"
+       $(MAKECMDPREFIX)rm -fr "$(INCLUDEDIR)/nmea"
+       $(MAKECMDPREFIX)cp -rv include/nmea "$(INCLUDEDIR)"
 
 uninstall:
-       @rm -fv "$(LIBDIR)/$(LIBNAME)" "$(LIBDIR)/$(LIBNAME).$(VERSION)"
-       @/sbin/ldconfig -n "$(LIBDIR)"
-       @rmdir -v -p --ignore-fail-on-non-empty "$(LIBDIR)"
+       $(MAKECMDPREFIX)rm -fv "$(LIBDIR)/$(LIBNAME)" "$(LIBDIR)/$(LIBNAME).$(VERSION)"
+       $(MAKECMDPREFIX)/sbin/ldconfig -n "$(LIBDIR)"
+       $(MAKECMDPREFIX)rmdir -v -p --ignore-fail-on-non-empty "$(LIBDIR)"
 
 uninstall-headers:
-       @rm -frv "$(INCLUDEDIR)/nmea"
-       @rmdir -v -p --ignore-fail-on-non-empty "$(INCLUDEDIR)"
+       $(MAKECMDPREFIX)rm -frv "$(INCLUDEDIR)/nmea"
+       $(MAKECMDPREFIX)rmdir -v -p --ignore-fail-on-non-empty "$(INCLUDEDIR)"
index 0bdfbe0..cb16939 100644 (file)
@@ -8,6 +8,15 @@
 DEBUG ?= 1
 
 
+# shows full compiler/linker calls if activated
+VERBOSE ?= 0
+
+ifeq ($(VERBOSE),0)
+MAKECMDPREFIX = @
+else
+MAKECMDPREFIX =
+endif
+
 ######################
 #
 # Lowlevel options and rules
index 81a5118..a5b2cd2 100644 (file)
@@ -3,16 +3,27 @@ include ../Makefile.inc
 .PHONY: all clean
 
 clean:
-       rm -fr html latex man nmealib.pdf
+       $(MAKECMDPREFIX)rm -fr html latex man nmealib.pdf
 
 all: clean nmea.doxygen
+ifeq ($(VERBOSE),0)
        @echo "Updating version..."
-       @sed -r "s/^([[:space:]]*PROJECT_NUMBER[[:space:]]*=).*/\1 $(GITVERSION)/" nmea.doxygen > nmea.doxygen.temp
+endif
+       $(MAKECMDPREFIX)sed -r "s/^([[:space:]]*PROJECT_NUMBER[[:space:]]*=).*/\1 $(GITVERSION)/" nmea.doxygen > nmea.doxygen.temp
+ifeq ($(VERBOSE),0)
        @echo "Generating HTML and man pages..."
-       @doxygen nmea.doxygen.temp
-       @rm nmea.doxygen.temp
+endif
+       $(MAKECMDPREFIX)doxygen nmea.doxygen.temp
+       $(MAKECMDPREFIX)rm nmea.doxygen.temp
+ifeq ($(VERBOSE),0)
        @echo "Generating PDF..."
-       @make -C latex -s > /dev/null 2>&1
-       @mv latex/refman.pdf nmealib.pdf
-       @rm -fr latex
+       @$(MAKE) -C latex -s > /dev/null 2>&1
+else
+       $(MAKE) -C latex
+endif
+       $(MAKECMDPREFIX)mv latex/refman.pdf nmealib.pdf
+       $(MAKECMDPREFIX)rm -fr latex
+ifeq ($(VERBOSE),0)
        @echo "Done"
+endif
+
index 2f87548..ac2b4c6 100644 (file)
@@ -23,12 +23,16 @@ remake: clean all
 samples: $(SMPLS)
 
 ../build/samples/%: %/main.o
+ifeq ($(VERBOSE),0)
        @echo "[LD] $@"
-       @$(CC) $(CFLAGS) $< $(LIBRARIES) -o $@
+endif
+       $(MAKECMDPREFIX)$(CC) $(CFLAGS) $< $(LIBRARIES) -o $@
 
 %/main.o: %/main.c Makefile ../Makefile.inc
+ifeq ($(VERBOSE),0)
        @echo "[CC] $<"
-       @$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
+endif
+       $(MAKECMDPREFIX)$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
 
 
 #
@@ -38,7 +42,7 @@ samples: $(SMPLS)
 .PHONY: all all-before clean samples
 
 all-before:
-       @mkdir -p ../build/samples
+       $(MAKECMDPREFIX)mkdir -p ../build/samples
 
 clean:
-       rm -f $(SMPLOBJ) $(SMPLS)
+       $(MAKECMDPREFIX)rm -f $(SMPLOBJ) $(SMPLS)
index 1b5d9cd..10d65e5 100644 (file)
@@ -88,21 +88,25 @@ all: default_target
 default_target: prepare $(LIBDIR_BUILD)/$(SONAME) java
 
 .gitignore:
+ifeq ($(VERBOSE),0)
        @echo "[$@]"
-       @echo "/$(BUILD_DIR)/" > $@
-       @echo "/$(LIBDIR_BUILD)/" >> $@
-       @echo "/build.xml" >> $@
-       @echo "/$(SRC_DIR_C)/$(JAVA_PKG_UNDER)_PositionUpdate.h" >> $@
-       @echo "/$(SRC_DIR_C)/$(JAVA_PKG_UNDER)_ClusterLeader.h" >> $@
-       @echo "/$(SRC_DIR_C)/$(JAVA_PKG_UNDER)_UplinkMessage.h" >> $@
-       @echo "/$(JAVASRC)/$(JAVA_PKG_DIR)/WireFormatConstants.java" >> $@
-       @$(MAKE) -C doc $@
+endif
+       $(MAKECMDPREFIX)echo "/$(BUILD_DIR)/" > $@
+       $(MAKECMDPREFIX)echo "/$(LIBDIR_BUILD)/" >> $@
+       $(MAKECMDPREFIX)echo "/build.xml" >> $@
+       $(MAKECMDPREFIX)echo "/$(SRC_DIR_C)/$(JAVA_PKG_UNDER)_PositionUpdate.h" >> $@
+       $(MAKECMDPREFIX)echo "/$(SRC_DIR_C)/$(JAVA_PKG_UNDER)_ClusterLeader.h" >> $@
+       $(MAKECMDPREFIX)echo "/$(SRC_DIR_C)/$(JAVA_PKG_UNDER)_UplinkMessage.h" >> $@
+       $(MAKECMDPREFIX)echo "/$(JAVASRC)/$(JAVA_PKG_DIR)/WireFormatConstants.java" >> $@
+       $(MAKECMDPREFIX)$(MAKE) -C doc $@
 
 $(LIBDIR_BUILD)/$(SONAME): $(BUILD_DIR)/$(JAVA_PKG_UNDER)_UplinkMessage.o \
                            $(BUILD_DIR)/$(JAVA_PKG_UNDER)_ClusterLeader.o \
                            $(BUILD_DIR)/$(JAVA_PKG_UNDER)_PositionUpdate.o
+ifeq ($(VERBOSE),0)
        @echo "[LD] $@"
-       @$(CC) -shared -Wl,-soname=$(SONAME) $(LIBRARIES) -o "$@" \
+endif
+       $(MAKECMDPREFIX)$(CC) -shared -Wl,-soname=$(SONAME) $(LIBRARIES) -o "$@" \
       $(BUILD_DIR)/$(JAVA_PKG_UNDER)_UplinkMessage.o \
       $(BUILD_DIR)/$(JAVA_PKG_UNDER)_ClusterLeader.o \
       $(BUILD_DIR)/$(JAVA_PKG_UNDER)_PositionUpdate.o
@@ -112,57 +116,75 @@ $(BUILD_DIR)/$(JAVA_PKG_UNDER)_PositionUpdate.o: $(SRC_DIR_C)/$(JAVA_PKG_UNDER)_
                                                  $(SRC_DIR_C)/$(JAVA_PKG_UNDER)_PositionUpdate.h \
                                                  $(INC_DIR_WIREFORMAT_FULL)/wireFormat.h \
                                                  $(INC_DIR_WIREFORMAT_FULL)/nodeIdConversion.h
+ifeq ($(VERBOSE),0)
        @echo "[CC] $<"
-       @$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -c -o "$@" "$<"
+endif
+       $(MAKECMDPREFIX)$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -c -o "$@" "$<"
 
 $(SRC_DIR_C)/$(JAVA_PKG_UNDER)_PositionUpdate.h: $(BUILD_DIR_JNI)/$(JAVA_PKG_DIR)/PositionUpdate.class
+ifeq ($(VERBOSE),0)
        @echo "[JavaH] $<"
-       @rm -f "$@"
-       @javah -jni -classpath "$(BUILD_DIR_JNI)" -o "$@" "$(JAVA_PKG).PositionUpdate"
+endif
+       $(MAKECMDPREFIX)rm -f "$@"
+       $(MAKECMDPREFIX)javah -jni -classpath "$(BUILD_DIR_JNI)" -o "$@" "$(JAVA_PKG).PositionUpdate"
 
 $(BUILD_DIR_JNI)/$(JAVA_PKG_DIR)/PositionUpdate.class: $(JAVASRC)/$(JAVA_PKG_DIR)/PositionUpdate.java \
                                                        $(JAVASRC)/$(JAVA_PKG_DIR)/LibraryLoader.java \
                                                        $(JAVASRC)/$(JAVA_PKG_DIR)/WireFormatConstants.java
+ifeq ($(VERBOSE),0)
        @echo "[JavaC] $<"
-       @javac -bootclasspath $(JAVABOOTCLASSPATH) -classpath $(JAVASRC) -source 1.6 -target 1.6 -Xlint -d "$(BUILD_DIR_JNI)" "$<"
+endif
+       $(MAKECMDPREFIX)javac -bootclasspath $(JAVABOOTCLASSPATH) -classpath $(JAVASRC) -source 1.6 -target 1.6 -Xlint -d "$(BUILD_DIR_JNI)" "$<"
 
 # ClusterLeader
 $(BUILD_DIR)/$(JAVA_PKG_UNDER)_ClusterLeader.o: $(SRC_DIR_C)/$(JAVA_PKG_UNDER)_ClusterLeader.c \
                                                  $(SRC_DIR_C)/$(JAVA_PKG_UNDER)_ClusterLeader.h \
                                                  $(INC_DIR_WIREFORMAT_FULL)/wireFormat.h \
                                                  $(INC_DIR_WIREFORMAT_FULL)/nodeIdConversion.h
+ifeq ($(VERBOSE),0)
        @echo "[CC] $<"
-       @$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -c -o "$@" "$<"
+endif
+       $(MAKECMDPREFIX)$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -c -o "$@" "$<"
 
 $(SRC_DIR_C)/$(JAVA_PKG_UNDER)_ClusterLeader.h: $(BUILD_DIR_JNI)/$(JAVA_PKG_DIR)/ClusterLeader.class
+ifeq ($(VERBOSE),0)
        @echo "[JavaH] $<"
-       @rm -f "$@"
-       @javah -jni -classpath "$(BUILD_DIR_JNI)" -o "$@" "$(JAVA_PKG).ClusterLeader"
+endif
+       $(MAKECMDPREFIX)rm -f "$@"
+       $(MAKECMDPREFIX)javah -jni -classpath "$(BUILD_DIR_JNI)" -o "$@" "$(JAVA_PKG).ClusterLeader"
 
 $(BUILD_DIR_JNI)/$(JAVA_PKG_DIR)/ClusterLeader.class: $(JAVASRC)/$(JAVA_PKG_DIR)/ClusterLeader.java \
                                                       $(JAVASRC)/$(JAVA_PKG_DIR)/LibraryLoader.java \
                                                       $(JAVASRC)/$(JAVA_PKG_DIR)/WireFormatConstants.java
+ifeq ($(VERBOSE),0)
        @echo "[JavaC] $<"
-       @javac -bootclasspath $(JAVABOOTCLASSPATH) -classpath $(JAVASRC) -source 1.6 -target 1.6 -Xlint -d "$(BUILD_DIR_JNI)" "$<"
+endif
+       $(MAKECMDPREFIX)javac -bootclasspath $(JAVABOOTCLASSPATH) -classpath $(JAVASRC) -source 1.6 -target 1.6 -Xlint -d "$(BUILD_DIR_JNI)" "$<"
 
 # UplinkMessage
 $(BUILD_DIR)/$(JAVA_PKG_UNDER)_UplinkMessage.o: $(SRC_DIR_C)/$(JAVA_PKG_UNDER)_UplinkMessage.c \
                                                  $(SRC_DIR_C)/$(JAVA_PKG_UNDER)_UplinkMessage.h \
                                                  $(INC_DIR_WIREFORMAT_FULL)/wireFormat.h \
                                                  $(INC_DIR_WIREFORMAT_FULL)/nodeIdConversion.h
+ifeq ($(VERBOSE),0)
        @echo "[CC] $<"
-       @$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -c -o "$@" "$<"
+endif
+       $(MAKECMDPREFIX)$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -c -o "$@" "$<"
 
 $(SRC_DIR_C)/$(JAVA_PKG_UNDER)_UplinkMessage.h: $(BUILD_DIR_JNI)/$(JAVA_PKG_DIR)/UplinkMessage.class
+ifeq ($(VERBOSE),0)
        @echo "[JavaH] $<"
-       @rm -f "$@"
-       @javah -jni -classpath "$(BUILD_DIR_JNI)" -o "$@" "$(JAVA_PKG).UplinkMessage"
+endif
+       $(MAKECMDPREFIX)rm -f "$@"
+       $(MAKECMDPREFIX)javah -jni -classpath "$(BUILD_DIR_JNI)" -o "$@" "$(JAVA_PKG).UplinkMessage"
 
 $(BUILD_DIR_JNI)/$(JAVA_PKG_DIR)/UplinkMessage.class: $(JAVASRC)/$(JAVA_PKG_DIR)/UplinkMessage.java \
                                                       $(JAVASRC)/$(JAVA_PKG_DIR)/LibraryLoader.java \
                                                       $(JAVASRC)/$(JAVA_PKG_DIR)/WireFormatConstants.java
+ifeq ($(VERBOSE),0)
        @echo "[JavaC] $<"
-       @javac -bootclasspath $(JAVABOOTCLASSPATH) -classpath $(JAVASRC) -source 1.6 -target 1.6 -Xlint -d "$(BUILD_DIR_JNI)" "$<"
+endif
+       $(MAKECMDPREFIX)javac -bootclasspath $(JAVABOOTCLASSPATH) -classpath $(JAVASRC) -source 1.6 -target 1.6 -Xlint -d "$(BUILD_DIR_JNI)" "$<"
 
 
 #
@@ -173,11 +195,13 @@ java: prepare \
      build.xml \
      $(JAVASRC)/$(JAVA_PKG_DIR)/PositionUpdate.java \
      $(JAVASRC)/$(JAVA_PKG_DIR)/WireFormatConstants.java
-       @ant -f build.xml release
+       $(MAKECMDPREFIX)ant -f build.xml release
 
 build.xml: $(RESOURCES_DIR)/build.xml
+ifeq ($(VERBOSE),0)
        @echo "[generate] $@"
-       @sed -r -e "s#PLUGIN_VER#$(PLUGIN_VER)#g" \
+endif
+       $(MAKECMDPREFIX)sed -r -e "s#PLUGIN_VER#$(PLUGIN_VER)#g" \
                -e "s#PROJECT#$(PROJECT)#g" \
                -e "s#BUILD_DIR#$(BUILD_DIR)#g" \
                -e "s#LIBDIR_BUILD#$(LIBDIR_BUILD)#g" \
@@ -196,8 +220,10 @@ $(JAVASRC)/$(JAVA_PKG_DIR)/WireFormatConstants.java: \
       $(RESOURCES_DIR)/WireFormatConstants.java.h \
       $(BUILD_DIR_JNI)/c/library.h \
       $(BUILD_DIR_JNI)/c/wireFormat.h
+ifeq ($(VERBOSE),0)
        @echo "[generate] $@"
-       @$(CPP) -I "$(BUILD_DIR_JNI)/c" -DPLUGIN_VER=\"$(PLUGIN_VER)\" -DGIT_SHA=\"$(GIT_SHA)\" "$<" | \
+endif
+       $(MAKECMDPREFIX)$(CPP) -I "$(BUILD_DIR_JNI)/c" -DPLUGIN_VER=\"$(PLUGIN_VER)\" -DGIT_SHA=\"$(GIT_SHA)\" "$<" | \
          sed -r -e '/^[[:space:]]*#.*$$/ d' \
                 -e '/^[[:space:]]*$$/ d' \
                 > "$@"
@@ -208,12 +234,16 @@ $(JAVASRC)/$(JAVA_PKG_DIR)/WireFormatConstants.java: \
 #
 
 $(BUILD_DIR_JNI)/c/library.h: Makefile.inc
+ifeq ($(VERBOSE),0)
        @echo "[generate] $@"
-       @echo "#define PUD_WIRE_FORMAT_LIBRARYNAME \"$(PROJECT)\"" > "$@"
+endif
+       $(MAKECMDPREFIX)echo "#define PUD_WIRE_FORMAT_LIBRARYNAME \"$(PROJECT)\"" > "$@"
 
 $(BUILD_DIR_JNI)/c/wireFormat.h: $(INC_DIR_WIREFORMAT_FULL)/wireFormat.h
+ifeq ($(VERBOSE),0)
        @echo "[generate] $@"
-       @grep -E '^[[:space:]]*#define[[:space:]]+' "$<" > "$@"
+endif
+       $(MAKECMDPREFIX)grep -E '^[[:space:]]*#define[[:space:]]+' "$<" > "$@"
 
 
 #
@@ -221,24 +251,26 @@ $(BUILD_DIR_JNI)/c/wireFormat.h: $(INC_DIR_WIREFORMAT_FULL)/wireFormat.h
 #
 
 prepare:
-       @mkdir -p "$(BUILD_DIR)" \
+       $(MAKECMDPREFIX)mkdir -p "$(BUILD_DIR)" \
                  "$(LIBDIR_BUILD)" \
                  "$(BUILD_DIR_JNI)/c"
 
 
 clean: doc-clean
+ifeq ($(VERBOSE),0)
        @echo "[$@]"
-       @rm -fr "$(BUILD_DIR)" "$(LIBDIR_BUILD)" \
+endif
+       $(MAKECMDPREFIX)rm -fr "$(BUILD_DIR)" "$(LIBDIR_BUILD)" \
                build.xml \
                "$(SRC_DIR_C)/$(JAVA_PKG_UNDER)_PositionUpdate.h" \
                "$(JAVASRC)/$(JAVA_PKG_DIR)/WireFormatConstants.java"
 
 doc: build.xml
-       @$(MAKE) -C doc all
-       @ant -f build.xml javadoc
+       $(MAKECMDPREFIX)$(MAKE) -C doc all
+       $(MAKECMDPREFIX)ant -f build.xml javadoc
 
 doc-clean:
-       @$(MAKE) -C doc clean
+       $(MAKECMDPREFIX)$(MAKE) -C doc clean
 
 install: all
        mkdir -v -p "$(LIBDIR)"
index 14b68b5..1642b8f 100644 (file)
@@ -12,27 +12,33 @@ TMP_DOX_FILE = $(DOX_FILE).temp
 .PHONY: .gitignore all clean
 
 .gitignore:
+ifeq ($(VERBOSE),0)
        @echo "[$@]"
-       @echo "/$(JAVADOC_DIR)/" > $@
-       @echo "/$(HTML_DIR)/" >> $@
-       @echo "/$(MAN_DIR)/" >> $@
-       @echo "/$(LATEX_DIR)/" >> $@
-       @echo "/$(TMP_DOX_FILE)" >> $@
-       @echo "/$(PDF_NAME)" >> $@
+endif
+       $(MAKECMDPREFIX)echo "/$(JAVADOC_DIR)/" > $@
+       $(MAKECMDPREFIX)echo "/$(HTML_DIR)/" >> $@
+       $(MAKECMDPREFIX)echo "/$(MAN_DIR)/" >> $@
+       $(MAKECMDPREFIX)echo "/$(LATEX_DIR)/" >> $@
+       $(MAKECMDPREFIX)echo "/$(TMP_DOX_FILE)" >> $@
+       $(MAKECMDPREFIX)echo "/$(PDF_NAME)" >> $@
 
 all: clean $(DOX_FILE)
+ifeq ($(VERBOSE),0)
        @echo "[$@]"
-       @sed \
+endif
+       $(MAKECMDPREFIX)sed \
          -e "s/__PLUGIN_VER__/$(PLUGIN_VER)/" \
          -e "s/__LIBNAME__/$(LIBNAME)/" \
          "$(DOX_FILE)" > "$(TMP_DOX_FILE)"
-       @doxygen "$(TMP_DOX_FILE)"
-       @rm "$(TMP_DOX_FILE)"
-       @$(MAKE) -s -C $(LATEX_DIR) all > /dev/null 2>&1
-       @mv "$(LATEX_DIR)/refman.pdf" "$(PDF_NAME)"
-       @rm -fr "$(LATEX_DIR)"
+       $(MAKECMDPREFIX)doxygen "$(TMP_DOX_FILE)"
+       $(MAKECMDPREFIX)rm "$(TMP_DOX_FILE)"
+       $(MAKECMDPREFIX)$(MAKE) -s -C $(LATEX_DIR) all > /dev/null 2>&1
+       $(MAKECMDPREFIX)mv "$(LATEX_DIR)/refman.pdf" "$(PDF_NAME)"
+       $(MAKECMDPREFIX)rm -fr "$(LATEX_DIR)"
 
 clean:
+ifeq ($(VERBOSE),0)
        @echo "[$@]"
-       @rm -fr "$(JAVADOC_DIR)" "$(HTML_DIR)" "$(LATEX_DIR)" "$(MAN_DIR)" \
+endif
+       $(MAKECMDPREFIX)rm -fr "$(JAVADOC_DIR)" "$(HTML_DIR)" "$(LATEX_DIR)" "$(MAN_DIR)" \
                "$(TMP_DOX_FILE)" "$(PDF_NAME)"
index adf7b75..c7c7752 100644 (file)
@@ -45,18 +45,24 @@ all: default_target
 default_target: prepare $(LIBDIR_BUILD)/$(SONAME)
 
 $(LIBDIR_BUILD)/$(SONAME): $(OBJECTS_C)
+ifeq ($(VERBOSE),0)
        @echo "[LD] $@"
-       @$(CC) -shared -Wl,-soname=$(SONAME) $(LIBRARIES) -o "$@" $(OBJECTS_C)
+endif
+       $(MAKECMDPREFIX)$(CC) -shared -Wl,-soname=$(SONAME) $(LIBRARIES) -o "$@" $(OBJECTS_C)
 
 $(BUILD_DIR)/%.o: $(SRC_DIR_C)/%.c $(INC_DIR_C)/compiler.h
+ifeq ($(VERBOSE),0)
        @echo "[CC] $<"
-       @$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -c -o "$@" "$<"
+endif
+       $(MAKECMDPREFIX)$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -c -o "$@" "$<"
 
 .gitignore:
+ifeq ($(VERBOSE),0)
        @echo "[$@]"
-       @echo "/$(BUILD_DIR)/" > $@
-       @echo "/$(LIBDIR_BUILD)/" >> $@
-       @$(MAKE) -C doc $@
+endif
+       $(MAKECMDPREFIX)echo "/$(BUILD_DIR)/" > $@
+       $(MAKECMDPREFIX)echo "/$(LIBDIR_BUILD)/" >> $@
+       $(MAKECMDPREFIX)$(MAKE) -C doc $@
 
 
 #
@@ -64,17 +70,19 @@ $(BUILD_DIR)/%.o: $(SRC_DIR_C)/%.c $(INC_DIR_C)/compiler.h
 #
 
 prepare:
-       @mkdir -p "$(BUILD_DIR)" "$(LIBDIR_BUILD)"
+       $(MAKECMDPREFIX)mkdir -p "$(BUILD_DIR)" "$(LIBDIR_BUILD)"
 
 clean: doc-clean
+ifeq ($(VERBOSE),0)
        @echo "[$@]"
-       @rm -fr "$(BUILD_DIR)" "$(LIBDIR_BUILD)" "$(SRC_DIR_C)/"*.d
+endif
+       $(MAKECMDPREFIX)rm -fr "$(BUILD_DIR)" "$(LIBDIR_BUILD)" "$(SRC_DIR_C)/"*.d
 
 doc:
-       @$(MAKE) -C doc all
+       $(MAKECMDPREFIX)$(MAKE) -C doc all
 
 doc-clean:
-       @$(MAKE) -C doc clean
+       $(MAKECMDPREFIX)$(MAKE) -C doc clean
 
 install: all
        mkdir -v -p "$(LIBDIR)"
index 50adf6c..7654ff0 100644 (file)
@@ -11,25 +11,31 @@ TMP_DOX_FILE = $(DOX_FILE).temp
 .PHONY: .gitignore all clean
 
 .gitignore:
+ifeq ($(VERBOSE),0)
        @echo "[$@]"
-       @echo "/$(HTML_DIR)/" > $@
-       @echo "/$(MAN_DIR)/" >> $@
-       @echo "/$(LATEX_DIR)/" >> $@
-       @echo "/$(TMP_DOX_FILE)" >> $@
-       @echo "/$(PDF_NAME)" >> $@
+endif
+       $(MAKECMDPREFIX)echo "/$(HTML_DIR)/" > $@
+       $(MAKECMDPREFIX)echo "/$(MAN_DIR)/" >> $@
+       $(MAKECMDPREFIX)echo "/$(LATEX_DIR)/" >> $@
+       $(MAKECMDPREFIX)echo "/$(TMP_DOX_FILE)" >> $@
+       $(MAKECMDPREFIX)echo "/$(PDF_NAME)" >> $@
 
 all: clean $(DOX_FILE)
+ifeq ($(VERBOSE),0)
        @echo "[$@]"
-       @sed \
+endif
+       $(MAKECMDPREFIX)sed \
          -e "s/__PLUGIN_VER__/$(PLUGIN_VER)/" \
          -e "s/__LIBNAME__/$(LIBNAME)/" \
          "$(DOX_FILE)" > "$(TMP_DOX_FILE)"
-       @doxygen "$(TMP_DOX_FILE)"
-       @rm "$(TMP_DOX_FILE)"
-       @$(MAKE) -s -C $(LATEX_DIR) all > /dev/null 2>&1
-       @mv "$(LATEX_DIR)/refman.pdf" "$(PDF_NAME)"
-       @rm -fr "$(LATEX_DIR)"
+       $(MAKECMDPREFIX)doxygen "$(TMP_DOX_FILE)"
+       $(MAKECMDPREFIX)rm "$(TMP_DOX_FILE)"
+       $(MAKECMDPREFIX)$(MAKE) -s -C $(LATEX_DIR) all > /dev/null 2>&1
+       $(MAKECMDPREFIX)mv "$(LATEX_DIR)/refman.pdf" "$(PDF_NAME)"
+       $(MAKECMDPREFIX)rm -fr "$(LATEX_DIR)"
 
 clean:
-       @echo "[$@]"
-       @rm -fr "$(HTML_DIR)" "$(LATEX_DIR)" "$(MAN_DIR)" "$(TMP_DOX_FILE)" "$(PDF_NAME)"
+ifeq ($(VERBOSE),0)
+       echo "[$@]"
+endif
+       $(MAKECMDPREFIX)rm -fr "$(HTML_DIR)" "$(LATEX_DIR)" "$(MAN_DIR)" "$(TMP_DOX_FILE)" "$(PDF_NAME)"
index b97aef8..5befa60 100644 (file)
@@ -56,8 +56,10 @@ else
 default_target: $(PLUGIN_FULLNAME)
 
 $(PLUGIN_FULLNAME): $(OBJS) version-script.txt
+ifeq ($(VERBOSE),0)
                @echo "[LD] $@"
-               @$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
+endif
+               $(MAKECMDPREFIX)$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
 
 install:       $(PLUGIN_FULLNAME)
                $(STRIP) $(PLUGIN_FULLNAME)
index adb5e1e..bf0b7c9 100644 (file)
@@ -51,8 +51,10 @@ endif
 default_target: $(PLUGIN_FULLNAME)
 
 $(PLUGIN_FULLNAME): $(OBJS) version-script.txt
+ifeq ($(VERBOSE),0)
                @echo "[LD] $@"
-               @$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
+endif
+               $(MAKECMDPREFIX)$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
 
 install:       $(PLUGIN_FULLNAME)
                $(STRIP) $(PLUGIN_FULLNAME)
index 0efb81c..4fce5ed 100644 (file)
@@ -36,8 +36,10 @@ all: default_target
 default_target: $(PLUGIN_FULLNAME)
 
 $(PLUGIN_FULLNAME): $(OBJS) version-script.txt
+ifeq ($(VERBOSE),0)
        @echo "[LD] $@"
-       @$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
+endif
+       $(MAKECMDPREFIX)$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
 
 install: all
        $(INSTALL_LIB)
@@ -51,14 +53,16 @@ uninstall:
        rmdir -v -p --ignore-fail-on-non-empty "$(LIBDIR)" "$(DOCDIR_OLSRD)"
 
 clean:
+ifeq ($(VERBOSE),0)
        @echo "[$@]"
-       @rm -f $(OBJS) $(SRCS:%.c=%.d) "$(PLUGIN_FULLNAME)"
-       @$(MAKE) -C doc clean
+endif
+       $(MAKECMDPREFIX)rm -f $(OBJS) $(SRCS:%.c=%.d) "$(PLUGIN_FULLNAME)"
+       $(MAKECMDPREFIX)$(MAKE) -C doc clean
 
 doc:
-       @$(MAKE) -C doc all
+       $(MAKECMDPREFIX)$(MAKE) -C doc all
 
 doc-clean:
-       @$(MAKE) -C doc clean
+       $(MAKECMDPREFIX)$(MAKE) -C doc clean
 
 endif
index 262d89a..8ecd78a 100644 (file)
@@ -10,25 +10,31 @@ TMP_DOX_FILE = $(DOX_FILE).temp
 .PHONY: .gitignore all clean
 
 .gitignore:
+ifeq ($(VERBOSE),0)
        @echo "[$@] doc"
-       @echo "/$(HTML_DIR)/" > $@
-       @echo "/$(MAN_DIR)/" >> $@
-       @echo "/$(LATEX_DIR)/" >> $@
-       @echo "/$(TMP_DOX_FILE)" >> $@
-       @echo "/$(PDF_NAME)" >> $@
+endif
+       $(MAKECMDPREFIX)echo "/$(HTML_DIR)/" > $@
+       $(MAKECMDPREFIX)echo "/$(MAN_DIR)/" >> $@
+       $(MAKECMDPREFIX)echo "/$(LATEX_DIR)/" >> $@
+       $(MAKECMDPREFIX)echo "/$(TMP_DOX_FILE)" >> $@
+       $(MAKECMDPREFIX)echo "/$(PDF_NAME)" >> $@
 
 clean:
+ifeq ($(VERBOSE),0)
        @echo "[$@] doc"
-       @rm -fr "$(TMP_DOX_FILE)" "$(HTML_DIR)" "$(LATEX_DIR)" "$(MAN_DIR)" "$(PDF_NAME)"
+endif
+       $(MAKECMDPREFIX)rm -fr "$(TMP_DOX_FILE)" "$(HTML_DIR)" "$(LATEX_DIR)" "$(MAN_DIR)" "$(PDF_NAME)"
 
 all: clean $(DOX_FILE)
+ifeq ($(VERBOSE),0)
        @echo "[$@] doc"
-       @sed \
+endif
+       $(MAKECMDPREFIX)sed \
          -e "s/__PLUGIN_VER__/$(PLUGIN_VER)/" \
          -e "s/__LIBNAME__/$(PLUGIN_NAME)/" \
          "$(DOX_FILE)" > "$(TMP_DOX_FILE)"
-       @doxygen "$(TMP_DOX_FILE)"
-       @rm "$(TMP_DOX_FILE)"
-       @$(MAKE) -s -C $(LATEX_DIR) all > /dev/null 2>&1
-       @mv "$(LATEX_DIR)/refman.pdf" "$(PDF_NAME)"
-       @rm -fr "$(LATEX_DIR)"
+       $(MAKECMDPREFIX)doxygen "$(TMP_DOX_FILE)"
+       $(MAKECMDPREFIX)rm "$(TMP_DOX_FILE)"
+       $(MAKECMDPREFIX)$(MAKE) -s -C $(LATEX_DIR) all > /dev/null 2>&1
+       $(MAKECMDPREFIX)mv "$(LATEX_DIR)/refman.pdf" "$(PDF_NAME)"
+       $(MAKECMDPREFIX)rm -fr "$(LATEX_DIR)"
index c164dcf..83279a0 100644 (file)
@@ -60,8 +60,10 @@ else
 default_target: $(PLUGIN_FULLNAME)
 
 $(PLUGIN_FULLNAME): $(OBJS) version-script.txt
+ifeq ($(VERBOSE),0)
                @echo "[LD] $@"
-               @$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
+endif
+               $(MAKECMDPREFIX)$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
 
 # this is not nice but there is no nicer solution
 src/lua/lapi.o src/lua/ltable.o:  CFLAGS += -Wno-cast-qual
index 63c2920..a2fa16a 100644 (file)
@@ -46,8 +46,10 @@ include $(TOPDIR)/Makefile.inc
 default_target: $(PLUGIN_FULLNAME)
 
 $(PLUGIN_FULLNAME): $(OBJS) version-script.txt
+ifeq ($(VERBOSE),0)
                @echo "[LD] $@"
-               @$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
+endif
+               $(MAKECMDPREFIX)$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
 
 install:       $(PLUGIN_FULLNAME)
                $(STRIP) $(PLUGIN_FULLNAME)
index b22c094..e87aaf9 100644 (file)
@@ -46,8 +46,10 @@ include $(TOPDIR)/Makefile.inc
 default_target: $(PLUGIN_FULLNAME)
 
 $(PLUGIN_FULLNAME): $(OBJS) version-script.txt
+ifeq ($(VERBOSE),0)
                @echo "[LD] $@"
-               @$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
+endif
+               $(MAKECMDPREFIX)$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
 
 install:       $(PLUGIN_FULLNAME)
                $(STRIP) $(PLUGIN_FULLNAME)
index 0fecbf3..7ec5370 100644 (file)
@@ -116,7 +116,7 @@ endif
 REGEX_LIB = $(TOPDIR)/android/regex/libregex.a
 REGEX_CLEAN = regex_clean
 $(REGEX_LIB):
-       @$(MAKE) -C $(TOPDIR)/android/regex/ REGEX_LIB=$(REGEX_LIB) VERBOSE=$(VERBOSE) \
+       $(MAKECMDPREFIX)$(MAKE) MAKECMDPREFIX="$(MAKECMDPREFIX)" -C $(TOPDIR)/android/regex/ REGEX_LIB=$(REGEX_LIB) VERBOSE=$(VERBOSE) \
                NDK_TOOLCHAIN_BASE="$(NDK_TOOLCHAIN_BASE)" \
                NDK_PLATFORM_VERSION="$(NDK_PLATFORM_VERSION)" \
                NDK_SYSROOT="$(NDK_SYSROOT)" \
@@ -125,7 +125,7 @@ $(REGEX_LIB):
                CPPFLAGS="$(CPPFLAGS)"
 
 $(REGEX_CLEAN):
-       @$(MAKE) -C $(TOPDIR)/android/regex/ clean REGEX_LIB=$(REGEX_LIB)
+       $(MAKECMDPREFIX)$(MAKE) MAKECMDPREFIX="$(MAKECMDPREFIX)" -C $(TOPDIR)/android/regex/ clean REGEX_LIB=$(REGEX_LIB)
 
 # Local Variables:
 # mode: makefile
index ce2e05e..d318410 100644 (file)
@@ -89,8 +89,10 @@ endif
 default_target: $(NAME)
 
 $(NAME):       $(OBJS)
+ifeq ($(VERBOSE),0)
                @echo "[LD] $@"
-               @$(CC) $(LDFLAGS) -o "$@" $^ $(LIBS)
+endif
+               $(MAKECMDPREFIX)$(CC) $(LDFLAGS) -o "$@" $^ $(LIBS)
 
 install:
                install -D -m 755 $(NAME) $(LIBDIR)/$(NAME)
index 0a3212a..63bc2fc 100644 (file)
@@ -46,9 +46,11 @@ OBJS += $(foreach file,olsrd_conf oparse oscan cfgfile_gen,$(C)$(file).o)
 HDRS += $(foreach file,olsrd_conf oparse,$(C)$(file).h)
 
 $(C)oscan.c: $(C)oscan.lex $(C)Makefile
+ifeq ($(VERBOSE),0)
        @echo "[FLEX] $@"
-       @$(FLEX) -Cem -o"$@-tmp" "$<"
-       @sed    -e '/^static/s/yy_get_next_buffer[\(][\)]/yy_get_next_buffer(void)/' \
+endif
+       $(MAKECMDPREFIX)$(FLEX) -Cem -o"$@-tmp" "$<"
+       $(MAKECMDPREFIX)sed     -e '/^static/s/yy_get_next_buffer[\(][\)]/yy_get_next_buffer(void)/' \
                -e '/^static/s/yy_get_previous_state[\(][\)]/yy_get_previous_state(void)/' \
                -e '/^static/s/yygrowstack[\(][\)]/yygrowstack(void)/' \
                -e '/^static/s/input[\(][\)]/input(void)/' \
@@ -56,7 +58,7 @@ $(C)oscan.c: $(C)oscan.lex $(C)Makefile
                -e 's/register //' \
                -e '/^#line/s/$(call quote,$@-tmp)/$(call quote,$@)/' \
                < "$@-tmp" >"$@"
-       @$(RM) "$@-tmp"
+       $(MAKECMDPREFIX)$(RM) "$@-tmp"
 
 # we need a dependency to generate oparse before we compile oscan.c
 $(C)oscan.o: $(C)oparse.c
@@ -65,13 +67,15 @@ $(C)oscan.o: CFLAGS := $(filter-out -Wunreachable-code -Wsign-compare,$(CFLAGS))
 $(C)oscan.o: CPPFLAGS += $(if $(CFGDIR),-I$(CFGDIR)) -DYY_NO_INPUT
 
 $(C)oparse.c: $(C)oparse.y $(C)olsrd_conf.h $(C)Makefile
+ifeq ($(VERBOSE),0)
        @echo "[BISON] $@"
-       @$(BISON) -d -o "$@-tmp" "$<"
-       @sed    -e 's/register //' \
+endif
+       $(MAKECMDPREFIX)$(BISON) -d -o "$@-tmp" "$<"
+       $(MAKECMDPREFIX)sed     -e 's/register //' \
                -e '/^#line/s/$(call quote,$@-tmp)/$(call quote,$@)/' \
                < "$@-tmp" >"$@"
-       @mv "$(subst .c,.h,$@-tmp)" "$(subst .c,.h,$@)"
-       @$(RM) "$@-tmp" "$(subst .c,.h,$@-tmp)"
+       $(MAKECMDPREFIX)mv "$(subst .c,.h,$@-tmp)" "$(subst .c,.h,$@)"
+       $(MAKECMDPREFIX)$(RM) "$@-tmp" "$(subst .c,.h,$@-tmp)"
 
 $(C)oparse.o: CFLAGS := $(filter-out -Wunreachable-code,$(CFLAGS))
 
index d32f5be..8f3c5ba 100644 (file)
@@ -11,8 +11,10 @@ endif
 default_target:        $(TOPDIR)/$(BINNAME)
 
 $(TOPDIR)/$(BINNAME):  $(OBJS)
+ifeq ($(VERBOSE),0)
        @echo "[LD] $@"
-       @$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
+endif
+       $(MAKECMDPREFIX)$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
 
 ohs_cmd.o: CFLAGS += -Wno-cast-qual -DNO_OLDNAMES