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