Files @ r23819:b46d3930800a
Branch filter:

Location: cpp/openttd-patchpack/source/Makefile.grf.in - annotation

Niels Martin Hansen
Fix b3fd7879: Ignore command flags when verifying script commands

Multiplayer games has the server add some flags to the cmd value during the handling.
These flags should not be included in the verification, mask them out. Without this
masking out, scripts tend to die when executing their first command in multiplayer.
r15805:83ef427d044d
r15805:83ef427d044d
r15805:83ef427d044d
r15805:83ef427d044d
r15805:83ef427d044d
r15805:83ef427d044d
r15805:83ef427d044d
r22099:1e9ac1e2a14c
r15805:83ef427d044d
r22099:1e9ac1e2a14c
r15805:83ef427d044d
r15805:83ef427d044d
r22099:1e9ac1e2a14c
r15805:83ef427d044d
r15805:83ef427d044d
r15805:83ef427d044d
r15805:83ef427d044d
r15805:83ef427d044d
r15805:83ef427d044d
r20206:ba8b34058692
r20206:ba8b34058692
r18374:ea9fdd784480
r15805:83ef427d044d
r15859:1a0e19e54e67
r15892:c047b238dbdf
r15805:83ef427d044d
r15805:83ef427d044d
r15805:83ef427d044d
r15805:83ef427d044d
r15805:83ef427d044d
r15805:83ef427d044d
r15805:83ef427d044d
r15805:83ef427d044d
r15805:83ef427d044d
r15805:83ef427d044d
r18581:273e8f67cd69
r18581:273e8f67cd69
r20087:f95c02581a97
r15859:1a0e19e54e67
r15805:83ef427d044d
r15805:83ef427d044d
r17947:429fbf8ea627
r17947:429fbf8ea627
r15805:83ef427d044d
r23209:3f88d406e1cd
r23209:3f88d406e1cd
r23209:3f88d406e1cd
r23209:3f88d406e1cd
r23209:3f88d406e1cd
r23209:3f88d406e1cd
r23209:3f88d406e1cd
r23209:3f88d406e1cd
r23209:3f88d406e1cd
r23209:3f88d406e1cd
r23209:3f88d406e1cd
r23209:3f88d406e1cd
r15805:83ef427d044d
r23209:3f88d406e1cd
r18581:273e8f67cd69
r23209:3f88d406e1cd
r18581:273e8f67cd69
r15805:83ef427d044d
r20206:ba8b34058692
r20206:ba8b34058692
r20206:ba8b34058692
r20206:ba8b34058692
r22523:2816509b7317
r20206:ba8b34058692
r22523:2816509b7317
r20206:ba8b34058692
r20206:ba8b34058692
r15805:83ef427d044d
r20206:ba8b34058692
r20206:ba8b34058692
r20206:ba8b34058692
r20206:ba8b34058692
r20206:ba8b34058692
r20206:ba8b34058692
r20206:ba8b34058692
r20206:ba8b34058692
r23209:3f88d406e1cd
r23209:3f88d406e1cd
r23209:3f88d406e1cd
r23209:3f88d406e1cd
r20206:ba8b34058692
r22523:2816509b7317
r15892:c047b238dbdf
r22523:2816509b7317
r16308:51c3b474f96d
r21584:561d516cfa45
r18581:273e8f67cd69
r15892:c047b238dbdf
r19110:4b2cb8e165ae
r20206:ba8b34058692
r15805:83ef427d044d
r22523:2816509b7317
r22523:2816509b7317
r22523:2816509b7317
r22523:2816509b7317
r22523:2816509b7317
r22523:2816509b7317
r22523:2816509b7317
r22523:2816509b7317
r22523:2816509b7317
r22523:2816509b7317
r22523:2816509b7317
r23209:3f88d406e1cd
r23209:3f88d406e1cd
r23209:3f88d406e1cd
r15805:83ef427d044d
r15805:83ef427d044d
r23209:3f88d406e1cd
r15805:83ef427d044d
r16049:533aca9c3542
r15805:83ef427d044d
r15805:83ef427d044d
r15805:83ef427d044d
r15805:83ef427d044d
# $Id$

# This file is part of OpenTTD.
# OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
# OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
#
# Building requires GRFCodec.
#
# Recent versions (including sources) can be found at:
#  http://www.openttd.org/download-grfcodec
#
# The mercurial repository can be found at:
#  http://hg.openttdcoop.org/grfcodec
#


ROOT_DIR = !!ROOT_DIR!!
GRF_DIR  = $(ROOT_DIR)/media/extra_grf
BASESET_DIR = $(ROOT_DIR)/media/baseset
LANG_DIR = $(ROOT_DIR)/src/lang
BIN_DIR  = !!BIN_DIR!!/baseset
OBJS_DIR = !!GRF_OBJS_DIR!!
OS       = !!OS!!
STAGE    = !!STAGE!!

# Check if we want to show what we are doing
ifdef VERBOSE
	Q =
	E = @true
else
	Q = @
	E = @echo
endif

GRFCODEC := !!GRFCODEC!!
NFORENUM := !!NFORENUM!!
CC_BUILD := !!CC_BUILD!!
MD5SUM   := $(shell [ "$(OS)" = "OSX" ] && echo "md5 -r" || echo "md5sum")

