source: trunk/make/process.mak@ 9044

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

polish.

File size: 35.0 KB
RevLine 
[9044]1# $Id: process.mak,v 1.18 2002-08-20 05:53:26 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
73! if [$(ECHO) $(CLRERR)Fatal Error: Bad TARGET_MODE="$(TARGET_MODE)". Valid ones are: EXE, DLL, SYS, IFS, VDD, LIB, SYSLIB, IFSLIB, TESTCASE and EMPTY.$(CLRRST)]
74! endif
75! error
76! else
77! error $(CLRERR)Fatal Error: Bad TARGET_MODE="$(TARGET_MODE)". Valid ones are: EXE, DLL, SYS, IFS, VDD, LIB, SYSLIB, IFSLIB, 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
92
[8253]93# -----------------------------------------------------------------------------
94# Provide overridable defaults
95# -----------------------------------------------------------------------------
96
97# Default target mode is executable.
98!ifndef TARGET_MODE
99TARGET_MODE = EXE
100!endif
101
102# Default extension corresponds to the target mode.
103!ifndef TARGET_EXT
[8423]104! if "$(TARGET_MODE)" == "DLL"
[8253]105TARGET_EXT = $(EXT_DLL)
106! endif
107! if "$(TARGET_MODE)" == "SYS"
108TARGET_EXT = $(EXT_SYS)
109! endif
[8290]110! if "$(TARGET_MODE)" == "IFS"
111TARGET_EXT = $(EXT_IFS)
112! endif
113! if "$(TARGET_MODE)" == "VDD"
114TARGET_EXT = $(EXT_VDD)
115! endif
[8253]116! if "$(TARGET_MODE)" == "EXE"
117TARGET_EXT = $(EXT_EXE)
118! endif
[8290]119! if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFSLIB"
[8253]120TARGET_EXT = $(EXT_LIB)
121! endif
122! if "$(TARGET_MODE)" == "EMPTY"
123TARGET_EXT = empty
124! endif
[9028]125! if "$(TARGET_MODE)" == "DEPEND"
126TARGET_EXT = depend
127! endif
[8714]128! if "$(TARGET_MODE)" == "TESTCASE"
129TARGET_EXT = testcase
130! endif
[8253]131! ifndef TARGET_EXT
[8714]132! ifndef MAKEVER
133! if [$(ECHO) $(CLRERR)Internal Error: TARGET_EXT not set. Probably invalid TARGET_MODE. (TARGET_MODE="$(TARGET_MODE)")$(CLRRST)]
134! endif
135! error
136! else
137! error $(CLRERR)Internal Error: TARGET_EXT not set. Probably invalid TARGET_MODE. (TARGET_MODE="$(TARGET_MODE)")$(CLRRST)
[8423]138! endif
[8253]139! endif
140!endif
141
142# Default target path. (where all the generated stuff for this target goes)
143!ifndef PATH_TARGET
144PATH_TARGET = $(PATH_OBJ)\$(TARGET_NAME).$(TARGET_EXT)
145!endif
146
147# Default target file. (output)
[8197]148!ifndef TARGET
[8270]149! if "$(TARGET_MODE)" != "EMPTY"
[8714]150! if "$(TARGET_MODE)" != "TESTCASE"
[8253]151TARGET = $(PATH_TARGET)\$(TARGET_NAME).$(TARGET_EXT)
[8714]152! else
153TARGET = testcase
154! endif
[8270]155! endif
[8197]156!endif
157
[8333]158# Default target .sym file. (output)
159!ifndef TARGET_SYM
160TARGET_SYM = $(PATH_TARGET)\$(TARGET_NAME).$(EXT_SYM)
161!endif
[8270]162
[8253]163# Default object file. (output)
[8197]164!ifndef TARGET_OBJS
[8253]165TARGET_OBJS = $(PATH_TARGET)\$(TARGET_NAME).$(EXT_OBJ)
[8197]166!endif
167
[8253]168# Default libraries. (input)
[8197]169!ifndef TARGET_LIBS
[8253]170TARGET_LIBS = $(LIB_C_DLL) $(LIB_OS) $(LIB_C_RTDLL)
[8197]171!endif
172
[8253]173# Default definition file. (input)
[8197]174!ifndef TARGET_DEF
[8253]175TARGET_DEF = $(MAKEDIR)\$(PATH_DEF)\$(TARGET_NAME).def
[8197]176!endif
177
[8333]178# Default modified definition filename. (output)
179!ifndef TARGET_DEF_LINK
180TARGET_DEF_LINK = $(PATH_TARGET)\$(TARGET_NAME)_link.def
181!endif
182
[8253]183# Default definition file for generating the import library. (input)
[8197]184!ifndef TARGET_IDEF
[8253]185TARGET_IDEF = $(TARGET_DEF)
[8197]186!endif
187
[8253]188# Default map file. (output)
[8197]189!ifndef TARGET_MAP
[8333]190TARGET_MAP = $(PATH_TARGET)\$(TARGET_NAME).$(EXT_MAP)
[8197]191!endif
192
[8253]193# Default link file. (output)
[8197]194!ifndef TARGET_LNK
[8253]195TARGET_LNK = $(PATH_TARGET)\$(TARGET_NAME).lnk
[8197]196!endif
197
[8253]198# Default import library file. (output)
199!ifndef TARGET_ILIB
[8423]200! if "$(TARGET_MODE)" == "DLL"
[8253]201TARGET_ILIB =$(PATH_LIB)\$(TARGET_NAME).$(EXT_ILIB)
202! endif
[8197]203!endif
204
[8290]205# Default public name. (output)
206!ifndef TARGET_PUBNAME
207TARGET_PUBNAME=
208! ifdef TARGET_PUBLIC
209! if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFSLIB"
210TARGET_PUBNAME=$(PATH_LIB)\$(TARGET_NAME).$(TARGET_EXT)
211! endif
212! if "$(TARGET_MODE)" == "EXE"
213TARGET_PUBNAME=$(PATH_EXE)\$(TARGET_NAME).$(TARGET_EXT)
214! endif
[8423]215! if "$(TARGET_MODE)" == "DLL"
[8290]216TARGET_PUBNAME=$(PATH_DLL)\$(TARGET_NAME).$(TARGET_EXT)
217! endif
218! if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "IFS"
219TARGET_PUBNAME=$(PATH_SYS)\$(TARGET_NAME).$(TARGET_EXT)
220! endif
221! if "$(TARGET_MODE)" == "VDD"
222TARGET_PUBNAME=$(PATH_VDD)\$(TARGET_NAME).$(TARGET_EXT)
223! endif
[8253]224! endif
[8197]225!endif
[8253]226
227# Default depend filename.
228!ifndef TARGET_DEPEND
229TARGET_DEPEND = $(PATH_TARGET)\.depend
[8197]230!endif
231
[8423]232# Default makefile names.
233!ifndef BUILD_MAKEFILE
234BUILD_MAKEFILE = Makefile
235!endif
236
[8253]237# Default makefile name.
238!ifndef MAKEFILE
[8423]239MAKEFILE = $(BUILD_MAKEFILE)
[8197]240!endif
241
[8253]242# Ignore linker warnings for some target modes.
243!ifndef TARGET_IGNORE_LINKER_WARNINGS
[8423]244! if "$(TARGET_MODE)" == "DLL"
[8253]245TARGET_IGNORE_LINKER_WARNINGS = 1
246! endif
[8197]247!endif
248
249
[8253]250# Default stacksize
[8355]251# If 16bit: 8KB
252# Else (32bit): 64KB
[8197]253!ifndef TARGET_STACKSIZE
[8355]254! ifdef ENV_16BIT
[8197]255TARGET_STACKSIZE=0x2000
256! else
257TARGET_STACKSIZE=0x10000
258! endif
259!endif
260
[8253]261
262
263# -----------------------------------------------------------------------------
264# Tell user what we're building.
265# -----------------------------------------------------------------------------
266!ifndef BUILD_QUIET
[9044]267! if "$(TARGET)" != ""
268! ifndef MAKEVER
269! if [$(ECHO) Target is $(CLRFIL)$(TARGET)$(CLRRST)]
270! endif
271! else
272$(ECHO) Target is $(CLRFIL)$(TARGET)$(CLRRST)
[8714]273! endif
274! endif
[8197]275!endif
276
277
[8253]278# -----------------------------------------------------------------------------
279# Ensure the platform-specific target path exists
280# -----------------------------------------------------------------------------
281
282!if "$(TARGET_MODE)" != "EMPTY"
283! if "$(PATH_TARGET)" != ""
[8714]284! ifndef MAKEVER
285! if [$(TOOL_EXISTS) $(PATH_TARGET)] != 0
286! ifndef BUILD_QUIET
287! if [$(ECHO) Target path $(CLRFIL)$(PATH_TARGET)$(CLRTXT) does NOT exist. Creating. $(CLRRST)]
288! endif
[8253]289! endif
[8714]290! if [$(TOOL_CREATEPATH) $(PATH_TARGET)]
291! if [$(ECHO) $(CLRERR)Error: Could not create $(CLRFIL)$(PATH_TARGET)$(CLRRST)]
292! endif
293! error
294! endif
[8253]295! endif
[8714]296! else
297! if %exist($(PATH_TARGET)) == 0
298! ifndef BUILD_QUIET
299$(ECHO) Target path $(CLRFIL)$(PATH_TARGET)$(CLRTXT) does NOT exist. Creating. $(CLRRST)
[8423]300! endif
[8714]301! else
302! if [$(TOOL_CREATEPATH) $(PATH_TARGET)]
303! error $(CLRERR)Error: Could not create $(CLRFIL)$(PATH_TARGET)$(CLRRST)
304! endif
[8253]305! endif
[8197]306! endif
307! endif
308!endif
[8253]309# not 100% sure about the != EMPTY stuff, but this is way faster.
[8197]310
311
312
[8253]313# -----------------------------------------------------------------------------
314# Common inference rules
315# -----------------------------------------------------------------------------
[8197]316.SUFFIXES:
[8714]317.SUFFIXES: .c .cpp .asm .$(EXT_OBJ) .$(EXT_RES) .rc .ii .s
[8197]318
[8714]319#
320# A workaround for SlickEdits inability to find the buggy files..
321# This makes the source filenames in the error listing have full path.
322# See setup.mak for compile command line.
323#
324_SRC = $<
325!ifdef SLKRUNS
326_SRC = $(PATH_CURRENT)\$<
327!endif
[8197]328
[8714]329
[8197]330# Assembling assembly source.
331.asm{$(PATH_TARGET)}.$(EXT_OBJ):
[8714]332 @$(ECHO) Assembling $(CLRFIL)$(_SRC) $(CLRTXT)$(TOOL_JOB_SUB_MSG) $(CLRRST)
333 \
[8423]334! ifndef BUILD_VERBOSE
[8290]335 @ \
[8423]336! endif
[8213]337!if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB"
[8714]338 $(TOOL_JOB_SUB) $(AS) $(AS_FLAGS_SYS) $(_SRC) $(AS_OBJ_OUT)$@
[8197]339!else
[8714]340 $(TOOL_JOB_SUB) $(AS) $(AS_FLAGS) $(_SRC) $(AS_OBJ_OUT)$@
[8197]341!endif
342
343.asm.$(EXT_OBJ):
[8714]344 @$(ECHO) Assembling $(CLRFIL)$(_SRC) $(CLRRST)
345 \
[8290]346!ifndef BUILD_VERBOSE
347 @ \
348!endif
[8213]349!if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB"
[8714]350 $(AS) $(AS_FLAGS_SYS) $(_SRC) $(AS_OBJ_OUT)$(PATH_TARGET)\$(@F)
[8197]351!else
[8714]352 $(AS) $(AS_FLAGS) $(_SRC) $(AS_OBJ_OUT)$(PATH_TARGET)\$(@F)
[8197]353!endif
354
[8714]355# C++ Compiler base line
356_CXX_BASELINE = $(CXX) \
[8290]357!if "$(TARGET_MODE)" == "EXE" || "$(TARGET_MODE)" == "LIB"
[8197]358 $(CXX_FLAGS_EXE) \
359!endif
360!if "$(TARGET_MODE)" == "DLL"
361 $(CXX_FLAGS_DLL) \
362!endif
363!if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB"
364 $(CXX_FLAGS_SYS) \
365!endif
[8213]366!if "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB"
367 $(CXX_FLAGS_IFS) \
368!endif
[8714]369
370# Compiling C++ source.
371.cpp{$(PATH_TARGET)}.$(EXT_OBJ):
372 @$(ECHO) C++ Compiler $(CLRFIL)$(_SRC) $(CLRTXT)$(TOOL_JOB_SUB_MSG) $(CLRRST)
373 \
374!ifndef BUILD_VERBOSE
375 @ \
376!endif
377 $(TOOL_JOB_SUB) $(_CXX_BASELINE) \
[8253]378!if "$(CXX_LST_OUT)" != ""
[8213]379 $(CXX_LST_OUT)$(PATH_TARGET)\$(@B).s \
380!endif
[8714]381 $(CXX_OBJ_OUT)$@ $(_SRC)
[8197]382
383.cpp.$(EXT_OBJ):
[8714]384 @$(ECHO) C++ Compiler $(CLRFIL)$(_SRC) $(CLRRST)
385 \
[8290]386!ifndef BUILD_VERBOSE
387 @ \
388!endif
[8714]389 $(_CXX_BASELINE) \
[8253]390!if "$(CXX_LST_OUT)" != ""
[8213]391 $(CXX_LST_OUT)$(PATH_TARGET)\$(@B).s \
392!endif
[8714]393 $(CXX_OBJ_OUT)$(PATH_TARGET)\$(@F) $(_SRC)
[8197]394
395
396# Pre-Compiling C++ source.
[8714]397.cpp.ii:
398 @$(ECHO) C++ Compiler $(CLRFIL)$(_SRC) $(CLRRST)
399 \
[8290]400!ifndef BUILD_VERBOSE
401 @ \
402!endif
[8714]403 $(_CXX_BASELINE) \
404 $(CXX_PC_2_STDOUT) $(_SRC) > $@
[8197]405
406
[8714]407# Compiler C++ source to assembly.
408!if "$(CXX_AS_2_FILE)" != ""
409.cpp.s:
410 @$(ECHO) C++ To Assembly $(CLRFIL)$(_SRC) $(CLRRST)
411 \
[8290]412!ifndef BUILD_VERBOSE
413 @ \
414!endif
[8714]415 $(_CXX_BASELINE) \
416 $(CXX_AS_2_FILE)$@ $(_SRC)
417!endif
418
419
420
421# C Compiler base line
422_CC_BASELINE = $(CC) \
[8290]423!if "$(TARGET_MODE)" == "EXE" || "$(TARGET_MODE)" == "LIB"
[8197]424 $(CC_FLAGS_EXE) \
425!endif
426!if "$(TARGET_MODE)" == "DLL"
427 $(CC_FLAGS_DLL) \
428!endif
429!if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB"
430 $(CC_FLAGS_SYS) \
431!endif
[8213]432!if "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB"
433 $(CC_FLAGS_IFS) \
434!endif
[8714]435
436# Compiling C source.
437.c{$(PATH_TARGET)}.$(EXT_OBJ):
438 @$(ECHO) C Compiler $(CLRFIL)$(_SRC) $(CLRTXT)$(TOOL_JOB_SUB_MSG) $(CLRRST)
439 \
440!ifndef BUILD_VERBOSE
441 @ \
442!endif
443 $(TOOL_JOB_SUB) $(_CC_BASELINE) \
[8253]444!if "$(CC_LST_OUT)" != ""
[8213]445 $(CC_LST_OUT)$(PATH_TARGET)\$(@B).s \
446!endif
[8714]447 $(CC_OBJ_OUT)$@ $(_SRC)
[8197]448
449.c.$(EXT_OBJ):
[8714]450 @$(ECHO) C Compiler $(CLRFIL)$(_SRC) $(CLRRST)
451 \
[8290]452!ifndef BUILD_VERBOSE
453 @ \
454!endif
[8714]455 $(_CC_BASELINE) \
[8253]456!if "$(CC_LST_OUT)" != ""
[8213]457 $(CC_LST_OUT)$(PATH_TARGET)\$(@B).s \
458!endif
[8714]459 $(CC_OBJ_OUT)$(PATH_TARGET)\$(@F) $(_SRC)
[8197]460
461
462# Pre-Compiling C source.
[8714]463.c.ii:
464 @$(ECHO) C PreCompiler $(CLRFIL)$(_SRC) $(CLRRST)
465 \
[8290]466!ifndef BUILD_VERBOSE
467 @ \
468!endif
[8714]469 $(_CC_BASELINE) \
470 $(CC_PC_2_STDOUT) $(_SRC) > $@
471
472
473# Compiler C source to assembly.
474!if "$(CC_AS_2_FILE)" != ""
475.c.s:
476 @$(ECHO) C To Assembly $(CLRFIL)$(_SRC) $(CLRRST)
477 \
478!ifndef BUILD_VERBOSE
479 @ \
[8197]480!endif
[8714]481 $(_CC_BASELINE) \
482 $(CC_AS_2_FILE)$@ $(_SRC)
[8197]483!endif
484
485
486# Compiling resources.
487.rc{$(PATH_TARGET)}.res:
[8714]488 @$(ECHO) RC Compiler $(CLRFIL)$(_SRC) $(CLRTXT)$(TOOL_JOB_SUB_MSG)$(CLRRST)
489 \
[8290]490!ifndef BUILD_VERBOSE
491 @ \
492!endif
[8714]493 $(TOOL_JOB_SUB) $(RC) $(RC_FLAGS) $(_SRC) $@
[8197]494
495.rc.res:
[8714]496 @$(ECHO) RC Compiler $(CLRFIL)$(_SRC) $(CLRRST)
497 \
[8290]498!ifndef BUILD_VERBOSE
499 @ \
500!endif
[8714]501 $(RC) $(RC_FLAGS) $(_SRC) $(PATH_TARGET)\$(@F)
[8197]502
503
[8253]504
505
506
507# -----------------------------------------------------------------------------
508# The all rule - The default one, as it's the first rule in the file.
509# -----------------------------------------------------------------------------
[8197]510all: build
511
512
[8253]513
514# -----------------------------------------------------------------------------
[9031]515# The build rule - This runs all passes:
516# 1. Make Dependencies
517# 2. Make Libraries (all kinds)
518# 3. Make Executables
519# 4. Make Miscellaneous Targets
520# 5. Make Install
521# Note: In order to load dependencies we'll do a forwarding after making them.
[8253]522# -----------------------------------------------------------------------------
[9031]523build: _build
524!if "$(MAKEFLAGS:I=_)" == "$(MAKEFLAGS)" # this is of course broken in nmake v5.0 for OS/2.
525 @$(ECHO)$(CLRMAK)[Successfully Built Everything!] $(CLRRST)
526!else
527 @$(ECHO)$(CLRMAK)[Built Everything! (Ignore option specified)] $(CLRRST)
528!endif
529
530# internal rule shared by rebuild and build.
531_build: _build_banner_dep dep
532!ifndef BUILD_QUIET
533 @$(ECHO) Restarting $(CLRFIL)$(MAKEFILE)$(CLRTXT) with new dependencies. $(CLRRST)
534!endif
535 \
536!ifndef BUILD_VERBOSE
537 @ \
538!endif
539 $(TOOL_MAKE) -f $(MAKEFILE) _build_new_dependencies_
540
541# internal rule used to reload dependencies.
542_build_new_dependencies_: \
543 _build_banner_lib lib \
544 _build_banner_executable executable \
545 _build_banner_miscellaneous miscellaneous \
546 _build_banner_install install
547
548# Banners for rebuild and build.
549_build_banner_clean:
550 @$(ECHO)$(CLRMAK)[Start Pass 0 - Make Clean] $(CLRRST)
551 @SET _BUILD_PASS=0
552_build_banner_dep:
553 @$(ECHO)$(CLRMAK)[Start Pass 1 - Make Dependencies] $(CLRRST)
554 @SET _BUILD_PASS=1
555_build_banner_lib:
556 @$(ECHO)$(CLRMAK)[Start Pass 2 - Make Libraries] $(CLRRST)
557 @SET _BUILD_PASS=2
558_build_banner_executable:
559 @$(ECHO)$(CLRMAK)[Start Pass 3 - Make Executables] $(CLRRST)
560 @SET _BUILD_PASS=3
561_build_banner_miscellaneous:
562 @$(ECHO)$(CLRMAK)[Start Pass 4 - Make Miscellaneous Targets] $(CLRRST)
563 @SET _BUILD_PASS=4
564_build_banner_install:
565 @$(ECHO)$(CLRMAK)[Start Pass 5 - Make Install] $(CLRRST)
566 @SET _BUILD_PASS=5
567
568
569
570# -----------------------------------------------------------------------------
571# The rebuild rule - Same as build but does a clean first (as Pass 0).
572# -----------------------------------------------------------------------------
573rebuild: \
574 _build_banner_clean clean \
575 _build
576!if "$(MAKEFLAGS:i=_)" == "$(MAKEFLAGS)"
577 @$(ECHO)$(CLRMAK)[Successfully Rebuilt Everything!] $(CLRRST)
578!else
579 @$(ECHO)$(CLRMAK)[Rebuilt Everything! (Ignore option specified)] $(CLRRST)
580!endif
581
582
583
584# -----------------------------------------------------------------------------
585# Pass 0 - The clean rule - Clean up output files.
586# The current setup doesn't clean the installed ones.
587# -----------------------------------------------------------------------------
588!if "$(TARGET_MODE)" != "TESTCASE"
589clean:
590 @$(ECHO) Cleaning... $(CLRRST)
591!if "$(PATH_TARGET)" != "" # paranoia
592 \
593! ifndef BUILD_VERBOSE
594 @ \
595! endif
596 $(TOOL_RM) \
[9044]597 "$(PATH_TARGET)\*.$(EXT_OBJ)" \
598 "$(PATH_TARGET)\*.$(EXT_ILIB)" \
599 "$(PATH_TARGET)\*.$(EXT_EXE)" \
600 "$(PATH_TARGET)\*.$(EXT_DLL)" \
601 "$(PATH_TARGET)\*.$(EXT_RES)"
[9031]602 \
603! ifndef BUILD_VERBOSE
604 @ \
605! endif
606 $(TOOL_RM) \
[9044]607 "$(PATH_TARGET)\*.$(EXT_SYS)" \
608 "$(PATH_TARGET)\*.$(EXT_LIB)" \
609 "$(PATH_TARGET)\*.$(EXT_IFS)" \
610 "$(PATH_TARGET)\*.$(EXT_MAP)" \
611 "$(PATH_TARGET)\*.$(EXT_SYM)"
[9031]612 \
613! ifndef BUILD_VERBOSE
614 @ \
615! endif
616 $(TOOL_RM) \
[9044]617 "$(PATH_TARGET)\*.s" \
618 "$(PATH_TARGET)\*.lst" \
619 "$(PATH_TARGET)\*.lnk" \
620 "$(PATH_TARGET)\*.ii" \
621 "$(PATH_TARGET)\.depend"
[9031]622 \
623! ifndef BUILD_VERBOSE
624 @ \
625! endif
626 $(TOOL_RM) \
[9044]627 ".\*.ii" \
628 ".\*.err" \
629 ".\.depend"
[9031]630!endif
[8197]631!ifdef SUBDIRS
[9031]632 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) NODEP=1 $@
[8197]633!endif
[9031]634!ifdef PREMAKEFILES
635 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) NODEP=1 $@
636!endif
637!ifdef POSTMAKEFILES
638 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) NODEP=1 $@
639!endif
640!endif #!TESTCASE
[8197]641
[9031]642
643
644# -----------------------------------------------------------------------------
645# Pass 1 - The dep rule - Make dependencies.
646# -----------------------------------------------------------------------------
647dep:
[9044]648!if "$(TARGET_MODE)" != "EMPTY" && "$(TARGET_MODE)" != "TESTCASE"
[9031]649 @$(ECHO) Making dependencies... $(CLRRST)
650 \
[9044]651! ifndef BUILD_VERBOSE
[9031]652 @ \
[9044]653! endif
[9031]654 $(TOOL_DEP) $(TOOL_DEP_FLAGS) -o$$(PATH_TARGET) -d$(TARGET_DEPEND)\
655! ifdef TARGET_NO_DEP
656 -x$(TARGET_NO_DEP: =;)\
657! endif
658 $(TOOL_DEP_FILES)
659!endif
660!ifdef SUBDIRS
661 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) NODEP=1 $@
662!endif
[8197]663!ifdef PREMAKEFILES
[9031]664 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) NODEP=1 $@
[8197]665!endif
666!ifdef POSTMAKEFILES
[9031]667 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) NODEP=1 $@
[8197]668!endif
669
670
[8253]671
672# -----------------------------------------------------------------------------
[9031]673# Pass 2 - The lib rule - Make libraries.
[8253]674# -----------------------------------------------------------------------------
[8197]675!ifdef SUBDIRS
[9031]676SUBDIRS_LIB = _subdir_lib
[8197]677$(SUBDIRS_LIB):
[8423]678 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) lib
[8197]679!endif
680
681!ifdef PREMAKEFILES
[9031]682PREMAKEFILES_LIB = _premakefiles_lib
[8197]683$(PREMAKEFILES_LIB):
684 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) lib
685!endif
686
[9031]687lib: $(SUBDIRS_LIB) $(PREMAKEFILES_LIB) \
688!if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFSLIB"
689 $(TARGET) $(TARGET_PUBNAME) \
690!endif
691 $(TARGET_ILIB)
692!ifdef POSTMAKEFILES
693 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
694!endif
695
696
697
698# -----------------------------------------------------------------------------
699# Pass 3 - The executable rule - Build the executables.
700# -----------------------------------------------------------------------------
701!ifdef SUBDIRS
702SUBDIRS_EXECUTABLE = _subdir_executable
703$(SUBDIRS_EXECUTABLE):
704 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) executable
705!endif
706
707!ifdef PREMAKEFILES
708PREMAKEFILES_EXECUTABLE = _premakefiles_executable
709$(PREMAKEFILES_EXECUTABLE):
710 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) executable
711!endif
712
713executable: \
714!if "$(TARGET_MODE)" != "LIB" && "$(TARGET_MODE)" != "SYSLIB" && "$(TARGET_MODE)" != "IFSLIB"
715 $(SUBDIRS_EXECUTABLE) $(PREMAKEFILES_EXECUTABLE) $(TARGET) $(TARGET_PUBNAME)
[9044]716! if "$(TARGET)" != ""
[9031]717 @$(ECHO) Successfully Built $(CLRFIL)$(TARGET)$(CLRRST)
[9044]718! endif
[8290]719!else
[9031]720 $(SUBDIRS_EXECUTABLE) $(PREMAKEFILES_EXECUTABLE)
[8290]721!endif
[8197]722!ifdef POSTMAKEFILES
723 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
724!endif
725
726
[8253]727
728# -----------------------------------------------------------------------------
[9031]729# Pass 4 - The miscellaneous rule - Makes other miscellaneous stuff like
730# documentations etc. This is experimental for the moment.
731# -----------------------------------------------------------------------------
732!ifdef SUBDIRS
733SUBDIRS_MISC = _subdir_misc
734$(SUBDIRS_MISC):
735 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) miscellaneous
736!endif
737
738!ifdef PREMAKEFILES
739PREMAKEFILES_MISC = _premakefiles_misc
740$(PREMAKEFILES_MISC):
741 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) miscellaneous
742!endif
743
744miscellaneous: $(SUBDIRS_MISC) $(PREMAKEFILES_MISC) \
745 $(TARGET_DOCS) $(TARGET_MISC)
746!if "$(TARGET_DOCS)$(TARGET_MISC)" != ""
747 @$(ECHO) Successfully Built $(CLRFIL)$(TARGET_DOCS) $(TARGET_MISC)$(CLRRST)
748!else
749!endif
750!ifdef POSTMAKEFILES
751 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
752!endif
753
754
755
756# -----------------------------------------------------------------------------
757# Pass 5 - The install rule - Copies target to main binary directory.
[8253]758# Installation order is not concidered vital, so subdirectories and
759# pre-makefiles are processed after this directory. This might be changed.
760# -----------------------------------------------------------------------------
[8197]761install:
[8290]762!if "$(TARGET_PUBLIC)" == ""
763! if "$(TARGET_MODE)" == "EXE"
764 @$(ECHO) Installing $(CLRFIL)$(TARGET)$(CLRTXT) in directory $(CLRFIL)$(PATH_BIN)$(CLRRST)
765 @if not exist $(TARGET) $(ECHO) $(CLRERR)WARNING: $(CLRFIL)$(TARGET)$(CLRERR) doesn't exist. $(CLRRST)
[8423]766 @if not exist $(PATH_BIN) $(TOOL_CREATEPATH) $(PATH_BIN)
[8333]767 @if exist $(TARGET) $(TOOL_COPY) $(TARGET) $(PATH_BIN)
768 @if exist $(TARGET_SYM) $(TOOL_COPY) $(TARGET_SYM) $(PATH_BIN)
[8290]769! endif
[8423]770! if "$(TARGET_MODE)" == "DLL"
[8290]771 @$(ECHO) Installing $(CLRFIL)$(TARGET)$(CLRTXT) in directory $(CLRFIL)$(PATH_DLL)$(CLRRST)
772 @if not exist $(TARGET) $(ECHO) $(CLRERR)WARNING: $(CLRFIL)$(TARGET)$(CLRERR) doesn't exist. $(CLRRST)
[8423]773 @if not exist $(PATH_DLL) $(TOOL_CREATEPATH) $(PATH_DLL)
[8333]774 @if exist $(TARGET) $(TOOL_COPY) $(TARGET) $(PATH_DLL)
775 @if exist $(TARGET_SYM) $(TOOL_COPY) $(TARGET_SYM) $(PATH_DLL)
[8290]776! endif
777! if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "IFS"
778 @$(ECHO) Installing $(CLRFIL)$(TARGET)$(CLRTXT) in directory $(CLRFIL)$(PATH_SYS)$(CLRRST)
779 @if not exist $(TARGET) $(ECHO) $(CLRERR)WARNING: $(CLRFIL)$(TARGET)$(CLRERR) doesn't exist. $(CLRRST)
[8423]780 @if not exist $(PATH_SYS) $(TOOL_CREATEPATH) $(PATH_SYS)
[8333]781 @if exist $(TARGET) $(TOOL_COPY) $(TARGET) $(PATH_SYS)
782 @if exist $(TARGET_SYM) $(TOOL_COPY) $(TARGET_SYM) $(PATH_SYS)
[8290]783! endif
[8423]784!if 0 # these targets are either TARGET_PUBLIC or all private.
[8290]785! if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFSLIB"
786 @$(ECHO) Installing $(CLRFIL)$(TARGET)$(CLRTXT) in directory $(CLRFIL)$(PATH_LIB)$(CLRRST)
787 @if not exist $(TARGET) $(ECHO) $(CLRERR)WARNING: $(CLRFIL)$(TARGET)$(CLRERR) doesn't exist. $(CLRRST)
[8423]788 @if not exist $(PATH_LIB) $(TOOL_CREATEPATH) $(PATH_LIB)
[8333]789 @if exist $(TARGET) $(TOOL_COPY) $(TARGET) $(PATH_LIB)
790 @if exist $(TARGET_SYM) $(TOOL_COPY) $(TARGET_SYM) $(PATH_LIB)
[8290]791! endif
792! endif
[8197]793!endif
794!if "$(TARGET_DOCS)" != ""
795 $(TOOL_COPY) $(TARGET_DOCS) $(PATH_DOC)
796!endif
797!ifdef SUBDIRS
[8423]798 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) $@
[8197]799!endif
800!ifdef PREMAKEFILES
801 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) $@
802!endif
803!ifdef POSTMAKEFILES
804 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
805!endif
806
807
[8253]808
[9031]809# -----------------------------------------------------------------------------
810# Pass x - The testcase rule - Execute testcases when present.
811# Testcases are either a testcase.mak file or a testcase subdirectory.
812# -----------------------------------------------------------------------------
[8714]813!if "$(TARGET_MODE)" != "TESTCASE"
814!ifndef BUILD_OWN_TESTCASE_RULE
815!ifndef MAKEVER
816_TESTCASE_TST1 = [$(TOOL_EXISTS) testcase] == 0
817_TESTCASE_TST2 = [$(TOOL_EXISTS) testcase.mak] == 0
818!else
819_TESTCASE_TST1 = exists(testcase) != 0
820_TESTCASE_TST2 = exists(testcase.mak) != 0
821!endif
[9031]822
[8290]823testcase:
[9031]824 @$(ECHO) Executing testcases $(CLRRST)
[8714]825!if $(_TESTCASE_TST1)
[8423]826 @$(TOOL_DODIRS) "testcase" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) $@
[8197]827!endif
[8714]828!if $(_TESTCASE_TST2)
[8197]829 @$(TOOL_DOMAKES) "testcase.mak" $(TOOL_MAKE) $@
830!endif
831!ifdef SUBDIRS
[8423]832 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) $@
[8197]833!endif
834!ifdef PREMAKEFILES
835 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) $@
836!endif
837!ifdef POSTMAKEFILES
838 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
839!endif
840!endif
[8714]841!endif #!TESTCASE
[8197]842
843
[8253]844
845# -----------------------------------------------------------------------------
[9031]846# The target rule - Build the target.
847# Note: This also builds libraries in subdirectories and submakefiles.
[8298]848# -----------------------------------------------------------------------------
[9031]849!ifdef SUBDIRS
850SUBDIRS_TARGET = _subdir_target
851$(SUBDIRS_TARGET):
852 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) target
[8298]853!endif
854
[8197]855!ifdef PREMAKEFILES
[9031]856PREMAKEFILES_TARGET = _premakefiles_target
857$(PREMAKEFILES_TARGET):
858 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) target
[8197]859!endif
[9031]860
861target: $(SUBDIRS_TARGET) $(PREMAKEFILES_TARGET) $(TARGET) $(TARGET_ILIB) $(TARGET_PUBNAME)
862 @$(ECHO) Successfully Built $(CLRFIL)$(TARGET) $(TARGET_ILIB)$(CLRRST)
[8197]863!ifdef POSTMAKEFILES
[9031]864 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
[8197]865!endif
866
867
[8253]868
869# -----------------------------------------------------------------------------
[9031]870# The shell rule - Setup the correcte shell environment and start a shell.
[8253]871# -----------------------------------------------------------------------------
[9031]872shell:
873 @$(ECHO) Creating work shell $(CLRRST)
874 \
875!ifndef BUILD_VERBOSE
876 @ \
[8197]877!endif
[9031]878 -$(TOOL_BUILDENV) $(BUILD_ENVS_BASE_PRE) $(BUILD_ENVS_PRE) $(ENV_ENVS) \
879 $(BUILD_ENVS_BASE_POST) $(BUILD_ENVS_POST) * $(COMSPEC)
[8714]880
881
882
883# -----------------------------------------------------------------------------
884# The nothing rule - Rule for testing the makefile structure.
885# -----------------------------------------------------------------------------
886nothing:
[9031]887 @$(ECHO) Doing nothing in $(MAKEFILE).
[8714]888!ifdef SUBDIRS
[8423]889 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) -f $(BUILD_MAKEFILE) $@
[8197]890!endif
891!ifdef PREMAKEFILES
892 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) $@
893!endif
894!ifdef POSTMAKEFILES
895 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
896!endif
[8714]897 @$(ECHO) Completed nothing in $(MAKEFILE).
[8197]898
899
[8253]900
901# -----------------------------------------------------------------------------
902# The $(TARGET) rule - For EXE, DLL, SYS and IFS targets
903# -----------------------------------------------------------------------------
[8423]904!if "$(TARGET_MODE)" == "EXE" || "$(TARGET_MODE)" == "DLL" || "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "VDD"
[8333]905$(TARGET): $(TARGET_OBJS) $(TARGET_RES) $(TARGET_DEF_LINK) $(TARGET_LNK) $(TARGET_DEPS)
[8423]906!if "$(TOOL_JOB_WAIT)" != ""
907! ifndef BUILD_QUIET
[8714]908 @$(ECHO) Waiting for jobs to complete $(CLRRST)
[8423]909! endif
[8714]910 \
[8423]911! ifndef BUILD_VERBOSE
[8714]912 @ \
[8423]913! endif
[8714]914 $(TOOL_JOB_WAIT)
[8423]915!endif
[8197]916 @$(ECHO) Linking $(TARGET_MODE) $(CLRFIL)$@ $(CLRRST)
[8714]917 \
[8290]918!ifndef BUILD_VERBOSE
919 @ \
920!endif
[8197]921!ifdef TARGET_IGNORE_LINKER_WARNINGS
922 -4 \
923!endif
924!if "$(TARGET_MODE)" == "EXE"
[8253]925 $(LINK_CMD_EXE)
[8197]926!endif
[8423]927!if "$(TARGET_MODE)" == "DLL"
[8290]928 $(LINK_CMD_DLL)
[8197]929!endif
930!if "$(TARGET_MODE)" == "SYS"
[8290]931 $(LINK_CMD_SYS)
[8197]932!endif
[8213]933!if "$(TARGET_MODE)" == "IFS"
[8290]934 $(LINK_CMD_IFS)
[8213]935!endif
[8290]936!if "$(TARGET_MODE)" == "VDD"
937 $(LINK_CMD_VDD)
938!endif
[8197]939!if "$(TARGET_RES)" != "" && "$(RL)" != ""
940 @$(ECHO) Linking Resources $(CLRRST)
[8714]941 \
[8290]942! ifndef BUILD_VERBOSE
943 @ \
944! endif
945 $(RL) $(RL_FLAGS) $(TARGET_RES) $@
[8197]946!endif
947!if "$(TARGET_DLLRNAME)" != ""
948 @$(ECHO) Dll Rename $(TARGET_DLLRNAME)
[8714]949 \
[8290]950! ifndef BUILD_VERBOSE
951 @ \
952! endif
[8197]953 $(TOOL_DLLRNAME) $(TARGET) $(TARGET_DLLRNAME)
954!endif
[8333]955!if "$(TOOL_MAPSYM)" != "" && "$(TARGET_SYM)" != "" && "$(TARGET_MAP)" != ""
[8714]956 \
[8333]957! ifndef BUILD_VERBOSE
958 @ \
959! endif
960 $(TOOL_MAPSYM) $(TARGET_MAP) $(TARGET_SYM)
961!endif
[8197]962
963
964#
965# Linker parameter file.
966#
967$(TARGET_LNK): $(MAKE_INCLUDE_PROCESS) $(MAKE_INCLUDE_SETUP) $(PATH_MAKE)\setup.mak $(MAKEFILE)
[8362]968!ifndef TOOL_DEFCONV
[8714]969 @$(TOOL_ECHO) Creating Linker Input File $(CLRRST)<<$@
[8197]970$(LINK_LNK1)
971$(LINK_LNK2)
972$(LINK_LNK3)
973$(LINK_LNK4)
974$(LINK_LNK5)
975<<KEEP
[8362]976!else
977 @$(ECHO) Creating Linker Input File $(CLRRST) $@
[9044]978 @$(TOOL_RM) "$@"
[8714]979 \
[8362]980! ifdef BUILD_VERBOSE
981 @ \
982! endif
983 $(TOOL_DEFCONV) $(TARGET_DEF_LINK) $@ <<$(TARGET_LNK)2
984#
985# LINK_LNK[1-5]:
986#
987$(LINK_LNK1)
988$(LINK_LNK2)
989$(LINK_LNK3)
990$(LINK_LNK4)
991$(LINK_LNK5)
992<<keep
993!endif
[8355]994!ifdef BUILD_VERBOSE
995 @type $@
996!endif
[8333]997
998
999#
1000# Builddef modified definition file.
1001#
1002!if "$(TARGET_DEF_LINK)" != "$(TARGET_DEF)"
1003$(TARGET_DEF_LINK): $(TARGET_DEF)
1004! ifndef BUILD_QUIET
1005 @$(ECHO) Stamping deffile with build level info.$(CLRRST)
1006! endif
[8714]1007 \
[8333]1008! ifndef BUILD_VERBOSE
1009 @ \
1010! endif
1011 $(TOOL_BLDLEVEL) $(BUILD_BLDLEVEL_FLAGS) $(TARGET_BLDLEVEL_FLAGS) -R$** $** $@
[8290]1012!endif
[8197]1013
[8333]1014!endif
[8197]1015
[8333]1016
[8253]1017# -----------------------------------------------------------------------------
[8290]1018# The $(TARGET) rule - For LIB, SYSLIB, and IFSLIB targets.
[8253]1019# -----------------------------------------------------------------------------
[8290]1020!if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFSLIB"
[8197]1021$(TARGET): $(TARGET_OBJS) $(TARGET_LNK) $(TARGET_DEPS)
[8423]1022!if "$(TOOL_JOB_WAIT)" != ""
1023! ifndef BUILD_QUIET
1024 @$(ECHO) Waiting for jobs to complete $(CLRRST)
1025! endif
[8714]1026 \
[8423]1027! ifndef BUILD_VERBOSE
1028 @ \
1029! endif
1030 $(TOOL_JOB_WAIT)
1031!endif
[8197]1032 @$(ECHO) Creating Library $(CLRFIL)$@ $(CLRRST)
[8290]1033!ifndef BUILD_VERBOSE
[9044]1034 @$(TOOL_RM) "$@"
[8290]1035 @$(AR_CMD)
1036!else
[9044]1037 $(TOOL_RM) "$@"
[8197]1038 $(AR_CMD)
[8290]1039!endif
[8197]1040
1041
1042#
1043# Lib parameter file.
1044#
1045$(TARGET_LNK): $(MAKE_INCLUDE_PROCESS) $(MAKE_INCLUDE_SETUP) $(PATH_MAKE)\setup.mak $(MAKEFILE)
[8714]1046 @$(TOOL_ECHO) Creating Lib Input File $(CLRRST)<<$@
[8197]1047$(AR_LNK1)
1048$(AR_LNK2)
1049$(AR_LNK3)
1050$(AR_LNK4)
1051$(AR_LNK5)
1052<<KEEP
[8423]1053!ifdef BUILD_VERBOSE
1054 @type $@
[8197]1055!endif
[8423]1056!endif
[8197]1057
1058
[9031]1059# -----------------------------------------------------------------------------
[8290]1060# Copy rule for public targets.
[9031]1061# Normally used for public libraries, but may be used for other purposes...
1062# -----------------------------------------------------------------------------
[8290]1063!if "$(TARGET_PUBNAME)" != ""
1064$(TARGET_PUBNAME): $(TARGET)
1065 @$(ECHO) Copying $(CLRFIL)$(TARGET)$(CLRTXT) to $(CLRFIL)$(@D)$(CLRRST)
[8714]1066 \
[8290]1067!ifndef BUILD_VERBOSE
[8423]1068 @if not exist $(@D) $(ECHO) Target public path $(CLRFIL)$(@D)$(CLRTXT) does NOT exist. Creating. $(CLRRST)
1069!endif
1070 @if not exist $(@D) $(TOOL_CREATEPATH) $(@D)
[8714]1071 \
[8423]1072!ifndef BUILD_VERBOSE
[8290]1073 @ \
[8197]1074!endif
[8290]1075 $(TOOL_COPY) $** $@
[8333]1076 @if exist $(TARGET_SYM) $(TOOL_COPY) $(TARGET_SYM) $(@R).sym
[8290]1077!endif
[8197]1078
1079
[8253]1080
1081# -----------------------------------------------------------------------------
[9031]1082# The $(TARGET) rule - For DEPEND targets.
[8253]1083# -----------------------------------------------------------------------------
[9028]1084!if "$(TARGET_MODE)" == "DEPEND"
1085$(TARGET):
1086 @$(ECHO) .
[8197]1087!endif
1088
1089
[8253]1090
1091# -----------------------------------------------------------------------------
1092# The $(TARGET_ILIB) rule - Make import library.
1093# -----------------------------------------------------------------------------
1094!ifdef TARGET_ILIB
1095$(TARGET_ILIB): $(TARGET_IDEF)
1096 @$(ECHO) Creating Import Library $(CLRFIL)$@ $(CLRRST)
[8714]1097 \
[8290]1098!ifndef BUILD_VERBOSE
1099 @ \
1100!endif
[8253]1101 $(IMPLIB) $(IMPLIB_FLAGS) $@ $(TARGET_IDEF)
1102!endif
1103
1104
1105
1106# -----------------------------------------------------------------------------
1107# The .force rule - Force a remake of something everytime.
1108# -----------------------------------------------------------------------------
1109.force:
[8290]1110!ifndef BUILD_VERBOSE
[8253]1111 @$(ECHO) .
[8290]1112!else
1113 @$(ECHO) . (force) .
1114!endif
[8253]1115
1116
1117
1118# -----------------------------------------------------------------------------
1119# Read Dependencies.
1120# -----------------------------------------------------------------------------
[9028]1121!if "$(TARGET_MODE)" != "TESTCASE" && "$(TARGET_MODE)" != "DEPEND"
[8714]1122!if "$(TARGET_MODE)" != "EMPTY" && "$(NODEP)" == ""
[8253]1123
[8197]1124#
[8253]1125# Read dependency file for current directory
[8197]1126#
[8714]1127!ifndef MAKEVER
1128! if [$(TOOL_EXISTS) $(TARGET_DEPEND)] == 0
1129! ifdef BUILD_VERBOSE
1130! if [$(ECHO) Including dependency $(CLRFIL)$(TARGET_DEPEND)$(CLRRST)]
1131! endif
[8197]1132! endif
[8714]1133! include $(TARGET_DEPEND)
1134! else
1135! ifndef NODEP
[8253]1136! if [$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(TARGET_DEPEND) is missing.$(CLRRST)]
1137! endif
[8714]1138! endif
[8253]1139! endif
[8714]1140!else
1141! if %exists($(TARGET_DEPEND)) != 0
1142! ifdef BUILD_VERBOSE
1143$(ECHO) Including dependency $(CLRFIL)$(TARGET_DEPEND)$(CLRRST)
1144! endif
1145! include $(TARGET_DEPEND)
1146! else
1147! ifndef NODEP
1148$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(TARGET_DEPEND) is missing.$(CLRRST)
1149! endif
1150! endif
[8253]1151!endif
1152
1153
1154#
1155# Read global dependency files.
1156#
1157!ifdef BUILD_DEPEND1
[8714]1158! ifndef MAKEVER
1159! if [$(TOOL_EXISTS) $(BUILD_DEPEND1)] == 0
1160! ifdef BUILD_VERBOSE
1161! if [$(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND1)$(CLRRST)]
1162! endif
[8253]1163! endif
[8714]1164! include $(BUILD_DEPEND1)
1165! else
1166! ifndef NODEP
[8253]1167! if [$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND1) is missing.$(CLRRST)]
[8197]1168! endif
[8714]1169! endif
[8197]1170! endif
[8714]1171! else
1172! if %exists($(BUILD_DEPEND1)) != 0
1173! ifdef BUILD_VERBOSE
1174$(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND1)$(CLRRST)
1175! endif
1176! include $(BUILD_DEPEND1)
1177! else
1178! ifndef NODEP
1179$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND1) is missing.$(CLRRST)
1180! endif
1181! endif
[8197]1182! endif
1183!endif
1184
[8714]1185
[8253]1186!ifdef BUILD_DEPEND2
[8714]1187! ifndef MAKEVER
1188! if [$(TOOL_EXISTS) $(BUILD_DEPEND2)] == 0
1189! ifdef BUILD_VERBOSE
1190! if [$(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND2)$(CLRRST)]
1191! endif
[8253]1192! endif
[8714]1193! include $(BUILD_DEPEND2)
1194! else
1195! ifndef NODEP
[8253]1196! if [$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND2) is missing.$(CLRRST)]
1197! endif
[8714]1198! endif
[8253]1199! endif
[8714]1200! else
1201! if %exists($(BUILD_DEPEND2)) != 0
1202! ifdef BUILD_VERBOSE
1203$(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND2)$(CLRRST)
1204! endif
1205! include $(BUILD_DEPEND2)
1206! else
1207! ifndef NODEP
1208$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND2) is missing.$(CLRRST)
1209! endif
1210! endif
[8253]1211! endif
1212!endif
[8197]1213
1214
[8253]1215!ifdef BUILD_DEPEND3
[8714]1216! ifndef MAKEVER
1217! if [$(TOOL_EXISTS) $(BUILD_DEPEND3)] == 0
1218! ifdef BUILD_VERBOSE
1219! if [$(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND3)$(CLRRST)]
1220! endif
[8253]1221! endif
[8714]1222! include $(BUILD_DEPEND3)
1223! else
1224! ifndef NODEP
[8253]1225! if [$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND3) is missing.$(CLRRST)]
1226! endif
[8714]1227! endif
[8253]1228! endif
[8714]1229! else
1230! if %exists($(BUILD_DEPEND3)) != 0
1231! ifdef BUILD_VERBOSE
1232$(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND3)$(CLRRST)
1233! endif
1234! include $(BUILD_DEPEND3)
1235! else
1236! ifndef NODEP
1237$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND3) is missing.$(CLRRST)
1238! endif
1239! endif
[8253]1240! endif
1241!endif
1242
1243
1244!endif
1245
[8423]1246
1247#
1248# If BUILD_MULTIJOBS is nonempty make sure the job daemon is up running.
1249#
1250!if "$(BUILD_MULTIJOBS)" != ""
1251! if [$(TOOL_JOB_UP)] != 0
1252! if "$(BUILD_QUITE)" == ""
[8714]1253! ifndef MAKEVER
1254! if [$(ECHO) Starting Job Daemon With $(TOOL_JOB_WORKERS) Workers...$(CLRRST)]
1255! endif
1256! else
1257$(ECHO) Starting Job Daemon With $(TOOL_JOB_WORKERS) Workers...$(CLRRST)
[8423]1258! endif
1259! endif
1260! if [$(TOOL_JOB_INIT) $(TOOL_JOB_WORKERS)] != 0
[8714]1261! ifndef MAKEVER
1262! if [$(ECHO) $(CLRERR)Fatal error: Failed to start job daemon.$(CLRRST)]
1263! endif
1264! error
1265!else
1266! error $(CLRERR)Fatal error: Failed to start job daemon.$(CLRRST)
1267!endif
[8423]1268! endif
1269! endif
1270!endif
1271
[8714]1272!endif #!TESTCASE
Note: See TracBrowser for help on using the repository browser.