improve VERBOSE handling
[olsrd.git] / lib / pud / Makefile
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