aboutsummaryrefslogtreecommitdiff
path: root/boehm-gc/WCC_MAKEFILE
blob: cc0ef1367421d883617da72af1c4432e0799d0de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# Makefile for Watcom C/C++ 10.5, 10.6, 11.0 on NT, OS2 and DOS4GW .
# May work with Watcom 10.0 .
#

#
# Uncoment one of line for cross compiling
#SYSTEM=DOS4GW
#SYSTEM=MSWIN32
#SYSTEM=OS2

!ifndef SYSTEM

!ifdef __MSDOS__
SYSTEM=DOS4GW
!endif

!ifdef __NT__
SYSTEM=MSWIN32
!endif

!ifdef __OS2__
SYSTEM=OS2
!endif

D_SYSTEM=

!else

D_SYSTEM=-D$(SYSTEM)

!endif

!define $(SYSTEM)


CC=wcc386
CXX=wpp386
AS=wasm


# Watcom before 11.0 not support option -oh
# Remove it if you get error
OPTIM=-oneatxh -s

CALLING=-5s

DEFS=-DALL_INTERIOR_POINTERS -DSILENT #-DSMALL_CONFIG #-DGC_DEBUG

# ! -DUSE_GENERIC required !
CFLAGS=$(OPTIM) -zp4 $(CALLING) -zc -DUSE_GENERIC $(D_SYSTEM) $(DEFS)
CXXFLAGS= $(CFLAGS)
ASFLAGS=$(CALLING)

OBJS= alloc.obj reclaim.obj allchblk.obj misc.obj &
      mach_dep.obj os_dep.obj mark_rts.obj headers.obj mark.obj &
      obj_map.obj blacklst.obj finalize.obj new_hblk.obj &
      dbg_mlc.obj malloc.obj stubborn.obj dyn_load.obj &
      typd_mlc.obj ptr_chck.obj gc_cpp.obj mallocx.obj


all: gc.lib gctest.exe

# this file required for DOS4GW only
gc_watcom.obj: gc_watcom.asm WCC_MAKEFILE
      $(AS) $(ASFLAGS) gc_watcom.asm

!ifdef DOS4GW
gc.lib: $(OBJS) gc_watcom.obj
      @%create $*.lb1
      @for %i in ($(OBJS)) do @%append $*.lb1 +'%i'
      @@%append $*.lb1 +'gc_watcom.obj'
      *wlib -b -c -n -p=512 $@ @$*.lb1
!else
gc.lib: $(OBJS)
        @%create $*.lb1
        @for %i in ($(OBJS)) do @%append $*.lb1 +'%i'
        *wlib -b -c -n -p=512 $@ @$*.lb1
!endif


test.obj: test.c
        $(CC) $(CFLAGS) $*.c

gctest.exe: test.obj gc.lib
        %create $*.lnk
!ifdef DOS4GW
        @%append $*.lnk sys dos4g
!endif
!ifdef MSWIN32
        @%append $*.lnk sys nt
!endif
!ifdef OS2
        @%append $*.lnk sys os2v2
!endif
        @%append $*.lnk op case
        @%append $*.lnk op stack=256K
        @%append $*.lnk name $*
        @%append $*.lnk file test.obj
        @%append $*.lnk library gc.lib
        *wlink @$*.lnk



.c.obj: .AUTODEPEND
        $(CC) $(CFLAGS) $*.c

.cc.obj: .AUTODEPEND
        $(CXX) $(CXXFLAGS) $*.cc

.cpp.obj: .AUTODEPEND
        $(CXX) $(CXXFLAGS) $*.cpp

clean : .SYMBOLIC
    @if exist *.obj del *.obj
    @if exist *.map del *.map
    @if exist *.lnk del *.lnk
    @if exist *.lb1 del *.lb1
    @if exist *.sym del *.sym
    @if exist *.err del *.err
    @if exist *.tmp del *.tmp
    @if exist *.lst del *.lst
    @if exist *.exe del *.exe
    @if exist *.log del *.log