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
RevLine 
[8291]1# $Id: setup.mak,v 1.4 2002-04-22 00:28:46 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
[8253]63!if "$(BUILD_ENV)" == "WAT11"
64SHT_BLDENV=wat11
65!endif
[8197]66!if "$(BUILD_ENV)" == "WATCOM"
[8253]67SHT_BLDENV=wat11
[8197]68!endif
[8253]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
[8197]71!endif
72
73
[8253]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)
[8291]101# Where the virtual dos drivers goes.
102PATH_VDD = $(PATH_ROOT)\bin\$(BUILD_MODE)
[8253]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.
[8197]117!endif
118
119
[8253]120# -----------------------------------------------------------------------------
121# Common variables / Project variables
122# -----------------------------------------------------------------------------
[8197]123
[8253]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
[8291]172! if [$(ECHO) Including platform setup file $(CLRFIL)$(MAKE_INCLUDE_SETUP)$(CLRRST)]
[8197]173! endif
174!endif
[8253]175!include $(MAKE_INCLUDE_SETUP)
[8197]176
177
[8253]178# -----------------------------------------------------------------------------
179# Verify the environment setups.
180# -----------------------------------------------------------------------------
[8197]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
[8253]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
[8197]225
226
227!endif MAKE_SETUP_INCLUDED
[8253]228
Note: See TracBrowser for help on using the repository browser.