Makefile.src.in
author celestar
Sun, 11 Mar 2007 09:28:58 +0000
branchcustombridgeheads
changeset 5651 335d9bd345b0
parent 5650 aefc131bf5ce
permissions -rw-r--r--
(svn r9109) [cbh] -Fix: Stabilize the reversing of trains on bridges/bridgeheads a little (it still crashes at times however). Also re-allow the construction of signals on bridgeheads
5643
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
     1
# Auto-generated file -- DO NOT EDIT
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
     2
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
     3
CC_HOST      = !!CC_HOST!!
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
     4
CXX_HOST     = !!CXX_HOST!!
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
     5
CC_BUILD     = !!CC_BUILD!!
5650
aefc131bf5ce (svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents: 5648
diff changeset
     6
CXX_BUILD    = !!CXX_BUILD!!
5643
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
     7
WINDRES      = !!WINDRES!!
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
     8
STRIP        = !!STRIP!!
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
     9
CC_CFLAGS    = !!CC_CFLAGS!!
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    10
CFLAGS       = !!CFLAGS!!
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    11
CFLAGS_BUILD = !!CFLAGS_BUILD!!
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    12
LIBS         = !!LIBS!!
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    13
LDFLAGS      = !!LDFLAGS!!
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    14
BIN_DIR      = !!BIN_DIR!!
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    15
LANG_DIR     = !!LANG_DIR!!
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    16
SRC_OBJS_DIR = !!SRC_OBJS_DIR!!
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    17
LANG_OBJS_DIR= !!LANG_OBJS_DIR!!
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    18
SRC_DIR      = !!SRC_DIR!!
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    19
MEDIA_DIR    = !!MEDIA_DIR!!
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    20
TTD          = !!TTD!!
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    21
STRGEN       = !!STRGEN!!
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    22
ENDIAN_CHECK = !!ENDIAN_CHECK!!
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    23
ENDIAN_FORCE = !!ENDIAN_FORCE!!
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    24
OS           = !!OS!!
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    25
STAGE        = !!STAGE!!
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    26
MAKEDEPEND   = !!MAKEDEPEND!!
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    27
CFLAGS_MAKEDEP= !!CFLAGS_MAKEDEP!!
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    28
SORT         = !!SORT!!
5648
1608018c5ff2 (svn r8059) [cbh] - Sync with r7788:8032 from trunk
celestar
parents: 5645
diff changeset
    29
REVISION     = !!REVISION!!
5643
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    30
CONFIG_CACHE_COMPILER = $(SRC_OBJS_DIR)/!!CONFIG_CACHE_COMPILER!!
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    31
CONFIG_CACHE_LINKER   = $(SRC_OBJS_DIR)/!!CONFIG_CACHE_LINKER!!
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    32
CONFIG_CACHE_ENDIAN   = $(SRC_OBJS_DIR)/!!CONFIG_CACHE_ENDIAN!!
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    33
CONFIG_CACHE_SOURCE   = $(SRC_OBJS_DIR)/!!CONFIG_CACHE_SOURCE!!
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    34
CONFIG_CACHE_VERSION  = $(SRC_OBJS_DIR)/!!CONFIG_CACHE_VERSION!!
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    35
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    36
OBJS_C   := !!OBJS_C!!
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    37
OBJS_CPP := !!OBJS_CPP!!
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    38
OBJS_M   := !!OBJS_M!!
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    39
OBJS_RC  := !!OBJS_RC!!
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    40
OBJS     := $(OBJS_C) $(OBJS_CPP) $(OBJS_M) $(OBJS_RC)
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    41
SRCS     := !!SRCS!!
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    42
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    43
# All C-files depend on those 3 files
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    44
FILE_DEP := $(CONFIG_CACHE_COMPILER) $(LANG_OBJS_DIR)/table/strings.h endian_target.h
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    45
# Create all dirs and subdirs
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    46
RES      := $(shell mkdir -p $(BIN_DIR) $(sort $(dir $(OBJS))))
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    47
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    48
# Make sure endian_target.h is reasable as if it was in the src/ dir
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    49
CFLAGS += -I $(SRC_OBJS_DIR) -I $(LANG_OBJS_DIR)
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    50
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    51
ENDIAN_TARGETS := endian_target.h $(ENDIAN_CHECK)
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    52
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    53
# Check if we want to show what we are doing
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    54
ifdef VERBOSE
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    55
	Q =
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    56
	E = @true
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    57
else
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    58
	Q = @
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    59
	E = @echo
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    60
endif
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    61
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    62
# Our default target
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    63
all: $(TTD)
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    64
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    65
# This are 2 rules that are pointing back to STRGEN stuff.
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    66
#  There is not really a need to have them here, but in case
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    67
#  some weirdo wants to run 'make' in the 'src' dir and expects
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    68
#  the languages to be recompiled, this catches that case and
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    69
#  takes care of it nicely.
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    70
$(LANG_OBJS_DIR)/$(STRGEN):
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    71
	$(MAKE) -C $(LANG_OBJS_DIR) $(STRGEN)
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    72
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    73
$(LANG_OBJS_DIR)/table/strings.h: $(LANG_DIR)/english.txt $(LANG_OBJS_DIR)/$(STRGEN)
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    74
	$(MAKE) -C $(LANG_OBJS_DIR) table/strings.h
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    75
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    76
# Make the revision number
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    77
ifdef REVISION
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    78
REV := $(REVISION)
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    79
else
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    80
# Are we a SVN dir?
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    81
ifeq ($(shell if test -d $(SRC_DIR)/.svn; then echo 1; fi), 1)
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    82
# Find if the local source if modified
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    83
REV_MODIFIED := $(shell svnversion $(SRC_DIR) | sed -n 's/.*\(M\).*/\1/p' )
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    84
# Find the revision like: rXXXX-branch
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    85
REV := $(shell LC_ALL=C svn info $(SRC_DIR) | awk '/^URL:.*branch/ { split($$2, a, "/"); BRANCH="-"a[5] } /^Last Changed Rev:/ { REV="r"$$4"$(REV_MODIFIED)" } END { print REV BRANCH }')
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    86
endif
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    87
endif
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    88
# Make sure we have something in REV
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    89
ifeq ($(REV),)
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    90
REV := norev000
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    91
endif
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    92
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    93
# This helps to recompile if flags change
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    94
RES := $(shell if [ "`cat $(CONFIG_CACHE_COMPILER) 2>/dev/null`" != "$(CC_CFLAGS) $(CFLAGS)" ]; then echo "$(CC_CFLAGS) $(CFLAGS)" > $(CONFIG_CACHE_COMPILER); fi )
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    95
RES := $(shell if [ "`cat $(CONFIG_CACHE_LINKER) 2>/dev/null`" != "$(LDFLAGS) $(LIBS)" ]; then echo "$(LDFLAGS) $(LIBS)" > $(CONFIG_CACHE_LINKER); fi )
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    96
RES := $(shell if [ "`cat $(CONFIG_CACHE_ENDIAN) 2>/dev/null`" != "$(ENDIAN_FORCE)" ]; then echo "$(ENDIAN_FORCE)" > $(CONFIG_CACHE_ENDIAN); fi )
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    97
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    98
# If there is a change in the source-file-list, make sure we recheck the deps
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
    99
RES := $(shell if [ "`cat $(CONFIG_CACHE_SOURCE) 2>/dev/null`" != "$(SRCS)" ]; then echo "$(SRCS)" > $(CONFIG_CACHE_SOURCE); fi )
5650
aefc131bf5ce (svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents: 5648
diff changeset
   100
# If there is a change in the revision, make sure we recompile rev.cpp
5643
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   101
RES := $(shell if [ "`cat $(CONFIG_CACHE_VERSION) 2>/dev/null`" != "$(REV)" ]; then echo "$(REV)" > $(CONFIG_CACHE_VERSION); fi )
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   102
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   103
ifndef MAKEDEPEND
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   104
# The slow, but always correct, dep-check
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   105
DEP_MASK := %.d
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   106
DEPS     := $(OBJS:%.o=%.d)
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   107
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   108
# Only include the deps if we are compiling everything
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   109
ifeq ($(filter $(ENDIAN_TARGETS) %.o clean mrproper, $(MAKECMDGOALS)),)
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   110
-include $(DEPS)
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   111
else
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   112
# In case we want to compile a single target, include the .d file for it
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   113
ifneq ($(filter %.o, $(MAKECMDGOALS)),)
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   114
SINGLE_DEP := $(filter %.o, $(MAKECMDGOALS))
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   115
-include $(SINGLE_DEP:%.o=%.d)
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   116
endif
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   117
endif
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   118
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   119
# Find the deps via GCC. Rarely wrong, but a bit slow
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   120
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   121
$(OBJS_C:%.o=%.d): %.d: $(SRC_DIR)/%.c $(FILE_DEP)
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   122
	$(E) '$(STAGE) DEP $(<:$(SRC_DIR)/%.c=%.c)'
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   123
	$(Q)$(CC_HOST) $(CC_CFLAGS) $(CFLAGS) -MM $< | sed 's#^$(@F:%.d=%.o):#$@ $(@:%.d=%.o):#' > $@
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   124
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   125
$(OBJS_CPP:%.o=%.d): %.d: $(SRC_DIR)/%.cpp $(FILE_DEP)
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   126
	$(E) '$(STAGE) DEP $(<:$(SRC_DIR)/%.cpp=%.cpp)'
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   127
	$(Q)$(CXX_HOST) $(CFLAGS) -MM $< | sed 's#^$(@F:%.d=%.o):#$@ $(@:%.d=%.o):#' > $@
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   128
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   129
$(OBJS_M:%.o=%.d): %.d: $(SRC_DIR)/%.m $(FILE_DEP)
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   130
	$(E) '$(STAGE) DEP $(<:$(SRC_DIR)/%.m=%.m)'
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   131
	$(Q)$(CC_HOST) $(CC_CFLAGS) $(CFLAGS) -MM $< | sed 's#^$(@F:%.d=%.o):#$@ $(@:%.d=%.o):#' > $@
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   132
5645
72ebd9e4cd64 (svn r7792) [cbh] -Sync: with trunk r7759:7788.
rubidium
parents: 5643
diff changeset
   133
$(OBJS_RC:%.o=%.d): %.d: $(SRC_DIR)/%.rc $(FILE_DEP)
72ebd9e4cd64 (svn r7792) [cbh] -Sync: with trunk r7759:7788.
rubidium
parents: 5643
diff changeset
   134
	$(E) '$(STAGE) DEP $(<:$(SRC_DIR)/%.m=%.m)'
72ebd9e4cd64 (svn r7792) [cbh] -Sync: with trunk r7759:7788.
rubidium
parents: 5643
diff changeset
   135
	$(Q)touch $@
72ebd9e4cd64 (svn r7792) [cbh] -Sync: with trunk r7759:7788.
rubidium
parents: 5643
diff changeset
   136
5643
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   137
else
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   138
# The much faster, but can be wrong, dep-check
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   139
DEP_MASK :=
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   140
DEPS     := Makefile.dep
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   141
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   142
# Only include the deps if we are not cleaning
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   143
ifeq ($(filter $(ENDIAN_TARGETS) depend clean mrproper, $(MAKECMDGOALS)),)
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   144
-include Makefile.dep
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   145
endif
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   146
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   147
# Make sure that only 'make depend' ALWAYS triggers a recheck
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   148
ifeq ($(filter depend, $(MAKECMDGOALS)),)
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   149
Makefile.dep: $(FILE_DEP) $(SRCS:%=$(SRC_DIR)/%) $(CONFIG_CACHE_SOURCE)
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   150
else
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   151
Makefile.dep: FORCE
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   152
endif
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   153
	$(E) '$(STAGE) DEP CHECK (all files)'
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   154
	$(Q)rm -f Makefile.dep.tmp
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   155
	$(Q)touch Makefile.dep.tmp
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   156
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   157
# Calculate the deps via makedepend
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   158
	$(Q)$(MAKEDEPEND) -f$(SRC_OBJS_DIR)/Makefile.dep.tmp -o.o -Y -v -- $(CFLAGS_MAKEDEP) -- $(SRCS:%=$(SRC_DIR)/%) 2>/dev/null
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   159
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   160
# Convert x:/... paths to /x/... for mingw
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   161
ifeq ($(OS), MINGW)
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   162
	@cat Makefile.dep.tmp | sed 's@\([a-zA-Z]\):/@/\1/@g' > Makefile.dep.tmp.mingw
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   163
	@cp Makefile.dep.tmp.mingw Makefile.dep.tmp
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   164
	@rm -f Makefile.dep.tmp.mingw
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   165
endif
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   166
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   167
# Remove all comments and includes that don't start with $(SRC_DIR)
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   168
# Remove $(SRC_DIR) from object-file-name
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   169
	@awk '                              \
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   170
	/^# DO NOT/ { print $$0 ; next}     \
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   171
	/^#/ {next}                         \
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   172
	/:/ {                               \
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   173
		left = NF - 1;                    \
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   174
		for (n = 2; n <= NF; n++) {       \
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   175
			if (match($$n, "^$(SRC_DIR)") == 0) { \
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   176
				$$n = "";                     \
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   177
				left--;                       \
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   178
			}                               \
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   179
		}                                 \
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   180
		gsub("$(SRC_DIR)/", "", $$1);     \
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   181
		if (left > 0) {                   \
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   182
			print $$0;                      \
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   183
			$$1 = "Makefile.dep:";          \
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   184
			print $$0;                      \
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   185
		}                                 \
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   186
		next                              \
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   187
	}                                   \
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   188
	{                                   \
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   189
		print $$0                         \
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   190
	}                                   \
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   191
	' < Makefile.dep.tmp | sed 's/  */ /g;s/ $$//' | $(SORT) > Makefile.dep
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   192
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   193
	$(Q)rm -f Makefile.dep.tmp Makefile.dep.tmp.bak
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   194
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   195
endif
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   196
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   197
# Avoid problems with deps if a .h file is deleted without the deps
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   198
#  being updated. Now the Makefile continues, the deps are recreated
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   199
#  and all will be fine.
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   200
%.h:
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   201
	@true
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   202
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   203
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   204
# Compile all the files according to the targets
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   205
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   206
$(OBJS_C): %.o: $(SRC_DIR)/%.c $(DEP_MASK) $(FILE_DEP)
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   207
	$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.c=%.c)'
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   208
	$(Q)$(CC_HOST) $(CC_CFLAGS) $(CFLAGS) -c -o $@ $<
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   209
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   210
$(OBJS_CPP): %.o: $(SRC_DIR)/%.cpp $(DEP_MASK) $(FILE_DEP)
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   211
	$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   212
	$(Q)$(CXX_HOST) $(CFLAGS) -c -o $@ $<
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   213
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   214
$(OBJS_M): %.o: $(SRC_DIR)/%.m $(DEP_MASK) $(FILE_DEP)
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   215
	$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.m=%.m)'
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   216
	$(Q)$(CC_HOST) $(CC_CFLAGS) $(CFLAGS) -c -o $@ $<
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   217
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   218
$(OBJS_RC): %.o: $(SRC_DIR)/%.rc $(FILE_DEP)
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   219
	$(E) '$(STAGE) Compiling resource $(<:$(SRC_DIR)/%.rc=%.rc)'
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   220
	$(Q)$(WINDRES) -o $@ -I $(MEDIA_DIR) $<
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   221
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   222
$(TTD): rev.o $(OBJS) $(CONFIG_CACHE_LINKER)
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   223
	$(E) '$(STAGE) Linking $@'
