source: trunk/make/process.mak@ 9224

Last change on this file since 9224 was 9224, checked in by bird, 23 years ago

Corrected bug which made us put the libraries in the PATH_PUB tree instead of PATH_LIB.

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