!ifdef __LINUX__
-REMOVECOMMAND=rm
+REMOVECOMMAND=rm -f
+COPYCOMMAND=cp -f
DIRSEP=/
OBJ=o
!else
REMOVECOMMAND=del
+COPYCOMMAND=copy /y
DIRSEP=\
OBJ=obj
!endif
#-zk0 = kanji support~
#-zkl = current codepage
-#MFLAGS=-mc# -zm
-CFLAGS=-zk0 -wo -x -mc# -zdp# -zp16 -zq
-OFLAGS=-ot -ox -ob -oh -or# -om -ol -ol+
-FLAGS=-0 -d2 -lr $(OFLAGS) $(CFLAGS)
+EXMMTESTDIR=16$(DIRSEP)exmmtest$(DIRSEP)
SRC=src$(DIRSEP)
SRCLIB=$(SRC)lib$(DIRSEP)
JSMNLIB=$(SRCLIB)jsmn$(DIRSEP)
-EXMMLIB=$(SRCLIB)exmm$(DIRSEP)
+NYANLIB=$(SRCLIB)nyan$(DIRSEP)
+#EXMMLIB=$(SRCLIB)exmm$(DIRSEP)
DOSLIB=$(SRCLIB)doslib$(DIRSEP)
WCPULIB=$(SRCLIB)wcpu$(DIRSEP)
-16LIBOBJS = 16_in.$(OBJ) 16_mm.$(OBJ) wcpu.$(OBJ) 16_head.$(OBJ) scroll16.$(OBJ) 16_ca.$(OBJ) adlib.$(OBJ) 8254.$(OBJ) cpu.$(OBJ)
-#16_snd.$(OBJ)
+16FLAGS=-fh=16.hed
+BAKAPIFLAGS=-fh=bakapi.hed
+SFLAGS=-sg -st -of+ -k32768 -zu## -zdp#51200#49152#24576
+DFLAGS=-DTARGET_MSDOS=16 -DMSDOS=1 $(SFLAGS)
+ZFLAGS=-zk0 -zq -zu -zc -zm# -zdp# -zp16
+CFLAGS=-mc -lr -l=dos -wo -x## -d2
+OFLAGS=-obmiler -out -oh -ei -zp8 -0 -fpi87 -onac -ol+ -ok####x
+FLAGS=$(OFLAGS) $(CFLAGS) $(DFLAGS) $(ZFLAGS)
+
+DOSLIBEXMMOBJ = himemsys.$(OBJ) emm.$(OBJ)
+DOSLIBOBJ = adlib.$(OBJ) 8254.$(OBJ) 8259.$(OBJ) dos.$(OBJ) cpu.$(OBJ)
+16LIBOBJS = bakapee.$(OBJ) 16_in.$(OBJ) 16_mm.$(OBJ) wcpu.$(OBJ) 16_head.$(OBJ) scroll16.$(OBJ) 16_ca.$(OBJ) timer.$(OBJ) kitten.$(OBJ) 16_hc.$(OBJ)
GFXLIBOBJS = modex16.$(OBJ) bitmap.$(OBJ) planar.$(OBJ) 16text.$(OBJ)
-all: 16.exe test.exe pcxtest.exe test2.exe palettec.exe maptest.exe fmemtest.exe fonttest.exe exmmtest.exe fonttes0.exe fontgfx.exe sountest.exe
-#inputest.exe
+TESTEXEC = exmmtest.exe test.exe pcxtest.exe test2.exe palettec.exe maptest.exe fmemtest.exe fonttest.exe fontgfx.exe sountest.exe tsthimem.exe inputest.exe scroll.exe sega.exe
+#testemm.exe testemm0.exe fonttes0.exe miditest.exe
+EXEC = 16.exe bakapi.exe $(TESTEXEC)
+
+all: $(EXEC)
#
-#executables
+#game and bakapi executables
#
16.exe: 16.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) 16.lib
- wcl $(FLAGS) 16.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) 16.lib
+ wcl $(FLAGS) $(16FLAGS) 16.$(OBJ) mapread.$(OBJ) jsmn.$(OBJ) 16.lib
-scroll.exe: scroll.$(OBJ) 16.lib mapread.$(OBJ) jsmn.$(OBJ) dos_kb.$(OBJ)
- wcl $(FLAGS) scroll.$(OBJ) 16.lib mapread.$(OBJ) jsmn.$(OBJ) dos_kb.$(OBJ)
+bakapi.exe: bakapi.$(OBJ) 16.lib
+ wcl $(FLAGS) $(BAKAPIFLAGS) bakapi.$(OBJ) 16.lib
+#
+#Test Executables!
+#
+scroll.exe: scroll.$(OBJ) 16.lib mapread.$(OBJ) jsmn.$(OBJ)
+ wcl $(FLAGS) scroll.$(OBJ) 16.lib mapread.$(OBJ) jsmn.$(OBJ)
scroll.$(OBJ): $(SRC)scroll.c
wcl $(FLAGS) -c $(SRC)scroll.c
+
+sega.exe: sega.$(OBJ)
+ wcl $(FLAGS) sega.$(OBJ)
+sega.$(OBJ): $(SRC)sega.c
+ wcl $(FLAGS) -c $(SRC)sega.c
+
test.exe: test.$(OBJ) gfx.lib
wcl $(FLAGS) test.$(OBJ) gfx.lib
wcl $(FLAGS) fontgfx.$(OBJ) 16.lib
inputest.exe: inputest.$(OBJ) 16.lib
- wcl $(FLAGS) inputest.$(OBJ) 16.lib
+ wcl $(FLAGS) -D__DEBUG_InputMgr__=1 inputest.$(OBJ) 16.lib
sountest.exe: sountest.$(OBJ) 16.lib
wcl $(FLAGS) sountest.$(OBJ) 16.lib
+miditest.exe: miditest.$(OBJ) 16.lib $(DOSLIBEXMMOBJ) midi.$(OBJ)
+ wcl $(FLAGS) miditest.$(OBJ) 16.lib $(DOSLIBEXMMOBJ) midi.$(OBJ)
+
+tsthimem.exe: tsthimem.$(OBJ) 16.lib $(DOSLIBEXMMOBJ)
+ wcl $(FLAGS) tsthimem.$(OBJ) 16.lib $(DOSLIBEXMMOBJ)
+
+testemm.exe: testemm.$(OBJ) 16.lib $(DOSLIBEXMMOBJ)
+ wcl $(FLAGS) testemm.$(OBJ) 16.lib $(DOSLIBEXMMOBJ)
+
+testemm0.exe: testemm0.$(OBJ) 16.lib $(DOSLIBEXMMOBJ)
+ wcl $(FLAGS) testemm0.$(OBJ) 16.lib $(DOSLIBEXMMOBJ)
+
pcxtest.exe: pcxtest.$(OBJ) gfx.lib
wcl $(FLAGS) pcxtest.$(OBJ) gfx.lib
16.$(OBJ): $(SRC)16.h $(SRC)16.c
wcl $(FLAGS) -c $(SRC)16.c
+bakapi.$(OBJ): $(SRC)bakapi.h $(SRC)bakapi.c
+ wcl $(FLAGS) -c $(SRC)bakapi.c
+
test.$(OBJ): $(SRC)test.c $(SRCLIB)modex16.h
wcl $(FLAGS) -c $(SRC)test.c
sountest.$(OBJ): $(SRC)sountest.c
wcl $(FLAGS) -c $(SRC)sountest.c
+miditest.$(OBJ): $(SRC)miditest.c
+ wcl $(FLAGS) -c $(SRC)miditest.c
+
+testemm.$(OBJ): $(SRC)testemm.c
+ wcl $(FLAGS) -c $(SRC)testemm.c
+
+testemm0.$(OBJ): $(SRC)testemm0.c
+ wcl $(FLAGS) -c $(SRC)testemm0.c
+
+tsthimem.$(OBJ): $(SRC)tsthimem.c
+ wcl $(FLAGS) -c $(SRC)tsthimem.c
+
exmmtest.$(OBJ): $(SRC)exmmtest.c
wcl $(FLAGS) -c $(SRC)exmmtest.c
#
#non executable objects libraries
#
-16.lib: $(16LIBOBJS) gfx.lib
- wlib -b 16.lib $(16LIBOBJS) gfx.lib
+16.lib: $(16LIBOBJS) gfx.lib doslib.lib
+ wlib -b 16.lib $(16LIBOBJS) gfx.lib doslib.lib
gfx.lib: $(GFXLIBOBJS)
wlib -b gfx.lib $(GFXLIBOBJS)
+doslib.lib: $(DOSLIBOBJ) # $(SRCLIB)cpu.lib
+ wlib -b doslib.lib $(DOSLIBOBJ) # $(SRCLIB)cpu.lib
+
modex16.$(OBJ): $(SRCLIB)modex16.h $(SRCLIB)modex16.c
wcl $(FLAGS) -c $(SRCLIB)modex16.c
-#dos_kb.$(OBJ): $(SRCLIB)dos_kb.h $(SRCLIB)dos_kb.c
-# wcl $(FLAGS) -c $(SRCLIB)dos_kb.c
+bakapee.$(OBJ): $(SRCLIB)bakapee.h $(SRCLIB)bakapee.c
+ wcl $(FLAGS) -c $(SRCLIB)bakapee.c
bitmap.$(OBJ): $(SRCLIB)bitmap.h $(SRCLIB)bitmap.c
wcl $(FLAGS) -c $(SRCLIB)bitmap.c
16text.$(OBJ): $(SRCLIB)16text.c
wcl $(FLAGS) -c $(SRCLIB)16text.c
-mapread.$(OBJ): $(SRCLIB)mapread.h $(SRCLIB)mapread.c 16.lib
- wcl $(FLAGS) -c $(SRCLIB)mapread.c 16.lib
+mapread.$(OBJ): $(SRCLIB)mapread.h $(SRCLIB)mapread.c
+ wcl $(FLAGS) -c $(SRCLIB)mapread.c
#fmapread.$(OBJ): $(SRCLIB)fmapread.h $(SRCLIB)fmapread.c 16.lib
# wcl $(FLAGS) $(MFLAGS) -c $(SRCLIB)fmapread.c 16.lib
+timer.$(OBJ): $(SRCLIB)timer.h $(SRCLIB)timer.c
+ wcl $(FLAGS) -c $(SRCLIB)timer.c
+
16_in.$(OBJ): $(SRCLIB)16_in.h $(SRCLIB)16_in.c
wcl $(FLAGS) -c $(SRCLIB)16_in.c
16_ca.$(OBJ): $(SRCLIB)16_ca.h $(SRCLIB)16_ca.c
wcl $(FLAGS) -c $(SRCLIB)16_ca.c
-#16_snd.$(OBJ): $(SRCLIB)16_snd.h $(SRCLIB)16_snd.c
-# wcl $(FLAGS) -c $(SRCLIB)16_snd.c
+midi.$(OBJ): $(SRCLIB)midi.h $(SRCLIB)midi.c
+ wcl $(FLAGS) -c $(SRCLIB)midi.c
+#
+# doslib stuff
+#
adlib.$(OBJ): $(DOSLIB)adlib.h $(DOSLIB)adlib.c
wcl $(FLAGS) -c $(DOSLIB)adlib.c
8254.$(OBJ): $(DOSLIB)8254.h $(DOSLIB)8254.c
wcl $(FLAGS) -c $(DOSLIB)8254.c
+8259.$(OBJ): $(DOSLIB)8259.h $(DOSLIB)8259.c
+ wcl $(FLAGS) -c $(DOSLIB)8259.c
+
+dos.$(OBJ): $(DOSLIB)dos.h $(DOSLIB)dos.c
+ wcl $(FLAGS) -c $(DOSLIB)dos.c
+
cpu.$(OBJ): $(DOSLIB)cpu.h $(DOSLIB)cpu.c
wcl $(FLAGS) -c $(DOSLIB)cpu.c
+himemsys.$(OBJ): $(DOSLIB)himemsys.h $(DOSLIB)himemsys.c
+ wcl $(FLAGS) -c $(DOSLIB)himemsys.c
+
+emm.$(OBJ): $(DOSLIB)emm.h $(DOSLIB)emm.c
+ wcl $(FLAGS) -c $(DOSLIB)emm.c
+
+# end of doslib stuff
+
16_head.$(OBJ): $(SRCLIB)16_head.h $(SRCLIB)16_head.c
wcl $(FLAGS) -c $(SRCLIB)16_head.c
+16_hc.$(OBJ): $(SRCLIB)16_hc.h $(SRCLIB)16_hc.c
+ wcl $(FLAGS) -c $(SRCLIB)16_hc.c
+
jsmn.$(OBJ): $(JSMNLIB)jsmn.h $(JSMNLIB)jsmn.c
wcl $(FLAGS) -c $(JSMNLIB)jsmn.c
+kitten.$(OBJ): $(NYANLIB)kitten.h $(NYANLIB)kitten.c
+ wcl $(FLAGS) -c $(NYANLIB)kitten.c
+
#farjsmn.$(OBJ): $(JSMNLIB)farjsmn.h $(JSMNLIB)farjsmn.c
# wcl $(FLAGS) $(MFLAGS) -c $(JSMNLIB)farjsmn.c
#other~
#
clean: .symbolic
+ @$(REMOVECOMMAND) $(EXEC)
@$(REMOVECOMMAND) *.$(OBJ)
@$(REMOVECOMMAND) *.lib
@wlib -n 16.lib
@wlib -n gfx.lib
-# @$(REMOVECOMMAND) *.OBJ
-# @$(REMOVECOMMAND) *.out
-# @$(REMOVECOMMAND) *.OUT
-# @$(REMOVECOMMAND) makefi~1
-# @$(REMOVECOMMAND) makefile~
-# @$(REMOVECOMMAND) __WCL__.LNK
+ @wlib -n doslib.lib
+ @$(REMOVECOMMAND) *.16
+ @$(REMOVECOMMAND) *.OBJ
+ @$(REMOVECOMMAND) makefi~1
+ @$(REMOVECOMMAND) makefile~
+ @$(REMOVECOMMAND) __WCL__.LNK
# @$(REMOVECOMMAND) *.smp
-# @$(REMOVECOMMAND) *.SMP
-
+ @$(REMOVECOMMAND) *.SMP
+ @$(REMOVECOMMAND) *.hed
+ @$(COPYCOMMAND) $(SRC)exmmtest.c $(EXMMTESTDIR)$(SRC)
+ @$(COPYCOMMAND) $(SRCLIB)16_mm.* $(EXMMTESTDIR)$(SRCLIB)
+ @$(COPYCOMMAND) $(SRCLIB)16_head.* $(EXMMTESTDIR)$(SRCLIB)
+ @$(COPYCOMMAND) $(SRCLIB)16_ca.* $(EXMMTESTDIR)$(SRCLIB)
+ @$(COPYCOMMAND) $(SRCLIB)16_hc.* $(EXMMTESTDIR)$(SRCLIB)
+ @$(COPYCOMMAND) $(SRCLIB)types.h $(EXMMTESTDIR)$(SRCLIB)
+ @$(COPYCOMMAND) $(NYANLIB)* $(EXMMTESTDIR)$(NYANLIB)