1# Time-stamp: <04/03/31 07:55:19 ptr>
2# $Id$
3
4!if "$(TARGET_PROC)" == ""
5!error No target processor configured! Please rerun configure.bat!
6!endif
7
8!if "$(CC)" == ""
9!error CC not set, run the proper WCE*.bat from this shell to set it!
10!endif
11
12# All the batchfiles to setup the environment yield different
13# compilers which they put into CC.
14CXX = $(CC)
15
16DEFS_COMMON = $(DEFS_COMMON) /D _WIN32_WCE=$(CEVERSION) /D UNDER_CE=$(CEVERSION) /D "UNICODE"
17LDFLAGS_COMMON = $(LDFLAGS_COMMON) coredll.lib corelibc.lib /nodefaultlib:LIBC.lib /nodefaultlib:OLDNAMES.lib
18LDFLAGS_COMMON = $(LDFLAGS_COMMON) /stack:0x10000,0x1000 /subsystem:WINDOWSCE /align:"4096"
19
20# increase compiler memory in order to compile deeply nested template code
21OPT_STLDBG = $(OPT_STLDBG) /Zm800
22OPT_STATIC_STLDBG = $(OPT_STATIC_STLDBG) /Zm800
23
24# activate global (whole program) optimizations
25OPT_REL = $(OPT_REL) /Og
26OPT_STATIC_REL = $(OPT_STATIC_REL) /Og
27
28# ARM specific settings
29!if "$(TARGET_PROC)" == "arm"
30DEFS_COMMON = $(DEFS_COMMON) /D "ARM" /D "_ARM_" /D "ARMV4"
31OPT_STATIC_STLDBG = $(OPT_STATIC_STLDBG) /Zm800
32OPT_COMMON = $(OPT_COMMON)
33# TODO: eVC4 IDE uses ARM for ARMV4 and THUMB for ARMV4I and ARMV4T
34LDFLAGS_COMMON = $(LDFLAGS_COMMON) /MACHINE:ARM
35# RTTI patch for PPC2003 SDK
36!if "$(PLATFORM)" == "POCKET PC 2003"
37LDFLAGS_COMMON = $(LDFLAGS_COMMON) ccrtrtti.lib
38!endif
39!endif
40
41# x86 specific settings
42!if "$(TARGET_PROC)" == "x86"
43DEFS_COMMON = $(DEFS_COMMON) /D "x86" /D "_X86_" /D "_i386_"
44OPT_COMMON = $(OPT_COMMON) /Gs8192
45LDFLAGS_COMMON = $(LDFLAGS_COMMON) $(CEx86Corelibc) /MACHINE:X86
46!if "$(TARGET_PROC_SUBTYPE)" == "emulator"
47DEFS_COMMON = $(DEFS_COMMON) /D "_STLP_WCE_TARGET_PROC_SUBTYPE_EMULATOR"
48!endif
49!if "$(PLATFORM)" == "POCKET PC 2003"
50# RTTI patch for PPC2003 SDK
51LDFLAGS_COMMON = $(LDFLAGS_COMMON) ccrtrtti.lib
52!endif
53!endif
54
55# MIPS specific settings
56!if "$(TARGET_PROC)" == "mips"
57DEFS_COMMON = $(DEFS_COMMON) /D "_MIPS_" /D "MIPS" /D "$(TARGET_PROC_SUBTYPE)"
58OPT_COMMON = $(OPT_COMMON)
59
60# Note: one might think that MIPSII_FP and MIPSIV_FP should use /MACHINE:MIPSFPU
61# while MIPSII and MIPSIV should use /MACHINE:MIPS, but this is exactly how the
62# eVC4 IDE does it.
63!if "$(TARGET_PROC_SUBTYPE)" == ""
64!error "MIPS subtype not set"
65!elseif "$(TARGET_PROC_SUBTYPE)" == "MIPS16"
66LDFLAGS_COMMON = $(LDFLAGS_COMMON) /MACHINE:MIPS
67!elseif "$(TARGET_PROC_SUBTYPE)" == "MIPSII"
68OPT_COMMON = $(OPT_COMMON) /QMmips2 /QMFPE
69LDFLAGS_COMMON = $(LDFLAGS_COMMON) /MACHINE:MIPS
70!elseif "$(TARGET_PROC_SUBTYPE)" == "MIPSII_FP"
71OPT_COMMON = $(OPT_COMMON) /QMmips2 /QMFPE-
72LDFLAGS_COMMON = $(LDFLAGS_COMMON) /MACHINE:MIPS
73!elseif "$(TARGET_PROC_SUBTYPE)" == "MIPSIV"
74OPT_COMMON = $(OPT_COMMON) /QMmips4 /QMn32 /QMFPE
75LDFLAGS_COMMON = $(LDFLAGS_COMMON) /MACHINE:MIPSFPU
76!elseif "$(TARGET_PROC_SUBTYPE)" == "MIPSIV_FP"
77OPT_COMMON = $(OPT_COMMON) /QMmips4 /QMn32 /QMFPE-
78LDFLAGS_COMMON = $(LDFLAGS_COMMON) /MACHINE:MIPSFPU
79!else
80!error "unknown MIPS subtype"
81!endif
82
83!endif
84
85# SH3 specific settings
86!if "$(TARGET_PROC)" == "sh3"
87DEFS_COMMON = $(DEFS_COMMON) /D "SH3" /D "_SH3_" /D "SHx"
88OPT_COMMON = $(OPT_COMMON)
89LDFLAGS_COMMON = $(LDFLAGS_COMMON) /MACHINE:SH3
90!endif
91
92# SH4 specific settings
93!if "$(TARGET_PROC)" == "sh4"
94DEFS_COMMON = $(DEFS_COMMON) /D "SH4" /D "_SH4_" /D "SHx"
95OPT_COMMON = $(OPT_COMMON) /Qsh4
96LDFLAGS_COMMON = $(LDFLAGS_COMMON) /MACHINE:SH4
97!endif
98
99
100# exception handling support
101CFLAGS_COMMON = /nologo /TC /W4 /GF /GR /GX
102CFLAGS_REL = $(CFLAGS_COMMON) $(OPT_REL)
103CFLAGS_STATIC_REL = $(CFLAGS_COMMON) $(OPT_STATIC_REL)
104CFLAGS_DBG = $(CFLAGS_COMMON) $(OPT_DBG)
105CFLAGS_STATIC_DBG = $(CFLAGS_COMMON) $(OPT_STATIC_DBG)
106CFLAGS_STLDBG = $(CFLAGS_COMMON) $(OPT_STLDBG)
107CFLAGS_STATIC_STLDBG = $(CFLAGS_COMMON) $(OPT_STATIC_STLDBG)
108CXXFLAGS_COMMON = /nologo /TP /W4 /GF /GR /GX
109CXXFLAGS_REL = $(CXXFLAGS_COMMON) $(OPT_REL)
110CXXFLAGS_STATIC_REL = $(CXXFLAGS_COMMON) $(OPT_STATIC_REL)
111CXXFLAGS_DBG = $(CXXFLAGS_COMMON) $(OPT_DBG)
112CXXFLAGS_STATIC_DBG = $(CXXFLAGS_COMMON) $(OPT_STATIC_DBG)
113CXXFLAGS_STLDBG = $(CXXFLAGS_COMMON) $(OPT_STLDBG)
114CXXFLAGS_STATIC_STLDBG = $(CXXFLAGS_COMMON) $(OPT_STATIC_STLDBG)
115
116!include evc-common.mak
117