# Some "should not be changed" settings.
NFO_FILES    := $(GRF_DIR)/*.nfo $(GRF_DIR)/rivers/*.nfo
PNG_FILES    := $(GRF_DIR)/*.png $(GRF_DIR)/rivers/*.png

# List of target files.
OBT_FILES    := $(BIN_DIR)/orig_dos.obg
OBT_FILES    += $(BIN_DIR)/orig_dos_de.obg
OBT_FILES    += $(BIN_DIR)/orig_win.obg
OBT_FILES    += $(BIN_DIR)/orig_dos.obs
OBT_FILES    += $(BIN_DIR)/orig_win.obs
OBT_FILES    += $(BIN_DIR)/no_sound.obs
OBT_FILES    += $(BIN_DIR)/orig_dos.obm
OBT_FILES    += $(BIN_DIR)/orig_win.obm
OBT_FILES    += $(BIN_DIR)/no_music.obm
OBT_FILES    += $(BIN_DIR)/orig_tto.obm

# Build the GRF.
all: $(OBT_FILES)
ifdef GRFCODEC
all: $(BIN_DIR)/openttd.grf $(BIN_DIR)/orig_extra.grf
endif

$(OBJS_DIR)/langfiles.tmp: $(LANG_DIR)/*.txt
	$(E) '$(STAGE) Collecting baseset translations'
	$(Q) cat $^ > $@

$(BIN_DIR)/%.obg: $(BASESET_DIR)/%.obg $(BIN_DIR)/orig_extra.grf $(OBJS_DIR)/langfiles.tmp $(BASESET_DIR)/translations.awk
	$(E) '$(STAGE) Updating $(notdir $@)'
	$(Q) sed 's/^ORIG_EXTRA.GRF    = *[0-9a-f]*$$/ORIG_EXTRA.GRF    = '`$(MD5SUM) $(BIN_DIR)/orig_extra.grf | sed 's@ .*@@'`'/' $< > $@.tmp
	$(Q) awk -v langfiles='$(OBJS_DIR)/langfiles.tmp' -f $(BASESET_DIR)/translations.awk $@.tmp >$@
	$(Q) rm $@.tmp

$(BIN_DIR)/%.obs: $(BASESET_DIR)/%.obs $(OBJS_DIR)/langfiles.tmp $(BASESET_DIR)/translations.awk
	$(E) '$(STAGE) Updating $(notdir $@)'
	$(Q) awk -v langfiles='$(OBJS_DIR)/langfiles.tmp' -f $(BASESET_DIR)/translations.awk $< >$@

$(BIN_DIR)/%.obm: $(BASESET_DIR)/%.obm $(OBJS_DIR)/langfiles.tmp $(BASESET_DIR)/translations.awk
	$(E) '$(STAGE) Updating $(notdir $@)'
	$(Q) awk -v langfiles='$(OBJS_DIR)/langfiles.tmp' -f $(BASESET_DIR)/translations.awk $< >$@

# Guard against trying to run GRFCODEC/NFORENUM without either being set.
ifdef GRFCODEC
ifdef NFORENUM

# Compile extra grf
$(BIN_DIR)/openttd.grf: $(PNG_FILES) $(NFO_FILES) $(GRF_DIR)/assemble_nfo.awk
	$(E) '$(STAGE) Assembling openttd.nfo'
	$(Q)-mkdir -p $(OBJS_DIR)/sprites
	$(Q)-cp $(PNG_FILES) $(OBJS_DIR)/sprites 2> /dev/null
	$(Q) awk -f $(GRF_DIR)/assemble_nfo.awk $(GRF_DIR)/openttd.nfo > $(OBJS_DIR)/sprites/openttd.nfo
	$(Q) $(NFORENUM) -s $(OBJS_DIR)/sprites/openttd.nfo
	$(E) '$(STAGE) Compiling openttd.grf'
	$(Q) $(GRFCODEC) -n -s -e -p1 $(OBJS_DIR)/openttd.grf
	$(Q)cp $(OBJS_DIR)/openttd.grf $(BIN_DIR)/openttd.grf

# The copy operation of PNG_FILES is duplicated from the target 'openttd.grf', thus those targets may not run in parallel.
$(BIN_DIR)/orig_extra.grf: $(PNG_FILES) $(NFO_FILES) $(GRF_DIR)/assemble_nfo.awk | $(BIN_DIR)/openttd.grf
	$(E) '$(STAGE) Assembling orig_extra.nfo'
	$(Q)-mkdir -p $(OBJS_DIR)/sprites
	$(Q)-cp $(PNG_FILES) $(OBJS_DIR)/sprites 2> /dev/null
	$(Q) awk -f $(GRF_DIR)/assemble_nfo.awk $(GRF_DIR)/orig_extra.nfo > $(OBJS_DIR)/sprites/orig_extra.nfo
	$(Q) $(NFORENUM) -s $(OBJS_DIR)/sprites/orig_extra.nfo
	$(E) '$(STAGE) Compiling orig_extra.grf'
	$(Q) $(GRFCODEC) -n -s -e -p1 $(OBJS_DIR)/orig_extra.grf
	$(Q)cp $(OBJS_DIR)/orig_extra.grf $(BIN_DIR)/orig_extra.grf

endif
endif

# Clean up temporary files.
clean:
	$(Q)rm -f *.bak *.grf $(OBT_FILES)

# Clean up temporary files
mrproper: clean
	$(Q)rm -fr sprites

.PHONY: all mrproper depend clean