(svn r1619) Fight bit rot in the Makefile:
authortron
Sun, 23 Jan 2005 17:35:01 +0000
changeset 1118 a3c31d3fe6e1
parent 1117 7554ff2ed2f0
child 1119 5d434559a604
(svn r1619) Fight bit rot in the Makefile:
- Begin all echos with ===> to visually emphasise them
- Add @ to suppress printing of commands where it was missing
- Add echos to rules where none were
- Rephrase some existing echos
- Remove VERBOSE_FILTER, because piping errors to /dev/null is ... a bad idea
Makefile
--- a/Makefile	Sun Jan 23 16:33:09 2005 +0000
+++ b/Makefile	Sun Jan 23 17:35:01 2005 +0000
@@ -176,26 +176,15 @@
 -include $(LIB_DETECTION)
 endif
 
-# Verbose filter
-
-ifdef NOVERBOSE
-VERBOSE_FILTER =  >/dev/null 2>&1
-else
-VERBOSE_FILTER =
-endif
-
 ifdef DISPLAY_WARNINGS
 WARNING_DISPLAY:=-fstrict-aliasing
-VERBOSE_FILTER =
 else
 WARNING_DISPLAY:=-fno-strict-aliasing
 endif
 
 ifdef SUPRESS_LANG_ERRORS
-ifndef VERBOSE_FILTER
 LANG_ERRORS =  >/dev/null 2>&1
 endif
-endif
 
 ifdef STATIC
 ifndef WIN32
@@ -721,18 +710,18 @@
 all: endian.h $(UPDATECONFIG) $(LANGS) $(TTD) $(OSX) $(endwarnings)
 
 endian.h: $(ENDIAN_CHECK)
-	@# Check if system is LITTLE_ENDIAN or BIG_ENDIAN
-	@echo 'Running endian_check'; \
-		./$(ENDIAN_CHECK) > $@
+	@echo '===> Testing endianness'
+	@./$(ENDIAN_CHECK) > $@
 
 $(ENDIAN_CHECK): endian_check.c
-	@echo 'Compiling and Linking $@'; \
-		$(CC) $(BASECFLAGS) $(CDEFS) endian_check.c -o $@
+	@echo '===> Compiling and Linking $@'
+	@$(CC) $(BASECFLAGS) $(CDEFS) endian_check.c -o $@
 
 
 $(TTD): table/strings.h $(ttd_OBJS) $(MAKE_CONFIG)
-	$(if $(VERBOSE),@echo '$(C_LINK) $@ $(TTDLDFLAGS) $(ttd_OBJS) $(LIBS)';,@echo 'Compiling and Linking $@';) \
- 		$(C_LINK) $@ $(TTDLDFLAGS) $(ttd_OBJS) $(LIBS) $(VERBOSE_FILTER)
+	@echo '===> Linking $@'
+	@$(if $(VERBOSE), echo '$(C_LINK) $@ $(TTDLDFLAGS) $(ttd_OBJS) $(LIBS)')
+	@$(C_LINK) $@ $(TTDLDFLAGS) $(ttd_OBJS) $(LIBS)
 
 $(OSX): $(TTD)
 	@rm -fr "$(OSXAPP)"
@@ -758,19 +747,20 @@
 	$(warning If you see any bugs, include in your bug report that you use a 64 bit CPU)
 
 $(STRGEN): strgen/strgen.c endian.h
-	@echo 'Compiling and Linking $@'; \
-		$(CC) $(BASECFLAGS) $(CDEFS) -o $@ $< $(VERBOSE_FILTER)
+	@echo '===> Compiling and Linking $@'
+	@$(CC) $(BASECFLAGS) $(CDEFS) -o $@ $<
 
 table/strings.h: lang/english.txt $(STRGEN)
-	@echo 'Generating $@'; \
-	$(STRGEN)
+	@echo '===> Generating $@'
+	@$(STRGEN)
 
 lang/%.lng: lang/%.txt $(STRGEN) lang/english.txt
-	@echo 'Generating $@'; \
-	$(STRGEN) $(STRGEN_FLAGS) $< $(VERBOSE_FILTER) $(LANG_ERRORS)
+	@echo '===> Compiling language $(*F)'
+	@$(STRGEN) $(STRGEN_FLAGS) $< $(LANG_ERRORS)
 
 winres.o: ttd.rc
-	windres -o $@ $<
+	@echo '===> Compiling resource $<'
+	@windres -o $@ $<
 
 ifdef MORPHOS
 release: all
@@ -855,11 +845,11 @@
 
 
 clean:
-	@echo 'Cleaning up...'; \
-	rm -rf .deps *~ $(TTD) $(STRGEN) core table/strings.h $(LANGS) $(ttd_OBJS) endian.h $(ENDIAN_CHECK)
+	@echo '===> Cleaning up'
+	@rm -rf .deps *~ $(TTD) $(STRGEN) core table/strings.h $(LANGS) $(ttd_OBJS) endian.h $(ENDIAN_CHECK)
 
 mrproper: clean
-	rm -rf $(MAKE_CONFIG)
+	@rm -rf $(MAKE_CONFIG)
 
 ifndef OSX
 ifndef MORPHOS
@@ -915,8 +905,8 @@
 # Export all variables set to subprocesses (a bit dirty)
 .EXPORT_ALL_VARIABLES:
 upgradeconf: $(MAKE_CONFIG)
-	rm $(MAKE_CONFIG)
-	$(MAKE) $(MAKE_CONFIG)
+	@rm $(MAKE_CONFIG)
+	@$(MAKE) $(MAKE_CONFIG)
 
 .PHONY: upgradeconf
 
@@ -934,12 +924,11 @@
 # first compilation round as we just build everything at that time anyway,
 # therefore we do not need to watch deps.
 
-#@echo '$(C_BUILD) $<'; \
-
 
 %.o: %.c $(MAKE_CONFIG) endian.h table/strings.h
-	$(if $(VERBOSE),@echo '$(C_BUILD) $<',@echo 'Compiling $(*F).o'); \
-		       $(C_BUILD) $< -Wp,-MD,.deps/$(*F).pp $(VERBOSE_FILTER)
+	@echo '===> Compiling $<'
+	@$(if $(VERBOSE), echo '$(C_BUILD) $<')
+	@$(C_BUILD) $< -Wp,-MD,.deps/$(*F).pp
 	@-cp .deps/$(*F).pp .deps/$(*F).P; \
 		tr ' ' '\012' < .deps/$(*F).pp \
 		| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
@@ -948,4 +937,5 @@
 
 # For DirectMusic build and BeOS specific parts
 %.o: %.cpp  $(MAKE_CONFIG) endian.h table/strings.h
-	$(CXX_BUILD) $< -o $@
+	@echo '===> Compiling $<
+	@$(CXX_BUILD) $< -o $@