source: trunk/make/setup.mak@ 8197

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

Moved from tools\make.

File size: 4.4 KB
Line 
1# $Id: setup.mak,v 1.1 2002-04-06 20:25:05 bird Exp $
2
3#
4# Unix-like tools for OS/2
5#
6# Setting up the build environment variables
7#
8#
9
10
11!ifndef MAKE_SETUP_INCLUDED
12MAKE_SETUP_INCLUDED=YES
13
14
15
16# -----------
17# Directories
18# -----------
19
20# Note: external makefiles are supposed to set the
21# correct *RELATIVE* path to the projects root.
22# PATH_ROOT= .., ..\.., whatever
23!ifndef PATH_ROOT
24!error fatal error: PATH_ROOT undefined.
25!endif
26
27PATH_CURRENT=$(MAKEDIR)
28PATH_MAKE=$(PATH_ROOT)\tools\make
29PATH_TOOLS=$(PATH_ROOT)\tools\bin
30PATH_INCLUDE=$(PATH_ROOT)\include;$(PATH_ROOT)\include\win
31PATH_BIN=$(PATH_ROOT)\bin\$(BUILD_MODE)
32PATH_LIB=$(PATH_ROOT)\lib\$(BUILD_MODE)
33PATH_DLL=$(PATH_ROOT)\bin\$(BUILD_MODE)
34PATH_SYS=$(PATH_ROOT)\bin\$(BUILD_MODE)
35PATH_DOC=$(PATH_ROOT)\bin\$(BUILD_MODE)
36
37BUILD_TIMESTAMP=$(TIMESTAMP)
38
39
40# -----------------------------------------------------------------------
41# Common variables
42# We provide some variables that can be overridden by the specific setups
43# -----------------------------------------------------------------------
44
45TOOL_MAKE=$(MAKE) -nologo
46
47
48# ----------------------
49# Build the environments
50# ----------------------
51
52# BUILD_PLATFORM: OS2, WIN32, ...
53# BUILD_ENV: VAC308, VAC365, VAC4, EMX, MSC6, WATCOM
54# BUILD_MODE: RELEASE, PROFILE, DEBUG
55
56!ifndef BUILD_PLATFORM
57!error Please set BUILD_PLATFORM to OS2, WIN32, ...
58!endif
59
60!ifndef BUILD_MODE
61!error Please set BUILD_MODE to RELEASE, PROFILE, or DEBUG
62!endif
63
64!ifndef BUILD_ENV
65!error Please set BUILD_ENV to VAC308, VAC365, VAC4, EMX, MSVC6, ...
66!endif
67
68
69# ----------------------
70# Build the environments
71# ----------------------
72
73# Build the appropriate setup.xxx name from the BUILD environment variables.
74
75!if "$(BUILD_PLATFORM)" == "OS2"
76NAME_1=os2
77!endif
78!if "$(BUILD_PLATFORM)" == "WIN32"
79NAME_1=win32
80!endif
81!if "$(NAME_1)" == ""
82! error The current setting of BUILD_PLATFORM is unknown or incorrect ($(BUILD_PLATFORM)) (1)
83!endif
84
85
86!if "$(BUILD_MODE)" == "RELEASE"
87NAME_2=rel
88!endif
89!if "$(BUILD_MODE)" == "DEBUG"
90NAME_2=deb
91!endif
92!if "$(BUILD_MODE)" == "PROFILE"
93NAME_2=prf
94!endif
95!if "$(NAME_2)" == ""
96! error The current setting of BUILD_MODE is unknown or incorrect ($(BUILD_MODE)) (2)
97!endif
98
99
100!if "$(BUILD_ENV)" == "VAC308"
101NAME_3=vac308
102!endif
103!if "$(BUILD_ENV)" == "VAC365"
104NAME_3=vac365
105!endif
106!if "$(BUILD_ENV)" == "VAC4"
107NAME_3=vac4
108!endif
109!if "$(BUILD_ENV)" == "EMX"
110NAME_3=emx
111!endif
112!if "$(BUILD_ENV)" == "MSCV6"
113NAME_3=mscv6
114!endif
115!if "$(BUILD_ENV)" == "WATCOM"
116NAME_3=wat11
117!endif
118!if "$(NAME_3)" == ""
119! error The current setting of BUILD_ENV is unknown or incorrect ($(BUILD_ENV)) (3)
120!endif
121
122
123# build name from the fragments
124!include <$(PATH_MAKE)\setup.tools.mk>
125MAKE_INCLUDE_SETUP=$(PATH_MAKE)\setup.$(NAME_1)$(NAME_2)$(NAME_3).mk
126!if [$(ECHO) Including platform setup file $(CLRFIL)"$(MAKE_INCLUDE_SETUP)"$(CLRRST)]
127!endif
128!include <$(MAKE_INCLUDE_SETUP)>
129
130# set the path name for platform-specific generated files.
131PATH_OBJ=$(PATH_ROOT)\obj\$(NAME_1)$(NAME_2)$(NAME_3)
132
133# set the path name for platform-specific definitino files.
134PATH_DEF=
135
136# ensure this path exists
137!if "$(PATH_OBJ)" != ""
138! if [$(TOOL_EXISTS) $(PATH_OBJ)] != 0
139! if [$(ECHO) Target path $(PATH_OBJ) does NOT exist. Creating. $(CLRRST)]
140! endif
141! if [$(TOOL_CREATEPATH) $(PATH_OBJ)]
142! error Could not create $(PATH_OBJ)
143! endif
144! endif
145!endif
146
147
148# -----------------------
149# Verify the environments
150# Note: "foreach" is not used to provide compatibility with older NMAKEs.
151# -----------------------
152
153!ifndef ENV_NAME
154!error No environment signature has been defined ($(NAME_COMPLETE))
155!endif
156
157!ifndef MAKE_INCLUDE_SETUP
158!error No setup to include has been determined (MAKE_INCLUDE_SETUP)
159!endif
160
161!if "$(ENV_STATUS)" != "OK"
162!error Environment $(ENV_NAME) does work yet (ENV_STATUS is not OK).
163!endif
164
165!ifndef CC
166!error Environment $(ENV_NAME) does not define variable (CC).
167!endif
168
169!ifndef CD
170!error Environment $(ENV_NAME) does not define variable (CD).
171!endif
172
173!ifndef CC_FLAGS_EXE
174!error Environment $(ENV_NAME) does not define variable (CC_FLAGS_EXE).
175!endif
176
177!ifndef LINK
178!error Environment $(ENV_NAME) does not define variable (LINK).
179!endif
180
181!ifndef LINK_FLAGS_EXE
182!error Environment $(ENV_NAME) does not define variable (LINK_FLAGS_EXE).
183!endif
184
185
186# -----------------------------------------
187# Now we setup some final, common variables
188# -----------------------------------------
189MAKE_INCLUDE_PROCESS=$(PATH_MAKE)\process.mak
190
191
192!endif MAKE_SETUP_INCLUDED
Note: See TracBrowser for help on using the repository browser.