1 # Makefile for Watcom C/C++ 10.5, 10.6, 11.0 on NT, OS2 and DOS4GW.
2 # May work with Watcom 10.0.
4 # Uncoment one of the lines below for cross compilation.
9 # The collector can be built either as dynamic or as static library.
10 # Select the library type you need.
14 # Select calling conventions.
15 # Possible choices are r and s.
19 # Possible choices are 3, 4, 5, and 6.
20 # The last choice available only since version 11.0.
23 # Set optimization options.
24 # Watcom before 11.0 does not support option "-oh".
28 DEFS=-DALL_INTERIOR_POINTERS -DSILENT -DNO_SIGNALS #-DSMALL_CONFIG #-DGC_DEBUG
48 SYSFLAG=-DDOS4GW -bt=dos
50 SYSFLAG=-DMSWIN32 -bt=nt
54 !error undefined or unsupported target platform: $(SYSTEM)
59 !else ifdef MAKE_AS_LIB
63 !error Either MAKE_AS_LIB or MAKE_AS_DLL should be defined
69 # -DUSE_GENERIC is required !
70 CFLAGS=-$(CPU)$(CALLING) $(OPTIM) -zp4 -zc $(SYSFLAG) $(DLLFLAG) -DGC_BUILD -DUSE_GENERIC $(DEFS)
72 TEST_CFLAGS=-$(CPU)$(CALLING) $(OPTIM) -zp4 -zc $(SYSFLAG) $(TEST_DLLFLAG) $(DEFS)
73 TEST_CXXFLAGS= $(TEST_CFLAGS)
75 OBJS= alloc.obj reclaim.obj allchblk.obj misc.obj &
76 mach_dep.obj os_dep.obj mark_rts.obj headers.obj mark.obj &
77 obj_map.obj blacklst.obj finalize.obj new_hblk.obj &
78 dbg_mlc.obj malloc.obj stubborn.obj dyn_load.obj &
79 typd_mlc.obj ptr_chck.obj mallocx.obj
81 all: gc.lib gctest.exe test_cpp.exe
85 gc.lib: gc.dll gc_cpp.obj
86 *wlib -b -c -n -p=512 $@ +gc.dll +gc_cpp.obj
88 gc.dll: $(OBJS) .AUTODEPEND
91 @%append $*.lnk sys os2v2_dll
93 @%append $*.lnk sys nt_dll
95 @%append $*.lnk sys os2v2_dll
97 @%append $*.lnk name $*
98 @for %i in ($(OBJS)) do @%append $*.lnk file '%i'
100 @%append $*.lnk export GC_is_marked
101 @%append $*.lnk export GC_incr_words_allocd
102 @%append $*.lnk export GC_incr_mem_freed
103 @%append $*.lnk export GC_generic_malloc_words_small
105 @%append $*.lnk export GC_is_marked_
106 @%append $*.lnk export GC_incr_words_allocd_
107 @%append $*.lnk export GC_incr_mem_freed_
108 @%append $*.lnk export GC_generic_malloc_words_small_
112 gc.lib: $(OBJS) gc_cpp.obj
114 @for %i in ($(OBJS)) do @%append $*.lb1 +'%i'
115 @%append $*.lb1 +'gc_cpp.obj'
116 *wlib -b -c -n -p=512 $@ @$*.lb1
121 gctest.exe: test.obj gc.lib
124 @%append $*.lnk sys dos4g
126 @%append $*.lnk sys nt
128 @%append $*.lnk sys os2v2
130 @%append $*.lnk op case
131 @%append $*.lnk op stack=256K
132 @%append $*.lnk name $*
133 @%append $*.lnk file test.obj
134 @%append $*.lnk library gc.lib
137 @%append $*.lnk import GC_is_marked gc
139 @%append $*.lnk import GC_is_marked_ gc
143 test_cpp.exe: test_cpp.obj gc.lib
146 @%append $*.lnk sys dos4g
148 @%append $*.lnk sys nt
150 @%append $*.lnk sys os2v2
152 @%append $*.lnk op case
153 @%append $*.lnk op stack=256K
154 @%append $*.lnk name $*
155 @%append $*.lnk file test_cpp.obj
156 @%append $*.lnk library gc.lib
159 @%append $*.lnk import GC_incr_words_allocd gc
160 @%append $*.lnk import GC_incr_mem_freed gc
161 @%append $*.lnk import GC_generic_malloc_words_small gc
163 @%append $*.lnk import GC_incr_words_allocd_ gc
164 @%append $*.lnk import GC_incr_mem_freed_ gc
165 @%append $*.lnk import GC_generic_malloc_words_small_ gc
170 gc_cpp.obj: gc_cpp.cc .AUTODEPEND
171 $(CXX) $(TEST_CXXFLAGS) -iinclude $*.cc
172 test.obj: tests\test.c .AUTODEPEND
173 $(CC) $(TEST_CFLAGS) $*.c
174 test_cpp.obj: tests\test_cpp.cc .AUTODEPEND
175 $(CXX) $(TEST_CXXFLAGS) -iinclude $*.cc
182 $(CXX) $(CXXFLAGS) $*.cc
185 @if exist *.obj del *.obj
186 @if exist *.map del *.map
187 @if exist *.lnk del *.lnk
188 @if exist *.lb1 del *.lb1
189 @if exist *.sym del *.sym
190 @if exist *.err del *.err
191 @if exist *.tmp del *.tmp
192 @if exist *.lst del *.lst
193 @if exist *.exe del *.exe
194 @if exist *.log del *.log
195 @if exist *.lib del *.lib
196 @if exist *.dll del *.dll