-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOWDOS16.mak
90 lines (67 loc) · 1.97 KB
/
OWDOS16.mak
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
# this makefile creates a DOS 16-bit real-mode version of JWasm (JWASMR.EXE).
# tools used:
# - Open Watcom v1.8/v1.9
name = JWasm
!ifndef WATCOM
WATCOM = \Watcom
!endif
!ifndef DEBUG
DEBUG=0
!endif
!if $(DEBUG)
OUTD=OWDOS16D
!else
OUTD=OWDOS16R
!endif
inc_dirs = -IH -I$(WATCOM)\H
# to track memory leaks, the Open Watcom TRMEM module can be included.
# it's useful only if FASTMEM=0 is set, though, otherwise most allocs
# won't use the C heap.
!ifndef TRMEM
TRMEM=0
!endif
LINK = $(WATCOM)\binnt\wlink.exe
#cflags stuff
#########
extra_c_flags =
!if $(DEBUG)
!if $(TRMEM)
extra_c_flags += -od -d2 -DDEBUG_OUT -DTRMEM
!else
extra_c_flags += -od -d2 -DDEBUG_OUT
!endif
!else
extra_c_flags += -obmilrs -s -DNDEBUG
!endif
#########
!if $(DEBUG)
LOPTD = debug dwarf op symfile
!endif
lflagsd = $(LOPTD) sys dos op map=$^*, stack=0x8400
CC=$(WATCOM)\binnt\wcc -q -0 -w3 -zc -ml -bc -bt=dos $(inc_dirs) $(extra_c_flags) -fo$@ -DFASTMEM=0 -DFASTPASS=0 -DCOFF_SUPPORT=0 -DELF_SUPPORT=0 -DAMD64_SUPPORT=0 -DSSSE3SUPP=0 -DSSE4SUPP=0 -DOWFC_SUPPORT=0 -DDLLIMPORT=0 -DAVXSUPP=0 -DPE_SUPPORT=0 -DVMXSUPP=0 -DSVMSUPP=0 -DCVOSUPP=0 -DCOMDATSUPP=0 -DSTACKBASESUPP=0 -zt=12000
.c{$(OUTD)}.obj:
@$(CC) $<
proj_obj = &
!include owmod.inc
!if $(TRMEM)
proj_obj += $(OUTD)/trmem.obj
!endif
ALL: $(OUTD) $(OUTD)/$(name)r.exe
$(OUTD):
@if not exist $(OUTD) mkdir $(OUTD)
$(OUTD)/$(name)r.exe: $(OUTD)/$(name).lib $(OUTD)/main.obj
@set LIB=$(WATCOM)\Lib286;$(WATCOM)\Lib286\DOS
@$(LINK) $(lflagsd) file $(OUTD)/main.obj name $@ lib $(OUTD)/$(name).lib
$(OUTD)/$(name).lib: $(proj_obj)
@cd $(OUTD)
@wlib -q -n $(name).lib $(proj_obj:$(OUTD)/=+)
@cd ..
$(OUTD)/msgtext.obj: msgtext.c H/msgdef.h H/globals.h
@$(CC) msgtext.c
$(OUTD)/reswords.obj: reswords.c H/instruct.h H/special.h H/directve.h
@$(CC) reswords.c
######
clean: .SYMBOLIC
@if exist $(OUTD)\*.obj erase $(OUTD)\*.obj
@if exist $(OUTD)\$(name)r.exe erase $(OUTD)\$(name)r.exe
@if exist $(OUTD)\$(name)r.map erase $(OUTD)\$(name)r.map