forked from jonof/jfbuild
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.watcom
166 lines (136 loc) · 4 KB
/
Makefile.watcom
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# Build Makefile for Watcom Make
!ifdef OVERRIDES
!include $(OVERRIDES)
!endif
SRC=src
GAME=testgame
!ifndef OBJ
OBJ=obj.watcom
!endif
INC=include
!ifndef CFLAGS
CFLAGS=-dSUPERBUILD -dPOLYMOST -dUSE_OPENGL -dDYNAMIC_OPENGL -dKSFORBUILD
!endif
o=obj
res=res
asm=wasm
ENGINELIB=engine.lib
EDITORLIB=build.lib
DXROOT=c:\sdks\directx\dx7
!ifdef __LOADDLL__
! loaddll wcc386 wccd386
! loaddll wpp386 wppd386
!endif
# -d these to enable certain features of the port's compile process
# NOASM When defined, uses C code instead assembly code
TARGETOPTS=#-dNOASM
CC=wcc386
CXX=wpp386
AS=wasm
RC=wrc
CFLAGS+= -zq -5r -s -orb -fp5 $(TARGETOPTS) -d2 -dRENDERTYPEWIN=1 &
-i=$(INC) -i=$(SRC) -i=$(DXROOT)\include -i=..\jfaud\inc
GAMECFLAGS=-i=$(GAME)
LIBS=dxguid.lib wsock32.lib ..\jfaud\jfaud.lib winmm.lib #opengl32.lib
ASFLAGS=# -d1
EXESUFFIX=.exe
ENGINEOBJS=$(OBJ)\a.$o &
$(OBJ)\baselayer.$o &
$(OBJ)\cache1d.$o &
$(OBJ)\compat.$o &
$(OBJ)\crc32.$o &
$(OBJ)\defs.$o &
$(OBJ)\engine.$o &
$(OBJ)\glbuild.$o &
$(OBJ)\kplib.$o &
$(OBJ)\lzf_c.$o &
$(OBJ)\lzf_d.$o &
$(OBJ)\lzwnew.$o &
$(OBJ)\md4.$o &
$(OBJ)\mmulti.$o &
$(OBJ)\osd.$o &
$(OBJ)\pragmas.$o &
$(OBJ)\scriptfile.$o &
$(OBJ)\winlayer.$o
EDITOROBJS=$(OBJ)\build.$o &
$(OBJ)\config.$o &
$(OBJ)\startwin.editor.$o
GAMEEXEOBJS=$(OBJ)\game.$o &
$(OBJ)\jfaud_sound.$o &
$(OBJ)\config.$o &
$(OBJ)\startwin.game.$o
EDITOREXEOBJS=$(OBJ)\bstub.$o
# RULES
.EXTENSIONS: .wasm .res .rc
.wasm: $(SRC)
.c: $(SRC)
.cpp: $(SRC)
.c: $(GAME)
.cpp: $(GAME)
.c: $(SRC)\util
.rc: $(SRC)\misc
.wasm.$o:
$(AS) $(ASFLAGS) -fo=$(OBJ)\.$o $[@
.c.$o:
$(CC) $(CFLAGS) -fo=$(OBJ)\.$o $[@
.cpp.$o:
$(CXX) $(CFLAGS) $(GAMECFLAGS) -fo=$(OBJ)\.$o $[@
.rc.$(res):
$(RC) -i=$(SRC) -i=$(INC) -i=$(GAME) -fo=$^*.$(res) -r $[@
# TARGETS
UTILS=kextract$(EXESUFFIX) kgroup$(EXESUFFIX) transpal$(EXESUFFIX) wad2art$(EXESUFFIX) wad2map$(EXESUFFIX)
all: game$(EXESUFFIX) build$(EXESUFFIX) .SYMBOLIC
%null
utils: $(UTILS) .SYMBOLIC
%null
enginelib: $(OBJ)\$(ENGINELIB) .SYMBOLIC
%null
$(OBJ)\$(ENGINELIB): $(ENGINEOBJS)
%create $(OBJ)\$(ENGINELIB).tmp
for %i in ($(ENGINEOBJS)) do %append $(OBJ)\$(ENGINELIB).tmp +%i
wlib -b -n $^* @$(OBJ)\$(ENGINELIB).tmp
erase $(OBJ)\$(ENGINELIB).tmp
editorlib: $(OBJ)\$(EDITORLIB) .SYMBOLIC
%null
$(OBJ)\$(EDITORLIB): $(EDITOROBJS)
%create $(OBJ)\$(EDITORLIB).tmp
for %i in ($(EDITOROBJS)) do %append $(OBJ)\$(EDITORLIB).tmp +%i
wlib -b -n $^* @$(OBJ)\$(EDITORLIB).tmp
erase $(OBJ)\$(EDITORLIB).tmp
game$(EXESUFFIX): $(GAMEEXEOBJS) $(OBJ)\gameres.$(res) $(OBJ)\$(ENGINELIB)
wlink NAME $@ &
SYSTEM WIN95 &
DEBUG ALL &
OPTION MAP &
FILE { $(GAMEEXEOBJS) } &
RESOURCE $(OBJ)\gameres.$(res) &
LIBPATH $(DXROOT)\lib &
LIBPATH $(FMODROOT)\lib &
LIBPATH $(OBJ) &
LIBRARY { $(ENGINELIB) $(LIBS) }
build$(EXESUFFIX): $(EDITOREXEOBJS) $(OBJ)\buildres.$(res) $(OBJ)\$(ENGINELIB) $(OBJ)\$(EDITORLIB)
wlink NAME $@ &
SYSTEM WIN95 &
DEBUG ALL &
OPTION MAP &
FILE { $(EDITOREXEOBJS) } &
RESOURCE $(OBJ)\buildres.$(res) &
LIBPATH $(DXROOT)\lib &
LIBPATH $(FMODROOT)\lib &
LIBPATH $(OBJ) &
LIBRARY { $(ENGINELIB) $(EDITORLIB) $(LIBS) }
kextract$(EXESUFFIX): $(OBJ)\kextract.$o $(OBJ)\compat.$o
wlink NAME $@ SYSTEM 386 DEBUG ALL FILE { $< }
kgroup$(EXESUFFIX): $(OBJ)\kgroup.$o $(OBJ)\compat.$o
wlink NAME $@ SYSTEM 386 DEBUG ALL FILE { $< }
transpal$(EXESUFFIX): $(OBJ)\transpal.$o $(OBJ)\pragmas.$o $(OBJ)\compat.$o
wlink NAME $@ SYSTEM 386 DEBUG ALL FILE { $< }
wad2art$(EXESUFFIX): $(OBJ)\wad2art.$o $(OBJ)\pragmas.$o $(OBJ)\compat.$o
wlink NAME $@ SYSTEM 386 DEBUG ALL FILE { $< }
wad2map$(EXESUFFIX): $(OBJ)\wad2map.$o $(OBJ)\pragmas.$o $(OBJ)\compat.$o
wlink NAME $@ SYSTEM 386 DEBUG ALL FILE { $< }
# DEPENDENCIES
!include Makefile.deps
# PHONIES
clean: .SYMBOLIC
-erase /q $(OBJ)\* game$(EXESUFFIX) build$(EXESUFFIX) $(UTILS) *.err