source: trunk/make/process.mak@ 21787

Last change on this file since 21787 was 10493, checked in by bird, 22 years ago

InnoTek GCC.

File size: 54.1 KB
RevLine 
[10493]1# $Id: process.mak,v 1.40 2004-03-08 19:56:42 bird Exp $
[8197]2#
[9280]3# Generic Buildsystem
[8197]4#
5# The common build process rules
6#
[9280]7# Copyright (c) 2001-2002 knut st. osmundsen <bird@anduin.net>
8# Copyright (c) 2001 Patrick Haller
[8197]9#
[9280]10# This file is part of Generic Buildsystem.
11#
[8197]12
13
[8253]14# -----------------------------------------------------------------------------
15# Assertions.
16# This makefile expects setup.mak and the specific setup to be included
17# already.
18# It also requires the TARGET_NAME to be specified in the makefile.
19# -----------------------------------------------------------------------------
[8714]20!if "$(MAKE_SETUP_INCLUDED)" != "YES"
21! ifndef MAKEVER
22! if [$(ECHO) $(CLRERR)Fatal error: You must include setup.mak before process.mak in the makefile.$(CLRRST)]
23! endif
24! error
25!else
26! error $(CLRERR)Fatal error: You must include setup.mak before process.mak in the makefile.$(CLRRST)
[8197]27!endif
[8714]28!endif
[8253]29!if "$(ENV_STATUS)" != "OK"
[8714]30! ifndef MAKEVER
31! if [$(ECHO) $(CLRERR)Fatal error: The environment is not valid. Bad setup.mak?$(CLRRST)]
32! endif
33! error
34! else
35! error $(CLRERR)Fatal error: The environment is not valid. Bad setup.mak?$(CLRRST)
[8423]36! endif
[8253]37!endif
[8197]38
[8423]39!if "$(TARGET_NAME)" == "" && "$(TARGET_MODE)" != "EMPTY"
[8714]40! ifndef MAKEVER
41! if [$(ECHO) $(CLRERR)Fatal error: TARGET_NAME is not defined! Should be set in the makefile.$(CLRRST)]
42! endif
43! error
44! else
45! error $(CLRERR)Fatal error: TARGET_NAME is not defined! Should be set in the makefile.$(CLRRST)
[8423]46! endif
[8253]47!endif
48
[8290]49!ifdef TARGET_MODE
50# Executable target mode.
51! if "$(TARGET_MODE)" != "EXE"
52# Dynamic Load Library target mode.
53! if "$(TARGET_MODE)" != "DLL"
54# Drive (/ system software) target mode.
[8423]55! if "$(TARGET_MODE)" != "SYS"
[8290]56# Installable File System Drive target mode. (Also called FSD, File System Driver.)
[8423]57! if "$(TARGET_MODE)" != "IFS"
[8290]58# Virtual Device Driver target mode.
[8423]59! if "$(TARGET_MODE)" != "VDD"
[8290]60# Object Library target mode.
[8423]61! if "$(TARGET_MODE)" != "LIB"
[8290]62# Object Library target mode - Special variant which is to be linked with a SYS target.
[8423]63! if "$(TARGET_MODE)" != "SYSLIB"
[8290]64# Object Library target mode - Special variant which is to be linked with an IFS target.
[8423]65! if "$(TARGET_MODE)" != "IFSLIB"
[8290]66# Dummy/Hub/TopLevel empty makefile. This has no target.
[8423]67! if "$(TARGET_MODE)" != "EMPTY"
[9028]68# Dependency only makefile. (typical for include directories)
69! if "$(TARGET_MODE)" != "DEPEND"
70# Testcase makefile.
71! if "$(TARGET_MODE)" != "TESTCASE"
72# Bad TARGET_MODE complain.
73! ifndef MAKEVER
[9127]74! if [$(ECHO) $(CLRERR)Fatal Error: Bad TARGET_MODE="$(TARGET_MODE)". Valid ones are: EXE, DLL, SYS, IFS, VDD, LIB, SYSLIB, IFSLIB, DEPEND, TESTCASE and EMPTY.$(CLRRST)]
[9028]75! endif
76! error
77! else
[9127]78! error $(CLRERR)Fatal Error: Bad TARGET_MODE="$(TARGET_MODE)". Valid ones are: EXE, DLL, SYS, IFS, VDD, LIB, SYSLIB, IFSLIB, DEPEND, TESTCASE and EMPTY.$(CLRRST)
[8714]79! endif
80! endif
[8290]81! endif
82! endif
83! endif
84! endif
85! endif
86! endif
87! endif
88! endif
89! endif
90! endif
91!endif
92
[9127]93# stuff which has changed behavior.
94!if 1
[8290]95
[9127]96! ifdef TARGET_PUBNAME
97! if [$(ECHO) $(CLRERR)Fatal error: TARGET_PUBNAME isn't supported. The pubname stuff has changed!$(CLRRST)]
98! endif
99! error
100! endif
101
102! ifdef PATH_INCLUDE
103! if [$(ECHO) $(CLRERR)Fatal error: PATH_INCLUDE has changed name to PATH_INCLUDES!$(CLRRST)]
104! endif
105! error
106! endif
107
108!endif
109
110
111
[8253]112# -----------------------------------------------------------------------------
113# Provide overridable defaults
114# -----------------------------------------------------------------------------
115
116# Default target mode is executable.
117!ifndef TARGET_MODE
[9135]118! if "$(_BUILD_PROJECT)" != "Odin32"
[8253]119TARGET_MODE = EXE
[9116]120! else
121# Odin32 defaults.
122! ifndef CUSTOMBUILD
123TARGET_MODE = DLL
124! else
125TARGET_MODE = LIB
126! endif
127! endif
[8253]128!endif
129
130# Default extension corresponds to the target mode.
131!ifndef TARGET_EXT
[8423]132! if "$(TARGET_MODE)" == "DLL"
[8253]133TARGET_EXT = $(EXT_DLL)
134! endif
135! if "$(TARGET_MODE)" == "SYS"
136TARGET_EXT = $(EXT_SYS)
137! endif
[8290]138! if "$(TARGET_MODE)" == "IFS"
139TARGET_EXT = $(EXT_IFS)
140! endif
141! if "$(TARGET_MODE)" == "VDD"
142TARGET_EXT = $(EXT_VDD)
143! endif
[8253]144! if "$(TARGET_MODE)" == "EXE"
145TARGET_EXT = $(EXT_EXE)
146! endif
[8290]147! if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFSLIB"
[8253]148TARGET_EXT = $(EXT_LIB)
149! endif
150! if "$(TARGET_MODE)" == "EMPTY"
151TARGET_EXT = empty
152! endif
[9028]153! if "$(TARGET_MODE)" == "DEPEND"
154TARGET_EXT = depend
155! endif
[8714]156! if "$(TARGET_MODE)" == "TESTCASE"
157TARGET_EXT = testcase
158! endif
[8253]159! ifndef TARGET_EXT
[8714]160! ifndef MAKEVER
161! if [$(ECHO) $(CLRERR)Internal Error: TARGET_EXT not set. Probably invalid TARGET_MODE. (TARGET_MODE="$(TARGET_MODE)")$(CLRRST)]
162! endif
163! error
164! else
165! error $(CLRERR)Internal Error: TARGET_EXT not set. Probably invalid TARGET_MODE. (TARGET_MODE="$(TARGET_MODE)")$(CLRRST)
[8423]166! endif
[8253]167! endif
168!endif
169
170# Default target path. (where all the generated stuff for this target goes)
171!ifndef PATH_TARGET
[9127]172!if "$(TARGET_SUB)" != ""
173PATH_TARGET = $(PATH_OBJ)\$(TARGET_SUB)\$(TARGET_NAME).$(TARGET_EXT)
174!else
[8253]175PATH_TARGET = $(PATH_OBJ)\$(TARGET_NAME).$(TARGET_EXT)
176!endif
[9127]177!endif
[8253]178
179# Default target file. (output)
[8197]180!ifndef TARGET
[8270]181! if "$(TARGET_MODE)" != "EMPTY"
[8714]182! if "$(TARGET_MODE)" != "TESTCASE"
[8253]183TARGET = $(PATH_TARGET)\$(TARGET_NAME).$(TARGET_EXT)
[8714]184! else
185TARGET = testcase
186! endif
[8270]187! endif
[8197]188!endif
189
[8333]190# Default target .sym file. (output)
191!ifndef TARGET_SYM
192TARGET_SYM = $(PATH_TARGET)\$(TARGET_NAME).$(EXT_SYM)
193!endif
[8270]194
[8253]195# Default object file. (output)
[8197]196!ifndef TARGET_OBJS
[8253]197TARGET_OBJS = $(PATH_TARGET)\$(TARGET_NAME).$(EXT_OBJ)
[8197]198!endif
199
[8253]200# Default libraries. (input)
[8197]201!ifndef TARGET_LIBS
[8253]202TARGET_LIBS = $(LIB_C_DLL) $(LIB_OS) $(LIB_C_RTDLL)
[8197]203!endif
204
[8253]205# Default definition file. (input)
[8197]206!ifndef TARGET_DEF
[8253]207TARGET_DEF = $(MAKEDIR)\$(PATH_DEF)\$(TARGET_NAME).def
[8197]208!endif
209
[8333]210# Default modified definition filename. (output)
211!ifndef TARGET_DEF_LINK
212TARGET_DEF_LINK = $(PATH_TARGET)\$(TARGET_NAME)_link.def
213!endif
214
[8253]215# Default definition file for generating the import library. (input)
[8197]216!ifndef TARGET_IDEF
[9135]217! if "$(_BUILD_PROJECT)" != "Odin32"
[8253]218TARGET_IDEF = $(TARGET_DEF)
[9116]219! else
[9135]220! if defined(TARGET_IDEF_CONV) || "$(TARGET_IDEF_ORG)" != ""
[9116]221TARGET_IDEF = $(PATH_TARGET)\$(TARGET_NAME)_implib.def
[9135]222! ifndef TARGET_IDEF_ORG
[9116]223TARGET_IDEF_ORG = $(TARGET_DEF)
[9135]224! endif
[9116]225! else
226TARGET_IDEF = $(TARGET_DEF)
227TARGET_IDEF_ORG = $(TARGET_DEF)
228! endif
229! endif
[9135]230
[8197]231!endif
232
[8253]233# Default map file. (output)
[8197]234!ifndef TARGET_MAP
[8333]235TARGET_MAP = $(PATH_TARGET)\$(TARGET_NAME).$(EXT_MAP)
[8197]236!endif
237
[8253]238# Default link file. (output)
[8197]239!ifndef TARGET_LNK
[8253]240TARGET_LNK = $(PATH_TARGET)\$(TARGET_NAME).lnk
[8197]241!endif
242
[8253]243# Default import library file. (output)
244!ifndef TARGET_ILIB
[9090]245! if "$(TARGET_MODE)" == "DLL" || "$(TARGET_ILIB_YES)" != ""
[9127]246TARGET_ILIB = $(PATH_LIB)\$(TARGET_NAME).$(EXT_ILIB)
[8253]247! endif
[8197]248!endif
249
[9127]250# Default public base directory. (publish)
251!ifndef TARGET_PUB_BASE
[9224]252! if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFSLIB"
253TARGET_PUB_BASE = $(PATH_LIB)
254! else
[9127]255TARGET_PUB_BASE = $(PATH_PUB)
256!endif
[9224]257!endif
[9127]258
259# Default public base directory for unstripped release version.
260!ifndef TARGET_PUB_BASE_DEB
261! if "$(BUILD_MODE)" == "RELEASE" && "$(TARGET_MODE:LIB=...)" == "$(TARGET_MODE)"
262! if "$(TARGET_MODE)" == "EXE" || "$(TARGET_MODE)" == "DLL" || "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "VDD"
263TARGET_PUB_BASE_DEB = $(PATH_PUB_DEB)
[8290]264! endif
[9127]265! endif
266!endif
267
268# Default sub directory.
269!ifndef TARGET_PUB_SUB
270! if "$(TARGET_SUB)" != ""
271TARGET_PUB_SUB = $(TARGET_SUB)
272! else
[8290]273! if "$(TARGET_MODE)" == "EXE"
[9127]274TARGET_PUB_SUB = $(PATH_SUB_BIN)
[8290]275! endif
[8423]276! if "$(TARGET_MODE)" == "DLL"
[9127]277TARGET_PUB_SUB = $(PATH_SUB_DLL)
[8290]278! endif
[9127]279! if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFSLIB"
[9224]280TARGET_PUB_SUB = .
[9127]281! endif
[8290]282! if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "IFS"
[9127]283TARGET_PUB_SUB = $(PATH_SUB_SYS)
[8290]284! endif
285! if "$(TARGET_MODE)" == "VDD"
[9127]286TARGET_PUB_SUB = $(PATH_SUB_VDD)
[8290]287! endif
[8253]288! endif
[8197]289!endif
[8253]290
[9127]291# Default public directory.
292!ifndef TARGET_PUB_DIR
293TARGET_PUB_DIR = $(TARGET_PUB_BASE)\$(TARGET_PUB_SUB)
294!endif
295
296# Default unstripped public directory.
297!if !defined(TARGET_PUB_DIR_DEB) && "$(TARGET_PUB_BASE_DEB)" != ""
298TARGET_PUB_DIR_DEB = $(TARGET_PUB_BASE_DEB)\$(TARGET_PUB_SUB)
299!endif
300
301# Default public name.
302!ifndef TARGET_PUB_NAME
303TARGET_PUB_NAME = $(TARGET_NAME)
304!endif
305
306# Default public ext.
307!ifndef TARGET_PUB_EXT
308TARGET_PUB_EXT = $(TARGET_EXT)
309!endif
310
311# Default public full name.
312!ifndef TARGET_PUB
313TARGET_PUB = $(TARGET_PUB_DIR)\$(TARGET_PUB_NAME).$(TARGET_PUB_EXT)
314!endif
315
316# Default public full name of unstripped version.
317!if !defined(TARGET_PUB_DEB) && "$(TARGET_PUB_DIR_DEB)" != ""
318TARGET_PUB_DEB = $(TARGET_PUB_DIR_DEB)\$(TARGET_PUB_NAME).$(TARGET_PUB_EXT)
319!endif
320
[10438]321# Target publish no.2
322
323!if defined(TARGET_PUB2_BASE) || defined(TARGET_PUB2_BASE_DEB) || defined(TARGET_PUB2_SUB) \
324 || defined(TARGET_PUB2_DIR) || defined(TARGET_PUB2_DIR_DEB) || defined(TARGET_PUB2_NAME) \
325 || defined(TARGET_PUB2_EXT) || defined(TARGET_PUB2)
326
327# Default public base directory. (publish)
328! ifndef TARGET_PUB2_BASE
329! if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFSLIB"
330TARGET_PUB2_BASE = $(PATH_LIB)
331! else
332TARGET_PUB2_BASE = $(PATH_PUB)
333! endif
334! endif
335
336# Default public base directory for unstripped release version.
337! ifndef TARGET_PUB2_BASE_DEB
338! if "$(BUILD_MODE)" == "RELEASE" && "$(TARGET_MODE:LIB=...)" == "$(TARGET_MODE)"
339! if "$(TARGET_MODE)" == "EXE" || "$(TARGET_MODE)" == "DLL" || "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "VDD"
340TARGET_PUB2_BASE_DEB = $(PATH_PUB2_DEB)
341! endif
342! endif
343! endif
344
345# Default sub directory.
346! ifndef TARGET_PUB2_SUB
347! if "$(TARGET_SUB)" ! = ""
348TARGET_PUB2_SUB = $(TARGET_SUB)
349! else
350! if "$(TARGET_MODE)" == "EXE"
351TARGET_PUB2_SUB = $(PATH_SUB_BIN)
352! endif
353! if "$(TARGET_MODE)" == "DLL"
354TARGET_PUB2_SUB = $(PATH_SUB_DLL)
355! endif
356! if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFSLIB"
357TARGET_PUB2_SUB = .
358! endif
359! if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "IFS"
360TARGET_PUB2_SUB = $(PATH_SUB_SYS)
361! endif
362! if "$(TARGET_MODE)" == "VDD"
363TARGET_PUB2_SUB = $(PATH_SUB_VDD)
364! endif
365! endif
366! endif
367
368# Default public directory.
369! ifndef TARGET_PUB2_DIR
370TARGET_PUB2_DIR = $(TARGET_PUB2_BASE)\$(TARGET_PUB2_SUB)
371! endif
372
373# Default unstripped public directory.
374! if ! defined(TARGET_PUB2_DIR_DEB) && "$(TARGET_PUB2_BASE_DEB)" != ""
375TARGET_PUB2_DIR_DEB = $(TARGET_PUB2_BASE_DEB)\$(TARGET_PUB2_SUB)
376! endif
377
378# Default public name.
379! ifndef TARGET_PUB2_NAME
380TARGET_PUB2_NAME = $(TARGET_NAME)
381! endif
382
383# Default public ext.
384! ifndef TARGET_PUB2_EXT
385TARGET_PUB2_EXT = $(TARGET_EXT)
386! endif
387
388# Default public full name.
389! ifndef TARGET_PUB2
390TARGET_PUB2 = $(TARGET_PUB2_DIR)\$(TARGET_PUB2_NAME).$(TARGET_PUB2_EXT)
391! endif
392
393# Default public full name of unstripped version.
394! if !defined(TARGET_PUB2_DEB) && "$(TARGET_PUB2_DIR_DEB)" != ""
395TARGET_PUB2_DEB = $(TARGET_PUB2_DIR_DEB)\$(TARGET_PUB2_NAME).$(TARGET_PUB2_EXT)
396! endif
397
398!endif # pub2
399
[9275]400# Default public book dirs
401!ifndef TARGET_BOOK_PUB_BASE
402TARGET_BOOK_PUB_BASE = $(PATH_PUB)
403!endif
404!ifndef TARGET_BOOK_PUB_SUB
405TARGET_BOOK_PUB_SUB = $(PATH_SUB_BOOK)
406!endif
407!ifndef TARGET_BOOK_PUB_DIR
408TARGET_BOOK_PUB_DIR = $(TARGET_BOOK_PUB_BASE)\$(TARGET_BOOK_PUB_SUB)
409!endif
410
411# Default public help dirs
412!ifndef TARGET_HELP_PUB_BASE
413TARGET_HELP_PUB_BASE = $(PATH_PUB)
414!endif
415!ifndef TARGET_HELP_PUB_SUB
416TARGET_HELP_PUB_SUB = $(PATH_SUB_HELP)
417!endif
418!ifndef TARGET_HELP_PUB_DIR
419TARGET_HELP_PUB_DIR = $(TARGET_HELP_PUB_BASE)\$(TARGET_HELP_PUB_SUB)
420!endif
421
422# Default public docs dirs
423!ifndef TARGET_DOC_PUB_BASE
424TARGET_DOC_PUB_BASE = $(PATH_PUB)
425!endif
426!ifndef TARGET_DOC_PUB_SUB
427TARGET_DOC_PUB_SUB = $(PATH_SUB_DOC)
428!endif
429!ifndef TARGET_DOC_PUB_DIR
430TARGET_DOC_PUB_DIR = $(TARGET_DOC_PUB_BASE)\$(TARGET_DOC_PUB_SUB)
431!endif
432
[8253]433# Default depend filename.
434!ifndef TARGET_DEPEND
435TARGET_DEPEND = $(PATH_TARGET)\.depend
[8197]436!endif
437
[8423]438# Default makefile names.
439!ifndef BUILD_MAKEFILE
440BUILD_MAKEFILE = Makefile
441!endif
442
[8253]443# Default makefile name.
444!ifndef MAKEFILE
[8423]445MAKEFILE = $(BUILD_MAKEFILE)
[8197]446!endif
447
[8253]448# Ignore linker warnings for some target modes.
449!ifndef TARGET_IGNORE_LINKER_WARNINGS
[8423]450! if "$(TARGET_MODE)" == "DLL"
[8253]451TARGET_IGNORE_LINKER_WARNINGS = 1
[10493]452! else
453TARGET_IGNORE_LINKER_WARNINGS = 0
[8253]454! endif
[8197]455!endif
456
457
[8253]458# Default stacksize
[8355]459# If 16bit: 8KB
460# Else (32bit): 64KB
[8197]461!ifndef TARGET_STACKSIZE
[8355]462! ifdef ENV_16BIT
[8197]463TARGET_STACKSIZE=0x2000
464! else
465TARGET_STACKSIZE=0x10000
466! endif
467!endif
468
[8253]469
470
471# -----------------------------------------------------------------------------
[9127]472# Internal helper macros - don't mess!
473# -----------------------------------------------------------------------------
474
475# Helper for doing early publish of a target.
476!if defined(TARGET_NEEDED) || defined(TARGET_PUBLIC)
477_TARGET_EARLY_PUBLISH = publish_target
478!else
479_TARGET_EARLY_PUBLISH =
480!endif
481
482# The unstripped release name (internal!)
483_TARGET_DEB = $(TARGET).unstripped
484
485
486
487# -----------------------------------------------------------------------------
[8253]488# Tell user what we're building.
489# -----------------------------------------------------------------------------
490!ifndef BUILD_QUIET
[9044]491! if "$(TARGET)" != ""
492! ifndef MAKEVER
493! if [$(ECHO) Target is $(CLRFIL)$(TARGET)$(CLRRST)]
494! endif
495! else
496$(ECHO) Target is $(CLRFIL)$(TARGET)$(CLRRST)
[8714]497! endif
498! endif
[8197]499!endif
500
501
[8253]502# -----------------------------------------------------------------------------
503# Ensure the platform-specific target path exists
504# -----------------------------------------------------------------------------
505
506!if "$(TARGET_MODE)" != "EMPTY"
507! if "$(PATH_TARGET)" != ""
[8714]508! ifndef MAKEVER
509! if [$(TOOL_EXISTS) $(PATH_TARGET)] != 0
510! ifndef BUILD_QUIET
511! if [$(ECHO) Target path $(CLRFIL)$(PATH_TARGET)$(CLRTXT) does NOT exist. Creating. $(CLRRST)]
512! endif
[8253]513! endif
[8714]514! if [$(TOOL_CREATEPATH) $(PATH_TARGET)]
515! if [$(ECHO) $(CLRERR)Error: Could not create $(CLRFIL)$(PATH_TARGET)$(CLRRST)]
516! endif
517! error
518! endif
[8253]519! endif
[8714]520! else
521! if %exist($(PATH_TARGET)) == 0
522! ifndef BUILD_QUIET
523$(ECHO) Target path $(CLRFIL)$(PATH_TARGET)$(CLRTXT) does NOT exist. Creating. $(CLRRST)
[8423]524! endif
[8714]525! else
526! if [$(TOOL_CREATEPATH) $(PATH_TARGET)]
527! error $(CLRERR)Error: Could not create $(CLRFIL)$(PATH_TARGET)$(CLRRST)
528! endif
[8253]529! endif
[8197]530! endif
531! endif
532!endif
[8253]533# not 100% sure about the != EMPTY stuff, but this is way faster.
[8197]534
535
[9135]536# -----------------------------------------------------------------------------
537# Make all targets 'unprecious'. (works only on nmake5)
538# -----------------------------------------------------------------------------
539.PRECIOUS: .force
[8197]540
[9135]541
[8253]542# -----------------------------------------------------------------------------
543# Common inference rules
544# -----------------------------------------------------------------------------
[8197]545.SUFFIXES:
[9275]546.SUFFIXES: .c .cpp .orc .asm .$(EXT_OBJ) .$(EXT_RES) .rc .ii .s .ipp .ipf .$(EXT_INF) .$(EXT_HLP)
[8197]547
[8714]548#
549# A workaround for SlickEdits inability to find the buggy files..
550# This makes the source filenames in the error listing have full path.
551# See setup.mak for compile command line.
552#
[9904]553#_SRC = $<
554#!ifdef SLKRUNS
[9919]555_SRC = $(PATH_CURRENT)\$(<F)
[9904]556#!endif
[9165]557_DST = $(PATH_TARGET)\$(@F)
[8197]558
[8714]559
[8197]560# Assembling assembly source.
561.asm{$(PATH_TARGET)}.$(EXT_OBJ):
[8714]562 @$(ECHO) Assembling $(CLRFIL)$(_SRC) $(CLRTXT)$(TOOL_JOB_SUB_MSG) $(CLRRST)
563 \
[8423]564! ifndef BUILD_VERBOSE
[8290]565 @ \
[8423]566! endif
[8213]567!if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB"
[9165]568! ifdef AS_CMD_SYS
569 $(TOOL_JOB_SUB) $(AS_CMD_SYS)
570! else
571 $(TOOL_JOB_SUB) $(AS) $(AS_FLAGS_SYS) $(_SRC) $(AS_OBJ_OUT)$(_DST)
572! endif
[8197]573!else
[9165]574! ifdef AS_CMD
575 $(TOOL_JOB_SUB) $(AS_CMD)
576! else
577 $(TOOL_JOB_SUB) $(AS) $(AS_FLAGS) $(_SRC) $(AS_OBJ_OUT)$(_DST)
578! endif
[8197]579!endif
580
581.asm.$(EXT_OBJ):
[8714]582 @$(ECHO) Assembling $(CLRFIL)$(_SRC) $(CLRRST)
583 \
[8290]584!ifndef BUILD_VERBOSE
585 @ \
586!endif
[8213]587!if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB"
[9165]588! ifdef AS_CMD_SYS
589 $(AS_CMD_SYS)
590! else
591 $(AS) $(AS_FLAGS_SYS) $(_SRC) $(AS_OBJ_OUT)$(_DST)
592! endif
[8197]593!else
[9165]594! ifdef AS_CMD
595 $(AS_CMD)
596! else
597 $(AS) $(AS_FLAGS) $(_SRC) $(AS_OBJ_OUT)$(_DST)
598! endif
[8197]599!endif
600
[8714]601# C++ Compiler base line
602_CXX_BASELINE = $(CXX) \
[8290]603!if "$(TARGET_MODE)" == "EXE" || "$(TARGET_MODE)" == "LIB"
[8197]604 $(CXX_FLAGS_EXE) \
605!endif
606!if "$(TARGET_MODE)" == "DLL"
607 $(CXX_FLAGS_DLL) \
608!endif
609!if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB"
610 $(CXX_FLAGS_SYS) \
611!endif
[8213]612!if "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB"
613 $(CXX_FLAGS_IFS) \
614!endif
[8714]615
616# Compiling C++ source.
617.cpp{$(PATH_TARGET)}.$(EXT_OBJ):
618 @$(ECHO) C++ Compiler $(CLRFIL)$(_SRC) $(CLRTXT)$(TOOL_JOB_SUB_MSG) $(CLRRST)
619 \
620!ifndef BUILD_VERBOSE
621 @ \
622!endif
623 $(TOOL_JOB_SUB) $(_CXX_BASELINE) \
[8253]624!if "$(CXX_LST_OUT)" != ""
[8213]625 $(CXX_LST_OUT)$(PATH_TARGET)\$(@B).s \
626!endif
[9165]627 $(CXX_OBJ_OUT)$(_DST) $(_SRC)
[8197]628
629.cpp.$(EXT_OBJ):
[8714]630 @$(ECHO) C++ Compiler $(CLRFIL)$(_SRC) $(CLRRST)
631 \
[8290]632!ifndef BUILD_VERBOSE
633 @ \
634!endif
[8714]635 $(_CXX_BASELINE) \
[8253]636!if "$(CXX_LST_OUT)" != ""
[8213]637 $(CXX_LST_OUT)$(PATH_TARGET)\$(@B).s \
638!endif
[9165]639 $(CXX_OBJ_OUT)$(_DST) $(_SRC)
[8197]640
641
642# Pre-Compiling C++ source.
[8714]643.cpp.ii:
644 @$(ECHO) C++ Compiler $(CLRFIL)$(_SRC) $(CLRRST)
645 \
[8290]646!ifndef BUILD_VERBOSE
647 @ \
648!endif
[8714]649 $(_CXX_BASELINE) \
650 $(CXX_PC_2_STDOUT) $(_SRC) > $@
[8197]651
652
[8714]653# Compiler C++ source to assembly.
654!if "$(CXX_AS_2_FILE)" != ""
655.cpp.s:
656 @$(ECHO) C++ To Assembly $(CLRFIL)$(_SRC) $(CLRRST)
657 \
[8290]658!ifndef BUILD_VERBOSE
659 @ \
660!endif
[8714]661 $(_CXX_BASELINE) \
662 $(CXX_AS_2_FILE)$@ $(_SRC)
663!endif
664
665
666
667# C Compiler base line
668_CC_BASELINE = $(CC) \
[8290]669!if "$(TARGET_MODE)" == "EXE" || "$(TARGET_MODE)" == "LIB"
[8197]670 $(CC_FLAGS_EXE) \
671!endif
672!if "$(TARGET_MODE)" == "DLL"
673 $(CC_FLAGS_DLL) \
674!endif
675!if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB"
676 $(CC_FLAGS_SYS) \
677!endif
[8213]678!if "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB"
679 $(CC_FLAGS_IFS) \
680!endif
[10155]681!if "$(TARGET_MODE)" == "VDD"
682 $(CC_FLAGS_VDD) \
683!endif
[8714]684
685# Compiling C source.
686.c{$(PATH_TARGET)}.$(EXT_OBJ):
687 @$(ECHO) C Compiler $(CLRFIL)$(_SRC) $(CLRTXT)$(TOOL_JOB_SUB_MSG) $(CLRRST)
688 \
689!ifndef BUILD_VERBOSE
690 @ \
691!endif
692 $(TOOL_JOB_SUB) $(_CC_BASELINE) \
[8253]693!if "$(CC_LST_OUT)" != ""
[8213]694 $(CC_LST_OUT)$(PATH_TARGET)\$(@B).s \
695!endif
[9165]696 $(CC_OBJ_OUT)$(_DST) $(_SRC)
[8197]697
698.c.$(EXT_OBJ):
[8714]699 @$(ECHO) C Compiler $(CLRFIL)$(_SRC) $(CLRRST)
700 \
[8290]701!ifndef BUILD_VERBOSE
702 @ \
703!endif
[8714]704 $(_CC_BASELINE) \
[8253]705!if "$(CC_LST_OUT)" != ""
[8213]706 $(CC_LST_OUT)$(PATH_TARGET)\$(@B).s \
707!endif
[9165]708 $(CC_OBJ_OUT)$(_DST) $(_SRC)
[8197]709
710
711# Pre-Compiling C source.
[8714]712.c.ii:
713 @$(ECHO) C PreCompiler $(CLRFIL)$(_SRC) $(CLRRST)
714 \
[8290]715!ifndef BUILD_VERBOSE
716 @ \
717!endif
[8714]718 $(_CC_BASELINE) \
719 $(CC_PC_2_STDOUT) $(_SRC) > $@
720
721
722# Compiler C source to assembly.
723!if "$(CC_AS_2_FILE)" != ""
724.c.s:
725 @$(ECHO) C To Assembly $(CLRFIL)$(_SRC) $(CLRRST)
726 \
727!ifndef BUILD_VERBOSE
728 @ \
[8197]729!endif
[8714]730 $(_CC_BASELINE) \
731 $(CC_AS_2_FILE)$@ $(_SRC)
[8197]732!endif
733
734
735# Compiling resources.
736.rc{$(PATH_TARGET)}.res:
[8714]737 @$(ECHO) RC Compiler $(CLRFIL)$(_SRC) $(CLRTXT)$(TOOL_JOB_SUB_MSG)$(CLRRST)
738 \
[8290]739!ifndef BUILD_VERBOSE
740 @ \
741!endif
[10155]742 $(TOOL_JOB_SUB) $(RC) $(RC_FLAGS) $(_SRC) $(RC_RES_OUT)$(_DST)
[8197]743
744.rc.res:
[8714]745 @$(ECHO) RC Compiler $(CLRFIL)$(_SRC) $(CLRRST)
746 \
[8290]747!ifndef BUILD_VERBOSE
748 @ \
749!endif
[10155]750 $(RC) $(RC_FLAGS) $(_SRC) $(RC_RES_OUT)$(_DST)
[8197]751
752
[9116]753# Compiling Odin32 resources.
754.orc{$(PATH_TARGET)}.obj:
755 @$(ECHO) ORC Compiler $(CLRFIL)$(_SRC) $(CLRTXT)$(TOOL_JOB_SUB_MSG)$(CLRRST)
756 \
757!ifndef BUILD_VERBOSE
758 @ \
759!endif
760 $(ORC) $(ORC_FLAGS) $(ORC_ASM_OUT)$(PATH_TARGET)\$(@B).asm $(_SRC)
761 \
762!ifndef BUILD_VERBOSE
763 @ \
764!endif
[9165]765 $(AS) $(AS_FLAGS) $(PATH_TARGET)\$(@B).asm $(AS_OBJ_OUT)$(_DST)
[8253]766
[9116]767.orc.obj:
768 @$(ECHO) ORC Compiler $(CLRFIL)$(_SRC) $(CLRRST)
769 \
770!ifndef BUILD_VERBOSE
771 @ \
772!endif
773 $(ORC) $(ORC_FLAGS) $(ORC_ASM_OUT)$(PATH_TARGET)\$(@B).asm $(_SRC)
774 \
775!ifndef BUILD_VERBOSE
776 @ \
777!endif
[9165]778 $(AS) $(AS_FLAGS) $(PATH_TARGET)\$(@B).asm $(AS_OBJ_OUT)$(_DST)
[8253]779
780
[9275]781# Compiling INFs.
782.ipf{$(PATH_TARGET)}.$(EXT_INF):
783 @$(ECHO) BOOK Compiler $(CLRFIL)$(_SRC)$(CLRRST)
784 \
785!ifndef BUILD_VERBOSE
786 @ \
787!endif
788 $(INFC_CMD)
[9116]789
[9275]790.ipf.inf:
791 @$(ECHO) BOOK Compiler $(CLRFIL)$(_SRC)$(CLRRST)
792 \
793!ifndef BUILD_VERBOSE
794 @ \
795!endif
796 $(INFC_CMD)
[9116]797
798
[9275]799# Compiling INFs with pre-compiling
800.ipp{$(PATH_TARGET)}.$(EXT_INF):
801 @$(ECHO) CC Pre + BOOK Compiler $(CLRFIL)$(_SRC)$(CLRRST)
802!ifndef CC_PC_2_STRIPPED_STDOUT
803 $(TOOL_ECHO) $(CLRERR)fatal error: CC_PC_2_STRIPPED_STDOUT isn't supported on this compiler. $(CLRRST) && false
804!endif
805 \
806!ifndef BUILD_VERBOSE
807 @ \
808!endif
809 $(INFC_CMD_PRE)
810
811.ipp.inf:
812 @$(ECHO) CC Pre + BOOK Compiler $(CLRFIL)$(_SRC)$(CLRRST)
813!ifndef CC_PC_2_STRIPPED_STDOUT
814 $(TOOL_ECHO) $(CLRERR)fatal error: CC_PC_2_STRIPPED_STDOUT isn't supported on this compiler. $(CLRRST) && false
815!endif
816 \
817!ifndef BUILD_VERBOSE
818 @ \
819!endif
820 $(INFC_CMD_PRE)
821
822
823# Compiling HLPs
824.ipf{$(PATH_TARGET)}.$(EXT_HLP):
825 @$(ECHO) HELP Compiler $(CLRFIL)$(_SRC)$(CLRRST)
826 \
827!ifndef BUILD_VERBOSE
828 @ \
829!endif
830 $(HLPC_CMD)
831
832.ipf.hlp:
833 @$(ECHO) HELP Compiler $(CLRFIL)$(_SRC)$(CLRRST)
834 \
835!ifndef BUILD_VERBOSE
836 @ \
837!endif
838 $(HLPC_CMD)
839
840
841# Compiling HLPs with pre-compiling
842.ipp{$(PATH_TARGET)}.$(EXT_HLP):
843 @$(ECHO) CC Pre + HELP Compiler $(CLRFIL)$(_SRC)$(CLRRST)
844!ifndef CC_PC_2_STRIPPED_STDOUT
845 $(TOOL_ECHO) $(CLRERR)fatal error: CC_PC_2_STRIPPED_STDOUT isn't supported on this compiler. $(CLRRST) && false
846!endif
847 \
848!ifndef BUILD_VERBOSE
849 @ \
850!endif
851 $(HLPC_CMD_PRE)
852
853.ipp.hlp:
854 @$(ECHO) CC Pre + HELP Compiler $(CLRFIL)$(_SRC)$(CLRRST)
855!ifndef CC_PC_2_STRIPPED_STDOUT
856 $(TOOL_ECHO) $(CLRERR)fatal error: CC_PC_2_STRIPPED_STDOUT isn't supported on this compiler. $(CLRRST) && false
857!endif
858 \
859!ifndef BUILD_VERBOSE
860 @ \
861!endif
862 $(HLPC_CMD_PRE)
863
864
865
[8253]866# -----------------------------------------------------------------------------
867# The all rule - The default one, as it's the first rule in the file.
868# -----------------------------------------------------------------------------
[8197]869all: build
870
871
[8253]872
873# -----------------------------------------------------------------------------
[9031]874# The build rule - This runs all passes:
875# 1. Make Dependencies
[9090]876# 2. Make Needed Tools (stuff required in the next steps)
877# 3. Make Libraries (all kinds)
[9275]878# 4. Make Binaries (ie. executable files)
[9090]879# 5. Make Miscellaneous Targets
880# 6. Make Install
[9031]881# Note: In order to load dependencies we'll do a forwarding after making them.
[8253]882# -----------------------------------------------------------------------------
[9031]883build: _build
884!if "$(MAKEFLAGS:I=_)" == "$(MAKEFLAGS)" # this is of course broken in nmake v5.0 for OS/2.
885 @$(ECHO)$(CLRMAK)[Successfully Built Everything!] $(CLRRST)
886!else
887 @$(ECHO)$(CLRMAK)[Built Everything! (Ignore option specified)] $(CLRRST)
888!endif
889
890# internal rule shared by rebuild and build.
891_build: _build_banner_dep dep
892!ifndef BUILD_QUIET
893 @$(ECHO) Restarting $(CLRFIL)$(MAKEFILE)$(CLRTXT) with new dependencies. $(CLRRST)
894!endif
895 \
896!ifndef BUILD_VERBOSE
897 @ \
898!endif
899 $(TOOL_MAKE) -f $(MAKEFILE) _build_new_dependencies_
900
901# internal rule used to reload dependencies.
902_build_new_dependencies_: \
[9090]903 _build_banner_needed needed \
[9031]904 _build_banner_lib lib \
[9275]905 _build_banner_binary binary \
906 _build_banner_misc misc \
[9127]907 _build_banner_publish publish
[9031]908
[9228]909
[9031]910# Banners for rebuild and build.
911_build_banner_clean:
912 @$(ECHO)$(CLRMAK)[Start Pass 0 - Make Clean] $(CLRRST)
913 @SET _BUILD_PASS=0
914_build_banner_dep:
915 @$(ECHO)$(CLRMAK)[Start Pass 1 - Make Dependencies] $(CLRRST)
916 @SET _BUILD_PASS=1
[9090]917_build_banner_needed:
918 @$(ECHO)$(CLRMAK)[Start Pass 2 - Make Needed Tools] $(CLRRST)
919 @SET _BUILD_PASS=2
[9031]920_build_banner_lib:
[9090]921 @$(ECHO)$(CLRMAK)[Start Pass 3 - Make Libraries] $(CLRRST)
922 @SET _BUILD_PASS=3
[9275]923_build_banner_binary:
924 @$(ECHO)$(CLRMAK)[Start Pass 4 - Make Binaries] $(CLRRST)
[9090]925 @SET _BUILD_PASS=4
[9275]926_build_banner_misc:
[9090]927 @$(ECHO)$(CLRMAK)[Start Pass 5 - Make Miscellaneous Targets] $(CLRRST)
928 @SET _BUILD_PASS=5
[9127]929_build_banner_publish:
930 @$(ECHO)$(CLRMAK)[Start Pass 6 - Make Public (i.e. Publish)] $(CLRRST)
[9090]931 @SET _BUILD_PASS=6
[9031]932
933
934
935# -----------------------------------------------------------------------------
936# The rebuild rule - Same as build but does a clean first (as Pass 0).
937# -----------------------------------------------------------------------------
938rebuild: \
939 _build_banner_clean clean \
940 _build
941!if "$(MAKEFLAGS:i=_)" == "$(MAKEFLAGS)"
942 @$(ECHO)$(CLRMAK)[Successfully Rebuilt Everything!] $(CLRRST)
943!else
944 @$(ECHO)$(CLRMAK)[Rebuilt Everything! (Ignore option specified)] $(CLRRST)
945!endif
946
947
948
949# -----------------------------------------------------------------------------
[9228]950# A number of shortcuts for lazy programmers.
951# -----------------------------------------------------------------------------
952pass1: build
953
954pass2: _build_new_dependencies_
955
956pass3: _build_banner_lib lib \
[9275]957 _build_banner_binary binary \
958 _build_banner_misc misc \
[9228]959 _build_banner_publish publish
960
[9275]961pass4: _build_banner_binary binary \
962 _build_banner_misc misc \
[9228]963 _build_banner_publish publish
964
[9275]965pass5: _build_banner_misc misc \
[9228]966 _build_banner_publish publish
967
968pass6: _build_banner_publish publish
969
970quick: _build_banner_lib lib \
[9275]971 _build_banner_binary binary \
[9228]972 _build_banner_publish publish
973
974
975
976# -----------------------------------------------------------------------------
[9031]977# Pass 0 - The clean rule - Clean up output files.
[9127]978# The current setup doesn't clean the published ones.
[9031]979# -----------------------------------------------------------------------------
980!if "$(TARGET_MODE)" != "TESTCASE"
981clean:
982 @$(ECHO) Cleaning... $(CLRRST)
983 \
984! ifndef BUILD_VERBOSE
985 @ \
986! endif
[9116]987 $(TOOL_RM) @<<
988"$(PATH_TARGET)\*.$(EXT_OBJ)"
989"$(PATH_TARGET)\*.$(EXT_ILIB)"
990"$(PATH_TARGET)\*.$(EXT_EXE)"
991"$(PATH_TARGET)\*.$(EXT_DLL)"
992"$(PATH_TARGET)\*.$(EXT_RES)"
993"$(PATH_TARGET)\*.$(EXT_SYS)"
994"$(PATH_TARGET)\*.$(EXT_LIB)"
995"$(PATH_TARGET)\*.$(EXT_IFS)"
996"$(PATH_TARGET)\*.$(EXT_MAP)"
997"$(PATH_TARGET)\*.$(EXT_SYM)"
998"$(PATH_TARGET)\*.$(EXT_DEF)"
999"$(PATH_TARGET)\*.s"
1000"$(PATH_TARGET)\*.lst"
1001"$(PATH_TARGET)\*.lnk"
1002"$(PATH_TARGET)\*.ii"
1003"$(PATH_TARGET)\.depend"
1004"$(TARGET_DEPEND)"
1005.\*.ii
1006.\*.err
1007.\.depend
1008<<
[9090]1009!ifdef SUBDIRS_CLEAN
1010 @$(TOOL_DODIRS) "$(SUBDIRS_CLEAN)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) NODEP=1 $@
1011!else
[9275]1012! if "$(SUBDIRS)$(SUBDIRS_NEEDED)$(SUBDIRS_LIB)$(SUBDIRS_BINARY)$(SUBDIRS_MISC)" != ""
1013 @$(TOOL_DODIRS) "$(SUBDIRS) $(SUBDIRS_NEEDED) $(SUBDIRS_LIB) $(SUBDIRS_BINARY) $(SUBDIRS_MISC)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) NODEP=1 $@
[9090]1014! endif
[8197]1015!endif
[9090]1016!ifdef PREMAKEFILES_CLEAN
1017 @$(TOOL_DOMAKES) "$(PREMAKEFILES_CLEAN)" $(TOOL_MAKE) NODEP=1 $@
1018!else
[9275]1019! if "$(PREMAKEFILES)$(PREMAKEFILES_NEEDED)$(PREMAKEFILES_LIB)$(PREMAKEFILES_BINARY)$(PREMAKEFILES_MISC)" != ""
1020 @$(TOOL_DOMAKES) "$(PREMAKEFILES) $(PREMAKEFILES_NEEDED) $(PREMAKEFILES_LIB) $(PREMAKEFILES_BINARY) $(PREMAKEFILES_MISC)" $(TOOL_MAKE) NODEP=1 $@
[9090]1021! endif
[9031]1022!endif
[9090]1023!ifdef POSTMAKEFILES_CLEAN
1024 @$(TOOL_DOMAKES) "$(POSTMAKEFILES_CLEAN)" $(TOOL_MAKE) NODEP=1 $@
1025!else
[9275]1026! if "$(POSTMAKEFILES)$(POSTMAKEFILES_NEEDED)$(POSTMAKEFILES_LIB)$(POSTMAKEFILES_BINARY)$(POSTMAKEFILES_MISC)" != ""
1027 @$(TOOL_DOMAKES) "$(POSTMAKEFILES) $(POSTMAKEFILES_NEEDED) $(POSTMAKEFILES_LIB) $(POSTMAKEFILES_BINARY) $(POSTMAKEFILES_MISC)" $(TOOL_MAKE) NODEP=1 $@
[9090]1028! endif
[9031]1029!endif
[9090]1030
[9031]1031!endif #!TESTCASE
[8197]1032
[9031]1033
1034
1035# -----------------------------------------------------------------------------
1036# Pass 1 - The dep rule - Make dependencies.
1037# -----------------------------------------------------------------------------
1038dep:
[9044]1039!if "$(TARGET_MODE)" != "EMPTY" && "$(TARGET_MODE)" != "TESTCASE"
[9031]1040 @$(ECHO) Making dependencies... $(CLRRST)
1041 \
[9044]1042! ifndef BUILD_VERBOSE
[9031]1043 @ \
[9044]1044! endif
[9240]1045 $(TOOL_DEP) \
[9031]1046! ifdef TARGET_NO_DEP
1047 -x$(TARGET_NO_DEP: =;)\
1048! endif
[10324]1049 @<<$(TARGET_DEPEND).rsp
[9240]1050$(TOOL_DEP_FLAGS)
1051-o$$(PATH_TARGET)
1052-d$(TARGET_DEPEND)
1053-srcadd AS:$$(MAKE_INCLUDE_AS_SETUP)
1054-srcadd AS:$$(MAKE_INCLUDE_AS_OPT)
1055-srcadd RC:$$(MAKE_INCLUDE_RC_SETUP)
1056-srcadd ORC:$$(MAKE_INCLUDE_ORC_SETUP)
1057-srcadd CX:$$(MAKE_INCLUDE_SETUP)
1058-srcadd CX:$$(MAKE_INCLUDE_CX_OPT)
[9281]1059-srcadd IPF:$$(MAKE_INCLUDE_IPFC)
1060-srcadd IPP:$$(MAKE_INCLUDE_IPFC)
1061-srcadd IPP:$$(MAKE_INCLUDE_SETUP)
1062-srcadd IPP:$$(MAKE_INCLUDE_CX_OPT)
[9240]1063$(TOOL_DEP_FILES)
[10324]1064<<KEEP
1065!ifdef BUILD_VERBOSE
1066 @type $(TARGET_DEPEND).rsp
1067!endif
[9281]1068!ifdef BUILD_VERBOSE2
1069 $(ECHO) Dependcy file: $(CLRRST)
1070 @type $(TARGET_DEPEND)
[9031]1071!endif
[9281]1072!endif
[9090]1073!ifdef SUBDIRS_DEP
1074 @$(TOOL_DODIRS) "$(SUBDIRS_DEP)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) NODEP=1 $@
1075!else
[9275]1076! if "$(SUBDIRS)$(SUBDIRS_NEEDED)$(SUBDIRS_LIB)$(SUBDIRS_BINARY)$(SUBDIRS_MISC)" != ""
1077 @$(TOOL_DODIRS) "$(SUBDIRS) $(SUBDIRS_NEEDED) $(SUBDIRS_LIB) $(SUBDIRS_BINARY) $(SUBDIRS_MISC)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) NODEP=1 $@
[9090]1078! endif
[9031]1079!endif
[9090]1080!ifdef PREMAKEFILES_DEP
1081 @$(TOOL_DOMAKES) "$(PREMAKEFILES_DEP)" $(TOOL_MAKE) NODEP=1 $@
1082!else
[9275]1083! if "$(PREMAKEFILES)$(PREMAKEFILES_NEEDED)$(PREMAKEFILES_LIB)$(PREMAKEFILES_BINARY)$(PREMAKEFILES_MISC)" != ""
1084 @$(TOOL_DOMAKES) "$(PREMAKEFILES) $(PREMAKEFILES_NEEDED) $(PREMAKEFILES_LIB) $(PREMAKEFILES_BINARY) $(PREMAKEFILES_MISC)" $(TOOL_MAKE) NODEP=1 $@
[9090]1085! endif
[8197]1086!endif
[9090]1087!ifdef POSTMAKEFILES_DEP
1088 @$(TOOL_DOMAKES) "$(POSTMAKEFILES_DEP)" $(TOOL_MAKE) NODEP=1 $@
1089!else
[9275]1090! if "$(POSTMAKEFILES)$(POSTMAKEFILES_NEEDED)$(POSTMAKEFILES_LIB)$(POSTMAKEFILES_BINARY)$(POSTMAKEFILES_MISC)" != ""
1091 @$(TOOL_DOMAKES) "$(POSTMAKEFILES) $(POSTMAKEFILES_NEEDED) $(POSTMAKEFILES_LIB) $(POSTMAKEFILES_BINARY) $(POSTMAKEFILES_MISC)" $(TOOL_MAKE) NODEP=1 $@
[9090]1092! endif
[8197]1093!endif
1094
1095
[8253]1096
1097# -----------------------------------------------------------------------------
[9090]1098# Pass 2 - The needed rule - Make need tools.
1099# That is tools and stuff that is required for the next passes.
1100# WARNING! These tools and stuff shouldn't rely on libraries and other
1101# results of later passes.
[8253]1102# -----------------------------------------------------------------------------
[9090]1103!ifdef SUBDIRS_NEEDED
1104_SUBDIRS_NEEDED = _subdir_needed
1105$(_SUBDIRS_NEEDED):
1106 @$(TOOL_DODIRS) "$(SUBDIRS_NEEDED)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) needed
1107!else
1108! ifdef SUBDIRS
1109_SUBDIRS_NEEDED = _subdir_needed
1110$(_SUBDIRS_NEEDED):
1111 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) needed
1112! endif
1113!endif
1114
1115!ifdef PREMAKEFILES_NEEDED
1116_PREMAKEFILES_NEEDED = _premakefiles_needed
1117$(_PREMAKEFILES_NEEDED):
1118 @$(TOOL_DOMAKES) "$(PREMAKEFILES_NEEDED)" $(TOOL_MAKE) needed
1119!else
1120! ifdef PREMAKEFILES
1121_PREMAKEFILES_NEEDED = _premakefiles_needed
1122$(_PREMAKEFILES_NEEDED):
1123 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) needed
1124! endif
1125!endif
1126
[9127]1127!ifdef TARGET_NEEDED
[9090]1128needed: $(_SUBDIRS_NEEDED) $(_PREMAKEFILES_NEEDED) target
1129!else
1130needed: $(_SUBDIRS_NEEDED) $(_PREMAKEFILES_NEEDED)
1131!endif
1132!ifdef POSTMAKEFILES_NEEDED
1133 @$(TOOL_DOMAKES) "$(POSTMAKEFILES_NEEDED)" $(TOOL_MAKE) $@
1134!else
1135! ifdef POSTMAKEFILES
1136 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
1137! endif
1138!endif
1139
1140
1141
1142# -----------------------------------------------------------------------------
1143# Pass 3 - The lib rule - Make libraries.
1144# -----------------------------------------------------------------------------
1145!ifdef SUBDIRS_LIB
1146_SUBDIRS_LIB = _subdir_lib
1147$(_SUBDIRS_LIB):
1148 @$(TOOL_DODIRS) "$(SUBDIRS_LIB)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) lib
1149!else
1150! ifdef SUBDIRS
1151_SUBDIRS_LIB = _subdir_lib
1152$(_SUBDIRS_LIB):
[8423]1153 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) lib
[9090]1154! endif
[8197]1155!endif
1156
[9090]1157!ifdef PREMAKEFILES_LIB
1158_PREMAKEFILES_LIB = _premakefiles_lib
1159$(_PREMAKEFILES_LIB):
1160 @$(TOOL_DOMAKES) "$(PREMAKEFILES_LIB)" $(TOOL_MAKE) lib
1161!else
1162! ifdef PREMAKEFILES
1163_PREMAKEFILES_LIB = _premakefiles_lib
1164$(_PREMAKEFILES_LIB):
[8197]1165 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) lib
[9090]1166! endif
[8197]1167!endif
1168
[9090]1169lib: $(_SUBDIRS_LIB) $(_PREMAKEFILES_LIB) \
[9127]1170!if !defined(TARGET_NEEDED) && ("$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFSLIB")
1171 $(TARGET) $(_TARGET_EARLY_PUBLISH) \
[9031]1172!endif
1173 $(TARGET_ILIB)
[9090]1174!ifdef POSTMAKEFILES_LIB
1175 @$(TOOL_DOMAKES) "$(POSTMAKEFILES_LIB)" $(TOOL_MAKE) $@
1176!else
1177! ifdef POSTMAKEFILES
[9031]1178 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
[9090]1179! endif
[9031]1180!endif
1181
1182
1183
1184# -----------------------------------------------------------------------------
[9275]1185# Pass 4 - The binary rule - Build the binary.
[9031]1186# -----------------------------------------------------------------------------
[9275]1187!ifdef SUBDIRS_BINARY
1188_SUBDIRS_BINARY = _subdir_binary
1189$(_SUBDIRS_BINARY):
1190 @$(TOOL_DODIRS) "$(SUBDIRS_BINARY)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) binary
[9090]1191!else
1192! ifdef SUBDIRS
[9275]1193_SUBDIRS_BINARY = _subdir_binary
1194$(_SUBDIRS_BINARY):
1195 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) binary
[9090]1196! endif
[9031]1197!endif
1198
[9275]1199!ifdef PREMAKEFILES_BINARY
1200_PREMAKEFILES_BINARY = _premakefiles_binary
1201$(_PREMAKEFILES_BINARY):
1202 @$(TOOL_DOMAKES) "$(PREMAKEFILES_BINARY)" $(TOOL_MAKE) binary
[9090]1203!else
1204! ifdef PREMAKEFILES
[9275]1205_PREMAKEFILES_BINARY = _premakefiles_binary
1206$(_PREMAKEFILES_BINARY):
1207 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) binary
[9090]1208! endif
[9031]1209!endif
1210
[9275]1211binary executable: \
[9127]1212!if "$(TARGET_MODE)" != "LIB" && "$(TARGET_MODE)" != "SYSLIB" && "$(TARGET_MODE)" != "IFSLIB" && !defined(TARGET_NEEDED)
[9904]1213 $(_SUBDIRS_BINARY) $(_PREMAKEFILES_BINARY) $(TARGET) $(_TARGET_EARLY_PUBLISH) $(OTHERS)
[8290]1214!else
[9275]1215 $(_SUBDIRS_BINARY) $(_PREMAKEFILES_BINARY)
[8290]1216!endif
[9275]1217!ifdef POSTMAKEFILES_BINARY
1218 @$(TOOL_DOMAKES) "$(POSTMAKEFILES_BINARY)" $(TOOL_MAKE) $@
[9090]1219!else
1220! ifdef POSTMAKEFILES
[8197]1221 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
[9090]1222! endif
[8197]1223!endif
1224
1225
[8253]1226
1227# -----------------------------------------------------------------------------
[9275]1228# Pass 5 - The misc(ellaneous) rule - Makes miscellaneous stuff like
1229# help, documentations etc. This is experimental for the moment.
[9031]1230# -----------------------------------------------------------------------------
[9090]1231!ifdef SUBDIRS_MISC
1232_SUBDIRS_MISC = _subdir_misc
[9178]1233$(_SUBDIRS_MISC):
[9275]1234 @$(TOOL_DODIRS) "$(SUBDIRS_MISC)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) misc
[9090]1235!else
1236! ifdef SUBDIRS
1237_SUBDIRS_MISC = _subdir_misc
1238$(_SUBDIRS_MISC):
[9275]1239 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) misc
[9090]1240! endif
[9031]1241!endif
1242
[9090]1243!ifdef PREMAKEFILES_MISC
1244_PREMAKEFILES_MISC = _premakefiles_misc
[9031]1245$(PREMAKEFILES_MISC):
[9275]1246 @$(TOOL_DOMAKES) "$(PREMAKEFILES_MISC)" $(TOOL_MAKE) misc
[9090]1247!else
1248! ifdef PREMAKEFILES
1249_PREMAKEFILES_MISC = _premakefiles_misc
1250$(_PREMAKEFILES_MISC):
[9275]1251 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) misc
[9090]1252! endif
[9031]1253!endif
1254
[9275]1255misc miscellaneous: $(_SUBDIRS_MISC) $(_PREMAKEFILES_MISC) \
1256 $(TARGET_BOOKS) $(TARGET_HELPS) $(TARGET_DOCS) $(TARGET_MISC)
1257!if "$(TARGET_BOOKS)$(TARGET_HELPS)$(TARGET_DOCS)$(TARGET_MISC)" != ""
1258 @$(ECHO) Successfully Built $(CLRFIL)$(TARGET_BOOKS) $(TARGET_HELPS) $(TARGET_DOCS) $(TARGET_MISC)$(CLRRST)
[9090]1259!endif
1260!ifdef POSTMAKEFILES_MISC
1261 @$(TOOL_DOMAKES) "$(POSTMAKEFILES_MISC)" $(TOOL_MAKE) $@
[9031]1262!else
[9090]1263! ifdef POSTMAKEFILES
[9031]1264 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
[9090]1265! endif
[9031]1266!endif
1267
1268
1269
1270# -----------------------------------------------------------------------------
[9127]1271# Pass 6 - The publish rule - Copies target to main binary directory.
[8253]1272# Installation order is not concidered vital, so subdirectories and
[9127]1273# pre-makefiles are processed after this directory.
1274# However, this order might be changed!
[8253]1275# -----------------------------------------------------------------------------
[9127]1276!if "$(_TARGET_EARLY_PUBLISH)" != ""
1277publish:
1278!else
1279publish: publish_target
[8197]1280!endif
[9127]1281!ifdef SUBDIRS_PUBLISH
1282 @$(TOOL_DODIRS) "$(SUBDIRS_PUBLISH)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) $@
[9090]1283!else
1284! ifdef SUBDIRS
[8423]1285 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) $@
[9090]1286! endif
[8197]1287!endif
[9127]1288!ifdef PREMAKEFILES_PUBLISH
1289 @$(TOOL_DOMAKES) "$(PREMAKEFILES_PUBLISH)" $(TOOL_MAKE) $@
[9090]1290!else
1291! ifdef PREMAKEFILES
[8197]1292 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) $@
[9090]1293! endif
[8197]1294!endif
[9127]1295!ifdef POSTMAKEFILES_PUBLISH
1296 @$(TOOL_DOMAKES) "$(POSTMAKEFILES_PUBLISH)" $(TOOL_MAKE) $@
[9090]1297!else
1298! ifdef POSTMAKEFILES
[8197]1299 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
[9090]1300! endif
[8197]1301!endif
1302
[9135]1303
[9127]1304#
1305# Publish rule which doesn't go down into subdirs and submakes.
1306# This one is invoked when a target is 'needed' or early published.
1307#
1308publish_target:
[10438]1309!if ( "$(_TARGET_EARLY_PUBLISH)" != "" || "$(TARGET_MODE:LIB=cute)" == "$(TARGET_MODE)" ) && "$(TARGET_PRIVATE)" == ""
[9127]1310! if "$(TARGET_MODE)" != "EMPTY" && "$(TARGET_MODE)" != "TESTCASE" && "$(TARGET_MODE)" != "DEPEND"
[9919]1311 @$(ECHO) Publishing $(CLRFIL)$(TARGET)$(CLRTXT) to directory $(CLRFIL)$(TARGET_PUB_DIR)$(CLRRST)
[9127]1312 @if not exist "$(TARGET)" $(TOOL_ECHO) $(CLRERR)WARNING: $(CLRFIL)$(TARGET)$(CLRERR) doesn't exist. $(CLRRST)
1313 @if not exist "$(TARGET_PUB_DIR)" $(TOOL_CREATEPATH) $(TARGET_PUB_DIR)
1314 @if exist "$(TARGET)" $(TOOL_COPY) "$(TARGET)" "$(TARGET_PUB)"
1315 @if exist "$(TARGET_SYM)" $(TOOL_COPY) "$(TARGET_SYM)" "$(TARGET_PUB_DIR)"
[9919]1316! ifdef PUBLISH_MAP
1317 @if exist "$(TARGET_MAP)" $(TOOL_COPY) "$(TARGET_MAP)" "$(TARGET_PUB_DIR)"
1318! endif
[9127]1319! if "$(TARGET_PUB_DEB)" != ""
1320 @$(ECHO) Publishing unstripped $(CLRFIL)$(TARGET)$(CLRTXT) to directory $(CLRFIL)$(TARGET_PUB_DIR_DEB)$(CLRRST)
1321 @if not exist "$(_TARGET_DEB)" $(TOOL_ECHO) $(CLRERR)WARNING: $(CLRFIL)$(_TARGET)$(CLRERR) doesn't exist. $(CLRRST)
1322 @if not exist "$(TARGET_PUB_DIR_DEB)" $(TOOL_CREATEPATH) $(TARGET_PUB_DIR_DEB)
1323 @if exist "$(_TARGET_DEB)" $(TOOL_COPY) "$(_TARGET_DEB)" "$(TARGET_PUB_DEB)"
1324 @if exist "$(TARGET_SYM)" $(TOOL_COPY) "$(TARGET_SYM)" "$(TARGET_PUB_DIR_DEB)"
[9919]1325! ifdef PUBLISH_MAP
1326 @if exist "$(TARGET_MAP)" $(TOOL_COPY) "$(TARGET_MAP)" "$(TARGET_PUB_DIR_DEB)"
1327! endif
[9127]1328! endif
[10438]1329! if "$(TARGET_PUB2)" != ""
1330 @$(ECHO) Publishing $(CLRFIL)$(TARGET)$(CLRTXT) to directory $(CLRFIL)$(TARGET_PUB2_DIR)$(CLRRST)
1331 @if not exist "$(TARGET)" $(TOOL_ECHO) $(CLRERR)WARNING: $(CLRFIL)$(TARGET)$(CLRERR) doesn't exist. $(CLRRST)
1332 @if not exist "$(TARGET_PUB2_DIR)" $(TOOL_CREATEPATH) $(TARGET_PUB2_DIR)
1333 @if exist "$(TARGET)" $(TOOL_COPY) "$(TARGET)" "$(TARGET_PUB2)"
1334 @if exist "$(TARGET_SYM)" $(TOOL_COPY) "$(TARGET_SYM)" "$(TARGET_PUB2_DIR)"
1335! ifdef PUBLISH_MAP
1336 @if exist "$(TARGET_MAP)" $(TOOL_COPY) "$(TARGET_MAP)" "$(TARGET_PUB2_DIR)"
1337! endif
1338! if "$(TARGET_PUB2_DEB)" != ""
1339 @$(ECHO) Publishing unstripped $(CLRFIL)$(TARGET)$(CLRTXT) to directory $(CLRFIL)$(TARGET_PUB2_DIR_DEB)$(CLRRST)
1340 @if not exist "$(_TARGET_DEB)" $(TOOL_ECHO) $(CLRERR)WARNING: $(CLRFIL)$(_TARGET)$(CLRERR) doesn't exist. $(CLRRST)
1341 @if not exist "$(TARGET_PUB2_DIR_DEB)" $(TOOL_CREATEPATH) $(TARGET_PUB_DIR_DEB)
1342 @if exist "$(_TARGET_DEB)" $(TOOL_COPY) "$(_TARGET_DEB)" "$(TARGET_PUB2_DEB)"
1343 @if exist "$(TARGET_SYM)" $(TOOL_COPY) "$(TARGET_SYM)" "$(TARGET_PUB2_DIR_DEB)"
1344! ifdef PUBLISH_MAP
1345 @if exist "$(TARGET_MAP)" $(TOOL_COPY) "$(TARGET_MAP)" "$(TARGET_PUB2_DIR_DEB)"
1346! endif
1347! endif
1348! endif
[9127]1349! endif
1350!endif
[9275]1351!if "$(TARGET_BOOKS)" != ""
1352 @$(ECHO) Publishing Book(s) $(CLRFIL)$(TARGET_BOOKS)$(CLRTXT) to directory $(CLRFIL)$(TARGET_BOOK_PUB_DIR)$(CLRRST)
1353 @if not exist "$(TARGET_BOOK_PUB_DIR)" $(TOOL_CREATEPATH) $(TARGET_BOOK_PUB_DIR)
1354 @$(TOOL_COPY) $(TARGET_BOOKS) $(TARGET_BOOK_PUB_DIR)
1355!endif
1356!if "$(TARGET_HELPS)" != ""
1357 @$(ECHO) Publishing Help file(s) $(CLRFIL)$(TARGET_HELPS)$(CLRTXT) to directory $(CLRFIL)$(TARGET_HELP_PUB_DIR)$(CLRRST)
1358 @if not exist "$(TARGET_HELP_PUB_DIR)" $(TOOL_CREATEPATH) $(TARGET_HELP_PUB_DIR)
1359 @$(TOOL_COPY) $(TARGET_HELPS) $(TARGET_HELP_PUB_DIR)
1360!endif
[9127]1361!if "$(TARGET_DOCS)" != ""
[9275]1362 @$(ECHO) Publishing Doc(s) $(CLRFIL)$(TARGET_DOCS)$(CLRTXT) to directory $(CLRFIL)$(TARGET_DOC_PUB_DIR)$(CLRRST)
1363 @if not exist "$(TARGET_DOC_PUB_DIR)" $(TOOL_CREATEPATH) $(TARGET_DOC_PUB_DIR)
1364 @$(TOOL_COPY) $(TARGET_DOCS) $(TARGET_DOC_PUB_DIR)
[9127]1365!endif
[8197]1366
[8253]1367
[9127]1368
[9031]1369# -----------------------------------------------------------------------------
1370# Pass x - The testcase rule - Execute testcases when present.
1371# Testcases are either a testcase.mak file or a testcase subdirectory.
1372# -----------------------------------------------------------------------------
[8714]1373!if "$(TARGET_MODE)" != "TESTCASE"
1374!ifndef BUILD_OWN_TESTCASE_RULE
[9090]1375
[8714]1376!ifndef MAKEVER
1377_TESTCASE_TST1 = [$(TOOL_EXISTS) testcase] == 0
1378_TESTCASE_TST2 = [$(TOOL_EXISTS) testcase.mak] == 0
1379!else
1380_TESTCASE_TST1 = exists(testcase) != 0
1381_TESTCASE_TST2 = exists(testcase.mak) != 0
1382!endif
[9031]1383
[8290]1384testcase:
[9031]1385 @$(ECHO) Executing testcases $(CLRRST)
[8714]1386!if $(_TESTCASE_TST1)
[8423]1387 @$(TOOL_DODIRS) "testcase" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) $@
[8197]1388!endif
[8714]1389!if $(_TESTCASE_TST2)
[8197]1390 @$(TOOL_DOMAKES) "testcase.mak" $(TOOL_MAKE) $@
1391!endif
[9090]1392!ifdef SUBDIRS_TESTCASE
1393 @$(TOOL_DODIRS) "$(SUBDIRS_TESTCASE)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) $@
1394!else
1395! ifdef SUBDIRS
[8423]1396 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) $@
[9090]1397! endif
[8197]1398!endif
[9090]1399!ifdef PREMAKEFILES_TESTCASE
1400 @$(TOOL_DOMAKES) "$(PREMAKEFILES_TESTCASE)" $(TOOL_MAKE) $@
1401!else
1402! ifdef PREMAKEFILES
[8197]1403 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) $@
[9090]1404! endif
[8197]1405!endif
[9090]1406!ifdef POSTMAKEFILES_TESTCASE
1407 @$(TOOL_DOMAKES) "$(POSTMAKEFILES_TESTCASE)" $(TOOL_MAKE) $@
1408!else
1409! ifdef POSTMAKEFILES
[8197]1410 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
[9090]1411! endif
[8197]1412!endif
[9090]1413
1414!endif # BUILD_OWN_TESTCASE_RULE
[8714]1415!endif #!TESTCASE
[8197]1416
1417
[9178]1418# -----------------------------------------------------------------------------
1419# Pass x - The packing rule - traverse subdirs etc.
1420# -----------------------------------------------------------------------------
1421!ifdef SUBDIRS_PACKING
1422_SUBDIRS_PACKING = _subdir_packing
1423$(_SUBDIRS_PACKING):
1424 @$(TOOL_DODIRS) "$(SUBDIRS_PACKING)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) packing
1425!else
1426! ifdef SUBDIRS
1427_SUBDIRS_PACKING = _subdir_packing
1428$(_SUBDIRS_PACKING):
1429 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) packing
1430! endif
1431!endif
[8253]1432
[9178]1433!ifdef PREMAKEFILES_PACKING
1434_PREMAKEFILES_PACKING = _premakefiles_packing
1435$(PREMAKEFILES_PACKING):
1436 @$(TOOL_DOMAKES) "$(PREMAKEFILES_PACKING)" $(TOOL_MAKE) packing
1437!else
1438! ifdef PREMAKEFILES
1439_PREMAKEFILES_PACKING = _premakefiles_packing
1440$(_PREMAKEFILES_PACKING):
1441 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) packing
1442! endif
1443!endif
1444
1445!if "$(RULE_PACKING)" == "packing"
1446_packing: \
1447!else
1448packing: \
1449!endif
1450 $(_SUBDIRS_PACKING) $(_PREMAKEFILES_PACKING) $(RULE_PACKING)
1451!ifdef POSTMAKEFILES_PACKING
1452 @$(TOOL_DOMAKES) "$(POSTMAKEFILES_PACKING)" $(TOOL_MAKE) $@
1453!else
1454! ifdef POSTMAKEFILES
1455 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
1456! endif
1457!endif
1458 $(ECHO) .$(CLRRST)
1459
1460
1461
[8253]1462# -----------------------------------------------------------------------------
[9031]1463# The target rule - Build the target.
[9090]1464# NOTE! NO SUBDIRS OR POST/PREMAKED INVOLVED!
[8298]1465# -----------------------------------------------------------------------------
[9904]1466target: $(TARGET) $(TARGET_ILIB) $(_TARGET_EARLY_PUBLISH) $(OTHERS)
[9127]1467!if "$(TARGET)$(TARGET_ILIB)" != ""
[9031]1468 @$(ECHO) Successfully Built $(CLRFIL)$(TARGET) $(TARGET_ILIB)$(CLRRST)
[9127]1469!else
1470 @$(ECHO) .$(CLRRST)
1471!endif
[8197]1472
1473
[8253]1474
1475# -----------------------------------------------------------------------------
[9904]1476# Others (experimental)
1477# -----------------------------------------------------------------------------
1478others: $(OTHERS)
1479!if "$(OTHERS)" != ""
1480 @$(ECHO) Successfully Built $(OTHERS)$(CLRRST)
1481!else
1482 @$(ECHO) .$(CLRRST)
1483!endif
1484
1485
1486
1487# -----------------------------------------------------------------------------
[9031]1488# The shell rule - Setup the correcte shell environment and start a shell.
[8253]1489# -----------------------------------------------------------------------------
[9031]1490shell:
1491 @$(ECHO) Creating work shell $(CLRRST)
1492 \
1493!ifndef BUILD_VERBOSE
1494 @ \
[8197]1495!endif
[9031]1496 -$(TOOL_BUILDENV) $(BUILD_ENVS_BASE_PRE) $(BUILD_ENVS_PRE) $(ENV_ENVS) \
1497 $(BUILD_ENVS_BASE_POST) $(BUILD_ENVS_POST) * $(COMSPEC)
[8714]1498
1499
1500
1501# -----------------------------------------------------------------------------
1502# The nothing rule - Rule for testing the makefile structure.
1503# -----------------------------------------------------------------------------
1504nothing:
[9031]1505 @$(ECHO) Doing nothing in $(MAKEFILE).
[8714]1506!ifdef SUBDIRS
[8423]1507 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) $@
[8197]1508!endif
1509!ifdef PREMAKEFILES
1510 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) $@
1511!endif
1512!ifdef POSTMAKEFILES
1513 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
1514!endif
[8714]1515 @$(ECHO) Completed nothing in $(MAKEFILE).
[8197]1516
1517
[8253]1518
1519# -----------------------------------------------------------------------------
1520# The $(TARGET) rule - For EXE, DLL, SYS and IFS targets
1521# -----------------------------------------------------------------------------
[8423]1522!if "$(TARGET_MODE)" == "EXE" || "$(TARGET_MODE)" == "DLL" || "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "VDD"
[9240]1523$(TARGET): $(TARGET_OBJS) $(TARGET_RES) $(TARGET_DEF) $(TARGET_DEPS) $(TARGET_LIBS) \
1524 $(MAKEFILE) $(MAKE_INCLUDE_SETUP) $(MAKE_INCLUDE_LD_SETUP) $(MAKE_INCLUDE_LD_OPT) $(PATH_ROOT)\$(BUILD_SETUP_MAK) $(MAKE_INCLUDE_PROCESS) $(PATH_MAKE)\setup.tools.mk
[8423]1525!if "$(TOOL_JOB_WAIT)" != ""
1526! ifndef BUILD_QUIET
[8714]1527 @$(ECHO) Waiting for jobs to complete $(CLRRST)
[8423]1528! endif
[8714]1529 \
[8423]1530! ifndef BUILD_VERBOSE
[8714]1531 @ \
[8423]1532! endif
[8714]1533 $(TOOL_JOB_WAIT)
[8423]1534!endif
[9225]1535!if "$(TARGET_DEF_LINK)" != "$(TARGET_DEF)"
1536! ifndef BUILD_QUIET
1537 @$(ECHO) Stamping deffile with build level info.$(CLRRST)
1538! endif
1539 \
1540! ifndef BUILD_VERBOSE
1541 @ \
1542! endif
1543 $(TOOL_BLDLEVEL) $(BUILD_BLDLEVEL_FLAGS) $(TARGET_BLDLEVEL_FLAGS) -R$(TARGET_DEF) $(TARGET_DEF) $(TARGET_DEF_LINK)
1544!endif
1545!ifndef TOOL_DEFCONV
1546 @$(TOOL_ECHOTXT) Creating Linker Input File $(CLRRST)<<$(TARGET_LNK)
1547$(LINK_LNK1)
1548$(LINK_LNK2)
1549$(LINK_LNK3)
1550$(LINK_LNK4)
1551$(LINK_LNK5)
1552<<KEEP
1553!else
1554 @$(ECHO) Creating Linker Input File $(CLRRST) $(TARGET_LNK)
1555 @$(TOOL_RM) "$(TARGET_LNK)"
1556 \
[9240]1557! ifndef BUILD_VERBOSE
[9225]1558 @ \
1559! endif
1560 $(TOOL_DEFCONV) $(TARGET_DEF_LINK) $(TARGET_LNK) <<$(TARGET_LNK)2
1561$(LINK_LNK1)
1562$(LINK_LNK2)
1563$(LINK_LNK3)
1564$(LINK_LNK4)
1565$(LINK_LNK5)
1566<<keep
1567!endif
1568!ifdef BUILD_VERBOSE
1569 @type $(TARGET_LNK)
1570!endif
[8197]1571 @$(ECHO) Linking $(TARGET_MODE) $(CLRFIL)$@ $(CLRRST)
[8714]1572 \
[8290]1573!ifndef BUILD_VERBOSE
1574 @ \
1575!endif
[10493]1576!if $(TARGET_IGNORE_LINKER_WARNINGS)
[8197]1577 -4 \
1578!endif
1579!if "$(TARGET_MODE)" == "EXE"
[8253]1580 $(LINK_CMD_EXE)
[8197]1581!endif
[8423]1582!if "$(TARGET_MODE)" == "DLL"
[8290]1583 $(LINK_CMD_DLL)
[8197]1584!endif
1585!if "$(TARGET_MODE)" == "SYS"
[8290]1586 $(LINK_CMD_SYS)
[8197]1587!endif
[8213]1588!if "$(TARGET_MODE)" == "IFS"
[8290]1589 $(LINK_CMD_IFS)
[8213]1590!endif
[8290]1591!if "$(TARGET_MODE)" == "VDD"
1592 $(LINK_CMD_VDD)
1593!endif
[10324]1594!if "$(TARGET_POSTLINKING_CMD)" != ""
1595 @$(ECHO) Executing custom postlinking step...$(CLRRST)
1596 $(TARGET_POSTLINKING_CMD)
1597!endif
[8197]1598!if "$(TARGET_RES)" != "" && "$(RL)" != ""
1599 @$(ECHO) Linking Resources $(CLRRST)
[8714]1600 \
[8290]1601! ifndef BUILD_VERBOSE
1602 @ \
1603! endif
[10155]1604 $(RL) $(RL_FLAGS) $(TARGET_RES) $(RL_EXE_OUT)$@
[8197]1605!endif
1606!if "$(TARGET_DLLRNAME)" != ""
1607 @$(ECHO) Dll Rename $(TARGET_DLLRNAME)
[8714]1608 \
[8290]1609! ifndef BUILD_VERBOSE
1610 @ \
1611! endif
[8197]1612 $(TOOL_DLLRNAME) $(TARGET) $(TARGET_DLLRNAME)
1613!endif
[8333]1614!if "$(TOOL_MAPSYM)" != "" && "$(TARGET_SYM)" != "" && "$(TARGET_MAP)" != ""
[8714]1615 \
[8333]1616! ifndef BUILD_VERBOSE
1617 @ \
1618! endif
1619 $(TOOL_MAPSYM) $(TARGET_MAP) $(TARGET_SYM)
1620!endif
[9127]1621!if "$(BUILD_MODE)" == "RELEASE"
1622 \
1623! ifndef BUILD_VERBOSE
1624 @ \
1625! endif
1626 $(TOOL_COPY) "$@" "$(_TARGET_DEB)"
1627! if "$(TOOL_STRIP)" != ""
1628 \
1629! ifndef BUILD_VERBOSE
1630 @ \
1631! endif
1632 $(TOOL_STRIP) $@
1633! endif
1634!endif
[10324]1635!if "$(TARGET_POSTSTRIP_CMD)" != ""
1636 @$(ECHO) Executing custom poststrip step...$(CLRRST)
1637 $(TARGET_POSTSTRIP_CMD)
1638!endif
[8197]1639
[8362]1640!endif
[8333]1641
1642
[8253]1643# -----------------------------------------------------------------------------
[8290]1644# The $(TARGET) rule - For LIB, SYSLIB, and IFSLIB targets.
[8253]1645# -----------------------------------------------------------------------------
[8290]1646!if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFSLIB"
[8197]1647$(TARGET): $(TARGET_OBJS) $(TARGET_LNK) $(TARGET_DEPS)
[8423]1648!if "$(TOOL_JOB_WAIT)" != ""
1649! ifndef BUILD_QUIET
1650 @$(ECHO) Waiting for jobs to complete $(CLRRST)
1651! endif
[8714]1652 \
[8423]1653! ifndef BUILD_VERBOSE
1654 @ \
1655! endif
1656 $(TOOL_JOB_WAIT)
1657!endif
[8197]1658 @$(ECHO) Creating Library $(CLRFIL)$@ $(CLRRST)
[8290]1659!ifndef BUILD_VERBOSE
[9044]1660 @$(TOOL_RM) "$@"
[8290]1661 @$(AR_CMD)
1662!else
[9044]1663 $(TOOL_RM) "$@"
[8197]1664 $(AR_CMD)
[8290]1665!endif
[8197]1666
1667
1668#
1669# Lib parameter file.
1670#
[9240]1671$(TARGET_LNK): $(MAKEFILE) $(MAKE_INCLUDE_SETUP) $(MAKE_INCLUDE_AR_SETUP) $(PATH_ROOT)\$(BUILD_SETUP_MAK)
[9116]1672 @$(TOOL_ECHOTXT) Creating Lib Input File $(CLRRST)<<$@
[8197]1673$(AR_LNK1)
1674$(AR_LNK2)
1675$(AR_LNK3)
1676$(AR_LNK4)
1677$(AR_LNK5)
1678<<KEEP
[8423]1679!ifdef BUILD_VERBOSE
1680 @type $@
[8197]1681!endif
[8423]1682!endif
[8197]1683
1684
[9031]1685# -----------------------------------------------------------------------------
1686# The $(TARGET) rule - For DEPEND targets.
[8253]1687# -----------------------------------------------------------------------------
[9028]1688!if "$(TARGET_MODE)" == "DEPEND"
1689$(TARGET):
1690 @$(ECHO) .
[8197]1691!endif
1692
1693
[8253]1694
1695# -----------------------------------------------------------------------------
1696# The $(TARGET_ILIB) rule - Make import library.
1697# -----------------------------------------------------------------------------
1698!ifdef TARGET_ILIB
[9240]1699$(TARGET_ILIB): $(TARGET_IDEF) $(MAKEFILE) $(MAKE_INCLUDE_SETUP) $(MAKE_INCLUDE_AR_SETUP) $(PATH_MAKE)\setup.tools.mk
[8253]1700 @$(ECHO) Creating Import Library $(CLRFIL)$@ $(CLRRST)
[8714]1701 \
[8290]1702!ifndef BUILD_VERBOSE
[9065]1703 @if not exist $(@D) $(ECHO) Target implib path $(CLRFIL)$(@D)$(CLRTXT) does NOT exist. Creating. $(CLRRST)
1704!endif
1705 @if not exist $(@D) $(TOOL_CREATEPATH) $(@D)
1706 \
1707!ifndef BUILD_VERBOSE
[8290]1708 @ \
1709!endif
[8253]1710 $(IMPLIB) $(IMPLIB_FLAGS) $@ $(TARGET_IDEF)
[9116]1711
1712
1713#
1714# Conversion rule for converting the .def file before passing along to implib.
1715#
1716! if "$(TARGET_IDEF_ORG)" != "" && "$(TARGET_IDEF_ORG)" != "$(TARGET_IDEF)"
1717$(TARGET_IDEF): $(TARGET_IDEF_ORG)
1718 @$(ECHO) Making Import Definition File $(CLRFIL)$@ $(CLRRST)
1719 \
1720!ifndef BUILD_VERBOSE
1721 @if not exist $(@D) $(ECHO) Target .def path $(CLRFIL)$(@D)$(CLRTXT) does NOT exist. Creating. $(CLRRST)
[8253]1722!endif
[9116]1723 @if not exist $(@D) $(TOOL_CREATEPATH) $(@D)
1724 \
1725!ifndef BUILD_VERBOSE
1726 @ \
1727!endif
1728 $(TOOL_IDEFCONV) $(TOOL_IDEFCONV_FLAGS) $(TARGET_IDEF_ORG) $@
1729! endif
[8253]1730
[9116]1731!endif
[8253]1732
1733
[9116]1734
[8253]1735# -----------------------------------------------------------------------------
1736# The .force rule - Force a remake of something everytime.
1737# -----------------------------------------------------------------------------
1738.force:
[8290]1739!ifndef BUILD_VERBOSE
[8253]1740 @$(ECHO) .
[8290]1741!else
1742 @$(ECHO) . (force) .
1743!endif
[8253]1744
1745
1746
1747# -----------------------------------------------------------------------------
1748# Read Dependencies.
1749# -----------------------------------------------------------------------------
[9028]1750!if "$(TARGET_MODE)" != "TESTCASE" && "$(TARGET_MODE)" != "DEPEND"
[8714]1751!if "$(TARGET_MODE)" != "EMPTY" && "$(NODEP)" == ""
[8253]1752
[8197]1753#
[8253]1754# Read dependency file for current directory
[8197]1755#
[8714]1756!ifndef MAKEVER
1757! if [$(TOOL_EXISTS) $(TARGET_DEPEND)] == 0
1758! ifdef BUILD_VERBOSE
1759! if [$(ECHO) Including dependency $(CLRFIL)$(TARGET_DEPEND)$(CLRRST)]
1760! endif
[8197]1761! endif
[8714]1762! include $(TARGET_DEPEND)
1763! else
[9062]1764#! ifndef NODEP
1765#! if [$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(TARGET_DEPEND) is missing.$(CLRRST)]
1766#! endif
1767#! endif
[8253]1768! endif
[8714]1769!else
1770! if %exists($(TARGET_DEPEND)) != 0
1771! ifdef BUILD_VERBOSE
1772$(ECHO) Including dependency $(CLRFIL)$(TARGET_DEPEND)$(CLRRST)
1773! endif
1774! include $(TARGET_DEPEND)
1775! else
[9062]1776#! ifndef NODEP
1777#$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(TARGET_DEPEND) is missing.$(CLRRST)
1778#! endif
[8714]1779! endif
[8253]1780!endif
1781
1782
1783#
1784# Read global dependency files.
1785#
1786!ifdef BUILD_DEPEND1
[8714]1787! ifndef MAKEVER
1788! if [$(TOOL_EXISTS) $(BUILD_DEPEND1)] == 0
1789! ifdef BUILD_VERBOSE
1790! if [$(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND1)$(CLRRST)]
1791! endif
[8253]1792! endif
[8714]1793! include $(BUILD_DEPEND1)
1794! else
1795! ifndef NODEP
[8253]1796! if [$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND1) is missing.$(CLRRST)]
[8197]1797! endif
[8714]1798! endif
[8197]1799! endif
[8714]1800! else
1801! if %exists($(BUILD_DEPEND1)) != 0
1802! ifdef BUILD_VERBOSE
1803$(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND1)$(CLRRST)
1804! endif
1805! include $(BUILD_DEPEND1)
1806! else
1807! ifndef NODEP
1808$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND1) is missing.$(CLRRST)
1809! endif
1810! endif
[8197]1811! endif
1812!endif
1813
[8714]1814
[8253]1815!ifdef BUILD_DEPEND2
[8714]1816! ifndef MAKEVER
1817! if [$(TOOL_EXISTS) $(BUILD_DEPEND2)] == 0
1818! ifdef BUILD_VERBOSE
1819! if [$(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND2)$(CLRRST)]
1820! endif
[8253]1821! endif
[8714]1822! include $(BUILD_DEPEND2)
1823! else
1824! ifndef NODEP
[8253]1825! if [$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND2) is missing.$(CLRRST)]
1826! endif
[8714]1827! endif
[8253]1828! endif
[8714]1829! else
1830! if %exists($(BUILD_DEPEND2)) != 0
1831! ifdef BUILD_VERBOSE
1832$(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND2)$(CLRRST)
1833! endif
1834! include $(BUILD_DEPEND2)
1835! else
1836! ifndef NODEP
1837$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND2) is missing.$(CLRRST)
1838! endif
1839! endif
[8253]1840! endif
1841!endif
[8197]1842
1843
[8253]1844!ifdef BUILD_DEPEND3
[8714]1845! ifndef MAKEVER
1846! if [$(TOOL_EXISTS) $(BUILD_DEPEND3)] == 0
1847! ifdef BUILD_VERBOSE
1848! if [$(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND3)$(CLRRST)]
1849! endif
[8253]1850! endif
[8714]1851! include $(BUILD_DEPEND3)
1852! else
1853! ifndef NODEP
[8253]1854! if [$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND3) is missing.$(CLRRST)]
1855! endif
[8714]1856! endif
[8253]1857! endif
[8714]1858! else
1859! if %exists($(BUILD_DEPEND3)) != 0
1860! ifdef BUILD_VERBOSE
1861$(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND3)$(CLRRST)
1862! endif
1863! include $(BUILD_DEPEND3)
1864! else
1865! ifndef NODEP
1866$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND3) is missing.$(CLRRST)
1867! endif
1868! endif
[8253]1869! endif
1870!endif
1871
1872
1873!endif
1874
[8423]1875
1876#
1877# If BUILD_MULTIJOBS is nonempty make sure the job daemon is up running.
1878#
1879!if "$(BUILD_MULTIJOBS)" != ""
1880! if [$(TOOL_JOB_UP)] != 0
1881! if "$(BUILD_QUITE)" == ""
[8714]1882! ifndef MAKEVER
1883! if [$(ECHO) Starting Job Daemon With $(TOOL_JOB_WORKERS) Workers...$(CLRRST)]
1884! endif
1885! else
1886$(ECHO) Starting Job Daemon With $(TOOL_JOB_WORKERS) Workers...$(CLRRST)
[8423]1887! endif
1888! endif
1889! if [$(TOOL_JOB_INIT) $(TOOL_JOB_WORKERS)] != 0
[8714]1890! ifndef MAKEVER
1891! if [$(ECHO) $(CLRERR)Fatal error: Failed to start job daemon.$(CLRRST)]
1892! endif
1893! error
1894!else
1895! error $(CLRERR)Fatal error: Failed to start job daemon.$(CLRRST)
1896!endif
[8423]1897! endif
1898! endif
1899!endif
1900
[8714]1901!endif #!TESTCASE
[9178]1902
1903
1904#
1905# Include system library dependency stubs.
1906#
1907!include $(PATH_MAKE)\setup.$(SHT_TRGPLTFRM)libs.mk
1908
1909
1910#
1911# Check if TARGET_ALWAYS needs to be forced built.
1912#
1913!if "$(TARGET_ALWAYS)" != ""
1914! ifndef BUILD_FORCED_BUILD_TEST
[9188]1915! if [$(TOOL_MAKE) BUILD_FORCED_BUILD_TEST=1 -f $(MAKEFILE) -q $(TARGET) $(TARGET_ILIB) >nul 2>nul] != 0
[9178]1916$(TARGET_ALWAYS): .force
1917! endif
1918! endif
1919!endif
1920
Note: See TracBrowser for help on using the repository browser.