source: trunk/make/setup.mak@ 8291

Last change on this file since 8291 was 8291, checked in by bird, 23 years ago

PATH_VDD. We don't quote filenames anylonger, we color them. :)

File size: 6.6 KB
Line 
1# $Id: setup.mak,v 1.4 2002-04-22 00:28:46 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)" == "WAT11"
64SHT_BLDENV=wat11
65!endif
66!if "$(BUILD_ENV)" == "WATCOM"
67SHT_BLDENV=wat11
68!endif
69!if "$(SHT_BLDENV)" == ""
70! error Fatal error: Env.var BUILD_ENV is either unspecified or incorrect. ($(BUILD_MODE)) Valid values: VAC308, VAC365, VAC4, EMX, MSCV6 and WATCOM
71!endif
72
73
74
75# -----------------------------------------------------------------------------
76# Directories
77# -----------------------------------------------------------------------------
78
79# current directory.
80PATH_CURRENT = $(MAKEDIR)
81# Where build system files are located. (like this file)
82PATH_MAKE = $(PATH_ROOT)\make
83# Where the bulid system and other tools are located
84PATH_TOOLS = $(PATH_ROOT)\tools\bin
85# Where platform-specific files are located. (like the .def files)
86# (default) PATH_DEF = $(SHT_TRGPLTFRM)
87PATH_DEF = .
88# Where the include files are located.
89PATH_INCLUDES = $(PATH_ROOT)\include;$(PATH_ROOT)\include\win
90
91# Where the temporary files goes.
92PATH_OBJ = $(PATH_ROOT)\obj\$(SHT_TRGPLTFRM)$(SHT_BLDMD)$(SHT_BLDENV)
93# Where the executable binaries goes.
94PATH_BIN = $(PATH_ROOT)\bin\$(BUILD_MODE)
95# Where the public libraries goes.
96PATH_LIB = $(PATH_ROOT)\lib\$(BUILD_MODE)
97# Where the dynamic link libraries goes.
98PATH_DLL = $(PATH_ROOT)\bin\$(BUILD_MODE)
99# Where the drivers goes. (common for IFS and SYS.)
100PATH_SYS = $(PATH_ROOT)\bin\$(BUILD_MODE)
101# Where the virtual dos drivers goes.
102PATH_VDD = $(PATH_ROOT)\bin\$(BUILD_MODE)
103# Where the documentation goes.
104PATH_DOC = $(PATH_ROOT)\bin\$(BUILD_MODE)
105# Where the helpfiles goes.
106PATH_HLP = $(PATH_ROOT)\bin\$(BUILD_MODE)
107
108
109# Note: Makefiles are supposed to set the correct *RELATIVE* path to the
110# projects root. Using '\' slashes please. No trailing slash.
111#
112# Example:
113# PATH_ROOT= ..\..\..
114# Assert PATH_ROOT
115!if "$(PATH_ROOT)" == ""
116!error fatal error: PATH_ROOT empty or undefined.
117!endif
118
119
120# -----------------------------------------------------------------------------
121# Common variables / Project variables
122# -----------------------------------------------------------------------------
123
124# The default definitions.
125BUILD_DEFINES = -D__WIN32OS2__ -D__WINE__ -D__i386__
126
127# This is the process file to include at end of the makefile.
128MAKE_INCLUDE_PROCESS = $(PATH_MAKE)\process.mak
129
130
131
132# -----------------------------------------------------------------------------
133# Build the environments
134# -----------------------------------------------------------------------------
135
136# EXPERIMENTAL
137!if 0
138# These strings are passed on to the BuildEnv.cmd script to setup
139# the correct environment.
140BUILD_ENVS_BASE_POST = toolkit40
141BUILD_ENVS_BASE_PRE =
142
143# Check for forced change in default compiler environment.
144!ifdef BUILD_ENV_FORCE
145!if "$(BUILD_ENV)" != "$(BUILD_ENV_FORCE)" || "$(BUILD_ENVS_PRE)" != "" || "$(BUILD_ENVS_POST)" != ""
146#
147# Remove old compiler and insert new compiler into the environment.
148# The individual makefiles requests changes using BUILD_ENVS_[PRE|POST].
149#
150!if [echo call $(PATH_TOOLS)\BuildEnv.cmd $(BUILD_ENV)- $(BUILD_ENVS_BASE_PRE) $(BUILD_ENVS_PRE) $(BUILD_ENV_FORCE) $(BUILD_ENVS_BASE_POST) $(BUILD_ENVS_POST)]
151!endif
152!if [call $(PATH_TOOLS)\BuildEnv.cmd $(BUILD_ENV)- $(BUILD_ENVS_BASE_PRE) $(BUILD_ENVS_PRE) $(BUILD_ENV_FORCE) $(BUILD_ENVS_BASE_POST) $(BUILD_ENVS_POST)]
153!endif
154#BUILD_ENV = $(BUILD_ENV_FORCE)
155!endif
156!endif
157
158!endif
159
160
161
162# -----------------------------------------------------------------------------
163# Include the setup.
164# First the default common tools setup is included.
165# The the environment specific setup.
166# -----------------------------------------------------------------------------
167
168!include $(PATH_MAKE)\setup.tools.mk
169
170MAKE_INCLUDE_SETUP = $(PATH_MAKE)\setup.$(SHT_TRGPLTFRM)$(SHT_BLDMD)$(SHT_BLDENV).mk
171!ifndef BUILD_QUIET
172! if [$(ECHO) Including platform setup file $(CLRFIL)$(MAKE_INCLUDE_SETUP)$(CLRRST)]
173! endif
174!endif
175!include $(MAKE_INCLUDE_SETUP)
176
177
178# -----------------------------------------------------------------------------
179# Verify the environment setups.
180# -----------------------------------------------------------------------------
181
182!ifndef ENV_NAME
183!error No environment signature has been defined ($(NAME_COMPLETE))
184!endif
185
186!ifndef MAKE_INCLUDE_SETUP
187!error No setup to include has been determined (MAKE_INCLUDE_SETUP)
188!endif
189
190!if "$(ENV_STATUS)" != "OK"
191!error Environment $(ENV_NAME) does work yet (ENV_STATUS is not OK).
192!endif
193
194!ifndef CC
195!error Environment $(ENV_NAME) does not define variable (CC).
196!endif
197
198!ifndef CC_FLAGS_EXE
199!error Environment $(ENV_NAME) does not define variable (CC_FLAGS_EXE).
200!endif
201
202!ifndef LINK
203!error Environment $(ENV_NAME) does not define variable (LINK).
204!endif
205
206!ifndef LINK_FLAGS_EXE
207!error Environment $(ENV_NAME) does not define variable (LINK_FLAGS_EXE).
208!endif
209
210
211# -----------------------------------------------------------------------------
212# Ensure the output path exists
213# -----------------------------------------------------------------------------
214!if "$(PATH_OBJ)" != ""
215! if [$(TOOL_EXISTS) $(PATH_OBJ)] != 0
216! ifndef BUILD_QUIET
217! if [$(ECHO) Target path $(PATH_OBJ) does NOT exist. Creating. $(CLRRST)]
218! endif
219! endif
220! if [$(TOOL_CREATEPATH) $(PATH_OBJ)]
221! error Fatal error: Could not create $(PATH_OBJ).
222! endif
223! endif
224!endif
225
226
227!endif MAKE_SETUP_INCLUDED
228
Note: See TracBrowser for help on using the repository browser.