2 # Higanbana Project makefile
5 # Possible optimizations for 8088 class processors
7 # -oa Relax alias checking
8 # -ob Try to generate straight line code
9 # -oe - expand user functions inline (-oe=20 is default, adds lots of code)
10 # -oh Enable repeated optimizations
11 # -oi generate certain lib funcs inline
12 # -oi+ Set max inline depth (C++ only, use -oi for C)
13 # -ok Flowing of register save into function flow graph
14 # -ol loop optimizations
15 # -ol+ loop optimizations plus unrolling
16 # -or Reorder for pipelined (486+ procs); not sure if good to use
17 # -os Favor space over time
18 # -ot Favor time over space
19 # -ei Allocate an "int" for all enum types
20 # -zp2 Allow compiler to add padding to structs
21 # -zpw Use with above; make sure you are warning free!
22 # -0 8088/8086 class code generation
23 # -s disable stack overflow checking
40 #IN=..$(DIRSEP)..$(DIRSEP)fdos$(DIRSEP)watcom2$(DIRSEP)h
45 #-zk0u = translate kanji to unicode... wwww
46 #-zk0 = kanji support~
47 #-zkl = current codepage
49 #EXMMTESTDIR=16$(DIRSEP)exmmtest$(DIRSEP)
51 SRCLIB=$(SRC)lib$(DIRSEP)
52 JSMNLIB=$(SRCLIB)jsmn$(DIRSEP)
53 NYANLIB=$(SRCLIB)nyan$(DIRSEP)
54 #EXMMLIB=$(SRCLIB)exmm$(DIRSEP)
55 VGMSNDLIB=$(SRCLIB)vgmsnd$(DIRSEP)
56 DOSLIB=$(SRCLIB)doslib$(DIRSEP)
57 WCPULIB=$(SRCLIB)wcpu$(DIRSEP)
60 BAKAPIFLAGS=-fh=bakapi.hed
61 SFLAGS=-sg -st -of+ -zu -zdf -zff -zgf -k56000#60000#32768
62 DFLAGS=-DTARGET_MSDOS=16 -DMSDOS=1 $(SFLAGS)
63 ZFLAGS=-zk0 -zq -zc -zp8# -zm
64 CFLAGS=$(IFLAGS) -mh -lr -l=dos -wo# -d2##wwww
65 OFLAGS=-obmiler -out -oh -ei -zp8 -0 -fpi87 -onac -ol+ -ok####x
66 FLAGS=$(CFLAGS) $(OFLAGS) $(DFLAGS) $(ZFLAGS)
68 DOSLIBEXMMOBJ = himemsys.$(OBJ) emm.$(OBJ)
69 VGMSNDOBJ = vgmSnd.$(OBJ) 16_snd.$(OBJ)
70 DOSLIBOBJ = adlib.$(OBJ) 8254.$(OBJ) 8259.$(OBJ) dos.$(OBJ) cpu.$(OBJ)
71 16LIBOBJS = 16_in.$(OBJ) 16_mm.$(OBJ) wcpu.$(OBJ) 16_head.$(OBJ) 16_ca.$(OBJ) kitten.$(OBJ) 16_hc.$(OBJ) timer.$(OBJ)
74 GFXLIBOBJS = modex16.$(OBJ) bitmap.$(OBJ) planar.$(OBJ) 16text.$(OBJ) bakapee.$(OBJ) scroll16.$(OBJ)
76 TESTEXEC = exmmtest.exe test.exe pcxtest.exe pcxtest2.exe test2.exe palettec.exe maptest.exe fmemtest.exe fonttest.exe fontgfx.exe scroll.exe vgmtest.exe inputest.exe palettel.exe
78 #testemm.exe testemm0.exe fonttes0.exe miditest.exe sega.exe sountest.exe
79 EXEC = 16.exe bakapi.exe $(TESTEXEC) tesuto.exe
84 #game and bakapi executables
86 16.exe: 16.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIBOBJS) gfx.lib
87 wcl $(FLAGS) $(16FLAGS) 16.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIBOBJS) gfx.lib -fm=16.map
89 bakapi.exe: bakapi.$(OBJ) $(16LIBOBJS) gfx.lib
90 wcl $(FLAGS) $(BAKAPIFLAGS) bakapi.$(OBJ) $(16LIBOBJS) gfx.lib -fm=bakapi.map
94 scroll.exe: scroll.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIBOBJS) gfx.lib
95 wcl $(FLAGS) scroll.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIBOBJS) gfx.lib -fm=scroll.map
96 scroll.$(OBJ): $(SRC)scroll.c
97 wcl $(FLAGS) -c $(SRC)scroll.c
99 tesuto.exe: tesuto.$(OBJ)
100 wcl -zq -mh -d2 tesuto.$(OBJ)
101 tesuto.$(OBJ): $(SRC)tesuto.c
102 wcl -zq -mh -d2 -c $(SRC)tesuto.c
104 #sega.exe: sega.$(OBJ)
105 # wcl $(FLAGS) sega.$(OBJ)
106 #sega.$(OBJ): $(SRC)sega.c
107 # wcl $(FLAGS) -c $(SRC)sega.c
109 test.exe: test.$(OBJ) gfx.lib
110 wcl $(FLAGS) test.$(OBJ) gfx.lib -fm=test.map
112 test2.exe: test2.$(OBJ) gfx.lib
113 wcl $(FLAGS) test2.$(OBJ) gfx.lib -fm=test2.map
115 fonttest.exe: fonttest.$(OBJ) $(16LIBOBJS) gfx.lib
116 wcl $(FLAGS) fonttest.$(OBJ) $(16LIBOBJS) gfx.lib -fm=fonttest.map
118 #fonttes0.exe: fonttes0.$(OBJ) $(16LIBOBJS)
119 # wcl $(FLAGS) fonttes0.$(OBJ) $(16LIBOBJS)
121 fontgfx.exe: fontgfx.$(OBJ) $(16LIBOBJS) gfx.lib
122 wcl $(FLAGS) fontgfx.$(OBJ) $(16LIBOBJS) gfx.lib -fm=fontgfx.map
124 inputest.exe: inputest.$(OBJ) $(16LIBOBJS)
125 wcl $(FLAGS) inputest.$(OBJ) $(16LIBOBJS) -fm=inputest.map
127 #sountest.exe: sountest.$(OBJ) $(16LIBOBJS)
128 # wcl $(FLAGS) sountest.$(OBJ) $(16LIBOBJS)
130 #miditest.exe: miditest.$(OBJ) $(16LIBOBJS) $(DOSLIBEXMMOBJ) midi.$(OBJ)
131 # wcl $(FLAGS) miditest.$(OBJ) $(16LIBOBJS) $(DOSLIBEXMMOBJ) midi.$(OBJ)
133 tsthimem.exe: tsthimem.$(OBJ) $(16LIBOBJS) $(DOSLIBEXMMOBJ)
134 wcl $(FLAGS) tsthimem.$(OBJ) $(16LIBOBJS) $(DOSLIBEXMMOBJ) -fm=tsthimem.map
136 #testemm.exe: testemm.$(OBJ) $(16LIBOBJS) $(DOSLIBEXMMOBJ)
137 # wcl $(FLAGS) testemm.$(OBJ) $(16LIBOBJS) $(DOSLIBEXMMOBJ)
139 #testemm0.exe: testemm0.$(OBJ) $(16LIBOBJS) $(DOSLIBEXMMOBJ)
140 # wcl $(FLAGS) testemm0.$(OBJ) $(16LIBOBJS) $(DOSLIBEXMMOBJ)
142 pcxtest.exe: pcxtest.$(OBJ) gfx.lib
143 wcl $(FLAGS) pcxtest.$(OBJ) gfx.lib -fm=pcxtest.map
145 palettec.exe: palettec.$(OBJ) $(16LIBOBJS) gfx.lib
146 wcl $(FLAGS) palettec.$(OBJ) $(16LIBOBJS) gfx.lib -fm=palettec.map
148 palettel.exe: palettel.$(OBJ) $(16LIBOBJS) gfx.lib
149 wcl $(FLAGS) palettel.$(OBJ) $(16LIBOBJS) gfx.lib -fm=palettel.map
151 pcxtest2.exe: pcxtest2.$(OBJ) gfx.lib
152 wcl $(FLAGS) pcxtest2.$(OBJ) gfx.lib -fm=pcxtest2.map
154 maptest.exe: maptest.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIBOBJS) gfx.lib
155 wcl $(FLAGS) maptest.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIBOBJS) gfx.lib -fm=maptest.map
157 #maptest0.exe: maptest0.$(OBJ) fmapread.$(OBJ) farjsmn.$(OBJ)
158 # wcl $(FLAGS) $(MFLAGS) maptest0.$(OBJ) fmapread.$(OBJ) farjsmn.$(OBJ)
160 #emmtest.exe: emmtest.$(OBJ) memory.$(OBJ)
161 # wcl $(FLAGS) $(MFLAGS) emmtest.$(OBJ) memory.$(OBJ)
163 #emsdump.exe: emsdump.$(OBJ) memory.$(OBJ)
164 # wcl $(FLAGS) $(MFLAGS) emsdump.$(OBJ) memory.$(OBJ)
166 fmemtest.exe: fmemtest.$(OBJ) $(16LIBOBJS)
167 wcl $(FLAGS) fmemtest.$(OBJ) $(16LIBOBJS) -fm=fmemtest.map
169 exmmtest.exe: exmmtest.$(OBJ) $(16LIBOBJS)
170 wcl $(FLAGS) exmmtest.$(OBJ) -fm=exmmtest.map $(16LIBOBJS)
172 vgmtest.exe: vgmtest.$(OBJ) vgmsnd.lib $(16LIBOBJS)
173 wcl $(FLAGS) vgmtest.$(OBJ) vgmsnd.lib -fm=vgmtest.map $(16LIBOBJS)
174 #====wcl -mc vgmtest.$(OBJ) $(VGMSNDOBJ) -fm=vgmtest.map
178 #executable's objects
180 16.$(OBJ): $(SRC)16.h $(SRC)16.c
181 wcl $(FLAGS) -c $(SRC)16.c
183 bakapi.$(OBJ): $(SRC)bakapi.h $(SRC)bakapi.c
184 wcl $(FLAGS) -c $(SRC)bakapi.c
186 test.$(OBJ): $(SRC)test.c $(SRCLIB)modex16.h
187 wcl $(FLAGS) -c $(SRC)test.c
189 test2.$(OBJ): $(SRC)test2.c $(SRCLIB)modex16.h
190 wcl $(FLAGS) -c $(SRC)test2.c
192 pcxtest.$(OBJ): $(SRC)pcxtest.c $(SRCLIB)modex16.h
193 wcl $(FLAGS) -c $(SRC)pcxtest.c
195 pcxtest2.$(OBJ): $(SRC)pcxtest2.c $(SRCLIB)modex16.h
196 wcl $(FLAGS) -c $(SRC)pcxtest2.c
198 palettec.$(OBJ): $(SRC)palettec.c
199 wcl $(FLAGS) -c $(SRC)palettec.c
201 palettel.$(OBJ): $(SRC)palettel.c
202 wcl $(FLAGS) -c $(SRC)palettel.c
204 maptest.$(OBJ): $(SRC)maptest.c $(SRCLIB)modex16.h
205 wcl $(FLAGS) -c $(SRC)maptest.c
207 #maptest0.$(OBJ): $(SRC)maptest0.c# $(SRCLIB)modex16.h
208 # wcl $(FLAGS) $(MFLAGS) -c $(SRC)maptest0.c
210 #emmtest.$(OBJ): $(SRC)emmtest.c
211 # wcl $(FLAGS) $(MFLAGS) -c $(SRC)emmtest.c
213 #emsdump.$(OBJ): $(SRC)emsdump.c
214 # wcl $(FLAGS) $(MFLAGS) -c $(SRC)emsdump.c
216 fmemtest.$(OBJ): $(SRC)fmemtest.c
217 wcl $(FLAGS) -c $(SRC)fmemtest.c
219 fonttest.$(OBJ): $(SRC)fonttest.c
220 wcl $(FLAGS) -c $(SRC)fonttest.c
222 #fonttes0.$(OBJ): $(SRC)fonttes0.c
223 # wcl $(FLAGS) -c $(SRC)fonttes0.c
225 fontgfx.$(OBJ): $(SRC)fontgfx.c
226 wcl $(FLAGS) -c $(SRC)fontgfx.c
228 inputest.$(OBJ): $(SRC)inputest.c
229 wcl $(FLAGS) -c $(SRC)inputest.c
231 #sountest.$(OBJ): $(SRC)sountest.c
232 # wcl $(FLAGS) -c $(SRC)sountest.c
234 #miditest.$(OBJ): $(SRC)miditest.c
235 # wcl $(FLAGS) -c $(SRC)miditest.c
237 #testemm.$(OBJ): $(SRC)testemm.c
238 # wcl $(FLAGS) -c $(SRC)testemm.c
240 #testemm0.$(OBJ): $(SRC)testemm0.c
241 # wcl $(FLAGS) -c $(SRC)testemm0.c
243 tsthimem.$(OBJ): $(SRC)tsthimem.c
244 wcl $(FLAGS) -c $(SRC)tsthimem.c
246 exmmtest.$(OBJ): $(SRC)exmmtest.c
247 wcl $(FLAGS) -c $(SRC)exmmtest.c
249 vgmtest.$(OBJ): $(SRC)vgmtest.c
250 wcl $(FLAGS) -c $(SRC)vgmtest.c
251 #====wcl -mc -c $(SRC)vgmtest.c
254 #non executable objects libraries
256 16.lib: $(16LIBOBJS)# doslib.lib vgmsnd.lib
257 wlib -b -q $(16LIBOBJS) $(16LIBOBJS)# doslib.lib vgmsnd.lib
259 gfx.lib: $(GFXLIBOBJS)
260 wlib -b -q gfx.lib $(GFXLIBOBJS)
262 doslib.lib: $(DOSLIBOBJ) # $(SRCLIB)cpu.lib
263 wlib -b -q doslib.lib $(DOSLIBOBJ) # $(SRCLIB)cpu.lib
265 vgmsnd.lib: $(VGMSNDOBJ)
266 wlib -b -q vgmsnd.lib $(VGMSNDOBJ)
268 modex16.$(OBJ): $(SRCLIB)modex16.h $(SRCLIB)modex16.c
269 wcl $(FLAGS) -c $(SRCLIB)modex16.c
271 bakapee.$(OBJ): $(SRCLIB)bakapee.h $(SRCLIB)bakapee.c
272 wcl $(FLAGS) -c $(SRCLIB)bakapee.c
274 bitmap.$(OBJ): $(SRCLIB)bitmap.h $(SRCLIB)bitmap.c
275 wcl $(FLAGS) -c $(SRCLIB)bitmap.c
277 planar.$(OBJ): $(SRCLIB)planar.h $(SRCLIB)planar.c
278 wcl $(FLAGS) -c $(SRCLIB)planar.c
280 scroll16.$(OBJ): $(SRCLIB)scroll16.h $(SRCLIB)scroll16.c
281 wcl $(FLAGS) -c $(SRCLIB)scroll16.c
283 wcpu.$(OBJ): $(WCPULIB)wcpu.h $(WCPULIB)wcpu.c
284 wcl $(FLAGS) -c $(WCPULIB)wcpu.c
286 16text.$(OBJ): $(SRCLIB)16text.c
287 wcl $(FLAGS) -c $(SRCLIB)16text.c
289 mapread.$(OBJ): $(SRCLIB)mapread.h $(SRCLIB)mapread.c
290 wcl $(FLAGS) -c $(SRCLIB)mapread.c
292 timer.$(OBJ): $(SRCLIB)timer.h $(SRCLIB)timer.c
293 wcl $(FLAGS) -c $(SRCLIB)timer.c
295 16_in.$(OBJ): $(SRCLIB)16_in.h $(SRCLIB)16_in.c
296 wcl $(FLAGS) -c $(SRCLIB)16_in.c
298 16_mm.$(OBJ): $(SRCLIB)16_mm.h $(SRCLIB)16_mm.c
299 wcl $(FLAGS) -c $(SRCLIB)16_mm.c
301 16_ca.$(OBJ): $(SRCLIB)16_ca.h $(SRCLIB)16_ca.c
302 wcl $(FLAGS) -c $(SRCLIB)16_ca.c
304 midi.$(OBJ): $(SRCLIB)midi.h $(SRCLIB)midi.c
305 wcl $(FLAGS) -c $(SRCLIB)midi.c
310 adlib.$(OBJ): $(DOSLIB)adlib.h $(DOSLIB)adlib.c
311 wcl $(FLAGS) -c $(DOSLIB)adlib.c
313 8254.$(OBJ): $(DOSLIB)8254.h $(DOSLIB)8254.c
314 wcl $(FLAGS) -c $(DOSLIB)8254.c
316 8259.$(OBJ): $(DOSLIB)8259.h $(DOSLIB)8259.c
317 wcl $(FLAGS) -c $(DOSLIB)8259.c
319 dos.$(OBJ): $(DOSLIB)dos.h $(DOSLIB)dos.c
320 wcl $(FLAGS) -c $(DOSLIB)dos.c
322 cpu.$(OBJ): $(DOSLIB)cpu.h $(DOSLIB)cpu.c
323 wcl $(FLAGS) -c $(DOSLIB)cpu.c
325 himemsys.$(OBJ): $(DOSLIB)himemsys.h $(DOSLIB)himemsys.c
326 wcl $(FLAGS) -c $(DOSLIB)himemsys.c
328 emm.$(OBJ): $(DOSLIB)emm.h $(DOSLIB)emm.c
329 wcl $(FLAGS) -c $(DOSLIB)emm.c
331 # end of doslib stuff
333 16_head.$(OBJ): $(SRCLIB)16_head.h $(SRCLIB)16_head.c
334 wcl $(FLAGS) -c $(SRCLIB)16_head.c
336 16_hc.$(OBJ): $(SRCLIB)16_hc.h $(SRCLIB)16_hc.c
337 wcl $(FLAGS) -c $(SRCLIB)16_hc.c
339 16_snd.$(OBJ): $(SRCLIB)16_snd.h $(SRCLIB)16_snd.c
340 wcl $(FLAGS) -c $(SRCLIB)16_snd.c
341 #====wcl -mc -c $(SRCLIB)16_snd.c
343 jsmn.$(OBJ): $(JSMNLIB)jsmn.h $(JSMNLIB)jsmn.c
344 wcl $(FLAGS) -c $(JSMNLIB)jsmn.c
346 kitten.$(OBJ): $(NYANLIB)kitten.h $(NYANLIB)kitten.c
347 wcl $(FLAGS) -c $(NYANLIB)kitten.c
349 vgmSnd.$(OBJ): $(VGMSNDLIB)vgmSnd.h $(VGMSNDLIB)vgmSnd.c
350 wcl $(FLAGS) -c $(VGMSNDLIB)vgmSnd.c
351 #====wcl -c -mc $(VGMSNDLIB)vgmSnd.c
353 #3812intf.$(OBJ): $(VGMSNDLIB)3812intf.h $(VGMSNDLIB)3812intf.c
354 # wcl $(FLAGS) -c $(VGMSNDLIB)3812intf.c
356 #farjsmn.$(OBJ): $(JSMNLIB)farjsmn.h $(JSMNLIB)farjsmn.c
357 # wcl $(FLAGS) $(MFLAGS) -c $(JSMNLIB)farjsmn.c
359 #memory.$(OBJ): $(EXMMLIB)memory.h $(EXMMLIB)memory.c
360 # wcl $(FLAGS) $(MFLAGS) -c $(EXMMLIB)memory.c
366 @$(REMOVECOMMAND) $(EXEC)
367 @$(REMOVECOMMAND) *.$(OBJ)
368 @$(REMOVECOMMAND) *.lib
373 @$(REMOVECOMMAND) *.16
374 @$(REMOVECOMMAND) *.16W
375 @$(REMOVECOMMAND) *.16B
376 @$(REMOVECOMMAND) *.OBJ
377 @$(REMOVECOMMAND) *.o
378 @$(REMOVECOMMAND) *.BCO
379 @$(REMOVECOMMAND) makefi~1
380 @$(REMOVECOMMAND) makefile~
381 @$(REMOVECOMMAND) __wcl__.LNK
382 # @$(REMOVECOMMAND) *.smp
383 @$(REMOVECOMMAND) *.SMP
384 @$(REMOVECOMMAND) *.hed
385 @$(REMOVECOMMAND) *.MAP
386 @$(REMOVECOMMAND) *.map
387 @$(REMOVECOMMAND) *.err
388 @$(COPYCOMMAND) .git/config git_con.fig
389 # @$(COPYCOMMAND) $(SRC)exmmtest.c $(EXMMTESTDIR)$(SRC)
390 # @$(COPYCOMMAND) $(SRCLIB)16_mm.* $(EXMMTESTDIR)$(SRCLIB)
391 # @$(COPYCOMMAND) $(SRCLIB)16_head.* $(EXMMTESTDIR)$(SRCLIB)
392 # @$(COPYCOMMAND) $(SRCLIB)16_ca.* $(EXMMTESTDIR)$(SRCLIB)
393 # @$(COPYCOMMAND) $(SRCLIB)16_hc.* $(EXMMTESTDIR)$(SRCLIB)
394 # @$(COPYCOMMAND) $(SRCLIB)types.h $(EXMMTESTDIR)$(SRCLIB)
395 # @$(COPYCOMMAND) $(NYANLIB)* $(EXMMTESTDIR)$(NYANLIB)
402 updatelibs: .symbolic