source: trunk/make/process.forwarder.mak@ 10366

Last change on this file since 10366 was 9904, checked in by bird, 22 years ago

others. full source path to compilers.

File size: 7.2 KB
Line 
1# $Id: process.forwarder.mak,v 1.18 2003-03-05 15:10:07 bird Exp $
2#
3# Generic Buildsystem
4#
5# The common build process rules for all cases
6# where are forwarding the request to another environment setup.
7#
8#
9# Copyright (c) 2002 knut st. osmundsen <bird@anduin.net>
10#
11# This file is part of Generic Buildsystem.
12#
13
14
15# -----------------------------------------------------------------------------
16# Assertions.
17# This makefile expects setup.mak and the specific setup to be included
18# already.
19# It also requires the TARGET_NAME to be specified in the makefile.
20# -----------------------------------------------------------------------------
21!if "$(MAKE_SETUP_INCLUDED)" != "YES"
22!error Fatal error: You must include setup.mak before process.mak in the makefile.
23!endif
24!if "$(ENV_STATUS)" != "OK"
25!error Fatal error: The environment is not valid. Bad setup.mak?
26!endif
27
28!if "$(TARGET_NAME)" == "" && "$(TARGET_MODE)" != "EMPTY" && "$(TARGET_MODE)" != "DEPEND"
29!error Fatal error: TARGET_NAME is not defined! Should be set in the makefile.
30!endif
31
32# -----------------------------------------------------------------------------
33# Set necessary defaults.
34# -----------------------------------------------------------------------------
35
36# just make it shut up for now.
37TARGET = process.forwarder.mak
38
39# Default makefile names.
40!ifndef BUILD_MAKEFILE
41BUILD_MAKEFILE = Makefile
42!endif
43
44# Default makefile name.
45!ifndef MAKEFILE
46MAKEFILE = $(BUILD_MAKEFILE)
47!endif
48
49
50# -----------------------------------------------------------------------------
51# Tell user what we're doing.
52# -----------------------------------------------------------------------------
53!ifndef BUILD_QUIET
54! ifndef MAKEVER
55! if [$(ECHO) Forwarding to another (shell) environment setup...$(CLRRST)]
56! endif
57! else
58$(ECHO) Forwarding to another (shell) environment setup...$(CLRRST)
59! endif
60!endif
61
62
63# -----------------------------------------------------------------------------
64# Common inference rules
65# -----------------------------------------------------------------------------
66
67.SUFFIXES:
68.SUFFIXES: .c .cpp .asm .$(EXT_OBJ) .rc .$(EXT_RES) .ii .s .ipp .ipf .$(EXT_INF) .$(EXT_HLP)
69
70
71# Assembling assembly source.
72.asm{$(PATH_TARGET)}.$(EXT_OBJ):
73 \
74!ifndef BUILD_VERBOSE
75 @ \
76!endif
77 $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
78
79.asm.$(EXT_OBJ):
80 \
81!ifndef BUILD_VERBOSE
82 @ \
83!endif
84 $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
85
86
87# Compiling C++ source.
88.cpp{$(PATH_TARGET)}.$(EXT_OBJ):
89 \
90!ifndef BUILD_VERBOSE
91 @ \
92!endif
93 $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
94
95.cpp.$(EXT_OBJ):
96 \
97!ifndef BUILD_VERBOSE
98 @ \
99!endif
100 $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
101
102
103# Pre-Compiling C++ source.
104.cpp.ii:
105 \
106!ifndef BUILD_VERBOSE
107 @ \
108!endif
109 $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
110
111
112# Compiler C++ source to assembly.
113.cpp.s:
114 \
115!ifndef BUILD_VERBOSE
116 @ \
117!endif
118 $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
119
120
121# Compiling C source.
122.c{$(PATH_TARGET)}.$(EXT_OBJ):
123 \
124!ifndef BUILD_VERBOSE
125 @ \
126!endif
127 $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
128
129.c.$(EXT_OBJ):
130 \
131!ifndef BUILD_VERBOSE
132 @ \
133!endif
134 $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
135
136
137# Pre-Compiling C source.
138.c.ii:
139 \
140!ifndef BUILD_VERBOSE
141 @ \
142!endif
143 $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
144
145
146# Compiler C source to assembly.
147.c.s:
148 \
149!ifndef BUILD_VERBOSE
150 @ \
151!endif
152 $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
153
154
155# Compiling resources.
156.rc{$(PATH_TARGET)}.$(EXT_RES):
157 \
158!ifndef BUILD_VERBOSE
159 @ \
160!endif
161 $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
162
163.rc.res:
164 \
165!ifndef BUILD_VERBOSE
166 @ \
167!endif
168 $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
169
170
171# Compiling INFs.
172.ipf{$(PATH_TARGET)}.$(EXT_INF):
173 \
174!ifndef BUILD_VERBOSE
175 @ \
176!endif
177 $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
178
179.ipf.inf:
180 \
181!ifndef BUILD_VERBOSE
182 @ \
183!endif
184 $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
185
186
187# Compiling INFs with pre-compiling
188.ipp{$(PATH_TARGET)}.$(EXT_INF):
189 \
190!ifndef BUILD_VERBOSE
191 @ \
192!endif
193 $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
194
195.ipp.inf:
196 \
197!ifndef BUILD_VERBOSE
198 @ \
199!endif
200 $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
201
202
203# Compiling HLPs
204.ipf{$(PATH_TARGET)}.$(EXT_HLP):
205 \
206!ifndef BUILD_VERBOSE
207 @ \
208!endif
209 $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
210
211.ipf.hlp:
212 \
213!ifndef BUILD_VERBOSE
214 @ \
215!endif
216 $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
217
218
219# Compiling HLPs with pre-compiling
220.ipp{$(PATH_TARGET)}.$(EXT_HLP):
221 \
222!ifndef BUILD_VERBOSE
223 @ \
224!endif
225 $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
226
227.ipp.hlp:
228 \
229!ifndef BUILD_VERBOSE
230 @ \
231!endif
232 $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
233
234
235
236
237# -----------------------------------------------------------------------------
238# The all rule - The default one, as it's the first rule in the file.
239# -----------------------------------------------------------------------------
240all: build
241
242
243
244# -----------------------------------------------------------------------------
245# Generic forwarder
246# -----------------------------------------------------------------------------
247build rebuild clean dep needed lib binary misc \
248!if "$(TARGET_MODE)" == "DEPEND"
249$(TARGET) \
250!endif
251$(TARGET_ILIB) \
252$(RULES_FORWARD) \
253$(OTHERS) \
254publish publish_target testcase nothing target others packing \
255pass1 pass2 pass3 pass4 pass5 pass6 quick \
256# obsoletes:
257miscellaneous executable :
258 \
259!ifndef BUILD_VERBOSE
260 @ \
261!endif
262!ifndef _BUILD_PROJECT # workaround for buggy SET implementation in NMAKE.
263 echo . && SET _BUILD_PROJECT=$(BUILD_PROJECT) && \
264!endif
265 $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
266
267
268# -----------------------------------------------------------------------------
269# The shell rule - Setup the correcte shell environment and start a shell.
270# -----------------------------------------------------------------------------
271shell:
272 \
273!ifndef BUILD_VERBOSE
274 @ \
275!endif
276!ifndef _BUILD_PROJECT # workaround for buggy SET implementation in NMAKE.
277 echo . && SET _BUILD_PROJECT=$(BUILD_PROJECT) && \
278!endif
279 $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(COMSPEC)
280
281
282
283# -----------------------------------------------------------------------------
284# The $(TARGET) rule - For EMPTY & DEPEND targets.
285# -----------------------------------------------------------------------------
286!if "$(TARGET_MODE)" == "DEPEND"
287$(TARGET):
288 @$(ECHO) .
289!endif
290
291
292
293# -----------------------------------------------------------------------------
294# The .force rule - Force a remake of something everytime.
295# -----------------------------------------------------------------------------
296.force:
297 \
298!ifndef BUILD_VERBOSE
299 @$(ECHO) .
300!else
301 @$(ECHO) . (force) .
302!endif
303
Note: See TracBrowser for help on using the repository browser.