mirror of https://github.com/OpenTTD/OpenTTD
(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 idearelease/0.4.5
parent
88c10e02ff
commit
62e8c573e8
60
Makefile
60
Makefile
|
@ -176,26 +176,15 @@ ENABLE_NETWORK:=1
|
||||||
-include $(LIB_DETECTION)
|
-include $(LIB_DETECTION)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Verbose filter
|
|
||||||
|
|
||||||
ifdef NOVERBOSE
|
|
||||||
VERBOSE_FILTER = >/dev/null 2>&1
|
|
||||||
else
|
|
||||||
VERBOSE_FILTER =
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef DISPLAY_WARNINGS
|
ifdef DISPLAY_WARNINGS
|
||||||
WARNING_DISPLAY:=-fstrict-aliasing
|
WARNING_DISPLAY:=-fstrict-aliasing
|
||||||
VERBOSE_FILTER =
|
|
||||||
else
|
else
|
||||||
WARNING_DISPLAY:=-fno-strict-aliasing
|
WARNING_DISPLAY:=-fno-strict-aliasing
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef SUPRESS_LANG_ERRORS
|
ifdef SUPRESS_LANG_ERRORS
|
||||||
ifndef VERBOSE_FILTER
|
|
||||||
LANG_ERRORS = >/dev/null 2>&1
|
LANG_ERRORS = >/dev/null 2>&1
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef STATIC
|
ifdef STATIC
|
||||||
ifndef WIN32
|
ifndef WIN32
|
||||||
|
@ -721,18 +710,18 @@ endif
|
||||||
all: endian.h $(UPDATECONFIG) $(LANGS) $(TTD) $(OSX) $(endwarnings)
|
all: endian.h $(UPDATECONFIG) $(LANGS) $(TTD) $(OSX) $(endwarnings)
|
||||||
|
|
||||||
endian.h: $(ENDIAN_CHECK)
|
endian.h: $(ENDIAN_CHECK)
|
||||||
@# Check if system is LITTLE_ENDIAN or BIG_ENDIAN
|
@echo '===> Testing endianness'
|
||||||
@echo 'Running endian_check'; \
|
@./$(ENDIAN_CHECK) > $@
|
||||||
./$(ENDIAN_CHECK) > $@
|
|
||||||
|
|
||||||
$(ENDIAN_CHECK): endian_check.c
|
$(ENDIAN_CHECK): endian_check.c
|
||||||
@echo 'Compiling and Linking $@'; \
|
@echo '===> Compiling and Linking $@'
|
||||||
$(CC) $(BASECFLAGS) $(CDEFS) endian_check.c -o $@
|
@$(CC) $(BASECFLAGS) $(CDEFS) endian_check.c -o $@
|
||||||
|
|
||||||
|
|
||||||
$(TTD): table/strings.h $(ttd_OBJS) $(MAKE_CONFIG)
|
$(TTD): table/strings.h $(ttd_OBJS) $(MAKE_CONFIG)
|
||||||
$(if $(VERBOSE),@echo '$(C_LINK) $@ $(TTDLDFLAGS) $(ttd_OBJS) $(LIBS)';,@echo 'Compiling and Linking $@';) \
|
@echo '===> Linking $@'
|
||||||
$(C_LINK) $@ $(TTDLDFLAGS) $(ttd_OBJS) $(LIBS) $(VERBOSE_FILTER)
|
@$(if $(VERBOSE), echo '$(C_LINK) $@ $(TTDLDFLAGS) $(ttd_OBJS) $(LIBS)')
|
||||||
|
@$(C_LINK) $@ $(TTDLDFLAGS) $(ttd_OBJS) $(LIBS)
|
||||||
|
|
||||||
$(OSX): $(TTD)
|
$(OSX): $(TTD)
|
||||||
@rm -fr "$(OSXAPP)"
|
@rm -fr "$(OSXAPP)"
|
||||||
|
@ -758,19 +747,20 @@ $(64_bit_warnings):
|
||||||
$(warning If you see any bugs, include in your bug report that you use a 64 bit CPU)
|
$(warning If you see any bugs, include in your bug report that you use a 64 bit CPU)
|
||||||
|
|
||||||
$(STRGEN): strgen/strgen.c endian.h
|
$(STRGEN): strgen/strgen.c endian.h
|
||||||
@echo 'Compiling and Linking $@'; \
|
@echo '===> Compiling and Linking $@'
|
||||||
$(CC) $(BASECFLAGS) $(CDEFS) -o $@ $< $(VERBOSE_FILTER)
|
@$(CC) $(BASECFLAGS) $(CDEFS) -o $@ $<
|
||||||
|
|
||||||
table/strings.h: lang/english.txt $(STRGEN)
|
table/strings.h: lang/english.txt $(STRGEN)
|
||||||
@echo 'Generating $@'; \
|
@echo '===> Generating $@'
|
||||||
$(STRGEN)
|
@$(STRGEN)
|
||||||
|
|
||||||
lang/%.lng: lang/%.txt $(STRGEN) lang/english.txt
|
lang/%.lng: lang/%.txt $(STRGEN) lang/english.txt
|
||||||
@echo 'Generating $@'; \
|
@echo '===> Compiling language $(*F)'
|
||||||
$(STRGEN) $(STRGEN_FLAGS) $< $(VERBOSE_FILTER) $(LANG_ERRORS)
|
@$(STRGEN) $(STRGEN_FLAGS) $< $(LANG_ERRORS)
|
||||||
|
|
||||||
winres.o: ttd.rc
|
winres.o: ttd.rc
|
||||||
windres -o $@ $<
|
@echo '===> Compiling resource $<'
|
||||||
|
@windres -o $@ $<
|
||||||
|
|
||||||
ifdef MORPHOS
|
ifdef MORPHOS
|
||||||
release: all
|
release: all
|
||||||
|
@ -855,11 +845,11 @@ FORCE:
|
||||||
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@echo 'Cleaning up...'; \
|
@echo '===> Cleaning up'
|
||||||
rm -rf .deps *~ $(TTD) $(STRGEN) core table/strings.h $(LANGS) $(ttd_OBJS) endian.h $(ENDIAN_CHECK)
|
@rm -rf .deps *~ $(TTD) $(STRGEN) core table/strings.h $(LANGS) $(ttd_OBJS) endian.h $(ENDIAN_CHECK)
|
||||||
|
|
||||||
mrproper: clean
|
mrproper: clean
|
||||||
rm -rf $(MAKE_CONFIG)
|
@rm -rf $(MAKE_CONFIG)
|
||||||
|
|
||||||
ifndef OSX
|
ifndef OSX
|
||||||
ifndef MORPHOS
|
ifndef MORPHOS
|
||||||
|
@ -915,8 +905,8 @@ love:
|
||||||
# Export all variables set to subprocesses (a bit dirty)
|
# Export all variables set to subprocesses (a bit dirty)
|
||||||
.EXPORT_ALL_VARIABLES:
|
.EXPORT_ALL_VARIABLES:
|
||||||
upgradeconf: $(MAKE_CONFIG)
|
upgradeconf: $(MAKE_CONFIG)
|
||||||
rm $(MAKE_CONFIG)
|
@rm $(MAKE_CONFIG)
|
||||||
$(MAKE) $(MAKE_CONFIG)
|
@$(MAKE) $(MAKE_CONFIG)
|
||||||
|
|
||||||
.PHONY: upgradeconf
|
.PHONY: upgradeconf
|
||||||
|
|
||||||
|
@ -934,12 +924,11 @@ DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
|
||||||
# first compilation round as we just build everything at that time anyway,
|
# first compilation round as we just build everything at that time anyway,
|
||||||
# therefore we do not need to watch deps.
|
# therefore we do not need to watch deps.
|
||||||
|
|
||||||
#@echo '$(C_BUILD) $<'; \
|
|
||||||
|
|
||||||
|
|
||||||
%.o: %.c $(MAKE_CONFIG) endian.h table/strings.h
|
%.o: %.c $(MAKE_CONFIG) endian.h table/strings.h
|
||||||
$(if $(VERBOSE),@echo '$(C_BUILD) $<',@echo 'Compiling $(*F).o'); \
|
@echo '===> Compiling $<'
|
||||||
$(C_BUILD) $< -Wp,-MD,.deps/$(*F).pp $(VERBOSE_FILTER)
|
@$(if $(VERBOSE), echo '$(C_BUILD) $<')
|
||||||
|
@$(C_BUILD) $< -Wp,-MD,.deps/$(*F).pp
|
||||||
@-cp .deps/$(*F).pp .deps/$(*F).P; \
|
@-cp .deps/$(*F).pp .deps/$(*F).P; \
|
||||||
tr ' ' '\012' < .deps/$(*F).pp \
|
tr ' ' '\012' < .deps/$(*F).pp \
|
||||||
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
|
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
|
||||||
|
@ -948,4 +937,5 @@ DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
|
||||||
|
|
||||||
# For DirectMusic build and BeOS specific parts
|
# For DirectMusic build and BeOS specific parts
|
||||||
%.o: %.cpp $(MAKE_CONFIG) endian.h table/strings.h
|
%.o: %.cpp $(MAKE_CONFIG) endian.h table/strings.h
|
||||||
$(CXX_BUILD) $< -o $@
|
@echo '===> Compiling $<
|
||||||
|
@$(CXX_BUILD) $< -o $@
|
||||||
|
|
Loading…
Reference in New Issue