source: trunk/make/setup.mak@ 9718

Last change on this file since 9718 was 9718, checked in by sandervl, 23 years ago

Only add include\incl_vac if not building an odin32 app

File size: 11.9 KB
RevLine 
[9718]1# $Id: setup.mak,v 1.23 2003-01-23 13:50:43 sandervl Exp $
[8197]2#
[9280]3# The common build setup.
[8197]4#
[9280]5# Copyright (c) 2001-2002 knut st. osmundsen <bird@anduin.net>
6# Copyright (c) 2001 Patrick Haller
[8197]7#
[9280]8# This file is part of Generic Buildsystem.
[8197]9#
10
11
[9150]12# -----------------------------------------------------------------------------
13# Assert that the file isn't included several times.
14# -----------------------------------------------------------------------------
15!ifdef MAKE_SETUP_INCLUDED
16! error Fatal error: You've included setup.mak before!!!
17!endif
18MAKE_SETUP_INCLUDED = YES
[8197]19
20
[8253]21# -----------------------------------------------------------------------------
22# Validate the build the requested environment setup.
23# -----------------------------------------------------------------------------
[8197]24
[8253]25SHT_TRGPLTFRM=
[8197]26!if "$(BUILD_PLATFORM)" == "OS2"
[8253]27SHT_TRGPLTFRM=os2
[8197]28!endif
29!if "$(BUILD_PLATFORM)" == "WIN32"
[8253]30SHT_TRGPLTFRM=win32
[8197]31!endif
[8253]32!if "$(SHT_TRGPLTFRM)" == ""
33! error Fatal error: Env.var BUILD_PLATFORM is either unspecified or incorrect. ($(BUILD_PLATFORM)) Valid values: OS2 and WIN32
[8197]34!endif
35
36
[8253]37SHT_BLDMD=
[8197]38!if "$(BUILD_MODE)" == "RELEASE"
[8253]39SHT_BLDMD=rel
[8197]40!endif
41!if "$(BUILD_MODE)" == "DEBUG"
[8253]42SHT_BLDMD=deb
[8197]43!endif
44!if "$(BUILD_MODE)" == "PROFILE"
[8253]45SHT_BLDMD=prf
[8197]46!endif
[8253]47!if "$(SHT_BLDMD)" == ""
48! error Fatal error: Env.var BUILD_MODE is either unspecified or incorrect. ($(BUILD_MODE)) Valid values: RELEASE, DEBUG and PROFILE
[8197]49!endif
50
51
[8253]52SHT_BLDENV=
[8197]53!if "$(BUILD_ENV)" == "VAC308"
[8253]54SHT_BLDENV=vac308
[8197]55!endif
56!if "$(BUILD_ENV)" == "VAC365"
[8253]57SHT_BLDENV=vac365
[8197]58!endif
59!if "$(BUILD_ENV)" == "VAC4"
[8253]60SHT_BLDENV=vac4
[8197]61!endif
62!if "$(BUILD_ENV)" == "EMX"
[8253]63SHT_BLDENV=emx
[8197]64!endif
65!if "$(BUILD_ENV)" == "MSCV6"
[8253]66SHT_BLDENV=mscv6
[8197]67!endif
[8353]68!if "$(BUILD_ENV)" == "MSCV6-16"
69SHT_BLDENV=mscv6-16
70!endif
[9236]71!if "$(BUILD_ENV)" == "MSCV7-16"
72SHT_BLDENV=mscv7-16
73!endif
[8294]74!if "$(BUILD_ENV)" == "WAT11C"
[8253]75SHT_BLDENV=wat11
76!endif
[8353]77!if "$(BUILD_ENV)" == "WAT11C-16"
78SHT_BLDENV=wat11-16
79!endif
[8253]80!if "$(SHT_BLDENV)" == ""
[9236]81! error Fatal error: Env.var BUILD_ENV is either unspecified or incorrect. ($(BUILD_MODE)) Valid values: VAC308, VAC365, VAC4, EMX, MSCV6-16, MSCV7-16, WAT11C and WAT11C-16.
[8197]82!endif
83
84
[8294]85!ifdef BUILD_ENV_FORCE
86SHT_BLDENVFRC=
87!if "$(BUILD_ENV_FORCE)" == "VAC308"
88SHT_BLDENVFRC=vac308
89!endif
90!if "$(BUILD_ENV_FORCE)" == "VAC365"
91SHT_BLDENVFRC=vac365
92!endif
93!if "$(BUILD_ENV_FORCE)" == "VAC4"
94SHT_BLDENVFRC=vac4
95!endif
96!if "$(BUILD_ENV_FORCE)" == "EMX"
97SHT_BLDENVFRC=emx
98!endif
99!if "$(BUILD_ENV_FORCE)" == "MSCV6"
100SHT_BLDENVFRC=mscv6
101!endif
[8353]102!if "$(BUILD_ENV_FORCE)" == "MSCV6-16"
103SHT_BLDENVFRC=mscv6-16
104!endif
[9236]105!if "$(BUILD_ENV_FORCE)" == "MSCV7-16"
106SHT_BLDENVFRC=mscv7-16
107!endif
[8294]108!if "$(BUILD_ENV_FORCE)" == "WAT11C"
109SHT_BLDENVFRC=wat11
110!endif
[8353]111!if "$(BUILD_ENV_FORCE)" == "WAT11C-16"
112SHT_BLDENVFRC=wat11-16
113!endif
[8294]114!if "$(SHT_BLDENVFRC)" == ""
[9236]115! error Fatal error: Var BUILD_ENV_FORCE is incorrect. ($(BUILD_ENV_FORCE)) Valid values: VAC308, VAC365, VAC4, EMX, MSCV6-16, MSCV7-16, WAT11C and WAT11C-16.
[8294]116!endif
117!else
118BUILD_ENV_FORCE=$(BUILD_ENV)
119SHT_BLDENVFRC=$(SHT_BLDENV)
120!endif
[8253]121
[8294]122
[8253]123# -----------------------------------------------------------------------------
124# Directories
125# -----------------------------------------------------------------------------
126
127# current directory.
128PATH_CURRENT = $(MAKEDIR)
129# Where build system files are located. (like this file)
130PATH_MAKE = $(PATH_ROOT)\make
131# Where the bulid system and other tools are located
132PATH_TOOLS = $(PATH_ROOT)\tools\bin
133# Where platform-specific files are located. (like the .def files)
134PATH_DEF = .
135# Where the include files are located.
[9718]136PATH_INCLUDES = $(PATH_ROOT)\include\win;.;$(PATH_ROOT)\include
137!ifndef ODIN32_USERAPP
138PATH_INCLUDES = $(PATH_ROOT)\include\incl_vac;$(PATH_INCLUDES)
139!endif
[8253]140# Where the temporary files goes.
[9165]141PATH_OBJ = $(PATH_ROOT)\obj\$(SHT_TRGPLTFRM)$(SHT_BLDMD)$(SHT_BLDENV:-=_)
[9127]142# Where the libraries goes.
143PATH_LIB = $(PATH_ROOT)\lib\$(BUILD_MODE)
144# Base directory of the published files.
145PATH_PUB = $(PATH_ROOT)\bin\$(BUILD_MODE)
146# Base directory of the unstripped published files. (release mode only)
147PATH_PUB_DEB = $(PATH_ROOT)\bin\$(BUILD_MODE).unstripped
148# Sub dir where the executable binaries goes.
149PATH_SUB_BIN = .
150# Sub dir where the dynamic link libraries goes.
151PATH_SUB_DLL = .
152# Sub dir where the drivers goes. (common for IFS and SYS.)
153PATH_SUB_SYS = .
154# Sub dir where the virtual dos drivers goes.
155PATH_SUB_VDD = .
[9273]156# Sub dir where the book files goes. (aka .inf)
157PATH_SUB_BOOK = book
158# Sub dir where the help files goes. (aka .hlp)
159PATH_SUB_HELP = help
[9127]160# Sub dir where the documentation goes.
[9273]161PATH_SUB_DOC = docs
[8253]162
163
[9127]164
[8253]165# Note: Makefiles are supposed to set the correct *RELATIVE* path to the
166# projects root. Using '\' slashes please. No trailing slash.
167#
168# Example:
169# PATH_ROOT= ..\..\..
170# Assert PATH_ROOT
171!if "$(PATH_ROOT)" == ""
172!error fatal error: PATH_ROOT empty or undefined.
[8197]173!endif
174
[8715]175#
176# A workaround for SlickEdits inability to find the buggy files..
177# This fixes the relative paths of includes.
178# Set the make line to:
179# '%v && cd %p && nmake PATH_ROOT_ABS=%rp. %n.obj -a'
180# (NB! Set the project directory to the root dir by creating the project there!)
181#
182!ifdef SLKRUNS
183! ifdef PATH_ROOT_ABS
184PATH_ROOT = $(PATH_ROOT_ABS)
185! endif
186!endif
[8197]187
[8715]188
189
[8253]190# -----------------------------------------------------------------------------
191# Common variables / Project variables
192# -----------------------------------------------------------------------------
[8197]193
[8253]194# The default definitions.
[9131]195!ifndef ODIN32_USERAPP
196BUILD_DEFINES = -D__WIN32OS2__ -DTCPV40HDRS -DCOMCTL32UNDOC -D__WINE__
197!else
198BUILD_DEFINES = -D__WIN32OS2__ #-DTCPV40HDRS -DCOMCTL32UNDOC -D__WINE__
199!endif
[8333]200BUILD_BLDLEVEL_FLAGS = -V^"^#define=ODIN32_VERSION,$(PATH_ROOT)\include\odinbuild.h^" \
201 -M^"^#define=ODIN32_BUILD_NR,$(PATH_ROOT)\include\odinbuild.h^"
[8423]202BUILD_PROJECT = Odin32
[8253]203
[9117]204# Project Specific definitions.
205!if "$(BUILD_MODE)" != "DEBUG"
206LIB_ODINCRT = $(PATH_LIB)\odincrt.$(EXT_LIB)
207!else
208LIB_ODINCRT = $(PATH_LIB)\odincrtd.$(EXT_LIB)
209!endif
210!ifndef CUSTOMBUILD
211OBJ_DLLENTRY = $(PATH_LIB)\dllentry.$(EXT_OBJ)
212!else
213OBJ_DLLENTRY =
214!endif
215
[8253]216# This is the process file to include at end of the makefile.
217MAKE_INCLUDE_PROCESS = $(PATH_MAKE)\process.mak
218
[9165]219# -----------------------------------------------------------------------------
220# Build the environments variables
221# -----------------------------------------------------------------------------
[8253]222
[9165]223# In the makefiles you're allowed to use the BUILD_ENVS_PRE,
224# BUILD_ENV_FORCE, BUILD_ENVS_POST variables to make private changes to the
225# environment. These are combined with the two base ones as follows:
226# $(BUILD_ENVS_BASE_PRE) $(BUILD_ENVS_PRE) $(ENV_ENVS) $(BUILD_ENVS_BASE_POST) $(BUILD_ENVS_POST)
227#
228# BUILD_ENV_FORCE is used for changing the base compiler. Do *NOT* use
229# BUILD_ENV for that! BUILD_ENV_FORCE isn't used directly but in the setup
230# string above, but ENV_ENVS from the setup.[w]xyz.mk setup file is used.
231#
232
233# These strings are passed on to the BuildEnv.cmd script to setup the correct
234# shell environment.
235# TODO Should these be overridable by setup.[w]xyz.mak ? (kso)
[9174]236BUILD_ENVS_BASE_POST = toolkit452
[9165]237BUILD_ENVS_BASE_POST_16 =
[9186]238BUILD_ENVS_BASE_PRE = buildsetup emx~ cvs~
239BUILD_ENVS_BASE_PRE_16 = buildsetup emx~ cvs~ toolkit452 ddkbase
[9165]240
241
[9150]242# -----------------------------------------------------------------------------
243# Set forwarding flag.
244# If there is any change in the environment
245# OR the environment is uncertain (_BUILD_PROJECT not right) Then
246# Forward all target commands to the new shell environment we setup.
247#
248# (This have to be done early so the CC setup and it's like can check for
249# the flag. The rest of the forward stuff is at the bottom.)
250# -----------------------------------------------------------------------------
251!if "$(_BUILD_PROJECT)" != "$(BUILD_PROJECT)" || "$(BUILD_ENV)" != "$(BUILD_ENV_FORCE)" || "$(BUILD_ENVS_PRE)" != "" || "$(BUILD_ENVS_POST)" != ""
252BUILD_FORWARDING = 1
253!else
254BUILD_FORWARDING = 0
255!endif
[9131]256
[9150]257
[8253]258# -----------------------------------------------------------------------------
259# Include the setup.
260# First the default common tools setup is included.
261# The the environment specific setup.
262# -----------------------------------------------------------------------------
263
264!include $(PATH_MAKE)\setup.tools.mk
265
266MAKE_INCLUDE_SETUP = $(PATH_MAKE)\setup.$(SHT_TRGPLTFRM)$(SHT_BLDMD)$(SHT_BLDENV).mk
267!ifndef BUILD_QUIET
[8715]268! ifndef MAKEVER
269! if [$(ECHO) Including platform setup file $(CLRFIL)$(MAKE_INCLUDE_SETUP)$(CLRRST)]
270! endif
271! else
272$(ECHO) Including platform setup file $(CLRFIL)$(MAKE_INCLUDE_SETUP)$(CLRRST)
[8197]273! endif
274!endif
[8253]275!include $(MAKE_INCLUDE_SETUP)
[8197]276
277
[8253]278# -----------------------------------------------------------------------------
279# Verify the environment setups.
[9150]280# Uncomment this when configuring a new project.
281# When the setup is stable comment it out. (it's a waste of time!)
[8253]282# -----------------------------------------------------------------------------
[8197]283
[9150]284#
285#!ifndef ENV_NAME
286#!error No environment signature has been defined ($(NAME_COMPLETE))
287#!endif
288#
289#!ifndef MAKE_INCLUDE_SETUP
290#!error No setup to include has been determined (MAKE_INCLUDE_SETUP)
291#!endif
292#
293#!if "$(ENV_STATUS)" != "OK"
294#!error Environment $(ENV_NAME) does work yet (ENV_STATUS is not OK).
295#!endif
296#
297#!ifndef CC
298#!error Environment $(ENV_NAME) does not define variable (CC).
299#!endif
300#
301#!ifndef CC_FLAGS_EXE
302#!error Environment $(ENV_NAME) does not define variable (CC_FLAGS_EXE).
303#!endif
304#
305#!ifndef LINK
306#!error Environment $(ENV_NAME) does not define variable (LINK).
307#!endif
308#
309#!ifndef LINK_FLAGS_EXE
310#!error Environment $(ENV_NAME) does not define variable (LINK_FLAGS_EXE).
311#!endif
312#
[8197]313
[9165]314
[8253]315# -----------------------------------------------------------------------------
[9165]316# Forwarding processing.
[8294]317# -----------------------------------------------------------------------------
[9150]318!if $(BUILD_FORWARDING)
[8294]319
320MAKE_INCLUDE_PROCESS = $(PATH_MAKE)\process.forwarder.mak
321
[9047]322# Debug - find the reason for forwarding.
323#! if 0
324#! if "$(_BUILD_PROJECT)" != "$(BUILD_PROJECT)"
325#! if [echo debug - _BUILD_PROJECT: "$(_BUILD_PROJECT)" != "$(BUILD_PROJECT)"]
326#! endif
327#! endif
328#! if "$(BUILD_ENV)" != "$(BUILD_ENV_FORCE)"
329#! if [echo debug - BUILD_ENV: "$(BUILD_ENV)" != "$(BUILD_ENV_FORCE)"]
330#! endif
331#! endif
332#! if "$(BUILD_ENVS_PRE)" != ""
333#! if [echo debug - BUILD_ENVS_PRE: "$(BUILD_ENVS_PRE)" != ""]
334#! endif
335#! endif
336#! if "$(BUILD_ENVS_POST)" != ""
337#! if [echo debug - BUILD_ENVS_POST: "$(BUILD_ENVS_POST)" != ""]
338#! endif
339#! endif
340#! endif
341
342
[8423]343# set the secret _build_project env.var.
[9047]344# Note: This 'SET' operation doesn't allways work as designed.
345# Therefore we have a workaround in the forwarder statement which makes
346# sure that the internal variable is set. The problem seems to be to
347# create new environment variables.
348! if "$(_BUILD_PROJECT)" != "$(BUILD_PROJECT)"
349! if [SET _BUILD_PROJECT=$(BUILD_PROJECT)]
350! endif
[8423]351! endif
[8294]352
353# Compiler change or just environment change.
354! if "$(BUILD_ENV)" != "$(BUILD_ENV_FORCE)"
355MAKE_INCLUDE_SETUP_FORCE = $(PATH_MAKE)\setup.$(SHT_TRGPLTFRM)$(SHT_BLDMD)$(SHT_BLDENVFRC).mk
356! ifndef BUILD_QUIET
[8715]357! ifndef MAKEVER
358! if [$(ECHO) Including forced platform setup file $(CLRFIL)$(MAKE_INCLUDE_SETUP_FORCE)$(CLRRST)]
359! endif
360! else
361$(ECHO) Including forced platform setup file $(CLRFIL)$(MAKE_INCLUDE_SETUP_FORCE)$(CLRRST)
[8294]362! endif
363! endif
364! include $(MAKE_INCLUDE_SETUP_FORCE)
[8423]365! ifdef ENV_16BIT
366BUILD_ENVS_CHANGE = $(ENV_ENVS: =- )- $(BUILD_ENVS_BASE_PRE_16) $(BUILD_ENVS_PRE) $(ENV_ENVS_FORCE) $(BUILD_ENVS_BASE_POST_16) $(BUILD_ENVS_POST)
367! else
[8294]368BUILD_ENVS_CHANGE = $(ENV_ENVS: =- )- $(BUILD_ENVS_BASE_PRE) $(BUILD_ENVS_PRE) $(ENV_ENVS_FORCE) $(BUILD_ENVS_BASE_POST) $(BUILD_ENVS_POST)
[8423]369! endif
[8294]370! else
[8423]371! ifdef ENV_16BIT
372BUILD_ENVS_CHANGE = $(BUILD_ENVS_BASE_PRE_16) $(BUILD_ENVS_PRE) $(ENV_ENVS) $(BUILD_ENVS_BASE_POST_16) $(BUILD_ENVS_POST)
373! else
[8294]374BUILD_ENVS_CHANGE = $(BUILD_ENVS_BASE_PRE) $(BUILD_ENVS_PRE) $(ENV_ENVS) $(BUILD_ENVS_BASE_POST) $(BUILD_ENVS_POST)
[8423]375! endif
[8294]376! endif
377
[9150]378!endif # BUILD_FORWARDING
[8294]379
Note: See TracBrowser for help on using the repository browser.