5645
72ebd9e4cd64 (svn r7792) [cbh] -Sync: with trunk r7759:7788.
rubidium
parents: 5643
diff changeset
   224
	$(Q)$(CXX_HOST) $(LDFLAGS) rev.o $(OBJS) $(LIBS) -o $@
5643
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   225
ifdef STRIP
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   226
	$(Q)$(STRIP) $@
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   227
endif
5645
72ebd9e4cd64 (svn r7792) [cbh] -Sync: with trunk r7759:7788.
rubidium
parents: 5643
diff changeset
   228
	$(Q)cp $@ $(BIN_DIR)/
5643
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   229
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   230
# The targets to compile the endian-code
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   231
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   232
endian_target.h: $(ENDIAN_CHECK) $(CONFIG_CACHE_ENDIAN)
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   233
	$(E) '$(STAGE) Testing endianness for target'
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   234
	$(Q)./$(ENDIAN_CHECK) $(ENDIAN_FORCE) > $@
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   235
5650
aefc131bf5ce (svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents: 5648
diff changeset
   236
$(ENDIAN_CHECK): $(SRC_DIR)/endian_check.cpp
5643
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   237
	$(E) '$(STAGE) Compiling and Linking $@'
5650
aefc131bf5ce (svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents: 5648
diff changeset
   238
	$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $< -o $@
5643
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   239
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   240
# Revision files
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   241
5650
aefc131bf5ce (svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents: 5648
diff changeset
   242
rev.cpp: $(CONFIG_CACHE_VERSION)
5643
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   243
# setting the revision number in a place, there the binary can read it
5650
aefc131bf5ce (svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents: 5648
diff changeset
   244
	@echo 'extern const char _openttd_revision[] = "$(REV)";' > rev.cpp
5643
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   245
# Some additions for MorphOS versions tag
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   246
ifeq ($(OS),MORPHOS)
5650
aefc131bf5ce (svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents: 5648
diff changeset
   247
	@echo '#ifdef __MORPHOS__' >> rev.cpp
aefc131bf5ce (svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents: 5648
diff changeset
   248
	@echo 'extern const char morphos_versions_tag[] = "\\0$$VER: OpenTTD $(REV) ('`date +%d.%m.%y`') (C) OpenTTD Team [MorphOS, PowerPC]";' >> rev.cpp
aefc131bf5ce (svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents: 5648
diff changeset
   249
	@echo '#endif' >> rev.cpp
5643
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   250
endif
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   251
5650
aefc131bf5ce (svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents: 5648
diff changeset
   252
rev.o: rev.cpp $(FILE_DEP)
aefc131bf5ce (svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents: 5648
diff changeset
   253
	$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
aefc131bf5ce (svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents: 5648
diff changeset
   254
	$(Q)$(CXX_HOST) $(CFLAGS) -c -o $@ $<
5643
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   255
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   256
FORCE:
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   257
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   258
depend: $(DEPS)
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   259
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   260
clean:
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   261
	$(E) '$(STAGE) Cleaning up object files'
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   262
	$(Q)rm -f $(DEPS) $(OBJS) $(TTD) $(TTD:%=$(BIN_DIR)/%) $(CONFIG_CACHE_COMPILER) $(CONFIG_CACHE_LINKER) $(CONFIG_CACHE_ENDIAN) $(CONFIG_CACHE_SOURCE) $(ENDIAN_TARGETS) rev.o
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   263
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   264
mrproper: clean
5650
aefc131bf5ce (svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents: 5648
diff changeset
   265
	$(Q)rm -f rev.cpp
5643
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   266
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   267
%.o:
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   268
	@echo '$(STAGE) No such source-file: $(@:%.o=%).[c|cpp|m|rc]'
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   269
3778051e8095 (svn r7790) [cbh] -Sync: execute the same script for /branches/custombridgeheads as was done for /trunk in r7759.
rubidium
parents:
diff changeset
   270
.PHONY: all mrproper depend clean FORCE