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
39 #IN=..$(DIRSEP)..$(DIRSEP)fdos$(DIRSEP)watcom2$(DIRSEP)h
44 #-zk0u = translate kanji to unicode... wwww
45 #-zk0 = kanji support~
46 #-zkl = current codepage
48 #EXMMTESTDIR=16$(DIRSEP)exmmtest$(DIRSEP)
50 SRCLIB=$(SRC)lib$(DIRSEP)
51 JSMNLIB=$(SRCLIB)jsmn$(DIRSEP)
52 NYANLIB=$(SRCLIB)nyan$(DIRSEP)
53 #EXMMLIB=$(SRCLIB)exmm$(DIRSEP)
54 VGMSNDLIB=$(SRCLIB)vgmsnd$(DIRSEP)
55 DOSLIB=$(SRCLIB)doslib$(DIRSEP)
56 WCPULIB=$(SRCLIB)wcpu$(DIRSEP)
59 BAKAPIFLAGS=-fh=bakapi.hed
60 SFLAGS=-sg -st -of+ -zu -zdf -zff -zgf -k56000#60000#32768
61 DFLAGS=-DTARGET_MSDOS=16 -DMSDOS=1 $(SFLAGS)
62 ZFLAGS=-zk0 -zq -zc -zp8# -zm
63 CFLAGS=$(IFLAGS) -mh -lr -l=dos -wo# -d2##wwww
64 OFLAGS=-obmiler -out -oh -ei -zp8 -0 -fpi87 -onac -ol+ -ok####x
65 FLAGS=$(CFLAGS) $(OFLAGS) $(DFLAGS) $(ZFLAGS)
67 DOSLIBEXMMOBJ = himemsys.$(OBJ) emm.$(OBJ)
68 VGMSNDOBJ = vgmSnd.$(OBJ) 16_snd.$(OBJ)
69 DOSLIBOBJ = adlib.$(OBJ) 8254.$(OBJ) 8259.$(OBJ) dos.$(OBJ) cpu.$(OBJ)
70 16LIBOBJS = 16_in.$(OBJ) 16_mm.$(OBJ) wcpu.$(OBJ) 16_head.$(OBJ) 16_ca.$(OBJ) kitten.$(OBJ) 16_hc.$(OBJ) timer.$(OBJ)
73 GFXLIBOBJS = modex16.$(OBJ) bitmap.$(OBJ) planar.$(OBJ) 16text.$(OBJ) bakapee.$(OBJ) scroll16.$(OBJ)
75 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
77 #testemm.exe testemm0.exe fonttes0.exe miditest.exe sega.exe sountest.exe
78 EXEC = 16.exe bakapi.exe $(TESTEXEC) tesuto.exe
83 #game and bakapi executables
85 16.exe: 16.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIBOBJS) gfx.lib
86 wcl $(FLAGS) $(16FLAGS) 16.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIBOBJS) gfx.lib -fm=16.map
88 bakapi.exe: bakapi.$(OBJ) $(16LIBOBJS) gfx.lib
89 wcl $(FLAGS) $(BAKAPIFLAGS) bakapi.$(OBJ) $(16LIBOBJS) gfx.lib -fm=bakapi.map
93 scroll.exe: scroll.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIBOBJS) gfx.lib
94 wcl $(FLAGS) scroll.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIBOBJS) gfx.lib -fm=scroll.map
95 scroll.$(OBJ): $(SRC)scroll.c
96 wcl $(FLAGS) -c $(SRC)scroll.c
98 tesuto.exe: tesuto.$(OBJ)
99 wcl -zq -mh -d2 tesuto.$(OBJ)
100 tesuto.$(OBJ): $(SRC)tesuto.c
101 wcl -zq -mh -d2 -c $(SRC)tesuto.c
103 #sega.exe: sega.$(OBJ)
104 # wcl $(FLAGS) sega.$(OBJ)
105 #sega.$(OBJ): $(SRC)sega.c
106 # wcl $(FLAGS) -c $(SRC)sega.c
108 test.exe: test.$(OBJ) gfx.lib
109 wcl $(FLAGS) test.$(OBJ) gfx.lib -fm=test.map
111 test2.exe: test2.$(OBJ) gfx.lib
112 wcl $(FLAGS) test2.$(OBJ) gfx.lib -fm=test2.map
114 fonttest.exe: fonttest.$(OBJ) $(16LIBOBJS) gfx.lib
115 wcl $(FLAGS) fonttest.$(OBJ) $(16LIBOBJS) gfx.lib -fm=fonttest.map
117 #fonttes0.exe: fonttes0.$(OBJ) $(16LIBOBJS)
118 # wcl $(FLAGS) fonttes0.$(OBJ) $(16LIBOBJS)
120 fontgfx.exe: fontgfx.$(OBJ) $(16LIBOBJS) gfx.lib
121 wcl $(FLAGS) fontgfx.$(OBJ) $(16LIBOBJS) gfx.lib -fm=fontgfx.map
123 inputest.exe: inputest.$(OBJ) $(16LIBOBJS)
124 wcl $(FLAGS) inputest.$(OBJ) $(16LIBOBJS) -fm=inputest.map
126 #sountest.exe: sountest.$(OBJ) $(16LIBOBJS)
127 # wcl $(FLAGS) sountest.$(OBJ) $(16LIBOBJS)
129 #miditest.exe: miditest.$(OBJ) $(16LIBOBJS) $(DOSLIBEXMMOBJ) midi.$(OBJ)
130 # wcl $(FLAGS) miditest.$(OBJ) $(16LIBOBJS) $(DOSLIBEXMMOBJ) midi.$(OBJ)
132 tsthimem.exe: tsthimem.$(OBJ) $(16LIBOBJS) $(DOSLIBEXMMOBJ)
133 wcl $(FLAGS) tsthimem.$(OBJ) $(16LIBOBJS) $(DOSLIBEXMMOBJ) -fm=tsthimem.map
135 #testemm.exe: testemm.$(OBJ) $(16LIBOBJS) $(DOSLIBEXMMOBJ)
136 # wcl $(FLAGS) testemm.$(OBJ) $(16LIBOBJS) $(DOSLIBEXMMOBJ)
138 #testemm0.exe: testemm0.$(OBJ) $(16LIBOBJS) $(DOSLIBEXMMOBJ)
139 # wcl $(FLAGS) testemm0.$(OBJ) $(16LIBOBJS) $(DOSLIBEXMMOBJ)
141 pcxtest.exe: pcxtest.$(OBJ) gfx.lib
142 wcl $(FLAGS) pcxtest.$(OBJ) gfx.lib -fm=pcxtest.map
144 palettec.exe: palettec.$(OBJ) $(16LIBOBJS) gfx.lib
145 wcl $(FLAGS) palettec.$(OBJ) $(16LIBOBJS) gfx.lib -fm=palettec.map
147 palettel.exe: palettel.$(OBJ) $(16LIBOBJS) gfx.lib
148 wcl $(FLAGS) palettel.$(OBJ) $(16LIBOBJS) gfx.lib -fm=palettel.map
150 pcxtest2.exe: pcxtest2.$(OBJ) gfx.lib
151 wcl $(FLAGS) pcxtest2.$(OBJ) gfx.lib -fm=pcxtest2.map
153 maptest.exe: maptest.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIBOBJS) gfx.lib
154 wcl $(FLAGS) maptest.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) $(16LIBOBJS) gfx.lib -fm=maptest.map
156 #maptest0.exe: maptest0.$(OBJ) fmapread.$(OBJ) farjsmn.$(OBJ)
157 # wcl $(FLAGS) $(MFLAGS) maptest0.$(OBJ) fmapread.$(OBJ) farjsmn.$(OBJ)
159 #emmtest.exe: emmtest.$(OBJ) memory.$(OBJ)
160 # wcl $(FLAGS) $(MFLAGS) emmtest.$(OBJ) memory.$(OBJ)
162 #emsdump.exe: emsdump.$(OBJ) memory.$(OBJ)
163 # wcl $(FLAGS) $(MFLAGS) emsdump.$(OBJ) memory.$(OBJ)
165 fmemtest.exe: fmemtest.$(OBJ) $(16LIBOBJS)
166 wcl $(FLAGS) fmemtest.$(OBJ) $(16LIBOBJS) -fm=fmemtest.map
168 exmmtest.exe: exmmtest.$(OBJ) $(16LIBOBJS)
169 wcl $(FLAGS) exmmtest.$(OBJ) -fm=exmmtest.map $(16LIBOBJS)
171 vgmtest.exe: vgmtest.$(OBJ) vgmsnd.lib $(16LIBOBJS)
172 wcl $(FLAGS) vgmtest.$(OBJ) vgmsnd.lib -fm=vgmtest.map $(16LIBOBJS)
173 #====wcl -mc vgmtest.$(OBJ) $(VGMSNDOBJ) -fm=vgmtest.map
177 #executable's objects
179 16.$(OBJ): $(SRC)16.h $(SRC)16.c
180 wcl $(FLAGS) -c $(SRC)16.c
182 bakapi.$(OBJ): $(SRC)bakapi.h $(SRC)bakapi.c
183 wcl $(FLAGS) -c $(SRC)bakapi.c
185 test.$(OBJ): $(SRC)test.c $(SRCLIB)modex16.h
186 wcl $(FLAGS) -c $(SRC)test.c
188 test2.$(OBJ): $(SRC)test2.c $(SRCLIB)modex16.h
189 wcl $(FLAGS) -c $(SRC)test2.c
191 pcxtest.$(OBJ): $(SRC)pcxtest.c $(SRCLIB)modex16.h
192 wcl $(FLAGS) -c $(SRC)pcxtest.c
194 pcxtest2.$(OBJ): $(SRC)pcxtest2.c $(SRCLIB)modex16.h
195 wcl $(FLAGS) -c $(SRC)pcxtest2.c
197 palettec.$(OBJ): $(SRC)palettec.c
198 wcl $(FLAGS) -c $(SRC)palettec.c
200 palettel.$(OBJ): $(SRC)palettel.c
201 wcl $(FLAGS) -c $(SRC)palettel.c
203 maptest.$(OBJ): $(SRC)maptest.c $(SRCLIB)modex16.h
204 wcl $(FLAGS) -c $(SRC)maptest.c
206 #maptest0.$(OBJ): $(SRC)maptest0.c# $(SRCLIB)modex16.h
207 # wcl $(FLAGS) $(MFLAGS) -c $(SRC)maptest0.c
209 #emmtest.$(OBJ): $(SRC)emmtest.c
210 # wcl $(FLAGS) $(MFLAGS) -c $(SRC)emmtest.c
212 #emsdump.$(OBJ): $(SRC)emsdump.c
213 # wcl $(FLAGS) $(MFLAGS) -c $(SRC)emsdump.c
215 fmemtest.$(OBJ): $(SRC)fmemtest.c
216 wcl $(FLAGS) -c $(SRC)fmemtest.c
218 fonttest.$(OBJ): $(SRC)fonttest.c
219 wcl $(FLAGS) -c $(SRC)fonttest.c
221 #fonttes0.$(OBJ): $(SRC)fonttes0.c
222 # wcl $(FLAGS) -c $(SRC)fonttes0.c
224 fontgfx.$(OBJ): $(SRC)fontgfx.c
225 wcl $(FLAGS) -c $(SRC)fontgfx.c
227 inputest.$(OBJ): $(SRC)inputest.c
228 wcl $(FLAGS) -c $(SRC)inputest.c
230 #sountest.$(OBJ): $(SRC)sountest.c
231 # wcl $(FLAGS) -c $(SRC)sountest.c
233 #miditest.$(OBJ): $(SRC)miditest.c
234 # wcl $(FLAGS) -c $(SRC)miditest.c
236 #testemm.$(OBJ): $(SRC)testemm.c
237 # wcl $(FLAGS) -c $(SRC)testemm.c
239 #testemm0.$(OBJ): $(SRC)testemm0.c
240 # wcl $(FLAGS) -c $(SRC)testemm0.c
242 tsthimem.$(OBJ): $(SRC)tsthimem.c
243 wcl $(FLAGS) -c $(SRC)tsthimem.c
245 exmmtest.$(OBJ): $(SRC)exmmtest.c
246 wcl $(FLAGS) -c $(SRC)exmmtest.c
248 vgmtest.$(OBJ): $(SRC)vgmtest.c
249 wcl $(FLAGS) -c $(SRC)vgmtest.c
250 #====wcl -mc -c $(SRC)vgmtest.c
253 #non executable objects libraries
255 16.lib: $(16LIBOBJS)# doslib.lib vgmsnd.lib
256 wlib -b -q $(16LIBOBJS) $(16LIBOBJS)# doslib.lib vgmsnd.lib
258 gfx.lib: $(GFXLIBOBJS)
259 wlib -b -q gfx.lib $(GFXLIBOBJS)
261 doslib.lib: $(DOSLIBOBJ) # $(SRCLIB)cpu.lib
262 wlib -b -q doslib.lib $(DOSLIBOBJ) # $(SRCLIB)cpu.lib
264 vgmsnd.lib: $(VGMSNDOBJ)
265 wlib -b -q vgmsnd.lib $(VGMSNDOBJ)
267 modex16.$(OBJ): $(SRCLIB)modex16.h $(SRCLIB)modex16.c
268 wcl $(FLAGS) -c $(SRCLIB)modex16.c
270 bakapee.$(OBJ): $(SRCLIB)bakapee.h $(SRCLIB)bakapee.c
271 wcl $(FLAGS) -c $(SRCLIB)bakapee.c
273 bitmap.$(OBJ): $(SRCLIB)bitmap.h $(SRCLIB)bitmap.c
274 wcl $(FLAGS) -c $(SRCLIB)bitmap.c
276 planar.$(OBJ): $(SRCLIB)planar.h $(SRCLIB)planar.c
277 wcl $(FLAGS) -c $(SRCLIB)planar.c
279 scroll16.$(OBJ): $(SRCLIB)scroll16.h $(SRCLIB)scroll16.c
280 wcl $(FLAGS) -c $(SRCLIB)scroll16.c
282 wcpu.$(OBJ): $(WCPULIB)wcpu.h $(WCPULIB)wcpu.c
283 wcl $(FLAGS) -c $(WCPULIB)wcpu.c
285 16text.$(OBJ): $(SRCLIB)16text.c
286 wcl $(FLAGS) -c $(SRCLIB)16text.c
288 mapread.$(OBJ): $(SRCLIB)mapread.h $(SRCLIB)mapread.c
289 wcl $(FLAGS) -c $(SRCLIB)mapread.c
291 timer.$(OBJ): $(SRCLIB)timer.h $(SRCLIB)timer.c
292 wcl $(FLAGS) -c $(SRCLIB)timer.c
294 16_in.$(OBJ): $(SRCLIB)16_in.h $(SRCLIB)16_in.c
295 wcl $(FLAGS) -c $(SRCLIB)16_in.c
297 16_mm.$(OBJ): $(SRCLIB)16_mm.h $(SRCLIB)16_mm.c
298 wcl $(FLAGS) -c $(SRCLIB)16_mm.c
300 16_ca.$(OBJ): $(SRCLIB)16_ca.h $(SRCLIB)16_ca.c
301 wcl $(FLAGS) -c $(SRCLIB)16_ca.c
303 midi.$(OBJ): $(SRCLIB)midi.h $(SRCLIB)midi.c
304 wcl $(FLAGS) -c $(SRCLIB)midi.c
309 adlib.$(OBJ): $(DOSLIB)adlib.h $(DOSLIB)adlib.c
310 wcl $(FLAGS) -c $(DOSLIB)adlib.c
312 8254.$(OBJ): $(DOSLIB)8254.h $(DOSLIB)8254.c
313 wcl $(FLAGS) -c $(DOSLIB)8254.c
315 8259.$(OBJ): $(DOSLIB)8259.h $(DOSLIB)8259.c
316 wcl $(FLAGS) -c $(DOSLIB)8259.c
318 dos.$(OBJ): $(DOSLIB)dos.h $(DOSLIB)dos.c
319 wcl $(FLAGS) -c $(DOSLIB)dos.c
321 cpu.$(OBJ): $(DOSLIB)cpu.h $(DOSLIB)cpu.c
322 wcl $(FLAGS) -c $(DOSLIB)cpu.c
324 himemsys.$(OBJ): $(DOSLIB)himemsys.h $(DOSLIB)himemsys.c
325 wcl $(FLAGS) -c $(DOSLIB)himemsys.c
327 emm.$(OBJ): $(DOSLIB)emm.h $(DOSLIB)emm.c
328 wcl $(FLAGS) -c $(DOSLIB)emm.c
330 # end of doslib stuff
332 16_head.$(OBJ): $(SRCLIB)16_head.h $(SRCLIB)16_head.c
333 wcl $(FLAGS) -c $(SRCLIB)16_head.c
335 16_hc.$(OBJ): $(SRCLIB)16_hc.h $(SRCLIB)16_hc.c
336 wcl $(FLAGS) -c $(SRCLIB)16_hc.c
338 16_snd.$(OBJ): $(SRCLIB)16_snd.h $(SRCLIB)16_snd.c
339 wcl $(FLAGS) -c $(SRCLIB)16_snd.c
340 #====wcl -mc -c $(SRCLIB)16_snd.c
342 jsmn.$(OBJ): $(JSMNLIB)jsmn.h $(JSMNLIB)jsmn.c
343 wcl $(FLAGS) -c $(JSMNLIB)jsmn.c
345 kitten.$(OBJ): $(NYANLIB)kitten.h $(NYANLIB)kitten.c
346 wcl $(FLAGS) -c $(NYANLIB)kitten.c
348 vgmSnd.$(OBJ): $(VGMSNDLIB)vgmSnd.h $(VGMSNDLIB)vgmSnd.c
349 wcl $(FLAGS) -c $(VGMSNDLIB)vgmSnd.c
350 #====wcl -c -mc $(VGMSNDLIB)vgmSnd.c
352 #3812intf.$(OBJ): $(VGMSNDLIB)3812intf.h $(VGMSNDLIB)3812intf.c
353 # wcl $(FLAGS) -c $(VGMSNDLIB)3812intf.c
355 #farjsmn.$(OBJ): $(JSMNLIB)farjsmn.h $(JSMNLIB)farjsmn.c
356 # wcl $(FLAGS) $(MFLAGS) -c $(JSMNLIB)farjsmn.c
358 #memory.$(OBJ): $(EXMMLIB)memory.h $(EXMMLIB)memory.c
359 # wcl $(FLAGS) $(MFLAGS) -c $(EXMMLIB)memory.c
365 @$(REMOVECOMMAND) $(EXEC)
366 @$(REMOVECOMMAND) *.$(OBJ)
367 @$(REMOVECOMMAND) *.lib
372 @$(REMOVECOMMAND) *.16
373 @$(REMOVECOMMAND) *.16W
374 @$(REMOVECOMMAND) *.16B
375 @$(REMOVECOMMAND) *.OBJ
376 @$(REMOVECOMMAND) *.o
377 @$(REMOVECOMMAND) *.BCO
378 @$(REMOVECOMMAND) makefi~1
379 @$(REMOVECOMMAND) makefile~
380 @$(REMOVECOMMAND) __wcl__.LNK
381 # @$(REMOVECOMMAND) *.smp
382 @$(REMOVECOMMAND) *.SMP
383 @$(REMOVECOMMAND) *.hed
384 @$(REMOVECOMMAND) *.MAP
385 @$(REMOVECOMMAND) *.map
386 @$(REMOVECOMMAND) *.err
387 @$(COPYCOMMAND) .git/config git_con.fig
388 # @$(COPYCOMMAND) $(SRC)exmmtest.c $(EXMMTESTDIR)$(SRC)
389 # @$(COPYCOMMAND) $(SRCLIB)16_mm.* $(EXMMTESTDIR)$(SRCLIB)
390 # @$(COPYCOMMAND) $(SRCLIB)16_head.* $(EXMMTESTDIR)$(SRCLIB)
391 # @$(COPYCOMMAND) $(SRCLIB)16_ca.* $(EXMMTESTDIR)$(SRCLIB)
392 # @$(COPYCOMMAND) $(SRCLIB)16_hc.* $(EXMMTESTDIR)$(SRCLIB)
393 # @$(COPYCOMMAND) $(SRCLIB)types.h $(EXMMTESTDIR)$(SRCLIB)
394 # @$(COPYCOMMAND) $(NYANLIB)* $(EXMMTESTDIR)$(NYANLIB)
401 updatelibs: .symbolic