source: trunk/make/process.mak@ 9031

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

Implemented structured make passes.

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