source: trunk/make/setup.mak@ 8333

Last change on this file since 8333 was 8333, checked in by bird, 24 years ago

Build level info. Symbol files.

File size: 8.2 KB
Line 
1# $Id: setup.mak,v 1.7 2002-04-30 06:19:13 bird Exp $
2
3#
4# Generic makefile system.
5#
6# Setting up the build environment variables
7#
8# Many of the variables are a subject to change from project to project.
9#
10
11
12!ifndef MAKE_SETUP_INCLUDED
13MAKE_SETUP_INCLUDED=YES
14
15
16# -----------------------------------------------------------------------------
17# Validate the build the requested environment setup.
18# -----------------------------------------------------------------------------
19
20SHT_TRGPLTFRM=
21!if "$(BUILD_PLATFORM)" == "OS2"
22SHT_TRGPLTFRM=os2
23!endif
24!if "$(BUILD_PLATFORM)" == "WIN32"
25SHT_TRGPLTFRM=win32
26!endif
27!if "$(SHT_TRGPLTFRM)" == ""
28! error Fatal error: Env.var BUILD_PLATFORM is either unspecified or incorrect. ($(BUILD_PLATFORM)) Valid values: OS2 and WIN32
29!endif
30
31
32SHT_BLDMD=
33!if "$(BUILD_MODE)" == "RELEASE"
34SHT_BLDMD=rel
35!endif
36!if "$(BUILD_MODE)" == "DEBUG"
37SHT_BLDMD=deb
38!endif
39!if "$(BUILD_MODE)" == "PROFILE"
40SHT_BLDMD=prf
41!endif
42!if "$(SHT_BLDMD)" == ""
43! error Fatal error: Env.var BUILD_MODE is either unspecified or incorrect. ($(BUILD_MODE)) Valid values: RELEASE, DEBUG and PROFILE
44!endif
45
46
47SHT_BLDENV=
48!if "$(BUILD_ENV)" == "VAC308"
49SHT_BLDENV=vac308
50!endif
51!if "$(BUILD_ENV)" == "VAC365"
52SHT_BLDENV=vac365
53!endif
54!if "$(BUILD_ENV)" == "VAC4"
55SHT_BLDENV=vac4
56!endif
57!if "$(BUILD_ENV)" == "EMX"
58SHT_BLDENV=emx
59!endif
60!if "$(BUILD_ENV)" == "MSCV6"
61SHT_BLDENV=mscv6
62!endif
63!if "$(BUILD_ENV)" == "WAT11C"
64SHT_BLDENV=wat11
65!endif
66!if "$(SHT_BLDENV)" == ""
67! error Fatal error: Env.var BUILD_ENV is either unspecified or incorrect. ($(BUILD_MODE)) Valid values: VAC308, VAC365, VAC4, EMX, MSCV6 and WATCOM
68!endif
69
70
71!ifdef BUILD_ENV_FORCE
72SHT_BLDENVFRC=
73!if "$(BUILD_ENV_FORCE)" == "VAC308"
74SHT_BLDENVFRC=vac308
75!endif
76!if "$(BUILD_ENV_FORCE)" == "VAC365"
77SHT_BLDENVFRC=vac365
78!endif
79!if "$(BUILD_ENV_FORCE)" == "VAC4"
80SHT_BLDENVFRC=vac4
81!endif
82!if "$(BUILD_ENV_FORCE)" == "EMX"
83SHT_BLDENVFRC=emx
84!endif
85!if "$(BUILD_ENV_FORCE)" == "MSCV6"
86SHT_BLDENVFRC=mscv6
87!endif
88!if "$(BUILD_ENV_FORCE)" == "WAT11C"
89SHT_BLDENVFRC=wat11
90!endif
91!if "$(SHT_BLDENVFRC)" == ""
92! error Fatal error: Var BUILD_ENV_FORCE is incorrect. ($(BUILD_ENV_FORCE)) Valid values: VAC308, VAC365, VAC4, EMX, MSCV6 and WATCOM
93!endif
94!else
95BUILD_ENV_FORCE=$(BUILD_ENV)
96SHT_BLDENVFRC=$(SHT_BLDENV)
97!endif
98
99
100# -----------------------------------------------------------------------------
101# Directories
102# -----------------------------------------------------------------------------
103
104# current directory.
105PATH_CURRENT = $(MAKEDIR)
106# Where build system files are located. (like this file)
107PATH_MAKE = $(PATH_ROOT)\make
108# Where the bulid system and other tools are located
109PATH_TOOLS = $(PATH_ROOT)\tools\bin
110# Where platform-specific files are located. (like the .def files)
111# (default) PATH_DEF = $(SHT_TRGPLTFRM)
112PATH_DEF = .
113# Where the include files are located.
114PATH_INCLUDES = $(PATH_ROOT)\include;$(PATH_ROOT)\include\win
115
116# Where the temporary files goes.
117PATH_OBJ = $(PATH_ROOT)\obj\$(SHT_TRGPLTFRM)$(SHT_BLDMD)$(SHT_BLDENV)
118# Where the executable binaries goes.
119PATH_BIN = $(PATH_ROOT)\bin\$(BUILD_MODE)
120# Where the public libraries goes.
121PATH_LIB = $(PATH_ROOT)\lib\$(BUILD_MODE)
122# Where the dynamic link libraries goes.
123PATH_DLL = $(PATH_ROOT)\bin\$(BUILD_MODE)
124# Where the drivers goes. (common for IFS and SYS.)
125PATH_SYS = $(PATH_ROOT)\bin\$(BUILD_MODE)
126# Where the virtual dos drivers goes.
127PATH_VDD = $(PATH_ROOT)\bin\$(BUILD_MODE)
128# Where the documentation goes.
129PATH_DOC = $(PATH_ROOT)\bin\$(BUILD_MODE)
130# Where the helpfiles goes.
131PATH_HLP = $(PATH_ROOT)\bin\$(BUILD_MODE)
132
133
134# Note: Makefiles are supposed to set the correct *RELATIVE* path to the
135# projects root. Using '\' slashes please. No trailing slash.
136#
137# Example:
138# PATH_ROOT= ..\..\..
139# Assert PATH_ROOT
140!if "$(PATH_ROOT)" == ""
141!error fatal error: PATH_ROOT empty or undefined.
142!endif
143
144
145# -----------------------------------------------------------------------------
146# Common variables / Project variables
147# -----------------------------------------------------------------------------
148
149# The default definitions.
150BUILD_DEFINES = -D__WIN32OS2__ -D__WINE__ -D__i386__
151BUILD_BLDLEVEL_FLAGS = -V^"^#define=ODIN32_VERSION,$(PATH_ROOT)\include\odinbuild.h^" \
152 -M^"^#define=ODIN32_BUILD_NR,$(PATH_ROOT)\include\odinbuild.h^"
153
154# This is the process file to include at end of the makefile.
155MAKE_INCLUDE_PROCESS = $(PATH_MAKE)\process.mak
156
157
158
159# -----------------------------------------------------------------------------
160# Include the setup.
161# First the default common tools setup is included.
162# The the environment specific setup.
163# -----------------------------------------------------------------------------
164
165!include $(PATH_MAKE)\setup.tools.mk
166
167MAKE_INCLUDE_SETUP = $(PATH_MAKE)\setup.$(SHT_TRGPLTFRM)$(SHT_BLDMD)$(SHT_BLDENV).mk
168!ifndef BUILD_QUIET
169! if [$(ECHO) Including platform setup file $(CLRFIL)$(MAKE_INCLUDE_SETUP)$(CLRRST)]
170! endif
171!endif
172!include $(MAKE_INCLUDE_SETUP)
173
174
175# -----------------------------------------------------------------------------
176# Verify the environment setups.
177# -----------------------------------------------------------------------------
178
179!ifndef ENV_NAME
180!error No environment signature has been defined ($(NAME_COMPLETE))
181!endif
182
183!ifndef MAKE_INCLUDE_SETUP
184!error No setup to include has been determined (MAKE_INCLUDE_SETUP)
185!endif
186
187!if "$(ENV_STATUS)" != "OK"
188!error Environment $(ENV_NAME) does work yet (ENV_STATUS is not OK).
189!endif
190
191!ifndef CC
192!error Environment $(ENV_NAME) does not define variable (CC).
193!endif
194
195!ifndef CC_FLAGS_EXE
196!error Environment $(ENV_NAME) does not define variable (CC_FLAGS_EXE).
197!endif
198
199!ifndef LINK
200!error Environment $(ENV_NAME) does not define variable (LINK).
201!endif
202
203!ifndef LINK_FLAGS_EXE
204!error Environment $(ENV_NAME) does not define variable (LINK_FLAGS_EXE).
205!endif
206
207
208# -----------------------------------------------------------------------------
209# Ensure the output path exists
210# -----------------------------------------------------------------------------
211!if "$(PATH_OBJ)" != ""
212! if [$(TOOL_EXISTS) $(PATH_OBJ)] != 0
213! ifndef BUILD_QUIET
214! if [$(ECHO) Target path $(PATH_OBJ) does NOT exist. Creating. $(CLRRST)]
215! endif
216! endif
217! if [$(TOOL_CREATEPATH) $(PATH_OBJ)]
218! error Fatal error: Could not create $(PATH_OBJ).
219! endif
220! endif
221!endif
222
223
224
225# -----------------------------------------------------------------------------
226# Build the environments
227# -----------------------------------------------------------------------------
228
229# In the makefiles you're allowed to use the BUILD_ENVS_PRE,
230# BUILD_ENV_FORCE, BUILD_ENVS_POST variables to make private changes to the
231# environment. These are combined with the two base ones as follows:
232# $(BUILD_ENVS_BASE_PRE) $(BUILD_ENVS_PRE) $(ENV_ENVS) $(BUILD_ENVS_BASE_POST) $(BUILD_ENVS_POST)
233#
234# BUILD_ENV_FORCE is used for changing the base compiler. Do *NOT* use
235# BUILD_ENV for that! BUILD_ENV_FORCE isn't used directly but in the setup
236# string above, but ENV_ENVS from the setup.[w]xyz.mk setup file is used.
237#
238
239# These strings are passed on to the BuildEnv.cmd script to setup the correct
240# shell environment.
241# TODO Should these be overridable by setup.[w]xyz.mak ? (kso)
242
243BUILD_ENVS_BASE_POST = toolkit40
244BUILD_ENVS_BASE_PRE = odin32testcase
245
246
247# Check if there is any change in the environment.
248# If there are we will have to forward all target commands to the
249# correct shell environment
250!if "$(BUILD_ENV)" != "$(BUILD_ENV_FORCE)" || "$(BUILD_ENVS_PRE)" != "" || "$(BUILD_ENVS_POST)" != ""
251MAKE_INCLUDE_PROCESS = $(PATH_MAKE)\process.forwarder.mak
252
253
254# Compiler change or just environment change.
255! if "$(BUILD_ENV)" != "$(BUILD_ENV_FORCE)"
256MAKE_INCLUDE_SETUP_FORCE = $(PATH_MAKE)\setup.$(SHT_TRGPLTFRM)$(SHT_BLDMD)$(SHT_BLDENVFRC).mk
257! ifndef BUILD_QUIET
258! if [$(ECHO) Including forced platform setup file $(CLRFIL)$(MAKE_INCLUDE_SETUP_FORCE)$(CLRRST)]
259! endif
260! endif
261! include $(MAKE_INCLUDE_SETUP_FORCE)
262BUILD_ENVS_CHANGE = $(ENV_ENVS: =- )- $(BUILD_ENVS_BASE_PRE) $(BUILD_ENVS_PRE) $(ENV_ENVS_FORCE) $(BUILD_ENVS_BASE_POST) $(BUILD_ENVS_POST)
263! else
264BUILD_ENVS_CHANGE = $(BUILD_ENVS_BASE_PRE) $(BUILD_ENVS_PRE) $(ENV_ENVS) $(BUILD_ENVS_BASE_POST) $(BUILD_ENVS_POST)
265! endif
266
267!endif
268
269
270!endif # MAKE_SETUP_INCLUDED
271
Note: See TracBrowser for help on using the repository browser.