source: trunk/make/process.mak@ 9281

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

Corrected dependencies for IPF/IPP files and ORC.

File size: 49.4 KB
RevLine 
[9281]1# $Id: process.mak,v 1.34 2002-09-20 04:35:45 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
[9275]321# Default public book dirs
322!ifndef TARGET_BOOK_PUB_BASE
323TARGET_BOOK_PUB_BASE = $(PATH_PUB)
324!endif
325!ifndef TARGET_BOOK_PUB_SUB
326TARGET_BOOK_PUB_SUB = $(PATH_SUB_BOOK)
327!endif
328!ifndef TARGET_BOOK_PUB_DIR
329TARGET_BOOK_PUB_DIR = $(TARGET_BOOK_PUB_BASE)\$(TARGET_BOOK_PUB_SUB)
330!endif
331
332# Default public help dirs
333!ifndef TARGET_HELP_PUB_BASE
334TARGET_HELP_PUB_BASE = $(PATH_PUB)
335!endif
336!ifndef TARGET_HELP_PUB_SUB
337TARGET_HELP_PUB_SUB = $(PATH_SUB_HELP)
338!endif
339!ifndef TARGET_HELP_PUB_DIR
340TARGET_HELP_PUB_DIR = $(TARGET_HELP_PUB_BASE)\$(TARGET_HELP_PUB_SUB)
341!endif
342
343# Default public docs dirs
344!ifndef TARGET_DOC_PUB_BASE
345TARGET_DOC_PUB_BASE = $(PATH_PUB)
346!endif
347!ifndef TARGET_DOC_PUB_SUB
348TARGET_DOC_PUB_SUB = $(PATH_SUB_DOC)
349!endif
350!ifndef TARGET_DOC_PUB_DIR
351TARGET_DOC_PUB_DIR = $(TARGET_DOC_PUB_BASE)\$(TARGET_DOC_PUB_SUB)
352!endif
353
[8253]354# Default depend filename.
355!ifndef TARGET_DEPEND
356TARGET_DEPEND = $(PATH_TARGET)\.depend
[8197]357!endif
358
[8423]359# Default makefile names.
360!ifndef BUILD_MAKEFILE
361BUILD_MAKEFILE = Makefile
362!endif
363
[8253]364# Default makefile name.
365!ifndef MAKEFILE
[8423]366MAKEFILE = $(BUILD_MAKEFILE)
[8197]367!endif
368
[8253]369# Ignore linker warnings for some target modes.
370!ifndef TARGET_IGNORE_LINKER_WARNINGS
[8423]371! if "$(TARGET_MODE)" == "DLL"
[8253]372TARGET_IGNORE_LINKER_WARNINGS = 1
373! endif
[8197]374!endif
375
376
[8253]377# Default stacksize
[8355]378# If 16bit: 8KB
379# Else (32bit): 64KB
[8197]380!ifndef TARGET_STACKSIZE
[8355]381! ifdef ENV_16BIT
[8197]382TARGET_STACKSIZE=0x2000
383! else
384TARGET_STACKSIZE=0x10000
385! endif
386!endif
387
[8253]388
389
390# -----------------------------------------------------------------------------
[9127]391# Internal helper macros - don't mess!
392# -----------------------------------------------------------------------------
393
394# Helper for doing early publish of a target.
395!if defined(TARGET_NEEDED) || defined(TARGET_PUBLIC)
396_TARGET_EARLY_PUBLISH = publish_target
397!else
398_TARGET_EARLY_PUBLISH =
399!endif
400
401# The unstripped release name (internal!)
402_TARGET_DEB = $(TARGET).unstripped
403
404
405
406# -----------------------------------------------------------------------------
[8253]407# Tell user what we're building.
408# -----------------------------------------------------------------------------
409!ifndef BUILD_QUIET
[9044]410! if "$(TARGET)" != ""
411! ifndef MAKEVER
412! if [$(ECHO) Target is $(CLRFIL)$(TARGET)$(CLRRST)]
413! endif
414! else
415$(ECHO) Target is $(CLRFIL)$(TARGET)$(CLRRST)
[8714]416! endif
417! endif
[8197]418!endif
419
420
[8253]421# -----------------------------------------------------------------------------
422# Ensure the platform-specific target path exists
423# -----------------------------------------------------------------------------
424
425!if "$(TARGET_MODE)" != "EMPTY"
426! if "$(PATH_TARGET)" != ""
[8714]427! ifndef MAKEVER
428! if [$(TOOL_EXISTS) $(PATH_TARGET)] != 0
429! ifndef BUILD_QUIET
430! if [$(ECHO) Target path $(CLRFIL)$(PATH_TARGET)$(CLRTXT) does NOT exist. Creating. $(CLRRST)]
431! endif
[8253]432! endif
[8714]433! if [$(TOOL_CREATEPATH) $(PATH_TARGET)]
434! if [$(ECHO) $(CLRERR)Error: Could not create $(CLRFIL)$(PATH_TARGET)$(CLRRST)]
435! endif
436! error
437! endif
[8253]438! endif
[8714]439! else
440! if %exist($(PATH_TARGET)) == 0
441! ifndef BUILD_QUIET
442$(ECHO) Target path $(CLRFIL)$(PATH_TARGET)$(CLRTXT) does NOT exist. Creating. $(CLRRST)
[8423]443! endif
[8714]444! else
445! if [$(TOOL_CREATEPATH) $(PATH_TARGET)]
446! error $(CLRERR)Error: Could not create $(CLRFIL)$(PATH_TARGET)$(CLRRST)
447! endif
[8253]448! endif
[8197]449! endif
450! endif
451!endif
[8253]452# not 100% sure about the != EMPTY stuff, but this is way faster.
[8197]453
454
[9135]455# -----------------------------------------------------------------------------
456# Make all targets 'unprecious'. (works only on nmake5)
457# -----------------------------------------------------------------------------
458.PRECIOUS: .force
[8197]459
[9135]460
[8253]461# -----------------------------------------------------------------------------
462# Common inference rules
463# -----------------------------------------------------------------------------
[8197]464.SUFFIXES:
[9275]465.SUFFIXES: .c .cpp .orc .asm .$(EXT_OBJ) .$(EXT_RES) .rc .ii .s .ipp .ipf .$(EXT_INF) .$(EXT_HLP)
[8197]466
[8714]467#
468# A workaround for SlickEdits inability to find the buggy files..
469# This makes the source filenames in the error listing have full path.
470# See setup.mak for compile command line.
471#
472_SRC = $<
473!ifdef SLKRUNS
474_SRC = $(PATH_CURRENT)\$<
475!endif
[9165]476_DST = $(PATH_TARGET)\$(@F)
[8197]477
[8714]478
[8197]479# Assembling assembly source.
480.asm{$(PATH_TARGET)}.$(EXT_OBJ):
[8714]481 @$(ECHO) Assembling $(CLRFIL)$(_SRC) $(CLRTXT)$(TOOL_JOB_SUB_MSG) $(CLRRST)
482 \
[8423]483! ifndef BUILD_VERBOSE
[8290]484 @ \
[8423]485! endif
[8213]486!if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB"
[9165]487! ifdef AS_CMD_SYS
488 $(TOOL_JOB_SUB) $(AS_CMD_SYS)
489! else
490 $(TOOL_JOB_SUB) $(AS) $(AS_FLAGS_SYS) $(_SRC) $(AS_OBJ_OUT)$(_DST)
491! endif
[8197]492!else
[9165]493! ifdef AS_CMD
494 $(TOOL_JOB_SUB) $(AS_CMD)
495! else
496 $(TOOL_JOB_SUB) $(AS) $(AS_FLAGS) $(_SRC) $(AS_OBJ_OUT)$(_DST)
497! endif
[8197]498!endif
499
500.asm.$(EXT_OBJ):
[8714]501 @$(ECHO) Assembling $(CLRFIL)$(_SRC) $(CLRRST)
502 \
[8290]503!ifndef BUILD_VERBOSE
504 @ \
505!endif
[8213]506!if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB"
[9165]507! ifdef AS_CMD_SYS
508 $(AS_CMD_SYS)
509! else
510 $(AS) $(AS_FLAGS_SYS) $(_SRC) $(AS_OBJ_OUT)$(_DST)
511! endif
[8197]512!else
[9165]513! ifdef AS_CMD
514 $(AS_CMD)
515! else
516 $(AS) $(AS_FLAGS) $(_SRC) $(AS_OBJ_OUT)$(_DST)
517! endif
[8197]518!endif
519
[8714]520# C++ Compiler base line
521_CXX_BASELINE = $(CXX) \
[8290]522!if "$(TARGET_MODE)" == "EXE" || "$(TARGET_MODE)" == "LIB"
[8197]523 $(CXX_FLAGS_EXE) \
524!endif
525!if "$(TARGET_MODE)" == "DLL"
526 $(CXX_FLAGS_DLL) \
527!endif
528!if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB"
529 $(CXX_FLAGS_SYS) \
530!endif
[8213]531!if "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB"
532 $(CXX_FLAGS_IFS) \
533!endif
[8714]534
535# Compiling C++ source.
536.cpp{$(PATH_TARGET)}.$(EXT_OBJ):
537 @$(ECHO) C++ Compiler $(CLRFIL)$(_SRC) $(CLRTXT)$(TOOL_JOB_SUB_MSG) $(CLRRST)
538 \
539!ifndef BUILD_VERBOSE
540 @ \
541!endif
542 $(TOOL_JOB_SUB) $(_CXX_BASELINE) \
[8253]543!if "$(CXX_LST_OUT)" != ""
[8213]544 $(CXX_LST_OUT)$(PATH_TARGET)\$(@B).s \
545!endif
[9165]546 $(CXX_OBJ_OUT)$(_DST) $(_SRC)
[8197]547
548.cpp.$(EXT_OBJ):
[8714]549 @$(ECHO) C++ Compiler $(CLRFIL)$(_SRC) $(CLRRST)
550 \
[8290]551!ifndef BUILD_VERBOSE
552 @ \
553!endif
[8714]554 $(_CXX_BASELINE) \
[8253]555!if "$(CXX_LST_OUT)" != ""
[8213]556 $(CXX_LST_OUT)$(PATH_TARGET)\$(@B).s \
557!endif
[9165]558 $(CXX_OBJ_OUT)$(_DST) $(_SRC)
[8197]559
560
561# Pre-Compiling C++ source.
[8714]562.cpp.ii:
563 @$(ECHO) C++ Compiler $(CLRFIL)$(_SRC) $(CLRRST)
564 \
[8290]565!ifndef BUILD_VERBOSE
566 @ \
567!endif
[8714]568 $(_CXX_BASELINE) \
569 $(CXX_PC_2_STDOUT) $(_SRC) > $@
[8197]570
571
[8714]572# Compiler C++ source to assembly.
573!if "$(CXX_AS_2_FILE)" != ""
574.cpp.s:
575 @$(ECHO) C++ To Assembly $(CLRFIL)$(_SRC) $(CLRRST)
576 \
[8290]577!ifndef BUILD_VERBOSE
578 @ \
579!endif
[8714]580 $(_CXX_BASELINE) \
581 $(CXX_AS_2_FILE)$@ $(_SRC)
582!endif
583
584
585
586# C Compiler base line
587_CC_BASELINE = $(CC) \
[8290]588!if "$(TARGET_MODE)" == "EXE" || "$(TARGET_MODE)" == "LIB"
[8197]589 $(CC_FLAGS_EXE) \
590!endif
591!if "$(TARGET_MODE)" == "DLL"
592 $(CC_FLAGS_DLL) \
593!endif
594!if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB"
595 $(CC_FLAGS_SYS) \
596!endif
[8213]597!if "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB"
598 $(CC_FLAGS_IFS) \
599!endif
[8714]600
601# Compiling C source.
602.c{$(PATH_TARGET)}.$(EXT_OBJ):
603 @$(ECHO) C Compiler $(CLRFIL)$(_SRC) $(CLRTXT)$(TOOL_JOB_SUB_MSG) $(CLRRST)
604 \
605!ifndef BUILD_VERBOSE
606 @ \
607!endif
608 $(TOOL_JOB_SUB) $(_CC_BASELINE) \
[8253]609!if "$(CC_LST_OUT)" != ""
[8213]610 $(CC_LST_OUT)$(PATH_TARGET)\$(@B).s \
611!endif
[9165]612 $(CC_OBJ_OUT)$(_DST) $(_SRC)
[8197]613
614.c.$(EXT_OBJ):
[8714]615 @$(ECHO) C Compiler $(CLRFIL)$(_SRC) $(CLRRST)
616 \
[8290]617!ifndef BUILD_VERBOSE
618 @ \
619!endif
[8714]620 $(_CC_BASELINE) \
[8253]621!if "$(CC_LST_OUT)" != ""
[8213]622 $(CC_LST_OUT)$(PATH_TARGET)\$(@B).s \
623!endif
[9165]624 $(CC_OBJ_OUT)$(_DST) $(_SRC)
[8197]625
626
627# Pre-Compiling C source.
[8714]628.c.ii:
629 @$(ECHO) C PreCompiler $(CLRFIL)$(_SRC) $(CLRRST)
630 \
[8290]631!ifndef BUILD_VERBOSE
632 @ \
633!endif
[8714]634 $(_CC_BASELINE) \
635 $(CC_PC_2_STDOUT) $(_SRC) > $@
636
637
638# Compiler C source to assembly.
639!if "$(CC_AS_2_FILE)" != ""
640.c.s:
641 @$(ECHO) C To Assembly $(CLRFIL)$(_SRC) $(CLRRST)
642 \
643!ifndef BUILD_VERBOSE
644 @ \
[8197]645!endif
[8714]646 $(_CC_BASELINE) \
647 $(CC_AS_2_FILE)$@ $(_SRC)
[8197]648!endif
649
650
651# Compiling resources.
652.rc{$(PATH_TARGET)}.res:
[8714]653 @$(ECHO) RC Compiler $(CLRFIL)$(_SRC) $(CLRTXT)$(TOOL_JOB_SUB_MSG)$(CLRRST)
654 \
[8290]655!ifndef BUILD_VERBOSE
656 @ \
657!endif
[9165]658 $(TOOL_JOB_SUB) $(RC) $(RC_FLAGS) $(_SRC) $(_DST)
[8197]659
660.rc.res:
[8714]661 @$(ECHO) RC Compiler $(CLRFIL)$(_SRC) $(CLRRST)
662 \
[8290]663!ifndef BUILD_VERBOSE
664 @ \
665!endif
[9165]666 $(RC) $(RC_FLAGS) $(_SRC) $(_DST)
[8197]667
668
[9116]669# Compiling Odin32 resources.
670.orc{$(PATH_TARGET)}.obj:
671 @$(ECHO) ORC Compiler $(CLRFIL)$(_SRC) $(CLRTXT)$(TOOL_JOB_SUB_MSG)$(CLRRST)
672 \
673!ifndef BUILD_VERBOSE
674 @ \
675!endif
676 $(ORC) $(ORC_FLAGS) $(ORC_ASM_OUT)$(PATH_TARGET)\$(@B).asm $(_SRC)
677 \
678!ifndef BUILD_VERBOSE
679 @ \
680!endif
[9165]681 $(AS) $(AS_FLAGS) $(PATH_TARGET)\$(@B).asm $(AS_OBJ_OUT)$(_DST)
[8253]682
[9116]683.orc.obj:
684 @$(ECHO) ORC Compiler $(CLRFIL)$(_SRC) $(CLRRST)
685 \
686!ifndef BUILD_VERBOSE
687 @ \
688!endif
689 $(ORC) $(ORC_FLAGS) $(ORC_ASM_OUT)$(PATH_TARGET)\$(@B).asm $(_SRC)
690 \
691!ifndef BUILD_VERBOSE
692 @ \
693!endif
[9165]694 $(AS) $(AS_FLAGS) $(PATH_TARGET)\$(@B).asm $(AS_OBJ_OUT)$(_DST)
[8253]695
696
[9275]697# Compiling INFs.
698.ipf{$(PATH_TARGET)}.$(EXT_INF):
699 @$(ECHO) BOOK Compiler $(CLRFIL)$(_SRC)$(CLRRST)
700 \
701!ifndef BUILD_VERBOSE
702 @ \
703!endif
704 $(INFC_CMD)
[9116]705
[9275]706.ipf.inf:
707 @$(ECHO) BOOK Compiler $(CLRFIL)$(_SRC)$(CLRRST)
708 \
709!ifndef BUILD_VERBOSE
710 @ \
711!endif
712 $(INFC_CMD)
[9116]713
714
[9275]715# Compiling INFs with pre-compiling
716.ipp{$(PATH_TARGET)}.$(EXT_INF):
717 @$(ECHO) CC Pre + BOOK Compiler $(CLRFIL)$(_SRC)$(CLRRST)
718!ifndef CC_PC_2_STRIPPED_STDOUT
719 $(TOOL_ECHO) $(CLRERR)fatal error: CC_PC_2_STRIPPED_STDOUT isn't supported on this compiler. $(CLRRST) && false
720!endif
721 \
722!ifndef BUILD_VERBOSE
723 @ \
724!endif
725 $(INFC_CMD_PRE)
726
727.ipp.inf:
728 @$(ECHO) CC Pre + BOOK Compiler $(CLRFIL)$(_SRC)$(CLRRST)
729!ifndef CC_PC_2_STRIPPED_STDOUT
730 $(TOOL_ECHO) $(CLRERR)fatal error: CC_PC_2_STRIPPED_STDOUT isn't supported on this compiler. $(CLRRST) && false
731!endif
732 \
733!ifndef BUILD_VERBOSE
734 @ \
735!endif
736 $(INFC_CMD_PRE)
737
738
739# Compiling HLPs
740.ipf{$(PATH_TARGET)}.$(EXT_HLP):
741 @$(ECHO) HELP Compiler $(CLRFIL)$(_SRC)$(CLRRST)
742 \
743!ifndef BUILD_VERBOSE
744 @ \
745!endif
746 $(HLPC_CMD)
747
748.ipf.hlp:
749 @$(ECHO) HELP Compiler $(CLRFIL)$(_SRC)$(CLRRST)
750 \
751!ifndef BUILD_VERBOSE
752 @ \
753!endif
754 $(HLPC_CMD)
755
756
757# Compiling HLPs with pre-compiling
758.ipp{$(PATH_TARGET)}.$(EXT_HLP):
759 @$(ECHO) CC Pre + HELP Compiler $(CLRFIL)$(_SRC)$(CLRRST)
760!ifndef CC_PC_2_STRIPPED_STDOUT
761 $(TOOL_ECHO) $(CLRERR)fatal error: CC_PC_2_STRIPPED_STDOUT isn't supported on this compiler. $(CLRRST) && false
762!endif
763 \
764!ifndef BUILD_VERBOSE
765 @ \
766!endif
767 $(HLPC_CMD_PRE)
768
769.ipp.hlp:
770 @$(ECHO) CC Pre + HELP Compiler $(CLRFIL)$(_SRC)$(CLRRST)
771!ifndef CC_PC_2_STRIPPED_STDOUT
772 $(TOOL_ECHO) $(CLRERR)fatal error: CC_PC_2_STRIPPED_STDOUT isn't supported on this compiler. $(CLRRST) && false
773!endif
774 \
775!ifndef BUILD_VERBOSE
776 @ \
777!endif
778 $(HLPC_CMD_PRE)
779
780
781
[8253]782# -----------------------------------------------------------------------------
783# The all rule - The default one, as it's the first rule in the file.
784# -----------------------------------------------------------------------------
[8197]785all: build
786
787
[8253]788
789# -----------------------------------------------------------------------------
[9031]790# The build rule - This runs all passes:
791# 1. Make Dependencies
[9090]792# 2. Make Needed Tools (stuff required in the next steps)
793# 3. Make Libraries (all kinds)
[9275]794# 4. Make Binaries (ie. executable files)
[9090]795# 5. Make Miscellaneous Targets
796# 6. Make Install
[9031]797# Note: In order to load dependencies we'll do a forwarding after making them.
[8253]798# -----------------------------------------------------------------------------
[9031]799build: _build
800!if "$(MAKEFLAGS:I=_)" == "$(MAKEFLAGS)" # this is of course broken in nmake v5.0 for OS/2.
801 @$(ECHO)$(CLRMAK)[Successfully Built Everything!] $(CLRRST)
802!else
803 @$(ECHO)$(CLRMAK)[Built Everything! (Ignore option specified)] $(CLRRST)
804!endif
805
806# internal rule shared by rebuild and build.
807_build: _build_banner_dep dep
808!ifndef BUILD_QUIET
809 @$(ECHO) Restarting $(CLRFIL)$(MAKEFILE)$(CLRTXT) with new dependencies. $(CLRRST)
810!endif
811 \
812!ifndef BUILD_VERBOSE
813 @ \
814!endif
815 $(TOOL_MAKE) -f $(MAKEFILE) _build_new_dependencies_
816
817# internal rule used to reload dependencies.
818_build_new_dependencies_: \
[9090]819 _build_banner_needed needed \
[9031]820 _build_banner_lib lib \
[9275]821 _build_banner_binary binary \
822 _build_banner_misc misc \
[9127]823 _build_banner_publish publish
[9031]824
[9228]825
[9031]826# Banners for rebuild and build.
827_build_banner_clean:
828 @$(ECHO)$(CLRMAK)[Start Pass 0 - Make Clean] $(CLRRST)
829 @SET _BUILD_PASS=0
830_build_banner_dep:
831 @$(ECHO)$(CLRMAK)[Start Pass 1 - Make Dependencies] $(CLRRST)
832 @SET _BUILD_PASS=1
[9090]833_build_banner_needed:
834 @$(ECHO)$(CLRMAK)[Start Pass 2 - Make Needed Tools] $(CLRRST)
835 @SET _BUILD_PASS=2
[9031]836_build_banner_lib:
[9090]837 @$(ECHO)$(CLRMAK)[Start Pass 3 - Make Libraries] $(CLRRST)
838 @SET _BUILD_PASS=3
[9275]839_build_banner_binary:
840 @$(ECHO)$(CLRMAK)[Start Pass 4 - Make Binaries] $(CLRRST)
[9090]841 @SET _BUILD_PASS=4
[9275]842_build_banner_misc:
[9090]843 @$(ECHO)$(CLRMAK)[Start Pass 5 - Make Miscellaneous Targets] $(CLRRST)
844 @SET _BUILD_PASS=5
[9127]845_build_banner_publish:
846 @$(ECHO)$(CLRMAK)[Start Pass 6 - Make Public (i.e. Publish)] $(CLRRST)
[9090]847 @SET _BUILD_PASS=6
[9031]848
849
850
851# -----------------------------------------------------------------------------
852# The rebuild rule - Same as build but does a clean first (as Pass 0).
853# -----------------------------------------------------------------------------
854rebuild: \
855 _build_banner_clean clean \
856 _build
857!if "$(MAKEFLAGS:i=_)" == "$(MAKEFLAGS)"
858 @$(ECHO)$(CLRMAK)[Successfully Rebuilt Everything!] $(CLRRST)
859!else
860 @$(ECHO)$(CLRMAK)[Rebuilt Everything! (Ignore option specified)] $(CLRRST)
861!endif
862
863
864
865# -----------------------------------------------------------------------------
[9228]866# A number of shortcuts for lazy programmers.
867# -----------------------------------------------------------------------------
868pass1: build
869
870pass2: _build_new_dependencies_
871
872pass3: _build_banner_lib lib \
[9275]873 _build_banner_binary binary \
874 _build_banner_misc misc \
[9228]875 _build_banner_publish publish
876
[9275]877pass4: _build_banner_binary binary \
878 _build_banner_misc misc \
[9228]879 _build_banner_publish publish
880
[9275]881pass5: _build_banner_misc misc \
[9228]882 _build_banner_publish publish
883
884pass6: _build_banner_publish publish
885
886quick: _build_banner_lib lib \
[9275]887 _build_banner_binary binary \
[9228]888 _build_banner_publish publish
889
890
891
892# -----------------------------------------------------------------------------
[9031]893# Pass 0 - The clean rule - Clean up output files.
[9127]894# The current setup doesn't clean the published ones.
[9031]895# -----------------------------------------------------------------------------
896!if "$(TARGET_MODE)" != "TESTCASE"
897clean:
898 @$(ECHO) Cleaning... $(CLRRST)
899 \
900! ifndef BUILD_VERBOSE
901 @ \
902! endif
[9116]903 $(TOOL_RM) @<<
904"$(PATH_TARGET)\*.$(EXT_OBJ)"
905"$(PATH_TARGET)\*.$(EXT_ILIB)"
906"$(PATH_TARGET)\*.$(EXT_EXE)"
907"$(PATH_TARGET)\*.$(EXT_DLL)"
908"$(PATH_TARGET)\*.$(EXT_RES)"
909"$(PATH_TARGET)\*.$(EXT_SYS)"
910"$(PATH_TARGET)\*.$(EXT_LIB)"
911"$(PATH_TARGET)\*.$(EXT_IFS)"
912"$(PATH_TARGET)\*.$(EXT_MAP)"
913"$(PATH_TARGET)\*.$(EXT_SYM)"
914"$(PATH_TARGET)\*.$(EXT_DEF)"
915"$(PATH_TARGET)\*.s"
916"$(PATH_TARGET)\*.lst"
917"$(PATH_TARGET)\*.lnk"
918"$(PATH_TARGET)\*.ii"
919"$(PATH_TARGET)\.depend"
920"$(TARGET_DEPEND)"
921.\*.ii
922.\*.err
923.\.depend
924<<
[9090]925!ifdef SUBDIRS_CLEAN
926 @$(TOOL_DODIRS) "$(SUBDIRS_CLEAN)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) NODEP=1 $@
927!else
[9275]928! if "$(SUBDIRS)$(SUBDIRS_NEEDED)$(SUBDIRS_LIB)$(SUBDIRS_BINARY)$(SUBDIRS_MISC)" != ""
929 @$(TOOL_DODIRS) "$(SUBDIRS) $(SUBDIRS_NEEDED) $(SUBDIRS_LIB) $(SUBDIRS_BINARY) $(SUBDIRS_MISC)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) NODEP=1 $@
[9090]930! endif
[8197]931!endif
[9090]932!ifdef PREMAKEFILES_CLEAN
933 @$(TOOL_DOMAKES) "$(PREMAKEFILES_CLEAN)" $(TOOL_MAKE) NODEP=1 $@
934!else
[9275]935! if "$(PREMAKEFILES)$(PREMAKEFILES_NEEDED)$(PREMAKEFILES_LIB)$(PREMAKEFILES_BINARY)$(PREMAKEFILES_MISC)" != ""
936 @$(TOOL_DOMAKES) "$(PREMAKEFILES) $(PREMAKEFILES_NEEDED) $(PREMAKEFILES_LIB) $(PREMAKEFILES_BINARY) $(PREMAKEFILES_MISC)" $(TOOL_MAKE) NODEP=1 $@
[9090]937! endif
[9031]938!endif
[9090]939!ifdef POSTMAKEFILES_CLEAN
940 @$(TOOL_DOMAKES) "$(POSTMAKEFILES_CLEAN)" $(TOOL_MAKE) NODEP=1 $@
941!else
[9275]942! if "$(POSTMAKEFILES)$(POSTMAKEFILES_NEEDED)$(POSTMAKEFILES_LIB)$(POSTMAKEFILES_BINARY)$(POSTMAKEFILES_MISC)" != ""
943 @$(TOOL_DOMAKES) "$(POSTMAKEFILES) $(POSTMAKEFILES_NEEDED) $(POSTMAKEFILES_LIB) $(POSTMAKEFILES_BINARY) $(POSTMAKEFILES_MISC)" $(TOOL_MAKE) NODEP=1 $@
[9090]944! endif
[9031]945!endif
[9090]946
[9031]947!endif #!TESTCASE
[8197]948
[9031]949
950
951# -----------------------------------------------------------------------------
952# Pass 1 - The dep rule - Make dependencies.
953# -----------------------------------------------------------------------------
954dep:
[9044]955!if "$(TARGET_MODE)" != "EMPTY" && "$(TARGET_MODE)" != "TESTCASE"
[9031]956 @$(ECHO) Making dependencies... $(CLRRST)
957 \
[9044]958! ifndef BUILD_VERBOSE
[9031]959 @ \
[9044]960! endif
[9240]961 $(TOOL_DEP) \
[9031]962! ifdef TARGET_NO_DEP
963 -x$(TARGET_NO_DEP: =;)\
964! endif
[9240]965 @<<
966$(TOOL_DEP_FLAGS)
967-o$$(PATH_TARGET)
968-d$(TARGET_DEPEND)
969-srcadd AS:$$(MAKE_INCLUDE_AS_SETUP)
970-srcadd AS:$$(MAKE_INCLUDE_AS_OPT)
971-srcadd RC:$$(MAKE_INCLUDE_RC_SETUP)
972-srcadd ORC:$$(MAKE_INCLUDE_ORC_SETUP)
973-srcadd CX:$$(MAKE_INCLUDE_SETUP)
974-srcadd CX:$$(MAKE_INCLUDE_CX_OPT)
[9281]975-srcadd IPF:$$(MAKE_INCLUDE_IPFC)
976-srcadd IPP:$$(MAKE_INCLUDE_IPFC)
977-srcadd IPP:$$(MAKE_INCLUDE_SETUP)
978-srcadd IPP:$$(MAKE_INCLUDE_CX_OPT)
[9240]979$(TOOL_DEP_FILES)
980<<
[9281]981!ifdef BUILD_VERBOSE2
982 $(ECHO) Dependcy file: $(CLRRST)
983 @type $(TARGET_DEPEND)
[9031]984!endif
[9281]985!endif
[9090]986!ifdef SUBDIRS_DEP
987 @$(TOOL_DODIRS) "$(SUBDIRS_DEP)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) NODEP=1 $@
988!else
[9275]989! if "$(SUBDIRS)$(SUBDIRS_NEEDED)$(SUBDIRS_LIB)$(SUBDIRS_BINARY)$(SUBDIRS_MISC)" != ""
990 @$(TOOL_DODIRS) "$(SUBDIRS) $(SUBDIRS_NEEDED) $(SUBDIRS_LIB) $(SUBDIRS_BINARY) $(SUBDIRS_MISC)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) NODEP=1 $@
[9090]991! endif
[9031]992!endif
[9090]993!ifdef PREMAKEFILES_DEP
994 @$(TOOL_DOMAKES) "$(PREMAKEFILES_DEP)" $(TOOL_MAKE) NODEP=1 $@
995!else
[9275]996! if "$(PREMAKEFILES)$(PREMAKEFILES_NEEDED)$(PREMAKEFILES_LIB)$(PREMAKEFILES_BINARY)$(PREMAKEFILES_MISC)" != ""
997 @$(TOOL_DOMAKES) "$(PREMAKEFILES) $(PREMAKEFILES_NEEDED) $(PREMAKEFILES_LIB) $(PREMAKEFILES_BINARY) $(PREMAKEFILES_MISC)" $(TOOL_MAKE) NODEP=1 $@
[9090]998! endif
[8197]999!endif
[9090]1000!ifdef POSTMAKEFILES_DEP
1001 @$(TOOL_DOMAKES) "$(POSTMAKEFILES_DEP)" $(TOOL_MAKE) NODEP=1 $@
1002!else
[9275]1003! if "$(POSTMAKEFILES)$(POSTMAKEFILES_NEEDED)$(POSTMAKEFILES_LIB)$(POSTMAKEFILES_BINARY)$(POSTMAKEFILES_MISC)" != ""
1004 @$(TOOL_DOMAKES) "$(POSTMAKEFILES) $(POSTMAKEFILES_NEEDED) $(POSTMAKEFILES_LIB) $(POSTMAKEFILES_BINARY) $(POSTMAKEFILES_MISC)" $(TOOL_MAKE) NODEP=1 $@
[9090]1005! endif
[8197]1006!endif
1007
1008
[8253]1009
1010# -----------------------------------------------------------------------------
[9090]1011# Pass 2 - The needed rule - Make need tools.
1012# That is tools and stuff that is required for the next passes.
1013# WARNING! These tools and stuff shouldn't rely on libraries and other
1014# results of later passes.
[8253]1015# -----------------------------------------------------------------------------
[9090]1016!ifdef SUBDIRS_NEEDED
1017_SUBDIRS_NEEDED = _subdir_needed
1018$(_SUBDIRS_NEEDED):
1019 @$(TOOL_DODIRS) "$(SUBDIRS_NEEDED)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) needed
1020!else
1021! ifdef SUBDIRS
1022_SUBDIRS_NEEDED = _subdir_needed
1023$(_SUBDIRS_NEEDED):
1024 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) needed
1025! endif
1026!endif
1027
1028!ifdef PREMAKEFILES_NEEDED
1029_PREMAKEFILES_NEEDED = _premakefiles_needed
1030$(_PREMAKEFILES_NEEDED):
1031 @$(TOOL_DOMAKES) "$(PREMAKEFILES_NEEDED)" $(TOOL_MAKE) needed
1032!else
1033! ifdef PREMAKEFILES
1034_PREMAKEFILES_NEEDED = _premakefiles_needed
1035$(_PREMAKEFILES_NEEDED):
1036 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) needed
1037! endif
1038!endif
1039
[9127]1040!ifdef TARGET_NEEDED
[9090]1041needed: $(_SUBDIRS_NEEDED) $(_PREMAKEFILES_NEEDED) target
1042!else
1043needed: $(_SUBDIRS_NEEDED) $(_PREMAKEFILES_NEEDED)
1044!endif
1045!ifdef POSTMAKEFILES_NEEDED
1046 @$(TOOL_DOMAKES) "$(POSTMAKEFILES_NEEDED)" $(TOOL_MAKE) $@
1047!else
1048! ifdef POSTMAKEFILES
1049 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
1050! endif
1051!endif
1052
1053
1054
1055# -----------------------------------------------------------------------------
1056# Pass 3 - The lib rule - Make libraries.
1057# -----------------------------------------------------------------------------
1058!ifdef SUBDIRS_LIB
1059_SUBDIRS_LIB = _subdir_lib
1060$(_SUBDIRS_LIB):
1061 @$(TOOL_DODIRS) "$(SUBDIRS_LIB)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) lib
1062!else
1063! ifdef SUBDIRS
1064_SUBDIRS_LIB = _subdir_lib
1065$(_SUBDIRS_LIB):
[8423]1066 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) lib
[9090]1067! endif
[8197]1068!endif
1069
[9090]1070!ifdef PREMAKEFILES_LIB
1071_PREMAKEFILES_LIB = _premakefiles_lib
1072$(_PREMAKEFILES_LIB):
1073 @$(TOOL_DOMAKES) "$(PREMAKEFILES_LIB)" $(TOOL_MAKE) lib
1074!else
1075! ifdef PREMAKEFILES
1076_PREMAKEFILES_LIB = _premakefiles_lib
1077$(_PREMAKEFILES_LIB):
[8197]1078 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) lib
[9090]1079! endif
[8197]1080!endif
1081
[9090]1082lib: $(_SUBDIRS_LIB) $(_PREMAKEFILES_LIB) \
[9127]1083!if !defined(TARGET_NEEDED) && ("$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFSLIB")
1084 $(TARGET) $(_TARGET_EARLY_PUBLISH) \
[9031]1085!endif
1086 $(TARGET_ILIB)
[9090]1087!ifdef POSTMAKEFILES_LIB
1088 @$(TOOL_DOMAKES) "$(POSTMAKEFILES_LIB)" $(TOOL_MAKE) $@
1089!else
1090! ifdef POSTMAKEFILES
[9031]1091 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
[9090]1092! endif
[9031]1093!endif
1094
1095
1096
1097# -----------------------------------------------------------------------------
[9275]1098# Pass 4 - The binary rule - Build the binary.
[9031]1099# -----------------------------------------------------------------------------
[9275]1100!ifdef SUBDIRS_BINARY
1101_SUBDIRS_BINARY = _subdir_binary
1102$(_SUBDIRS_BINARY):
1103 @$(TOOL_DODIRS) "$(SUBDIRS_BINARY)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) binary
[9090]1104!else
1105! ifdef SUBDIRS
[9275]1106_SUBDIRS_BINARY = _subdir_binary
1107$(_SUBDIRS_BINARY):
1108 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) binary
[9090]1109! endif
[9031]1110!endif
1111
[9275]1112!ifdef PREMAKEFILES_BINARY
1113_PREMAKEFILES_BINARY = _premakefiles_binary
1114$(_PREMAKEFILES_BINARY):
1115 @$(TOOL_DOMAKES) "$(PREMAKEFILES_BINARY)" $(TOOL_MAKE) binary
[9090]1116!else
1117! ifdef PREMAKEFILES
[9275]1118_PREMAKEFILES_BINARY = _premakefiles_binary
1119$(_PREMAKEFILES_BINARY):
1120 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) binary
[9090]1121! endif
[9031]1122!endif
1123
[9275]1124binary executable: \
[9127]1125!if "$(TARGET_MODE)" != "LIB" && "$(TARGET_MODE)" != "SYSLIB" && "$(TARGET_MODE)" != "IFSLIB" && !defined(TARGET_NEEDED)
[9275]1126 $(_SUBDIRS_BINARY) $(_PREMAKEFILES_BINARY) $(TARGET) $(_TARGET_EARLY_PUBLISH)
[8290]1127!else
[9275]1128 $(_SUBDIRS_BINARY) $(_PREMAKEFILES_BINARY)
[8290]1129!endif
[9275]1130!ifdef POSTMAKEFILES_BINARY
1131 @$(TOOL_DOMAKES) "$(POSTMAKEFILES_BINARY)" $(TOOL_MAKE) $@
[9090]1132!else
1133! ifdef POSTMAKEFILES
[8197]1134 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
[9090]1135! endif
[8197]1136!endif
1137
1138
[8253]1139
1140# -----------------------------------------------------------------------------
[9275]1141# Pass 5 - The misc(ellaneous) rule - Makes miscellaneous stuff like
1142# help, documentations etc. This is experimental for the moment.
[9031]1143# -----------------------------------------------------------------------------
[9090]1144!ifdef SUBDIRS_MISC
1145_SUBDIRS_MISC = _subdir_misc
[9178]1146$(_SUBDIRS_MISC):
[9275]1147 @$(TOOL_DODIRS) "$(SUBDIRS_MISC)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) misc
[9090]1148!else
1149! ifdef SUBDIRS
1150_SUBDIRS_MISC = _subdir_misc
1151$(_SUBDIRS_MISC):
[9275]1152 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) misc
[9090]1153! endif
[9031]1154!endif
1155
[9090]1156!ifdef PREMAKEFILES_MISC
1157_PREMAKEFILES_MISC = _premakefiles_misc
[9031]1158$(PREMAKEFILES_MISC):
[9275]1159 @$(TOOL_DOMAKES) "$(PREMAKEFILES_MISC)" $(TOOL_MAKE) misc
[9090]1160!else
1161! ifdef PREMAKEFILES
1162_PREMAKEFILES_MISC = _premakefiles_misc
1163$(_PREMAKEFILES_MISC):
[9275]1164 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) misc
[9090]1165! endif
[9031]1166!endif
1167
[9275]1168misc miscellaneous: $(_SUBDIRS_MISC) $(_PREMAKEFILES_MISC) \
1169 $(TARGET_BOOKS) $(TARGET_HELPS) $(TARGET_DOCS) $(TARGET_MISC)
1170!if "$(TARGET_BOOKS)$(TARGET_HELPS)$(TARGET_DOCS)$(TARGET_MISC)" != ""
1171 @$(ECHO) Successfully Built $(CLRFIL)$(TARGET_BOOKS) $(TARGET_HELPS) $(TARGET_DOCS) $(TARGET_MISC)$(CLRRST)
[9090]1172!endif
1173!ifdef POSTMAKEFILES_MISC
1174 @$(TOOL_DOMAKES) "$(POSTMAKEFILES_MISC)" $(TOOL_MAKE) $@
[9031]1175!else
[9090]1176! ifdef POSTMAKEFILES
[9031]1177 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
[9090]1178! endif
[9031]1179!endif
1180
1181
1182
1183# -----------------------------------------------------------------------------
[9127]1184# Pass 6 - The publish rule - Copies target to main binary directory.
[8253]1185# Installation order is not concidered vital, so subdirectories and
[9127]1186# pre-makefiles are processed after this directory.
1187# However, this order might be changed!
[8253]1188# -----------------------------------------------------------------------------
[9127]1189!if "$(_TARGET_EARLY_PUBLISH)" != ""
1190publish:
1191!else
1192publish: publish_target
[8197]1193!endif
[9127]1194!ifdef SUBDIRS_PUBLISH
1195 @$(TOOL_DODIRS) "$(SUBDIRS_PUBLISH)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) $@
[9090]1196!else
1197! ifdef SUBDIRS
[8423]1198 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) $@
[9090]1199! endif
[8197]1200!endif
[9127]1201!ifdef PREMAKEFILES_PUBLISH
1202 @$(TOOL_DOMAKES) "$(PREMAKEFILES_PUBLISH)" $(TOOL_MAKE) $@
[9090]1203!else
1204! ifdef PREMAKEFILES
[8197]1205 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) $@
[9090]1206! endif
[8197]1207!endif
[9127]1208!ifdef POSTMAKEFILES_PUBLISH
1209 @$(TOOL_DOMAKES) "$(POSTMAKEFILES_PUBLISH)" $(TOOL_MAKE) $@
[9090]1210!else
1211! ifdef POSTMAKEFILES
[8197]1212 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
[9090]1213! endif
[8197]1214!endif
1215
[9135]1216
[9127]1217#
1218# Publish rule which doesn't go down into subdirs and submakes.
1219# This one is invoked when a target is 'needed' or early published.
1220#
1221publish_target:
1222!if "$(_TARGET_EARLY_PUBLISH)" != "" || "$(TARGET_MODE:LIB=cute)" == "$(TARGET_MODE)"
1223! if "$(TARGET_MODE)" != "EMPTY" && "$(TARGET_MODE)" != "TESTCASE" && "$(TARGET_MODE)" != "DEPEND"
1224 @$(ECHO) Publishing $(CLRFIL)$(TARGET)$(CLRTXT) to directory $(CLRFIL)$(TARGET_PUB_DIR)\$(TARGET_PUB_SUB)$(CLRRST)
1225 @if not exist "$(TARGET)" $(TOOL_ECHO) $(CLRERR)WARNING: $(CLRFIL)$(TARGET)$(CLRERR) doesn't exist. $(CLRRST)
1226 @if not exist "$(TARGET_PUB_DIR)" $(TOOL_CREATEPATH) $(TARGET_PUB_DIR)
1227 @if exist "$(TARGET)" $(TOOL_COPY) "$(TARGET)" "$(TARGET_PUB)"
1228 @if exist "$(TARGET_SYM)" $(TOOL_COPY) "$(TARGET_SYM)" "$(TARGET_PUB_DIR)"
1229! if "$(TARGET_PUB_DEB)" != ""
1230 @$(ECHO) Publishing unstripped $(CLRFIL)$(TARGET)$(CLRTXT) to directory $(CLRFIL)$(TARGET_PUB_DIR_DEB)$(CLRRST)
1231 @if not exist "$(_TARGET_DEB)" $(TOOL_ECHO) $(CLRERR)WARNING: $(CLRFIL)$(_TARGET)$(CLRERR) doesn't exist. $(CLRRST)
1232 @if not exist "$(TARGET_PUB_DIR_DEB)" $(TOOL_CREATEPATH) $(TARGET_PUB_DIR_DEB)
1233 @if exist "$(_TARGET_DEB)" $(TOOL_COPY) "$(_TARGET_DEB)" "$(TARGET_PUB_DEB)"
1234 @if exist "$(TARGET_SYM)" $(TOOL_COPY) "$(TARGET_SYM)" "$(TARGET_PUB_DIR_DEB)"
1235! endif
1236! endif
1237!endif
[9275]1238!if "$(TARGET_BOOKS)" != ""
1239 @$(ECHO) Publishing Book(s) $(CLRFIL)$(TARGET_BOOKS)$(CLRTXT) to directory $(CLRFIL)$(TARGET_BOOK_PUB_DIR)$(CLRRST)
1240 @if not exist "$(TARGET_BOOK_PUB_DIR)" $(TOOL_CREATEPATH) $(TARGET_BOOK_PUB_DIR)
1241 @$(TOOL_COPY) $(TARGET_BOOKS) $(TARGET_BOOK_PUB_DIR)
1242!endif
1243!if "$(TARGET_HELPS)" != ""
1244 @$(ECHO) Publishing Help file(s) $(CLRFIL)$(TARGET_HELPS)$(CLRTXT) to directory $(CLRFIL)$(TARGET_HELP_PUB_DIR)$(CLRRST)
1245 @if not exist "$(TARGET_HELP_PUB_DIR)" $(TOOL_CREATEPATH) $(TARGET_HELP_PUB_DIR)
1246 @$(TOOL_COPY) $(TARGET_HELPS) $(TARGET_HELP_PUB_DIR)
1247!endif
[9127]1248!if "$(TARGET_DOCS)" != ""
[9275]1249 @$(ECHO) Publishing Doc(s) $(CLRFIL)$(TARGET_DOCS)$(CLRTXT) to directory $(CLRFIL)$(TARGET_DOC_PUB_DIR)$(CLRRST)
1250 @if not exist "$(TARGET_DOC_PUB_DIR)" $(TOOL_CREATEPATH) $(TARGET_DOC_PUB_DIR)
1251 @$(TOOL_COPY) $(TARGET_DOCS) $(TARGET_DOC_PUB_DIR)
[9127]1252!endif
[8197]1253
[8253]1254
[9127]1255
[9031]1256# -----------------------------------------------------------------------------
1257# Pass x - The testcase rule - Execute testcases when present.
1258# Testcases are either a testcase.mak file or a testcase subdirectory.
1259# -----------------------------------------------------------------------------
[8714]1260!if "$(TARGET_MODE)" != "TESTCASE"
1261!ifndef BUILD_OWN_TESTCASE_RULE
[9090]1262
[8714]1263!ifndef MAKEVER
1264_TESTCASE_TST1 = [$(TOOL_EXISTS) testcase] == 0
1265_TESTCASE_TST2 = [$(TOOL_EXISTS) testcase.mak] == 0
1266!else
1267_TESTCASE_TST1 = exists(testcase) != 0
1268_TESTCASE_TST2 = exists(testcase.mak) != 0
1269!endif
[9031]1270
[8290]1271testcase:
[9031]1272 @$(ECHO) Executing testcases $(CLRRST)
[8714]1273!if $(_TESTCASE_TST1)
[8423]1274 @$(TOOL_DODIRS) "testcase" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) $@
[8197]1275!endif
[8714]1276!if $(_TESTCASE_TST2)
[8197]1277 @$(TOOL_DOMAKES) "testcase.mak" $(TOOL_MAKE) $@
1278!endif
[9090]1279!ifdef SUBDIRS_TESTCASE
1280 @$(TOOL_DODIRS) "$(SUBDIRS_TESTCASE)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) $@
1281!else
1282! ifdef SUBDIRS
[8423]1283 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) $@
[9090]1284! endif
[8197]1285!endif
[9090]1286!ifdef PREMAKEFILES_TESTCASE
1287 @$(TOOL_DOMAKES) "$(PREMAKEFILES_TESTCASE)" $(TOOL_MAKE) $@
1288!else
1289! ifdef PREMAKEFILES
[8197]1290 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) $@
[9090]1291! endif
[8197]1292!endif
[9090]1293!ifdef POSTMAKEFILES_TESTCASE
1294 @$(TOOL_DOMAKES) "$(POSTMAKEFILES_TESTCASE)" $(TOOL_MAKE) $@
1295!else
1296! ifdef POSTMAKEFILES
[8197]1297 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
[9090]1298! endif
[8197]1299!endif
[9090]1300
1301!endif # BUILD_OWN_TESTCASE_RULE
[8714]1302!endif #!TESTCASE
[8197]1303
1304
[9178]1305# -----------------------------------------------------------------------------
1306# Pass x - The packing rule - traverse subdirs etc.
1307# -----------------------------------------------------------------------------
1308!ifdef SUBDIRS_PACKING
1309_SUBDIRS_PACKING = _subdir_packing
1310$(_SUBDIRS_PACKING):
1311 @$(TOOL_DODIRS) "$(SUBDIRS_PACKING)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) packing
1312!else
1313! ifdef SUBDIRS
1314_SUBDIRS_PACKING = _subdir_packing
1315$(_SUBDIRS_PACKING):
1316 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) packing
1317! endif
1318!endif
[8253]1319
[9178]1320!ifdef PREMAKEFILES_PACKING
1321_PREMAKEFILES_PACKING = _premakefiles_packing
1322$(PREMAKEFILES_PACKING):
1323 @$(TOOL_DOMAKES) "$(PREMAKEFILES_PACKING)" $(TOOL_MAKE) packing
1324!else
1325! ifdef PREMAKEFILES
1326_PREMAKEFILES_PACKING = _premakefiles_packing
1327$(_PREMAKEFILES_PACKING):
1328 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) packing
1329! endif
1330!endif
1331
1332!if "$(RULE_PACKING)" == "packing"
1333_packing: \
1334!else
1335packing: \
1336!endif
1337 $(_SUBDIRS_PACKING) $(_PREMAKEFILES_PACKING) $(RULE_PACKING)
1338!ifdef POSTMAKEFILES_PACKING
1339 @$(TOOL_DOMAKES) "$(POSTMAKEFILES_PACKING)" $(TOOL_MAKE) $@
1340!else
1341! ifdef POSTMAKEFILES
1342 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
1343! endif
1344!endif
1345 $(ECHO) .$(CLRRST)
1346
1347
1348
[8253]1349# -----------------------------------------------------------------------------
[9031]1350# The target rule - Build the target.
[9090]1351# NOTE! NO SUBDIRS OR POST/PREMAKED INVOLVED!
[8298]1352# -----------------------------------------------------------------------------
[9127]1353target: $(TARGET) $(TARGET_ILIB) $(_TARGET_EARLY_PUBLISH)
1354!if "$(TARGET)$(TARGET_ILIB)" != ""
[9031]1355 @$(ECHO) Successfully Built $(CLRFIL)$(TARGET) $(TARGET_ILIB)$(CLRRST)
[9127]1356!else
1357 @$(ECHO) .$(CLRRST)
1358!endif
[8197]1359
1360
[8253]1361
1362# -----------------------------------------------------------------------------
[9031]1363# The shell rule - Setup the correcte shell environment and start a shell.
[8253]1364# -----------------------------------------------------------------------------
[9031]1365shell:
1366 @$(ECHO) Creating work shell $(CLRRST)
1367 \
1368!ifndef BUILD_VERBOSE
1369 @ \
[8197]1370!endif
[9031]1371 -$(TOOL_BUILDENV) $(BUILD_ENVS_BASE_PRE) $(BUILD_ENVS_PRE) $(ENV_ENVS) \
1372 $(BUILD_ENVS_BASE_POST) $(BUILD_ENVS_POST) * $(COMSPEC)
[8714]1373
1374
1375
1376# -----------------------------------------------------------------------------
1377# The nothing rule - Rule for testing the makefile structure.
1378# -----------------------------------------------------------------------------
1379nothing:
[9031]1380 @$(ECHO) Doing nothing in $(MAKEFILE).
[8714]1381!ifdef SUBDIRS
[8423]1382 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) $@
[8197]1383!endif
1384!ifdef PREMAKEFILES
1385 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) $@
1386!endif
1387!ifdef POSTMAKEFILES
1388 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
1389!endif
[8714]1390 @$(ECHO) Completed nothing in $(MAKEFILE).
[8197]1391
1392
[8253]1393
1394# -----------------------------------------------------------------------------
1395# The $(TARGET) rule - For EXE, DLL, SYS and IFS targets
1396# -----------------------------------------------------------------------------
[8423]1397!if "$(TARGET_MODE)" == "EXE" || "$(TARGET_MODE)" == "DLL" || "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "VDD"
[9240]1398$(TARGET): $(TARGET_OBJS) $(TARGET_RES) $(TARGET_DEF) $(TARGET_DEPS) $(TARGET_LIBS) \
1399 $(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]1400!if "$(TOOL_JOB_WAIT)" != ""
1401! ifndef BUILD_QUIET
[8714]1402 @$(ECHO) Waiting for jobs to complete $(CLRRST)
[8423]1403! endif
[8714]1404 \
[8423]1405! ifndef BUILD_VERBOSE
[8714]1406 @ \
[8423]1407! endif
[8714]1408 $(TOOL_JOB_WAIT)
[8423]1409!endif
[9225]1410!if "$(TARGET_DEF_LINK)" != "$(TARGET_DEF)"
1411! ifndef BUILD_QUIET
1412 @$(ECHO) Stamping deffile with build level info.$(CLRRST)
1413! endif
1414 \
1415! ifndef BUILD_VERBOSE
1416 @ \
1417! endif
1418 $(TOOL_BLDLEVEL) $(BUILD_BLDLEVEL_FLAGS) $(TARGET_BLDLEVEL_FLAGS) -R$(TARGET_DEF) $(TARGET_DEF) $(TARGET_DEF_LINK)
1419!endif
1420!ifndef TOOL_DEFCONV
1421 @$(TOOL_ECHOTXT) Creating Linker Input File $(CLRRST)<<$(TARGET_LNK)
1422$(LINK_LNK1)
1423$(LINK_LNK2)
1424$(LINK_LNK3)
1425$(LINK_LNK4)
1426$(LINK_LNK5)
1427<<KEEP
1428!else
1429 @$(ECHO) Creating Linker Input File $(CLRRST) $(TARGET_LNK)
1430 @$(TOOL_RM) "$(TARGET_LNK)"
1431 \
[9240]1432! ifndef BUILD_VERBOSE
[9225]1433 @ \
1434! endif
1435 $(TOOL_DEFCONV) $(TARGET_DEF_LINK) $(TARGET_LNK) <<$(TARGET_LNK)2
1436$(LINK_LNK1)
1437$(LINK_LNK2)
1438$(LINK_LNK3)
1439$(LINK_LNK4)
1440$(LINK_LNK5)
1441<<keep
1442!endif
1443!ifdef BUILD_VERBOSE
1444 @type $(TARGET_LNK)
1445!endif
[8197]1446 @$(ECHO) Linking $(TARGET_MODE) $(CLRFIL)$@ $(CLRRST)
[8714]1447 \
[8290]1448!ifndef BUILD_VERBOSE
1449 @ \
1450!endif
[8197]1451!ifdef TARGET_IGNORE_LINKER_WARNINGS
1452 -4 \
1453!endif
1454!if "$(TARGET_MODE)" == "EXE"
[8253]1455 $(LINK_CMD_EXE)
[8197]1456!endif
[8423]1457!if "$(TARGET_MODE)" == "DLL"
[8290]1458 $(LINK_CMD_DLL)
[8197]1459!endif
1460!if "$(TARGET_MODE)" == "SYS"
[8290]1461 $(LINK_CMD_SYS)
[8197]1462!endif
[8213]1463!if "$(TARGET_MODE)" == "IFS"
[8290]1464 $(LINK_CMD_IFS)
[8213]1465!endif
[8290]1466!if "$(TARGET_MODE)" == "VDD"
1467 $(LINK_CMD_VDD)
1468!endif
[8197]1469!if "$(TARGET_RES)" != "" && "$(RL)" != ""
1470 @$(ECHO) Linking Resources $(CLRRST)
[8714]1471 \
[8290]1472! ifndef BUILD_VERBOSE
1473 @ \
1474! endif
1475 $(RL) $(RL_FLAGS) $(TARGET_RES) $@
[8197]1476!endif
1477!if "$(TARGET_DLLRNAME)" != ""
1478 @$(ECHO) Dll Rename $(TARGET_DLLRNAME)
[8714]1479 \
[8290]1480! ifndef BUILD_VERBOSE
1481 @ \
1482! endif
[8197]1483 $(TOOL_DLLRNAME) $(TARGET) $(TARGET_DLLRNAME)
1484!endif
[8333]1485!if "$(TOOL_MAPSYM)" != "" && "$(TARGET_SYM)" != "" && "$(TARGET_MAP)" != ""
[8714]1486 \
[8333]1487! ifndef BUILD_VERBOSE
1488 @ \
1489! endif
1490 $(TOOL_MAPSYM) $(TARGET_MAP) $(TARGET_SYM)
1491!endif
[9127]1492!if "$(BUILD_MODE)" == "RELEASE"
1493 \
1494! ifndef BUILD_VERBOSE
1495 @ \
1496! endif
1497 $(TOOL_COPY) "$@" "$(_TARGET_DEB)"
1498! if "$(TOOL_STRIP)" != ""
1499 \
1500! ifndef BUILD_VERBOSE
1501 @ \
1502! endif
1503 $(TOOL_STRIP) $@
1504! endif
1505!endif
[8197]1506
[8362]1507!endif
[8333]1508
1509
[8253]1510# -----------------------------------------------------------------------------
[8290]1511# The $(TARGET) rule - For LIB, SYSLIB, and IFSLIB targets.
[8253]1512# -----------------------------------------------------------------------------
[8290]1513!if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFSLIB"
[8197]1514$(TARGET): $(TARGET_OBJS) $(TARGET_LNK) $(TARGET_DEPS)
[8423]1515!if "$(TOOL_JOB_WAIT)" != ""
1516! ifndef BUILD_QUIET
1517 @$(ECHO) Waiting for jobs to complete $(CLRRST)
1518! endif
[8714]1519 \
[8423]1520! ifndef BUILD_VERBOSE
1521 @ \
1522! endif
1523 $(TOOL_JOB_WAIT)
1524!endif
[8197]1525 @$(ECHO) Creating Library $(CLRFIL)$@ $(CLRRST)
[8290]1526!ifndef BUILD_VERBOSE
[9044]1527 @$(TOOL_RM) "$@"
[8290]1528 @$(AR_CMD)
1529!else
[9044]1530 $(TOOL_RM) "$@"
[8197]1531 $(AR_CMD)
[8290]1532!endif
[8197]1533
1534
1535#
1536# Lib parameter file.
1537#
[9240]1538$(TARGET_LNK): $(MAKEFILE) $(MAKE_INCLUDE_SETUP) $(MAKE_INCLUDE_AR_SETUP) $(PATH_ROOT)\$(BUILD_SETUP_MAK)
[9116]1539 @$(TOOL_ECHOTXT) Creating Lib Input File $(CLRRST)<<$@
[8197]1540$(AR_LNK1)
1541$(AR_LNK2)
1542$(AR_LNK3)
1543$(AR_LNK4)
1544$(AR_LNK5)
1545<<KEEP
[8423]1546!ifdef BUILD_VERBOSE
1547 @type $@
[8197]1548!endif
[8423]1549!endif
[8197]1550
1551
[9031]1552# -----------------------------------------------------------------------------
1553# The $(TARGET) rule - For DEPEND targets.
[8253]1554# -----------------------------------------------------------------------------
[9028]1555!if "$(TARGET_MODE)" == "DEPEND"
1556$(TARGET):
1557 @$(ECHO) .
[8197]1558!endif
1559
1560
[8253]1561
1562# -----------------------------------------------------------------------------
1563# The $(TARGET_ILIB) rule - Make import library.
1564# -----------------------------------------------------------------------------
1565!ifdef TARGET_ILIB
[9240]1566$(TARGET_ILIB): $(TARGET_IDEF) $(MAKEFILE) $(MAKE_INCLUDE_SETUP) $(MAKE_INCLUDE_AR_SETUP) $(PATH_MAKE)\setup.tools.mk
[8253]1567 @$(ECHO) Creating Import Library $(CLRFIL)$@ $(CLRRST)
[8714]1568 \
[8290]1569!ifndef BUILD_VERBOSE
[9065]1570 @if not exist $(@D) $(ECHO) Target implib path $(CLRFIL)$(@D)$(CLRTXT) does NOT exist. Creating. $(CLRRST)
1571!endif
1572 @if not exist $(@D) $(TOOL_CREATEPATH) $(@D)
1573 \
1574!ifndef BUILD_VERBOSE
[8290]1575 @ \
1576!endif
[8253]1577 $(IMPLIB) $(IMPLIB_FLAGS) $@ $(TARGET_IDEF)
[9116]1578
1579
1580#
1581# Conversion rule for converting the .def file before passing along to implib.
1582#
1583! if "$(TARGET_IDEF_ORG)" != "" && "$(TARGET_IDEF_ORG)" != "$(TARGET_IDEF)"
1584$(TARGET_IDEF): $(TARGET_IDEF_ORG)
1585 @$(ECHO) Making Import Definition File $(CLRFIL)$@ $(CLRRST)
1586 \
1587!ifndef BUILD_VERBOSE
1588 @if not exist $(@D) $(ECHO) Target .def path $(CLRFIL)$(@D)$(CLRTXT) does NOT exist. Creating. $(CLRRST)
[8253]1589!endif
[9116]1590 @if not exist $(@D) $(TOOL_CREATEPATH) $(@D)
1591 \
1592!ifndef BUILD_VERBOSE
1593 @ \
1594!endif
1595 $(TOOL_IDEFCONV) $(TOOL_IDEFCONV_FLAGS) $(TARGET_IDEF_ORG) $@
1596! endif
[8253]1597
[9116]1598!endif
[8253]1599
1600
[9116]1601
[8253]1602# -----------------------------------------------------------------------------
1603# The .force rule - Force a remake of something everytime.
1604# -----------------------------------------------------------------------------
1605.force:
[8290]1606!ifndef BUILD_VERBOSE
[8253]1607 @$(ECHO) .
[8290]1608!else
1609 @$(ECHO) . (force) .
1610!endif
[8253]1611
1612
1613
1614# -----------------------------------------------------------------------------
1615# Read Dependencies.
1616# -----------------------------------------------------------------------------
[9028]1617!if "$(TARGET_MODE)" != "TESTCASE" && "$(TARGET_MODE)" != "DEPEND"
[8714]1618!if "$(TARGET_MODE)" != "EMPTY" && "$(NODEP)" == ""
[8253]1619
[8197]1620#
[8253]1621# Read dependency file for current directory
[8197]1622#
[8714]1623!ifndef MAKEVER
1624! if [$(TOOL_EXISTS) $(TARGET_DEPEND)] == 0
1625! ifdef BUILD_VERBOSE
1626! if [$(ECHO) Including dependency $(CLRFIL)$(TARGET_DEPEND)$(CLRRST)]
1627! endif
[8197]1628! endif
[8714]1629! include $(TARGET_DEPEND)
1630! else
[9062]1631#! ifndef NODEP
1632#! if [$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(TARGET_DEPEND) is missing.$(CLRRST)]
1633#! endif
1634#! endif
[8253]1635! endif
[8714]1636!else
1637! if %exists($(TARGET_DEPEND)) != 0
1638! ifdef BUILD_VERBOSE
1639$(ECHO) Including dependency $(CLRFIL)$(TARGET_DEPEND)$(CLRRST)
1640! endif
1641! include $(TARGET_DEPEND)
1642! else
[9062]1643#! ifndef NODEP
1644#$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(TARGET_DEPEND) is missing.$(CLRRST)
1645#! endif
[8714]1646! endif
[8253]1647!endif
1648
1649
1650#
1651# Read global dependency files.
1652#
1653!ifdef BUILD_DEPEND1
[8714]1654! ifndef MAKEVER
1655! if [$(TOOL_EXISTS) $(BUILD_DEPEND1)] == 0
1656! ifdef BUILD_VERBOSE
1657! if [$(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND1)$(CLRRST)]
1658! endif
[8253]1659! endif
[8714]1660! include $(BUILD_DEPEND1)
1661! else
1662! ifndef NODEP
[8253]1663! if [$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND1) is missing.$(CLRRST)]
[8197]1664! endif
[8714]1665! endif
[8197]1666! endif
[8714]1667! else
1668! if %exists($(BUILD_DEPEND1)) != 0
1669! ifdef BUILD_VERBOSE
1670$(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND1)$(CLRRST)
1671! endif
1672! include $(BUILD_DEPEND1)
1673! else
1674! ifndef NODEP
1675$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND1) is missing.$(CLRRST)
1676! endif
1677! endif
[8197]1678! endif
1679!endif
1680
[8714]1681
[8253]1682!ifdef BUILD_DEPEND2
[8714]1683! ifndef MAKEVER
1684! if [$(TOOL_EXISTS) $(BUILD_DEPEND2)] == 0
1685! ifdef BUILD_VERBOSE
1686! if [$(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND2)$(CLRRST)]
1687! endif
[8253]1688! endif
[8714]1689! include $(BUILD_DEPEND2)
1690! else
1691! ifndef NODEP
[8253]1692! if [$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND2) is missing.$(CLRRST)]
1693! endif
[8714]1694! endif
[8253]1695! endif
[8714]1696! else
1697! if %exists($(BUILD_DEPEND2)) != 0
1698! ifdef BUILD_VERBOSE
1699$(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND2)$(CLRRST)
1700! endif
1701! include $(BUILD_DEPEND2)
1702! else
1703! ifndef NODEP
1704$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND2) is missing.$(CLRRST)
1705! endif
1706! endif
[8253]1707! endif
1708!endif
[8197]1709
1710
[8253]1711!ifdef BUILD_DEPEND3
[8714]1712! ifndef MAKEVER
1713! if [$(TOOL_EXISTS) $(BUILD_DEPEND3)] == 0
1714! ifdef BUILD_VERBOSE
1715! if [$(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND3)$(CLRRST)]
1716! endif
[8253]1717! endif
[8714]1718! include $(BUILD_DEPEND3)
1719! else
1720! ifndef NODEP
[8253]1721! if [$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND3) is missing.$(CLRRST)]
1722! endif
[8714]1723! endif
[8253]1724! endif
[8714]1725! else
1726! if %exists($(BUILD_DEPEND3)) != 0
1727! ifdef BUILD_VERBOSE
1728$(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND3)$(CLRRST)
1729! endif
1730! include $(BUILD_DEPEND3)
1731! else
1732! ifndef NODEP
1733$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND3) is missing.$(CLRRST)
1734! endif
1735! endif
[8253]1736! endif
1737!endif
1738
1739
1740!endif
1741
[8423]1742
1743#
1744# If BUILD_MULTIJOBS is nonempty make sure the job daemon is up running.
1745#
1746!if "$(BUILD_MULTIJOBS)" != ""
1747! if [$(TOOL_JOB_UP)] != 0
1748! if "$(BUILD_QUITE)" == ""
[8714]1749! ifndef MAKEVER
1750! if [$(ECHO) Starting Job Daemon With $(TOOL_JOB_WORKERS) Workers...$(CLRRST)]
1751! endif
1752! else
1753$(ECHO) Starting Job Daemon With $(TOOL_JOB_WORKERS) Workers...$(CLRRST)
[8423]1754! endif
1755! endif
1756! if [$(TOOL_JOB_INIT) $(TOOL_JOB_WORKERS)] != 0
[8714]1757! ifndef MAKEVER
1758! if [$(ECHO) $(CLRERR)Fatal error: Failed to start job daemon.$(CLRRST)]
1759! endif
1760! error
1761!else
1762! error $(CLRERR)Fatal error: Failed to start job daemon.$(CLRRST)
1763!endif
[8423]1764! endif
1765! endif
1766!endif
1767
[8714]1768!endif #!TESTCASE
[9178]1769
1770
1771#
1772# Include system library dependency stubs.
1773#
1774!include $(PATH_MAKE)\setup.$(SHT_TRGPLTFRM)libs.mk
1775
1776
1777#
1778# Check if TARGET_ALWAYS needs to be forced built.
1779#
1780!if "$(TARGET_ALWAYS)" != ""
1781! ifndef BUILD_FORCED_BUILD_TEST
[9188]1782! if [$(TOOL_MAKE) BUILD_FORCED_BUILD_TEST=1 -f $(MAKEFILE) -q $(TARGET) $(TARGET_ILIB) >nul 2>nul] != 0
[9178]1783$(TARGET_ALWAYS): .force
1784! endif
1785! endif
1786!endif
1787
Note: See TracBrowser for help on using the repository browser.