source: trunk/make/process.mak@ 8287

Last change on this file since 8287 was 8270, checked in by bird, 24 years ago

Fixed some EMPTY mode bugs.

File size: 20.4 KB
RevLine 
[8270]1# $Id: process.mak,v 1.5 2002-04-16 00:09:35 bird Exp $
[8197]2
3#
4# Unix-like tools for OS/2
5#
6# The common build process rules
7#
8# Note: this makefile is supposed to be included from the
9# current source path.
10#
11
12
[8253]13# -----------------------------------------------------------------------------
14# Assertions.
15# This makefile expects setup.mak and the specific setup to be included
16# already.
17# It also requires the TARGET_NAME to be specified in the makefile.
18# -----------------------------------------------------------------------------
19!if "$(MAKE_SETUP_INCLUDED)" != "YES"
20!error Fatal error: You must include setup.mak before process.mak in the makefile.
[8197]21!endif
[8253]22!if "$(ENV_STATUS)" != "OK"
23!error Fatal error: The enironment is not valid. Bad setup.mak?
24!endif
[8197]25
[8253]26!if "$(TARGET_NAME)" == ""
27!error Fatal error: TARGET_NAME is not defined! Should be set in the makefile.
28!endif
29
30# -----------------------------------------------------------------------------
31# Provide overridable defaults
32# -----------------------------------------------------------------------------
33
34# Default target mode is executable.
35!ifndef TARGET_MODE
36TARGET_MODE = EXE
37!endif
38
39# Default extension corresponds to the target mode.
40!ifndef TARGET_EXT
41! if "$(TARGET_MODE)" == "CRT" || "$(TARGET_MODE)" == "DLL"
42TARGET_EXT = $(EXT_DLL)
43! endif
44! if "$(TARGET_MODE)" == "SYS"
45TARGET_EXT = $(EXT_SYS)
46! endif
47! if "$(TARGET_MODE)" == "EXE"
48TARGET_EXT = $(EXT_EXE)
49! endif
50! if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "PUBLIB" || "$(TARGET_MODE)" == "SYSLIB"
51TARGET_EXT = $(EXT_LIB)
52! endif
53! if "$(TARGET_MODE)" == "EMPTY"
54TARGET_EXT = empty
55! endif
56! ifndef TARGET_EXT
[8270]57!error Error: TARGET_EXT not set. (Probably invalid TARGET_MODE.)
[8253]58! endif
59!endif
60
61# Default target path. (where all the generated stuff for this target goes)
62!ifndef PATH_TARGET
63PATH_TARGET = $(PATH_OBJ)\$(TARGET_NAME).$(TARGET_EXT)
64!endif
65
66# Default target file. (output)
[8197]67!ifndef TARGET
[8270]68! if "$(TARGET_MODE)" != "EMPTY"
[8253]69TARGET = $(PATH_TARGET)\$(TARGET_NAME).$(TARGET_EXT)
[8270]70! endif
[8197]71!endif
72
[8270]73
[8253]74# Default object file. (output)
[8197]75!ifndef TARGET_OBJS
[8253]76TARGET_OBJS = $(PATH_TARGET)\$(TARGET_NAME).$(EXT_OBJ)
[8197]77!endif
78
[8253]79# Default libraries. (input)
[8197]80!ifndef TARGET_LIBS
[8253]81TARGET_LIBS = $(LIB_C_DLL) $(LIB_OS) $(LIB_C_RTDLL)
[8197]82!endif
83
[8253]84# Default definition file. (input)
[8197]85!ifndef TARGET_DEF
[8253]86TARGET_DEF = $(MAKEDIR)\$(PATH_DEF)\$(TARGET_NAME).def
[8197]87!endif
88
[8253]89# Default definition file for generating the import library. (input)
[8197]90!ifndef TARGET_IDEF
[8253]91TARGET_IDEF = $(TARGET_DEF)
[8197]92!endif
93
[8253]94# Default map file. (output)
[8197]95!ifndef TARGET_MAP
[8253]96TARGET_MAP = $(PATH_TARGET)\$(TARGET_NAME).map
[8197]97!endif
98
[8253]99# Default link file. (output)
[8197]100!ifndef TARGET_LNK
[8253]101TARGET_LNK = $(PATH_TARGET)\$(TARGET_NAME).lnk
[8197]102!endif
103
[8253]104# Default import library file. (output)
105!ifndef TARGET_ILIB
106! if "$(TARGET_MODE)" == "CRT" || "$(TARGET_MODE)" == "DLL"
107TARGET_ILIB =$(PATH_LIB)\$(TARGET_NAME).$(EXT_ILIB)
108! endif
[8197]109!endif
110
[8253]111# Default public library name. (output)
112!ifndef TARGET_PUBLIB
113! if "$(TARGET_MODE)" == "PUBLIB"
114TARGET_PUBLIB=$(PATH_LIB)\$(TARGET_NAME).$(TARGET_EXT)
115! else
116TARGET_PUBLIB=
117! endif
[8197]118!endif
[8253]119
120# Default depend filename.
121!ifndef TARGET_DEPEND
122TARGET_DEPEND = $(PATH_TARGET)\.depend
[8197]123!endif
124
[8253]125# Default makefile name.
126!ifndef MAKEFILE
127MAKEFILE = makefile
[8197]128!endif
129
[8253]130# Ignore linker warnings for some target modes.
131!ifndef TARGET_IGNORE_LINKER_WARNINGS
132! if "$(TARGET_MODE)" == "DLL" || "$(TARGET_MODE)" == "CRT"
133TARGET_IGNORE_LINKER_WARNINGS = 1
134! endif
[8197]135!endif
136
137
[8253]138# Default stacksize
139#
140# BUGBUG/TODO/FIXME
141# kso: Not sure if this is the *right* way to represent it!
142# It can't be when we start changing it based on the
143# current build environment.
[8197]144!ifndef TARGET_STACKSIZE
145# check if 16-bit target compiler
146! if "$(BUILD_ENV)" == "MSCV6"
147TARGET_STACKSIZE=0x2000
148! else
149TARGET_STACKSIZE=0x10000
150! endif
151!endif
152
[8253]153
154
155# -----------------------------------------------------------------------------
156# Tell user what we're building.
157# -----------------------------------------------------------------------------
158!ifndef BUILD_QUIET
159!if [$(ECHO) Target is $(CLRFIL)$(TARGET)$(CLRRST)]
[8197]160!endif
[8253]161!endif
[8197]162
163
[8253]164# -----------------------------------------------------------------------------
165# Ensure the platform-specific target path exists
166# -----------------------------------------------------------------------------
167
168!if "$(TARGET_MODE)" != "EMPTY"
169! if "$(PATH_TARGET)" != ""
170! if [$(TOOL_EXISTS) $(PATH_TARGET)] != 0
171! ifndef BUILD_QUIET
172! if [$(ECHO) Target path $(CLRFIL)$(PATH_TARGET)$(CLRTXT) does NOT exist. Creating. $(CLRRST)]
173! endif
174! endif
175! if [$(TOOL_CREATEPATH) $(PATH_TARGET)]
176! error Could not create $(PATH_TARGET)
177! endif
[8197]178! endif
179! endif
180!endif
[8253]181# not 100% sure about the != EMPTY stuff, but this is way faster.
[8197]182
183
184
[8253]185# -----------------------------------------------------------------------------
186# Common inference rules
187# -----------------------------------------------------------------------------
[8197]188
189.SUFFIXES:
[8213]190.SUFFIXES: .$(EXT_OBJ) .c .cpp .asm .$(EXT_RES) .rc .pre-c .pre-cpp # .h .def
[8197]191
192
193# Assembling assembly source.
194.asm{$(PATH_TARGET)}.$(EXT_OBJ):
195 @$(ECHO) Assembling $(CLRFIL)$< $(CLRRST)
[8213]196!if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB"
[8197]197 @$(AS) $(AS_FLAGS_SYS) $< $(AS_OBJ_OUT)$@
198!else
199 @$(AS) $(AS_FLAGS) $< $(AS_OBJ_OUT)$@
200!endif
201
202.asm.$(EXT_OBJ):
203 @$(ECHO) Assembling $(CLRFIL)$< $(CLRRST)
[8213]204!if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB"
[8197]205 @$(AS) $(AS_FLAGS_SYS) $< $(AS_OBJ_OUT)$(PATH_TARGET)\$(@F)
206!else
207 @$(AS) $(AS_FLAGS) $< $(AS_OBJ_OUT)$(PATH_TARGET)\$(@F)
208!endif
209
210
211# Compiling C++ source.
212.cpp{$(PATH_TARGET)}.$(EXT_OBJ):
213 @$(ECHO) C++ Compiler $(CLRFIL)$< $(CLRRST)
214 @$(CXX) \
215!if "$(TARGET_MODE)" == "EXE" || "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "PUBLIB"
216 $(CXX_FLAGS_EXE) \
217!endif
218!if "$(TARGET_MODE)" == "CRT"
219 $(CXX_FLAGS_CRT) \
220!endif
221!if "$(TARGET_MODE)" == "DLL"
222 $(CXX_FLAGS_DLL) \
223!endif
224!if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB"
225 $(CXX_FLAGS_SYS) \
226!endif
[8213]227!if "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB"
228 $(CXX_FLAGS_IFS) \
229!endif
[8253]230!if "$(CXX_LST_OUT)" != ""
[8213]231 $(CXX_LST_OUT)$(PATH_TARGET)\$(@B).s \
232!endif
[8197]233 $(CXX_OBJ_OUT)$@ $<
234
235.cpp.$(EXT_OBJ):
236 @$(ECHO) C++ Compiler $(CLRFIL)$< $(CLRRST)
237 @$(CXX) \
238!if "$(TARGET_MODE)" == "EXE" || "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "PUBLIB"
239 $(CXX_FLAGS_EXE) \
240!endif
241!if "$(TARGET_MODE)" == "CRT"
242 $(CXX_FLAGS_CRT) \
243!endif
244!if "$(TARGET_MODE)" == "DLL"
245 $(CXX_FLAGS_DLL) \
246!endif
247!if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB"
248 $(CXX_FLAGS_SYS) \
249!endif
[8213]250!if "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB"
251 $(CXX_FLAGS_IFS) \
252!endif
[8253]253!if "$(CXX_LST_OUT)" != ""
[8213]254 $(CXX_LST_OUT)$(PATH_TARGET)\$(@B).s \
255!endif
[8197]256 $(CXX_OBJ_OUT)$(PATH_TARGET)\$(@F) $<
257
258
259# Pre-Compiling C++ source.
260.cpp.pre-cpp:
261 @$(ECHO) C++ Compiler $(CLRFIL)$< $(CLRRST)
262 @$(CXX) \
263!if "$(TARGET_MODE)" == "EXE" || "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "PUBLIB"
264 $(CXX_FLAGS_EXE) \
265!endif
266!if "$(TARGET_MODE)" == "CRT"
267 $(CXX_FLAGS_CRT) \
268!endif
269!if "$(TARGET_MODE)" == "DLL"
270 $(CXX_FLAGS_DLL) \
271!endif
272!if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB"
273 $(CXX_FLAGS_SYS) \
274!endif
[8213]275!if "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB"
276 $(CXX_FLAGS_IFS) \
277!endif
[8197]278 $(CXX_PC_2_STDOUT) $< > $@
279
280
281# Compiling C source.
282.c{$(PATH_TARGET)}.$(EXT_OBJ):
283 @$(ECHO) C Compiler $(CLRFIL)$< $(CLRRST)
284 @$(CC) \
285!if "$(TARGET_MODE)" == "EXE" || "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "PUBLIB"
286 $(CC_FLAGS_EXE) \
287!endif
288!if "$(TARGET_MODE)" == "CRT"
289 $(CC_FLAGS_CRT) \
290!endif
291!if "$(TARGET_MODE)" == "DLL"
292 $(CC_FLAGS_DLL) \
293!endif
294!if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB"
295 $(CC_FLAGS_SYS) \
296!endif
[8213]297!if "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB"
298 $(CC_FLAGS_IFS) \
299!endif
[8253]300!if "$(CC_LST_OUT)" != ""
[8213]301 $(CC_LST_OUT)$(PATH_TARGET)\$(@B).s \
302!endif
[8197]303 $(CC_OBJ_OUT)$@ $<
304
305.c.$(EXT_OBJ):
306 @$(ECHO) C Compiler $(CLRFIL)$< $(CLRRST)
307 @$(CC) \
308!if "$(TARGET_MODE)" == "EXE" || "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "PUBLIB"
309 $(CC_FLAGS_EXE) \
310!endif
311!if "$(TARGET_MODE)" == "CRT"
312 $(CC_FLAGS_CRT) \
313!endif
314!if "$(TARGET_MODE)" == "DLL"
315 $(CC_FLAGS_DLL) \
316!endif
317!if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB"
318 $(CC_FLAGS_SYS) \
319!endif
[8213]320!if "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB"
321 $(CC_FLAGS_IFS) \
322!endif
[8253]323!if "$(CC_LST_OUT)" != ""
[8213]324 $(CC_LST_OUT)$(PATH_TARGET)\$(@B).s \
325!endif
[8197]326 $(CC_OBJ_OUT)$(PATH_TARGET)\$(@F) $<
327
328
329# Pre-Compiling C source.
330.c.pre-c:
331 @$(ECHO) C PreCompiler $(CLRFIL)$< $(CLRRST)
332 @$(CC) \
333!if "$(TARGET_MODE)" == "EXE" || "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "PUBLIB"
334 $(CC_FLAGS_EXE) \
335!endif
336!if "$(TARGET_MODE)" == "CRT"
337 $(CC_FLAGS_CRT) \
338!endif
339!if "$(TARGET_MODE)" == "DLL"
340 $(CC_FLAGS_DLL) \
341!endif
342!if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "SYSLIB"
343 $(CC_FLAGS_SYS) \
344!endif
[8213]345!if "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB"
346 $(CC_FLAGS_IFS) \
347!endif
[8197]348 $(CC_PC_2_STDOUT) $< > $@
349
350
351# Compiling resources.
352.rc{$(PATH_TARGET)}.res:
353 @$(ECHO) RC Compiler $(CLRFIL)$< $(CLRRST)
354 @$(RC) $(RC_FLAGS) $< $@
355
356.rc.res:
357 @$(ECHO) RC Compiler $(CLRFIL)$< $(CLRRST)
358 @$(RC) $(RC_FLAGS) $< $(PATH_TARGET)\$(@F)
359
360
[8253]361
362
363
364# -----------------------------------------------------------------------------
365# The all rule - The default one, as it's the first rule in the file.
366# -----------------------------------------------------------------------------
[8197]367all: build
368
369
[8253]370
371# -----------------------------------------------------------------------------
372# The build rule - Build the target.
373# Must take into account any subdirectories and makefiles which is is to be
374# made before and after the target. That makes it kind of messy, sorry.
375# -----------------------------------------------------------------------------
[8197]376!ifdef SUBDIRS
377SUBDIRS_BUILD = subbuild
378$(SUBDIRS_BUILD):
379 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) build
380!endif
381
382!ifdef PREMAKEFILES
383PREMAKEFILES_BUILD = premakefiles_build
384$(PREMAKEFILES_BUILD):
385 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) build
386!endif
387
388build: $(SUBDIRS_BUILD) $(PREMAKEFILES_BUILD) $(TARGET) $(TARGET_ILIB) $(TARGET_PUBLIB)
389 @$(ECHO) Successfully Built $(CLRFIL)$(TARGET) $(TARGET_ILIB)$(CLRRST)
390!ifdef POSTMAKEFILES
391 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
392!endif
393
394
[8253]395
396# -----------------------------------------------------------------------------
397# The lib rule - Make Public libraries.
398# Must take into account any subdirectories and makefiles which is is to be
399# made before and after the target. That makes it kind of messy, sorry.
400# -----------------------------------------------------------------------------
[8197]401!ifdef SUBDIRS
402SUBDIRS_LIB = subdir_lib
403$(SUBDIRS_LIB):
404 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) lib
405!endif
406
407!ifdef PREMAKEFILES
408PREMAKEFILES_LIB = premakefiles_lib
409$(PREMAKEFILES_LIB):
410 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) lib
411!endif
412
413lib: $(SUBDIRS_LIB) $(TARGET_ILIB) $(TARGET_PUBLIB)
414!ifdef POSTMAKEFILES
415 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
416!endif
417
418
[8253]419
420# -----------------------------------------------------------------------------
421# The install rule - Copies target to main binary directory.
422# Installation order is not concidered vital, so subdirectories and
423# pre-makefiles are processed after this directory. This might be changed.
424# -----------------------------------------------------------------------------
[8197]425install:
426!if "$(TARGET_MODE)" == "EXE"
427 if exist $(TARGET) $(TOOL_COPY) $(TARGET) $(PATH_BIN)
428!endif
429!if "$(TARGET_MODE)" == "DLL" || "$(TARGET_MODE)" == "CRT"
430 if exist $(TARGET) $(TOOL_COPY) $(TARGET) $(PATH_DLL)
431!endif
[8213]432!if "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "IFS" || "$(TARGET_MODE)" == "IFSLIB"
[8197]433 if exist $(TARGET) $(TOOL_COPY) $(TARGET) $(PATH_SYS)
434!endif
[8253]435!if 0
436# Nothing to do here currently. These are either private or they're allready where they should be.
437#
438# TODO/BUGBUG/FIXME:
439# The PUB stuff should be change to a separate variable.
440# It will make life easier to just state that this target,
441# what ever it is, should be public.
442#
443# That's allow project to install targets during make without
444# running the install command by setting some target modes
445# public by default.
446# (kso)
447#!if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "PUBLIB" || "$(TARGET_MODE)" == "SYSLIB"
[8197]448# if exist $(TARGET) $(TOOL_COPY) $(TARGET) $(PATH_LIB)
[8253]449#!endif
[8197]450!endif
451!if "$(TARGET_DOCS)" != ""
452 $(TOOL_COPY) $(TARGET_DOCS) $(PATH_DOC)
453!endif
454!ifdef SUBDIRS
455 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) $@
456!endif
457!ifdef PREMAKEFILES
458 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) $@
459!endif
460!ifdef POSTMAKEFILES
461 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
462!endif
463
464
[8253]465
466# -----------------------------------------------------------------------------
467# The testcase rule - Execute testcases when present.
468# Testcases are either a testcase.mak file or a testcase subdirectory.
469# -----------------------------------------------------------------------------
[8265]470!ifndef BUILD_OWN_TESTCASE_RULE
[8197]471testcase: install
472!if [$(TOOL_EXISTS) testcase] == 0
473 @$(TOOL_DODIRS) "testcase" $(TOOL_MAKE) $@
474!endif
475!if [$(TOOL_EXISTS) testcase.mak] == 0
476 @$(TOOL_DOMAKES) "testcase.mak" $(TOOL_MAKE) $@
477!endif
478!ifdef SUBDIRS
479 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) $@
480!endif
481!ifdef PREMAKEFILES
482 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) $@
483!endif
484!ifdef POSTMAKEFILES
485 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
486!endif
487!endif
488
489
[8253]490
491# -----------------------------------------------------------------------------
492# The dep rule - Make dependencies.
493# -----------------------------------------------------------------------------
[8197]494dep:
495 @$(ECHO) Building dependencies $(CLRRST)
[8253]496 @$(TOOL_DEP) $(TOOL_DEP_FLAGS) -o$$(PATH_TARGET) -d$(TARGET_DEPEND)\
[8197]497!ifdef TARGET_NO_DEP
498 -x$(TARGET_NO_DEP: =;)\
499!endif
500 $(TOOL_DEP_FILES)
501!ifdef SUBDIRS
502 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) NODEP=1 $@
503!endif
504!ifdef PREMAKEFILES
505 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) NODEP=1 $@
506!endif
507!ifdef POSTMAKEFILES
508 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) NODEP=1 $@
509!endif
510
511
[8253]512
513# -----------------------------------------------------------------------------
514# The clean rule - Clean up output files.
515# The current setup doesn't clean the installed ones.
516# -----------------------------------------------------------------------------
[8197]517clean:
518!if "$(PATH_TARGET)" != "" # paranoia
519 $(TOOL_RM) \
520 $(PATH_TARGET)\*.$(EXT_OBJ) \
521 $(PATH_TARGET)\*.$(EXT_ILIB) \
522 $(PATH_TARGET)\*.$(EXT_EXE) \
523 $(PATH_TARGET)\*.$(EXT_DLL) \
524 $(PATH_TARGET)\*.$(EXT_RES) \
525 $(PATH_TARGET)\*.$(EXT_SYS) \
[8213]526 $(PATH_TARGET)\*.$(EXT_LIB)
527 $(TOOL_RM) \
528 $(PATH_TARGET)\*.$(EXT_IFS) \
[8197]529 $(PATH_TARGET)\*.map \
[8213]530 $(PATH_TARGET)\*.s \
531 $(PATH_TARGET)\*.lst \
[8197]532 $(PATH_TARGET)\*.lnk \
533 $(PATH_TARGET)\*.pre-c \
534 $(PATH_TARGET)\*.pre-cpp \
[8213]535 $(PATH_TARGET)\.depend
[8197]536!endif
537!ifdef SUBDIRS
538 @$(TOOL_DODIRS) "$(SUBDIRS)" $(TOOL_MAKE) $@
539!endif
540!ifdef PREMAKEFILES
541 @$(TOOL_DOMAKES) "$(PREMAKEFILES)" $(TOOL_MAKE) $@
542!endif
543!ifdef POSTMAKEFILES
544 @$(TOOL_DOMAKES) "$(POSTMAKEFILES)" $(TOOL_MAKE) $@
545!endif
546
547
[8253]548
549# -----------------------------------------------------------------------------
550# The $(TARGET) rule - For EXE, DLL, SYS and IFS targets
551# -----------------------------------------------------------------------------
[8213]552!if "$(TARGET_MODE)" == "EXE" || "$(TARGET_MODE)" == "DLL" || "$(TARGET_MODE)" == "CRT" || "$(TARGET_MODE)" == "SYS" || "$(TARGET_MODE)" == "IFS"
[8197]553$(TARGET): $(TARGET_OBJS) $(TARGET_RES) $(TARGET_DEF) $(TARGET_LNK) $(TARGET_DEPS)
554 @$(ECHO) Linking $(TARGET_MODE) $(CLRFIL)$@ $(CLRRST)
555!ifdef TARGET_IGNORE_LINKER_WARNINGS
556 -4 \
557!endif
558!if "$(TARGET_MODE)" == "EXE"
[8253]559 $(LINK_CMD_EXE)
[8197]560!endif
561!if "$(TARGET_MODE)" == "DLL" || "$(TARGET_MODE)" == "CRT"
562 @$(LINK_CMD_DLL)
563!endif
564!if "$(TARGET_MODE)" == "SYS"
565 @$(LINK_CMD_SYS)
566!endif
[8213]567!if "$(TARGET_MODE)" == "IFS"
568 @$(LINK_CMD_IFS)
569!endif
[8197]570!if "$(TARGET_RES)" != "" && "$(RL)" != ""
571 @$(ECHO) Linking Resources $(CLRRST)
572 @$(RL) $(RL_FLAGS) $(TARGET_RES) $@
573!endif
574!if "$(TARGET_DLLRNAME)" != ""
575 @$(ECHO) Dll Rename $(TARGET_DLLRNAME)
576 $(TOOL_DLLRNAME) $(TARGET) $(TARGET_DLLRNAME)
577!endif
578
579
580#
581# Linker parameter file.
582#
583$(TARGET_LNK): $(MAKE_INCLUDE_PROCESS) $(MAKE_INCLUDE_SETUP) $(PATH_MAKE)\setup.mak $(MAKEFILE)
584 @$(ECHO) Creating Linker Input File $(CLRRST)<<$@
585$(LINK_LNK1)
586$(LINK_LNK2)
587$(LINK_LNK3)
588$(LINK_LNK4)
589$(LINK_LNK5)
590<<KEEP
591
592
593
[8253]594# -----------------------------------------------------------------------------
595# The $(TARGET) rule - For LIB, PUBLIB, and SYSLIB targets.
596# -----------------------------------------------------------------------------
[8213]597!if "$(TARGET_MODE)" == "LIB" || "$(TARGET_MODE)" == "PUBLIB" || "$(TARGET_MODE)" == "SYSLIB" || "$(TARGET_MODE)" == "IFSLIB"
[8197]598$(TARGET): $(TARGET_OBJS) $(TARGET_LNK) $(TARGET_DEPS)
599 @$(ECHO) Creating Library $(CLRFIL)$@ $(CLRRST)
600 $(TOOL_RM) $@
601 $(AR_CMD)
602
603
604#
605# Lib parameter file.
606#
607$(TARGET_LNK): $(MAKE_INCLUDE_PROCESS) $(MAKE_INCLUDE_SETUP) $(PATH_MAKE)\setup.mak $(MAKEFILE)
608 @$(ECHO) Creating Lib Input File $(CLRRST)<<$@
609$(AR_LNK1)
610$(AR_LNK2)
611$(AR_LNK3)
612$(AR_LNK4)
613$(AR_LNK5)
614<<KEEP
615!endif
616
617
618#
619# Copy rule for public libraries.
[8253]620# BUGBUG/TODO/FIXME: get rid of the PUBLIB stuff. see commet in install.
[8197]621#
622!if "$(TARGET_MODE)" == "PUBLIB"
623$(TARGET_PUBLIB): $(TARGET)
624 @$(ECHO) Copying $(CLRFIL)$(TARGET)$(CLRTXT) to the Library Directory $(CLRRST)
625 @$(TOOL_COPY) $** $@
626!endif
627
628
[8253]629
630# -----------------------------------------------------------------------------
631# The $(TARGET) rule - For EMPTY targets.
632# -----------------------------------------------------------------------------
[8197]633!if "$(TARGET_MODE)" == "EMPTY"
634$(TARGET):
635 @$(ECHO) .
636!endif
637
638
[8253]639
640# -----------------------------------------------------------------------------
641# The $(TARGET_ILIB) rule - Make import library.
642# -----------------------------------------------------------------------------
643!ifdef TARGET_ILIB
644$(TARGET_ILIB): $(TARGET_IDEF)
645 @$(ECHO) Creating Import Library $(CLRFIL)$@ $(CLRRST)
646 $(IMPLIB) $(IMPLIB_FLAGS) $@ $(TARGET_IDEF)
647!endif
648!endif
649
650
651
652# -----------------------------------------------------------------------------
653# The .force rule - Force a remake of something everytime.
654# -----------------------------------------------------------------------------
655.force:
656 @$(ECHO) .
657
658
659
660# -----------------------------------------------------------------------------
661# Read Dependencies.
662# -----------------------------------------------------------------------------
663
664!if "$(TARGET_MODE)" != "EMPTY"
665
[8197]666#
[8253]667# Read dependency file for current directory
[8197]668#
[8253]669!if [$(TOOL_EXISTS) $(TARGET_DEPEND)] == 0
670! ifndef BUILD_QUIET
671! if [$(ECHO) Including dependency $(CLRFIL)$(TARGET_DEPEND)$(CLRRST)]
[8197]672! endif
[8253]673! endif
674! include $(TARGET_DEPEND)
675!else
676! ifndef NODEP
677! if [$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(TARGET_DEPEND) is missing.$(CLRRST)]
678! endif
679! endif
680!endif
681
682
683#
684# Read global dependency files.
685#
686!ifdef BUILD_DEPEND1
687! if [$(TOOL_EXISTS) $(BUILD_DEPEND1)] == 0
688! ifndef BUILD_QUIET
689! if [$(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND1)$(CLRRST)]
690! endif
691! endif
692! include $(BUILD_DEPEND1)
[8197]693! else
694! ifndef NODEP
[8253]695! if [$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND1) is missing.$(CLRRST)]
[8197]696! endif
697! endif
698! endif
699!endif
700
[8253]701!ifdef BUILD_DEPEND2
702! if [$(TOOL_EXISTS) $(BUILD_DEPEND2)] == 0
703! ifndef BUILD_QUIET
704! if [$(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND2)$(CLRRST)]
705! endif
706! endif
707! include $(BUILD_DEPEND2)
708! else
709! ifndef NODEP
710! if [$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND2) is missing.$(CLRRST)]
711! endif
712! endif
713! endif
714!endif
[8197]715
716
[8253]717!ifdef BUILD_DEPEND3
718! if [$(TOOL_EXISTS) $(BUILD_DEPEND3)] == 0
719! ifndef BUILD_QUIET
720! if [$(ECHO) Including dependency $(CLRFIL)$(BUILD_DEPEND3)$(CLRRST)]
721! endif
722! endif
723! include $(BUILD_DEPEND3)
724! else
725! ifndef NODEP
726! if [$(ECHO) $(CLRERR)WARNING: Please make dependencies first. $(BUILD_DEPEND3) is missing.$(CLRRST)]
727! endif
728! endif
729! endif
730!endif
731
732
733!endif
734
Note: See TracBrowser for help on using the repository browser.