diff --git a/wmake/makefiles/general b/wmake/makefiles/general index b7f49358a173c24a417ee7b73364b17cead07302..7921ee0add09926734f62bb1fc10c0d84e3cb6b0 100644 --- a/wmake/makefiles/general +++ b/wmake/makefiles/general @@ -130,16 +130,18 @@ LIB_HEADER_DIRS = \ $(EXE): $(OBJECTS) @$(WM_SCRIPTS)/makeTargetDir $(EXE) - $(LINKEXE) $(OBJECTS) -L$(LIB_PLATFORMS) \ + $(call QUIET_MESSAGE, " ld: $(notdir $(EXE))") + $E $(LINKEXE) $(OBJECTS) -L$(LIB_PLATFORMS) \ $(EXE_LIBS) $(PROJECT_LIBS) $(SYS_LIBS) \ $(LINK_LIBS) $(GLIBS) -o $(EXE) exe: $(SEXE) - @echo \'$(SEXE)\' is up to date. + @echo "->> $(SEXE)" $(SEXE):$(OBJECTS) @$(WM_SCRIPTS)/makeTargetDir $(SEXE) - $(LINKEXE) $(OBJECTS) $(EXE_LIBS) \ + $(call QUIET_MESSAGE, " ld: $(notdir $(SEXE))") + $E $(LINKEXE) $(OBJECTS) $(EXE_LIBS) \ $(SYS_LIBS) $(LINK_LIBS) $(GLIBS) -o $(SEXE) @@ -150,29 +152,33 @@ $(SEXE):$(OBJECTS) objects: $(OBJECTS) libso: $(LIB).$(SO) - @echo \'$(LIB).$(SO)\' is up to date. + @echo "->> $(LIB).$(SO)" $(LIB).$(SO): $(OBJECTS) @$(WM_SCRIPTS)/makeTargetDir $(LIB) - $(LINKLIBSO) $(OBJECTS) -L$(LIB_PLATFORMS) \ + $(call QUIET_MESSAGE, " ld: $(notdir $(LIB)).$(SO)") + $E $(LINKLIBSO) $(OBJECTS) -L$(LIB_PLATFORMS) \ $(LIB_LIBS) $(GLIB_LIBS) -o $(LIB).$(SO) lib: $(LIB).a - @echo \'$(LIB).a\' is up to date. + @echo "->> $(LIB).a" $(LIB).a: $(OBJECTS) @$(WM_SCRIPTS)/makeTargetDir $(LIB) @rm -f $(LIB).a - $(AR) $(ARFLAGS) $(LIB).a $(OBJECTS) - $(RANLIB) $(LIB).a + $(call QUIET_MESSAGE, " ar: $(notdir $(LIB))") + $E $(AR) $(ARFLAGS) $(LIB).a $(OBJECTS) + $(call QUIET_MESSAGE, " ranlib: $(notdir $(LIB))") + $E $(RANLIB) $(LIB).a libo: $(LIB).o - @echo \'$(LIB).o\' is up to date. + @echo "->> $(LIB).o" $(LIB).o: $(OBJECTS) @$(WM_SCRIPTS)/makeTargetDir $(LIB) @rm -f $(LIB).o - $(LD) -r -o $(LIB).o $(OBJECTS) + $(call QUIET_MESSAGE, " ld: $(notdir $(LIB)).o") + $E $(LD) -r -o $(LIB).o $(OBJECTS) #------------------------------------------------------------------------------ @@ -205,4 +211,4 @@ ifeq ($(findstring lnInclude,$(MAKECMDGOALS))$(findstring updatedep,$(MAKECMDGOA endif -#------------------------------------------------------------------------------ +#----------------------------- vim: set ft=make: ------------------------------ diff --git a/wmake/rules/General/bison b/wmake/rules/General/bison index 4811b0ec1ca31b4bb8f4180fd0ab322c66805ed4..85ce618209a1fc31e8dc2fa8868c67b009778102 100644 --- a/wmake/rules/General/bison +++ b/wmake/rules/General/bison @@ -1,11 +1,13 @@ SUFFIXES += .y .Y -ytoo = $(WM_SCHEDULER) bison -v -d -y $< $(AND) \ +ytoo = $E $(call QUIET_MESSAGE, " bison: $(<F)) \ + $(WM_SCHEDULER) bison -v -d -y $< $(AND) \ mv y.tab.c $(@D)/$(<F).c $(AND) \ mv y.tab.h $(@D)/$(<F).h $(AND) \ $(cc) $(cFLAGS) -c $(@D)/$(<F).c -o $@ -Ytoo = $(WM_SCHEDULER) bison -v -d -y $< $(AND) \ +Ytoo = $E $(call QUIET_MESSAGE, " bison: $(<F)) \ + $(WM_SCHEDULER) bison -v -d -y $< $(AND) \ mv y.tab.c $(@D)/$(<F).C $(AND) \ mv y.tab.h $(@D)/$(<F).H $(AND) \ $(CC) $(c++FLAGS) -c $(@D)/$(<F).C -o $@ diff --git a/wmake/rules/General/btyacc b/wmake/rules/General/btyacc index 90124ebd458adecdd75257719c4df3b112128fff..9886c38d53a11f644f16f28c6c935f7633458977 100644 --- a/wmake/rules/General/btyacc +++ b/wmake/rules/General/btyacc @@ -1,6 +1,7 @@ SUFFIXES += .y -ytoo = $(WM_SCHEDULER) btyacc -v -d $(SKELETON) $< $(AND) \ +ytoo = $E $(call QUIET_MESSAGE, " btyacc: $(<F)") \ + $(WM_SCHEDULER) btyacc -v -d $(SKELETON) $< $(AND) \ mv y_tab.c $(@D)/$(<F).C $(AND) \ mv y_tab.h $(@D)/$(<F).H $(AND) \ $(CC) $(c++FLAGS) -c $(@D)/$(<F).C -o $@ diff --git a/wmake/rules/General/btyacc++ b/wmake/rules/General/btyacc++ index 2aa66cc8cb65bb60cd51ac8535e7fd438379cf2c..632626ad0420a73eed5c783db42c0acf3d81c9bc 100644 --- a/wmake/rules/General/btyacc++ +++ b/wmake/rules/General/btyacc++ @@ -1,6 +1,7 @@ SUFFIXES += .Y -Ytoo = $(WM_SCHEDULER) btyacc++ -v -d $(SKELETON) $< $(AND) \ +Ytoo = $E $(call QUIET_MESSAGE, " btyacc++: $(<F)") \ + $(WM_SCHEDULER) btyacc++ -v -d $(SKELETON) $< $(AND) \ mv y_tab.c $(@D)/$(<F).C $(AND) \ mv y_tab.h $(@D)/$(<F).H $(AND) \ $(CC) $(c++FLAGS) -c $(@D)/$(<F).C -o $@ diff --git a/wmake/rules/General/byacc b/wmake/rules/General/byacc index 177733805c4d33321f5407c87bd35961c1c3f20b..bdb044417f24c50d2326ab4e450d74906f2fbcb9 100644 --- a/wmake/rules/General/byacc +++ b/wmake/rules/General/byacc @@ -1,6 +1,7 @@ SUFFIXES += .y -ytoo = $(WM_SCHEDULER) byacc -v $(YYPREFIX) -d $< $(AND) \ +ytoo = $E $(call QUIET_MESSAGE, " byacc: $(<F)") \ + $(WM_SCHEDULER) byacc -v $(YYPREFIX) -d $< $(AND) \ mv y.tab.c $(@D)/$(<F).C $(AND) \ mv y.tab.h $(@D)/$(<F).H $(AND) \ $(CC) $(c++FLAGS) -c $(@D)/$(<F).C -o $@ diff --git a/wmake/rules/General/flex b/wmake/rules/General/flex index 3f2fe373f750985995e0a480d50cad531b0c1c44..6822775772a9086ba29dabe10e19f85ead0bce4e 100644 --- a/wmake/rules/General/flex +++ b/wmake/rules/General/flex @@ -1,4 +1,5 @@ SUFFIXES += .l -ltoo = $(WM_SCHEDULER) flex -o $(@D)/$(<F).c $< $(AND) \ +ltoo = $E $(call QUIET_MESSAGE, " flex: $(<F)") \ + $(WM_SCHEDULER) flex -o $(@D)/$(<F).c $< $(AND) \ $(cc) $(cFLAGS) -c $(@D)/$(<F).c -o $@ diff --git a/wmake/rules/General/flex++ b/wmake/rules/General/flex++ index 4a140628fc36b9b3ef231d41fef9384e9f2771ef..98dfd2385a3289a1e667a1f7efe47518c4831ff8 100644 --- a/wmake/rules/General/flex++ +++ b/wmake/rules/General/flex++ @@ -1,4 +1,5 @@ SUFFIXES += .L -Ltoo = $(WM_SCHEDULER) flex -+ -o$(@D)/$(<F).C -f $< $(AND) \ +Ltoo = $E $(call QUIET_MESSAGE, " flex++: $(<F)") \ + $(WM_SCHEDULER) flex -+ -o$(@D)/$(<F).C -f $< $(AND) \ $(CC) $(c++FLAGS) $(c++LESSWARN) -c $(@D)/$(<F).C -o $@ diff --git a/wmake/rules/General/moc b/wmake/rules/General/moc index 02a075843e099a8b2bdc5e8311c8df5fe5a05655..1ec5cf8906d612746cf569a62226a05087ecfac8 100644 --- a/wmake/rules/General/moc +++ b/wmake/rules/General/moc @@ -1,4 +1,5 @@ SUFFIXES += .qt -qttoo = $(WM_SCHEDULER) $(QTDIR)/bin/moc -f $< -o $(@D)/$(<F).C $(AND) \ - $(CC) $(c++FLAGS) -c $(@D)/$(<F).C -o $@ +qttoo = $E $(call QUIET_MESSAGE, " moc: $(<F)") \ + $(WM_SCHEDULER) $(QTDIR)/bin/moc -f $< -o $(@D)/$(<F).C $(AND) \ + $(CC) $(c++FLAGS) -c $(@D)/$(<F).C -o $@ diff --git a/wmake/rules/General/transform b/wmake/rules/General/transform index 3fa0152040e2b57dbe58779c47458356af8b299a..205368f30565bbb7bdad2e08c2865ccf08afaa49 100644 --- a/wmake/rules/General/transform +++ b/wmake/rules/General/transform @@ -1,15 +1,29 @@ #-------------------------------*- makefile -*--------------------------------- +ifneq ("$(WM_QUIET)","") + E=@ + define QUIET_MESSAGE + @echo $1 ; + endef + QUIET_OP=-s +else + E= + define QUIET_MESSAGE + endef + QUIET_OP= +endif + define DEFINE_TRANSFORM $(OBJECTS_DIR)/%.o : %$1 - $$($(subst .,,$(1))too) + $(call QUIET_MESSAGE, " $(subst .,,$(1))too: $(value <F)") + $E $$($(subst .,,$(1))too) endef $(foreach s,$(SUFFIXES),$(eval $(call DEFINE_TRANSFORM,$(s)))) $(OBJECTS_DIR)/%.dep : % @$(WM_SCRIPTS)/makeTargetDir $@ - @$(WMAKE_BIN)/wmkdep -I$(*D) $(LIB_HEADER_DIRS) $< | \ + @$(WMAKE_BIN)/wmkdep $(QUIET_OP) -I$(*D) $(LIB_HEADER_DIRS) $< | \ sed -e 's,^$(WM_PROJECT_DIR)/,$$(WM_PROJECT_DIR)/,' \ -e 's,^$(WM_THIRD_PARTY_DIR)/,$$(WM_THIRD_PARTY_DIR)/,' > $@ diff --git a/wmake/src/Makefile b/wmake/src/Makefile index f14baad937e099495610bff48240f15ba6bc2f04..c24ac811f3dd98b0aba87f7993dd1751631e186d 100644 --- a/wmake/src/Makefile +++ b/wmake/src/Makefile @@ -60,18 +60,18 @@ include $(GENERAL_RULES)/general all: $(WMAKE_BIN)/dirToString $(WMAKE_BIN)/wmkdep clean: - rm -f $(WMAKE_BIN)/* 2>/dev/null - + @E rm -f $(WMAKE_BIN)/* 2>/dev/null $(WMAKE_BIN)/dirToString: dirToString.c @mkdir -p $(WMAKE_BIN) - $(cc) $(cFLAGS) dirToString.c -o $(WMAKE_BIN)/dirToString - + $(call QUIET_MESSAGE, " compile: $<") + $E $(cc) $(cFLAGS) dirToString.c -o $(WMAKE_BIN)/dirToString $(WMAKE_BIN)/wmkdep: wmkdep.l @mkdir -p $(WMAKE_BIN) - flex wmkdep.l - $(cc) $(cFLAGS) lex.yy.c -o $(WMAKE_BIN)/wmkdep + $(call QUIET_MESSAGE, " lex: $<") + $E flex wmkdep.l; \ + $E $(cc) $(cFLAGS) lex.yy.c -o $(WMAKE_BIN)/wmkdep @rm -f lex.yy.c 2>/dev/null diff --git a/wmake/src/wmkdep.l b/wmake/src/wmkdep.l index a98a5972787d41b59a8f26a564d981e642e1afd1..81bede8569914db1d68c0cfd6ac88623391f8f8e 100644 --- a/wmake/src/wmkdep.l +++ b/wmake/src/wmkdep.l @@ -47,6 +47,7 @@ Usage #include <sys/types.h> #include <dirent.h> #include <errno.h> +#include <libgen.h> void nextFile(const char* fileName); void importFile(const char* fileName); @@ -145,7 +146,7 @@ const char* bufferPaths[FILE_STACK_SIZE]; int main(int argc, char* argv[]) { char *basePos, *dotPos; - int i; + int i, silent; if (argc == 1) { @@ -154,7 +155,20 @@ int main(int argc, char* argv[]) } sourceFile = strdup(argv[argc-1]); - fprintf(stderr, "Making dependency list for source file %s\n", sourceFile); + silent = (strncmp(argv[1], "-s", 2) == 0); + if (silent) + { + fprintf(stderr, " wmkdep: %s\n", basename(sourceFile)); + } + else + { + fprintf + ( + stderr, + "Making dependency list for source file %s\n", + sourceFile + ); + } if ((basePos = strrchr(sourceFile, '/')) == NULL) diff --git a/wmake/wmake b/wmake/wmake index ebf50cd4ba40543cbfa19a35c75d7698cd9304df..989af9fe729880b59b0f2036d03fa231a457f56c 100755 --- a/wmake/wmake +++ b/wmake/wmake @@ -67,7 +67,7 @@ Usage: $Script [OPTION] [dir] $Script [OPTION] target [dir [MakeDir]] options: - -s | -silent 'silent' mode (does not echo commands) + -s | -silent Quiet mode (does not echo commands) -a | -all wmake all sub-directories, running Allwmake if present -q | -queue wmakeQueue all sub-directories, running Allwmake if present -k or -non-stop Compile without stopping when errors occur @@ -138,7 +138,7 @@ do usage ;; -s | -silent) - make="$make -s" + export WM_QUIET=1 ;; -a | -all | all) all="all" diff --git a/wmake/wmakeCollect b/wmake/wmakeCollect index 4f1ca4bf4f93d89934c82b91c0c2285b1f1494dd..2aaa2c6eef5fb531961c7de42238481bdddec7fe 100755 --- a/wmake/wmakeCollect +++ b/wmake/wmakeCollect @@ -99,6 +99,12 @@ then fi +if [ -n "$WM_QUIET" ] +then + E="@" +fi + + # Collected makefile for this build makefile="$WM_COLLECT_DIR.Makefile" @@ -117,6 +123,9 @@ then # Make sure directories exist mkdir -p $WM_COLLECT_DIR + # The current source file + source="${@: -3:1}" + # The current target object="${@: -1:1}" @@ -128,7 +137,9 @@ then # Add the build rule for the current target echo "$object: $makefile" >> $file - echo -e "\tcd $PWD && \\" >> $file + [ -z "$E" ] || + echo -e "\t@echo \" compiling: ${source##*/}\"" >> $file + echo -e "\t$E cd $PWD && \\" >> $file echo -e "\t${@:1:($#-1)} $object" >> $file echo >> $file else diff --git a/wmake/wmakeLnInclude b/wmake/wmakeLnInclude index a9195b962866eefc0cc47e48a71b4bdb97f94332..3db3802de4cb15945533348d1d7c8ebf5a1bcb9d 100755 --- a/wmake/wmakeLnInclude +++ b/wmake/wmakeLnInclude @@ -138,9 +138,12 @@ fi cd $incDir || exit 1 -[ "$silentOpt" = true ] || { +if [ "$silentOpt" = true -o -n "$WM_QUIET" ] +then + echo " ln: $incDir" 1>&2 +else echo "$Script: linking include files to $incDir" 1>&2 -} +fi #------------------------------------------------------------------------------