diff --git a/Makefile.in b/Makefile.in index 19f69b15ba..5511bd75a9 100644 --- a/Makefile.in +++ b/Makefile.in @@ -156,16 +156,31 @@ DEST_READ_INC = $(incdir)/$(READ_INC) DEST_CMAN = $(man1dir)/$(CMAN) DEST_EMAN = $(man1dir)/$(EMAN) +# +# Silent/verbose commands +# +# when V is not set the output of commands is ommited or simplified +# +V ?= 0 + +SILENT = $(SILENT_$(V)) +SILENT_0 = @ +SILENT_1 = + +V_CC = $(V_CC_$(V)) +V_CC_0 = @echo [CC] $@; +V_CC_1 = + # # primary rules # all: $(CTAGS_EXEC) $(READ_LIB) $(READ_CMD) $(CTAGS_EXEC): $(OBJECTS) - $(CC) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBS) + $(V_CC) $(CC) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBS) $(READ_CMD): readtags.c readtags.h - $(CC) -DREADTAGS_MAIN -I. -I$(srcdir) -I$(srcdir)/main $(DEFS) $(ALL_CPPFLAGS) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(srcdir)/readtags.c + $(V_CC) $(CC) -DREADTAGS_MAIN -I. -I$(srcdir) -I$(srcdir)/main $(DEFS) $(ALL_CPPFLAGS) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(srcdir)/readtags.c $(OBJECTS): $(HEADERS) config.h Makefile @@ -174,16 +189,16 @@ $(OBJECTS): $(HEADERS) config.h Makefile # works with GNU make but should be harmless for other implementations. %: Makefile Makefile: Makefile.in config.status - ./config.status --file $@ + $(SILENT) ./config.status --file $@ config.h: config.h.in config.status - ./config.status --header $@ + $(SILENT) ./config.status --header $@ # Regenerate the build system whenever it changed config.status: configure - ./config.status --recheck + $(SILENT) ./config.status --recheck configure: configure.ac - cd $(srcdir) && autoreconf -vi + $(SILENT) cd $(srcdir) && autoreconf -vi # # generic install rules @@ -336,8 +351,9 @@ TAGS: $(CTAGS_EXEC) ./$(CTAGS_EXEC) -e $(srcdir)/* clean: clean-units clean-gcov clean-tmain - rm -f $(OBJECTS) $(CTAGS_EXEC) tags TAGS $(READ_LIB) - rm -f $(SOURCES:.c=.gcno) + $(SILENT) echo Cleaning top level + $(SILENT) rm -f $(OBJECTS) $(CTAGS_EXEC) tags TAGS $(READ_LIB) + $(SILENT) rm -f $(SOURCES:.c=.gcno) mostlyclean: clean @@ -352,8 +368,8 @@ maintainerclean: distclean # implicit rules # .c.$(OBJEXT): - dir="$$(dirname $@)"; [ -d "$$dir" ] || $(MKDIR_P) "$$dir" - $(CC) -I. -I$(srcdir) -I$(srcdir)/main $(DEFS) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -o $@ -c $< + $(SILENT) dir="$$(dirname $@)"; [ -d "$$dir" ] || $(MKDIR_P) "$$dir" + $(V_CC) $(CC) -I. -I$(srcdir) -I$(srcdir)/main $(DEFS) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -o $@ -c $< $(addsuffix .$(OBJEXT),$(basename $(notdir $(REGEX_SOURCES)))): ALL_CPPFLAGS += \ -D_GNU_SOURCE -D__USE_GNU -Dbool=int -Dfalse=0 -Dtrue=1 @@ -385,7 +401,7 @@ ifdef TRAVIS SHOW_DIFF_OUTPUT=--show-diff-output endif -.PHONY: check units fuzz noise tmain tinst clean-units clean-tmain clean-gcov run-gcov codecheck +.PHONY: check units fuzz noise tmain tinst clean-units clean-tmain clean-gcov run-gcov codecheck help check: tmain units # @@ -441,8 +457,9 @@ units: $(CTAGS_TEST) $(SHELL) $${c} $(srcdir)/Units $${builddir}/Units clean-units: - builddir=$$(pwd); \ - $(SHELL) $(srcdir)/misc/units clean $${builddir}/Units + $(SILENT) echo Cleaning test units + $(SILENT) builddir=$$(pwd); \ + $(SHELL) $(srcdir)/misc/units clean $${builddir}/Units # # Test main part, not parsers @@ -462,8 +479,9 @@ tmain: $(CTAGS_TEST) $(SHELL) $${c} $(srcdir)/Tmain $${builddir}/Tmain clean-tmain: - builddir=$$(pwd); \ - $(SHELL) $(srcdir)/misc/units clean-tmain $${builddir}/Tmain + $(SILENT) echo Cleaning main part tests + $(SILENT) builddir=$$(pwd); \ + $(SHELL) $(srcdir)/misc/units clean-tmain $${builddir}/Tmain # # Test installation @@ -490,7 +508,31 @@ run-gcov: gcov $$(find -name '*.gcda') clean-gcov: - rm -f $(SOURCES:.c=.gcda) - rm -f $(srcdir)/*.gcov + $(SILENT) echo Cleaning coverage reports + $(SILENT) rm -f $(SOURCES:.c=.gcda) + $(SILENT) rm -f $(srcdir)/*.gcov + +# +# Help +# +help: + @echo "Compilation targets:" + @echo "" + @echo "make - Build $(CTAGS_PROG)" + @echo "make V=1 - Build $(CTAGS_PROG) - verbose output" + @echo "make -f mk_mingw.mak - Build $(CTAGS_PROG) using MinGW" + @echo "make -f mk_mingw.mak V=1 - Build $(CTAGS_PROG) using MinGW - verbose output" + @echo "" + @echo "Testing targets:" + @echo "" + @echo "make units - Run parser unit test cases" + @echo "make tmain - Run ctags main functionality test cases" + @echo "make fuzz - Verify that all parsers are able to properly process each available test unit" + @echo "make noise - TODO" + @echo + @echo "Arguments that can be used in testing targets:" + @echo "VG=1 - Run test cases with Valgrind memory profiler" + @echo "LANGUAGES=[,] - Only run test cases of the selected languages" + @echo "CATEGORIES= - Only run tests available under folder Units/.r" # vi:set tabstop=8: diff --git a/mk_mingw.mak b/mk_mingw.mak index 7826d7bf49..73e0395c60 100644 --- a/mk_mingw.mak +++ b/mk_mingw.mak @@ -25,20 +25,37 @@ dctags.exe: SOURCES += debug.c .SUFFIXES: .c.o +# +# Silent/verbose commands +# +# when V is not set the output of commands is ommited or simplified +# +V ?= 0 + +SILENT = $(SILENT_$(V)) +SILENT_0 = @ +SILENT_1 = + +V_CC = $(V_CC_$(V)) +V_CC_0 = @echo [CC] $@; +V_CC_1 = + + .c.o: - $(CC) -c $(OPT) $(CFLAGS) $(DEFINES) $(INCLUDES) -o $@ $< + $(V_CC) $(CC) -c $(OPT) $(CFLAGS) $(DEFINES) $(INCLUDES) -o $@ $< ctags: ctags.exe dctags: dctags.exe ctags.exe dctags.exe: $(OBJECTS) $(HEADERS) $(REGEX_HEADERS) $(FNMATCH_HEADERS) - $(CC) $(OPT) $(CFLAGS) $(LDFLAGS) $(DEFINES) $(INCLUDES) -o $@ $(OBJECTS) $(LIBS) + $(V_CC) $(CC) $(OPT) $(CFLAGS) $(LDFLAGS) $(DEFINES) $(INCLUDES) -o $@ $(OBJECTS) $(LIBS) readtags.exe: readtags.c - $(CC) $(OPT) $(CFLAGS) -DREADTAGS_MAIN $(DEFINES) $(INCLUDES) -o $@ $< + $(V_CC) $(CC) $(OPT) $(CFLAGS) -DREADTAGS_MAIN $(DEFINES) $(INCLUDES) -o $@ $< clean: - - rm -f ctags.exe - - rm -f dctags.exe - - rm -f tags - - rm -f main/*.o parsers/*.o gnu_regex/*.o fnmatch/*.o + $(SILENT) echo Cleaning + $(SILENT) rm -f ctags.exe + $(SILENT) rm -f dctags.exe + $(SILENT) rm -f tags + $(SILENT) rm -f main/*.o parsers/*.o gnu_regex/*.o fnmatch/*.o