# Makefile for Watcom C/C++ 10.5, 10.6, 11.0 on NT, OS2 and DOS4GW.
|
# Makefile for Watcom C/C++ 10.5, 10.6, 11.0 on NT, OS2 and DOS4GW.
|
# May work with Watcom 10.0.
|
# May work with Watcom 10.0.
|
|
|
# Uncoment one of the lines below for cross compilation.
|
# Uncoment one of the lines below for cross compilation.
|
SYSTEM=MSWIN32
|
SYSTEM=MSWIN32
|
#SYSTEM=DOS4GW
|
#SYSTEM=DOS4GW
|
#SYSTEM=OS2
|
#SYSTEM=OS2
|
|
|
# The collector can be built either as dynamic or as static library.
|
# The collector can be built either as dynamic or as static library.
|
# Select the library type you need.
|
# Select the library type you need.
|
#MAKE_AS_DLL=1
|
#MAKE_AS_DLL=1
|
MAKE_AS_LIB=1
|
MAKE_AS_LIB=1
|
|
|
# Select calling conventions.
|
# Select calling conventions.
|
# Possible choices are r and s.
|
# Possible choices are r and s.
|
CALLING=s
|
CALLING=s
|
|
|
# Select target CPU.
|
# Select target CPU.
|
# Possible choices are 3, 4, 5, and 6.
|
# Possible choices are 3, 4, 5, and 6.
|
# The last choice available only since version 11.0.
|
# The last choice available only since version 11.0.
|
CPU=5
|
CPU=5
|
|
|
# Set optimization options.
|
# Set optimization options.
|
# Watcom before 11.0 does not support option "-oh".
|
# Watcom before 11.0 does not support option "-oh".
|
OPTIM=-oneatx -s
|
OPTIM=-oneatx -s
|
#OPTIM=-ohneatx -s
|
#OPTIM=-ohneatx -s
|
|
|
DEFS=-DALL_INTERIOR_POINTERS -DSILENT -DNO_SIGNALS #-DSMALL_CONFIG #-DGC_DEBUG
|
DEFS=-DALL_INTERIOR_POINTERS -DSILENT -DNO_SIGNALS #-DSMALL_CONFIG #-DGC_DEBUG
|
|
|
|
|
#####
|
#####
|
|
|
!ifndef SYSTEM
|
!ifndef SYSTEM
|
!ifdef __MSDOS__
|
!ifdef __MSDOS__
|
SYSTEM=DOS4GW
|
SYSTEM=DOS4GW
|
!else ifdef __NT__
|
!else ifdef __NT__
|
SYSTEM=MSWIN32
|
SYSTEM=MSWIN32
|
!else ifdef __OS2__
|
!else ifdef __OS2__
|
SYSTEM=OS2
|
SYSTEM=OS2
|
!else
|
!else
|
SYSTEM=Unknown
|
SYSTEM=Unknown
|
!endif
|
!endif
|
!endif
|
!endif
|
|
|
!define $(SYSTEM)
|
!define $(SYSTEM)
|
|
|
!ifdef DOS4GW
|
!ifdef DOS4GW
|
SYSFLAG=-DDOS4GW -bt=dos
|
SYSFLAG=-DDOS4GW -bt=dos
|
!else ifdef MSWIN32
|
!else ifdef MSWIN32
|
SYSFLAG=-DMSWIN32 -bt=nt
|
SYSFLAG=-DMSWIN32 -bt=nt
|
!else ifdef OS2
|
!else ifdef OS2
|
SYSFLAG=-DOS2 -bt=os2
|
SYSFLAG=-DOS2 -bt=os2
|
!else
|
!else
|
!error undefined or unsupported target platform: $(SYSTEM)
|
!error undefined or unsupported target platform: $(SYSTEM)
|
!endif
|
!endif
|
!ifdef MAKE_AS_DLL
|
!ifdef MAKE_AS_DLL
|
DLLFLAG=-bd -DGC_DLL
|
DLLFLAG=-bd -DGC_DLL
|
TEST_DLLFLAG=-DGC_DLL
|
TEST_DLLFLAG=-DGC_DLL
|
!else ifdef MAKE_AS_LIB
|
!else ifdef MAKE_AS_LIB
|
DLLFLAG=
|
DLLFLAG=
|
TEST_DLLFLAG=
|
TEST_DLLFLAG=
|
!else
|
!else
|
!error Either MAKE_AS_LIB or MAKE_AS_DLL should be defined
|
!error Either MAKE_AS_LIB or MAKE_AS_DLL should be defined
|
!endif
|
!endif
|
|
|
CC=wcc386
|
CC=wcc386
|
CXX=wpp386
|
CXX=wpp386
|
|
|
# -DUSE_GENERIC is required !
|
# -DUSE_GENERIC is required !
|
CFLAGS=-$(CPU)$(CALLING) $(OPTIM) -zp4 -zc $(SYSFLAG) $(DLLFLAG) -DGC_BUILD -DUSE_GENERIC $(DEFS)
|
CFLAGS=-$(CPU)$(CALLING) $(OPTIM) -zp4 -zc $(SYSFLAG) $(DLLFLAG) -DGC_BUILD -DUSE_GENERIC $(DEFS)
|
CXXFLAGS= $(CFLAGS)
|
CXXFLAGS= $(CFLAGS)
|
TEST_CFLAGS=-$(CPU)$(CALLING) $(OPTIM) -zp4 -zc $(SYSFLAG) $(TEST_DLLFLAG) $(DEFS)
|
TEST_CFLAGS=-$(CPU)$(CALLING) $(OPTIM) -zp4 -zc $(SYSFLAG) $(TEST_DLLFLAG) $(DEFS)
|
TEST_CXXFLAGS= $(TEST_CFLAGS)
|
TEST_CXXFLAGS= $(TEST_CFLAGS)
|
|
|
OBJS= alloc.obj reclaim.obj allchblk.obj misc.obj &
|
OBJS= alloc.obj reclaim.obj allchblk.obj misc.obj &
|
mach_dep.obj os_dep.obj mark_rts.obj headers.obj mark.obj &
|
mach_dep.obj os_dep.obj mark_rts.obj headers.obj mark.obj &
|
obj_map.obj blacklst.obj finalize.obj new_hblk.obj &
|
obj_map.obj blacklst.obj finalize.obj new_hblk.obj &
|
dbg_mlc.obj malloc.obj stubborn.obj dyn_load.obj &
|
dbg_mlc.obj malloc.obj stubborn.obj dyn_load.obj &
|
typd_mlc.obj ptr_chck.obj mallocx.obj
|
typd_mlc.obj ptr_chck.obj mallocx.obj
|
|
|
all: gc.lib gctest.exe test_cpp.exe
|
all: gc.lib gctest.exe test_cpp.exe
|
|
|
!ifdef MAKE_AS_DLL
|
!ifdef MAKE_AS_DLL
|
|
|
gc.lib: gc.dll gc_cpp.obj
|
gc.lib: gc.dll gc_cpp.obj
|
*wlib -b -c -n -p=512 $@ +gc.dll +gc_cpp.obj
|
*wlib -b -c -n -p=512 $@ +gc.dll +gc_cpp.obj
|
|
|
gc.dll: $(OBJS) .AUTODEPEND
|
gc.dll: $(OBJS) .AUTODEPEND
|
@%create $*.lnk
|
@%create $*.lnk
|
!ifdef DOS4GW
|
!ifdef DOS4GW
|
@%append $*.lnk sys os2v2_dll
|
@%append $*.lnk sys os2v2_dll
|
!else ifdef MSWIN32
|
!else ifdef MSWIN32
|
@%append $*.lnk sys nt_dll
|
@%append $*.lnk sys nt_dll
|
!else ifdef OS2
|
!else ifdef OS2
|
@%append $*.lnk sys os2v2_dll
|
@%append $*.lnk sys os2v2_dll
|
!endif
|
!endif
|
@%append $*.lnk name $*
|
@%append $*.lnk name $*
|
@for %i in ($(OBJS)) do @%append $*.lnk file '%i'
|
@for %i in ($(OBJS)) do @%append $*.lnk file '%i'
|
!ifeq CALLING s
|
!ifeq CALLING s
|
@%append $*.lnk export GC_is_marked
|
@%append $*.lnk export GC_is_marked
|
@%append $*.lnk export GC_incr_words_allocd
|
@%append $*.lnk export GC_incr_words_allocd
|
@%append $*.lnk export GC_incr_mem_freed
|
@%append $*.lnk export GC_incr_mem_freed
|
@%append $*.lnk export GC_generic_malloc_words_small
|
@%append $*.lnk export GC_generic_malloc_words_small
|
!else
|
!else
|
@%append $*.lnk export GC_is_marked_
|
@%append $*.lnk export GC_is_marked_
|
@%append $*.lnk export GC_incr_words_allocd_
|
@%append $*.lnk export GC_incr_words_allocd_
|
@%append $*.lnk export GC_incr_mem_freed_
|
@%append $*.lnk export GC_incr_mem_freed_
|
@%append $*.lnk export GC_generic_malloc_words_small_
|
@%append $*.lnk export GC_generic_malloc_words_small_
|
!endif
|
!endif
|
*wlink @$*.lnk
|
*wlink @$*.lnk
|
!else
|
!else
|
gc.lib: $(OBJS) gc_cpp.obj
|
gc.lib: $(OBJS) gc_cpp.obj
|
@%create $*.lb1
|
@%create $*.lb1
|
@for %i in ($(OBJS)) do @%append $*.lb1 +'%i'
|
@for %i in ($(OBJS)) do @%append $*.lb1 +'%i'
|
@%append $*.lb1 +'gc_cpp.obj'
|
@%append $*.lb1 +'gc_cpp.obj'
|
*wlib -b -c -n -p=512 $@ @$*.lb1
|
*wlib -b -c -n -p=512 $@ @$*.lb1
|
|
|
!endif
|
!endif
|
|
|
|
|
gctest.exe: test.obj gc.lib
|
gctest.exe: test.obj gc.lib
|
%create $*.lnk
|
%create $*.lnk
|
!ifdef DOS4GW
|
!ifdef DOS4GW
|
@%append $*.lnk sys dos4g
|
@%append $*.lnk sys dos4g
|
!else ifdef MSWIN32
|
!else ifdef MSWIN32
|
@%append $*.lnk sys nt
|
@%append $*.lnk sys nt
|
!else ifdef OS2
|
!else ifdef OS2
|
@%append $*.lnk sys os2v2
|
@%append $*.lnk sys os2v2
|
!endif
|
!endif
|
@%append $*.lnk op case
|
@%append $*.lnk op case
|
@%append $*.lnk op stack=256K
|
@%append $*.lnk op stack=256K
|
@%append $*.lnk name $*
|
@%append $*.lnk name $*
|
@%append $*.lnk file test.obj
|
@%append $*.lnk file test.obj
|
@%append $*.lnk library gc.lib
|
@%append $*.lnk library gc.lib
|
!ifdef MAKE_AS_DLL
|
!ifdef MAKE_AS_DLL
|
!ifeq CALLING s
|
!ifeq CALLING s
|
@%append $*.lnk import GC_is_marked gc
|
@%append $*.lnk import GC_is_marked gc
|
!else
|
!else
|
@%append $*.lnk import GC_is_marked_ gc
|
@%append $*.lnk import GC_is_marked_ gc
|
!endif
|
!endif
|
!endif
|
!endif
|
*wlink @$*.lnk
|
*wlink @$*.lnk
|
test_cpp.exe: test_cpp.obj gc.lib
|
test_cpp.exe: test_cpp.obj gc.lib
|
%create $*.lnk
|
%create $*.lnk
|
!ifdef DOS4GW
|
!ifdef DOS4GW
|
@%append $*.lnk sys dos4g
|
@%append $*.lnk sys dos4g
|
!else ifdef MSWIN32
|
!else ifdef MSWIN32
|
@%append $*.lnk sys nt
|
@%append $*.lnk sys nt
|
!else ifdef OS2
|
!else ifdef OS2
|
@%append $*.lnk sys os2v2
|
@%append $*.lnk sys os2v2
|
!endif
|
!endif
|
@%append $*.lnk op case
|
@%append $*.lnk op case
|
@%append $*.lnk op stack=256K
|
@%append $*.lnk op stack=256K
|
@%append $*.lnk name $*
|
@%append $*.lnk name $*
|
@%append $*.lnk file test_cpp.obj
|
@%append $*.lnk file test_cpp.obj
|
@%append $*.lnk library gc.lib
|
@%append $*.lnk library gc.lib
|
!ifdef MAKE_AS_DLL
|
!ifdef MAKE_AS_DLL
|
!ifeq CALLING s
|
!ifeq CALLING s
|
@%append $*.lnk import GC_incr_words_allocd gc
|
@%append $*.lnk import GC_incr_words_allocd gc
|
@%append $*.lnk import GC_incr_mem_freed gc
|
@%append $*.lnk import GC_incr_mem_freed gc
|
@%append $*.lnk import GC_generic_malloc_words_small gc
|
@%append $*.lnk import GC_generic_malloc_words_small gc
|
!else
|
!else
|
@%append $*.lnk import GC_incr_words_allocd_ gc
|
@%append $*.lnk import GC_incr_words_allocd_ gc
|
@%append $*.lnk import GC_incr_mem_freed_ gc
|
@%append $*.lnk import GC_incr_mem_freed_ gc
|
@%append $*.lnk import GC_generic_malloc_words_small_ gc
|
@%append $*.lnk import GC_generic_malloc_words_small_ gc
|
!endif
|
!endif
|
!endif
|
!endif
|
*wlink @$*.lnk
|
*wlink @$*.lnk
|
|
|
gc_cpp.obj: gc_cpp.cc .AUTODEPEND
|
gc_cpp.obj: gc_cpp.cc .AUTODEPEND
|
$(CXX) $(TEST_CXXFLAGS) -iinclude $*.cc
|
$(CXX) $(TEST_CXXFLAGS) -iinclude $*.cc
|
test.obj: tests\test.c .AUTODEPEND
|
test.obj: tests\test.c .AUTODEPEND
|
$(CC) $(TEST_CFLAGS) $*.c
|
$(CC) $(TEST_CFLAGS) $*.c
|
test_cpp.obj: tests\test_cpp.cc .AUTODEPEND
|
test_cpp.obj: tests\test_cpp.cc .AUTODEPEND
|
$(CXX) $(TEST_CXXFLAGS) -iinclude $*.cc
|
$(CXX) $(TEST_CXXFLAGS) -iinclude $*.cc
|
|
|
|
|
.c.obj: .AUTODEPEND
|
.c.obj: .AUTODEPEND
|
$(CC) $(CFLAGS) $*.c
|
$(CC) $(CFLAGS) $*.c
|
|
|
.cc.obj: .AUTODEPEND
|
.cc.obj: .AUTODEPEND
|
$(CXX) $(CXXFLAGS) $*.cc
|
$(CXX) $(CXXFLAGS) $*.cc
|
|
|
clean : .SYMBOLIC
|
clean : .SYMBOLIC
|
@if exist *.obj del *.obj
|
@if exist *.obj del *.obj
|
@if exist *.map del *.map
|
@if exist *.map del *.map
|
@if exist *.lnk del *.lnk
|
@if exist *.lnk del *.lnk
|
@if exist *.lb1 del *.lb1
|
@if exist *.lb1 del *.lb1
|
@if exist *.sym del *.sym
|
@if exist *.sym del *.sym
|
@if exist *.err del *.err
|
@if exist *.err del *.err
|
@if exist *.tmp del *.tmp
|
@if exist *.tmp del *.tmp
|
@if exist *.lst del *.lst
|
@if exist *.lst del *.lst
|
@if exist *.exe del *.exe
|
@if exist *.exe del *.exe
|
@if exist *.log del *.log
|
@if exist *.log del *.log
|
@if exist *.lib del *.lib
|
@if exist *.lib del *.lib
|
@if exist *.dll del *.dll
|
@if exist *.dll del *.dll
|
|
|