Debian Codegraph @

external/bdwgc/WCC_MAKEFILE

raw
1 # Makefile for Watcom C/C++ 10.5, 10.6, 11.0 on NT, OS2 and DOS4GW.
2 # May work with Watcom 10.0.
3
4 # Uncomment one of the lines below for cross compilation.
5 SYSTEM=MSWIN32
6 #SYSTEM=DOS4GW
7 #SYSTEM=OS2
8
9 # The collector can be built either as dynamic or as static library.
10 # Select the library type you need.
11 #MAKE_AS_DLL=1
12 MAKE_AS_LIB=1
13
14 # Select calling conventions.
15 # Possible choices are r and s.
16 CALLING=s
17
18 # Select target CPU.
19 # Possible choices are 3, 4, 5, and 6.
20 # The last choice available only since version 11.0.
21 CPU=5
22
23 # Set optimization options.
24 # Watcom before 11.0 does not support option "-oh".
25 OPTIM=-oneatx -s
26 #OPTIM=-ohneatx -s
27
28 DEFS=-DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM #-DSMALL_CONFIG #-DGC_DEBUG
29
30
31 #####
32
33 !ifndef SYSTEM
34 !ifdef __MSDOS__
35 SYSTEM=DOS4GW
36 !else ifdef __NT__
37 SYSTEM=MSWIN32
38 !else ifdef __OS2__
39 SYSTEM=OS2
40 !else
41 SYSTEM=Unknown
42 !endif
43 !endif
44
45 !define $(SYSTEM)
46
47 !ifdef DOS4GW
48 SYSFLAG=-DDOS4GW -bt=dos
49 !else ifdef MSWIN32
50 SYSFLAG=-DMSWIN32 -bt=nt
51 !else ifdef OS2
52 SYSFLAG=-DOS2 -bt=os2
53 !else
54 !error undefined or unsupported target platform: $(SYSTEM)
55 !endif
56 !ifdef MAKE_AS_DLL
57 DLLFLAG=-bd -DGC_DLL
58 TEST_DLLFLAG=-DGC_DLL
59 !else ifdef MAKE_AS_LIB
60 DLLFLAG=
61 TEST_DLLFLAG=
62 !else
63 !error Either MAKE_AS_LIB or MAKE_AS_DLL should be defined
64 !endif
65
66 CC=wcc386
67 CXX=wpp386
68
69 CFLAGS=-$(CPU)$(CALLING) $(OPTIM) -zp4 -zc $(SYSFLAG) $(DLLFLAG) $(DEFS)
70 CXXFLAGS= $(CFLAGS)
71 TEST_CFLAGS=-$(CPU)$(CALLING) $(OPTIM) -zp4 -zc $(SYSFLAG) $(TEST_DLLFLAG) $(DEFS)
72 TEST_CXXFLAGS= $(TEST_CFLAGS)
73
74 OBJS= alloc.obj reclaim.obj allchblk.obj misc.obj &
75 mach_dep.obj os_dep.obj mark_rts.obj headers.obj mark.obj &
76 obj_map.obj blacklst.obj finalize.obj new_hblk.obj &
77 dbg_mlc.obj malloc.obj dyn_load.obj &
78 typd_mlc.obj ptr_chck.obj mallocx.obj fnlz_mlc.obj
79
80 all: gc.lib gctest.exe test_cpp.exe
81
82 !ifdef MAKE_AS_DLL
83
84 gc.lib: gc.dll gc_cpp.obj
85 *wlib -b -c -n -p=512 $@ +gc.dll +gc_cpp.obj
86
87 gc.dll: $(OBJS) .AUTODEPEND
88 @%create $*.lnk
89 !ifdef DOS4GW
90 @%append $*.lnk sys os2v2_dll
91 !else ifdef MSWIN32
92 @%append $*.lnk sys nt_dll
93 !else ifdef OS2
94 @%append $*.lnk sys os2v2_dll
95 !endif
96 @%append $*.lnk name $*
97 @for %i in ($(OBJS)) do @%append $*.lnk file '%i'
98 *wlink @$*.lnk
99 !else
100 gc.lib: $(OBJS) gc_cpp.obj
101 @%create $*.lb1
102 @for %i in ($(OBJS)) do @%append $*.lb1 +'%i'
103 @%append $*.lb1 +'gc_cpp.obj'
104 *wlib -b -c -n -p=512 $@ @$*.lb1
105
106 !endif
107
108
109 gctest.exe: test.obj gc.lib
110 %create $*.lnk
111 !ifdef DOS4GW
112 @%append $*.lnk sys dos4g
113 !else ifdef MSWIN32
114 @%append $*.lnk sys nt
115 !else ifdef OS2
116 @%append $*.lnk sys os2v2
117 !endif
118 @%append $*.lnk op case
119 @%append $*.lnk op stack=256K
120 @%append $*.lnk name $*
121 @%append $*.lnk file test.obj
122 @%append $*.lnk library gc.lib
123 *wlink @$*.lnk
124 test_cpp.exe: test_cpp.obj gc.lib
125 %create $*.lnk
126 !ifdef DOS4GW
127 @%append $*.lnk sys dos4g
128 !else ifdef MSWIN32
129 @%append $*.lnk sys nt
130 !else ifdef OS2
131 @%append $*.lnk sys os2v2
132 !endif
133 @%append $*.lnk op case
134 @%append $*.lnk op stack=256K
135 @%append $*.lnk name $*
136 @%append $*.lnk file test_cpp.obj
137 @%append $*.lnk library gc.lib
138 *wlink @$*.lnk
139
140 gc_cpp.obj: gc_cpp.cc .AUTODEPEND
141 $(CXX) $(TEST_CXXFLAGS) -iinclude $*.cc
142 test.obj: tests\test.c .AUTODEPEND
143 $(CC) $(TEST_CFLAGS) $*.c
144 test_cpp.obj: tests\test_cpp.cc .AUTODEPEND
145 $(CXX) $(TEST_CXXFLAGS) -iinclude $*.cc
146
147
148 .c.obj: .AUTODEPEND
149 $(CC) $(CFLAGS) $*.c
150
151 .cc.obj: .AUTODEPEND
152 $(CXX) $(CXXFLAGS) $*.cc
153
154 clean : .SYMBOLIC
155 @if exist *.obj del *.obj
156 @if exist *.map del *.map
157 @if exist *.lnk del *.lnk
158 @if exist *.lb1 del *.lb1
159 @if exist *.sym del *.sym
160 @if exist *.err del *.err
161 @if exist *.tmp del *.tmp
162 @if exist *.lst del *.lst
163 @if exist *.exe del *.exe
164 @if exist *.log del *.log
165 @if exist *.lib del *.lib
166 @if exist *.dll del *.dll