source: trunk/make/process.mak@ 9275

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

Rulename changes executable -> binary. miscellaneous -> misc. IPF support. BOOK, HELP and DOC publish.

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