source: GPL/branches/DAZ/tools/header.mif@ 580

Last change on this file since 580 was 580, checked in by David Azarewicz, 11 years ago

Cleanup build environment

File size: 3.2 KB
Line 
1#
2# Target directories.
3# Both bin and lib directories are compiler dependent.
4#
5
6!ifndef ROOT
7!error ROOT is not defined. Please check your SETENV.CMD.
8!endif
9
10!ifndef %DDK
11!error DDK is not defined in the environment. Please check your SETENV.CMD.
12!endif
13DDK=$(%DDK)
14
15!ifndef %WATCOM
16!error WATCOM is not defined in the environment. Please check your SETENV.CMD.
17!endif
18WATCOM=$(%WATCOM)
19
20#Always build KEE version
21KEE = 1
22
23!if "$(DEBUG)" == "1"
24ALSA_BIN = $(ROOT)\bin\Debug
25ALSA_LIB = $(ROOT)\lib\Debug
26OBJDIR = obj\Debug
27!else
28ALSA_BIN = $(ROOT)\bin\Release
29ALSA_LIB = $(ROOT)\lib\Release
30OBJDIR = obj\Release
31!endif
32
33TOOLS=$(ROOT)\tools
34CREATEPATH=$(TOOLS)\CreatePath.cmd
35WAT2MAP=$(TOOLS)\wat2map.cmd
36
37#===================================================================
38#
39# Auto-dependency information
40#
41#===================================================================
42.ERASE
43.SUFFIXES:
44.SUFFIXES: .lst .obj .lib .cpp .cpp16 .c .c16 .asm .def
45
46!if "$(DEBUG)" == "1"
47CFLAGS = -dDEBUG -bt=os2v2 -e60 -hc -5r -omlinear -s -w4 -ze -zdp -zl -zq -nt=CODE32 -zff -zgf
48CPPFLAGS= -xd
49ASFLAGS = -D:DEBUG -Mb -Li -Sv:M510
50!else
51CFLAGS = -bt=os2v2 -e60 -5r -omlinear -s -w4 -ze -zdp -zl -zq -nt=CODE32 -zff -zgf
52CPPFLAGS= -xd
53ASFLAGS = -Mb -Li -Sv:M510
54!endif
55
56!ifdef PACK_1
57CFLAGS += -zp1
58!else
59CFLAGS += -zp4
60!endif
61
62!if $(KEE) == 1
63CFLAGS16 = $(CFLAGS) -mc -zu -zc
64CFLAGS += -mf -DKEE -DFLATSTACK
65ASFLAGS += -D:KEE -D:FLATSTACK
66!else
67CFLAGS16 = $(CFLAGS) -mc -zu -zc
68CFLAGS += -mf -DFLATSTACK
69ASFLAGS += -D:FLATSTACK
70!endif
71
72CC = WCC386 $(CFLAGS) -zev $(CDEFINES) -i$(CINCLUDES)
73CPP = WPP386 $(CFLAGS) $(CPPFLAGS) $(CDEFINES) -i$(CINCLUDES)
74CPP16 = WPP386 $(CFLAGS16) $(CPPFLAGS) $(CDEFINES) -i$(CINCLUDES)
75ASM = alp $(ASFLAGS) $(AINCLUDES)
76
77DFLAGS = -l -s
78DIS = WDISASM $(DFLAGS)
79
80!ifdef USE_WLINK
81!if "$(DEBUG)" == "1"
82LFLAGS = system os2v2 physdevice option int, dosseg, map, eliminate, mang, tog sort global d codeview
83!else
84LFLAGS = system os2v2 physdevice option int, dosseg, map, eliminate, mang, tog sort global
85!endif
86QFLAGS = system os2 option quiet, map, align=512
87LINK = wlink $(LFLAGS)
88!else
89LD2TARGETFLAGS =/PDD /OLDcpp /map /linenumbers
90!if "$(DEBUG)" == "1"
91LD2FLAGS = /nologo /noe /map /packcode /packdata /nod /debug $(LD2TARGETFLAGS)
92!else
93LD2FLAGS = /nologo /noe /map /packcode /packdata /exepack:2 /nod $(LD2TARGETFLAGS)
94!endif
95LINK = ilink $(LD2FLAGS)
96!endif
97
98!if "$(DEBUG)" == "1"
99BFLAGS = -c -b -q -n
100!else
101BFLAGS = -s -t -c -b -q -n
102!endif
103LIB = WLIB $(BFLAGS)
104
105IFLAGS = /nologo
106IMPLIB = IMPLIB $(IFLAGS)
107
108.obj: $(OBJDIR)
109.lib: $(OBJDIR)
110
111.obj.lst:
112 $(DIS) $*
113
114!ifdef EVERYTHING_AS_CPP
115.c.obj: .AUTODEPEND
116 $(CPP) -fo$(OBJDIR)\$^&.obj $^&.c
117!else
118.c.obj: .AUTODEPEND
119 $(CC) -fo$(OBJDIR)\$^&.obj $^&.c
120!endif
121
122.cpp.obj: .AUTODEPEND
123 $(CPP) -fo$(OBJDIR)\$^&.obj $^&.cpp
124
125.cpp16.obj: .AUTODEPEND
126 $(CPP16) $(CFLAGS16) -fo$(OBJDIR)\$^&.obj $^&.cpp16
127
128.asm.obj: .AUTODEPEND
129 $(ASM) $^&.asm -Fo:$(OBJDIR)\$^&.obj -Fl:$(OBJDIR)\$^&.lst
130
131.def.lib:
132 $(IMPLIB) $(OBJDIR)\$^&.lib $^&.def
133
134!ifndef NOOBJ
135.before
136 @if not exist $(OBJDIR) @$(CREATEPATH) $(OBJDIR)
137!endif
138
Note: See TracBrowser for help on using the repository browser.