source: trunk/make/setup.mak@ 8356

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

Compiler environment changes.

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