(svn r20586) -Codechange: silence nforenum and grfcodec progress output (if possible)

This commit is contained in:
rubidium 2010-08-21 10:57:01 +00:00
parent e4bb4af69f
commit 284feb4236
1 changed files with 6 additions and 2 deletions

View File

@ -23,6 +23,7 @@ GRF_DIR = $(ROOT_DIR)/media/extra_grf
BIN_DIR = !!BIN_DIR!!/data
OBJS_DIR = !!GRF_OBJS_DIR!!
OS = !!OS!!
STAGE = !!STAGE!!
# Check if we want to show what we are doing
ifdef VERBOSE
@ -34,8 +35,8 @@ else
endif
# Some configurational settings for your environment.
GRFCODEC := grfcodec
NFORENUM := $(shell [ `which nforenum 2>/dev/null` ] && echo "nforenum" || echo "renum")
GRFCODEC := $(shell grfcodec -s -v >/dev/null 2>/dev/null && echo "grfcodec -s" || echo "grfcodec")
NFORENUM := $(shell nforenum -s -v >/dev/null 2>/dev/null && echo "nforenum -s" || echo "nforenum")
MD5SUM := $(shell [ "$(OS)" = "OSX" ] && echo "md5 -r" || echo "md5sum")
# Some "should not be changed" settings.
@ -56,11 +57,14 @@ $(BIN_DIR)/openttd.grf: $(PCX_FILES) $(NFO_FILES) $(OBJS_DIR)/sprites
# Yeah, we'd like to use -i in the sed, but Mac OS X's sed and GNU sed just can't agree on the usage of -i. In any case either one of them fails.
$(OBJS_DIR)/openttd.grf: $(PCX_FILES) $(NFO_FILES) $(OBJS_DIR)/sprites
$(E) '$(STAGE) Assembling openttd.nfo'
$(Q)-cp $(PCX_FILES) $(OBJS_DIR)/sprites 2> /dev/null
$(Q) gcc -I$(GRF_DIR) -C -E - < "$(GRF_DIR)/openttd.nfo" | sed -e '/^#/d' -e '/^$$/d' > $(OBJS_DIR)/sprites/openttd.nfo
$(Q) $(NFORENUM) $(OBJS_DIR)/sprites/openttd.nfo
$(E) '$(STAGE) Compiling openttd.grf'
$(Q) $(GRFCODEC) -e -m1 $(OBJS_DIR)/openttd.grf
$(Q) cp $(OBJS_DIR)/openttd.grf $(BIN_DIR)/openttd.grf
$(E) '$(STAGE) Updating base graphics sets'
$(Q) for grf in $(BIN_DIR)/orig*.obg; do sed 's/^OPENTTD.GRF = [0-9a-f]*$$/OPENTTD.GRF = '`$(MD5SUM) $(BIN_DIR)/openttd.grf | sed 's@ .*@@'`'/' $$grf > $$grf.tmp && mv $$grf.tmp $$grf; done
# Clean up temporary files.