]> git.sur5r.net Git - cc65/blobdiff - testcode/lib/pce/Makefile
Changed the PC-Engine's configuration file, so that the command line can build 8K...
[cc65] / testcode / lib / pce / Makefile
index 9a4dd750634aa2674d2f83fe1feaeb23bbd2e596..a4a495c9aa693aca90747776aa991af7769fd134 100644 (file)
@@ -1,12 +1,29 @@
 .PHONY: all clean test
 
+# Size of cartridge to generate.
+# Possible values:
+#  8K = 0x2000
+# 16K = 0x4000
+# 32K = 0x8000
+CARTSIZE := 0x2000
+
+ifeq (${CARTSIZE},0x8000)
+COUNT := 3
+else
+COUNT := 1
+endif
+
 all: conio.pce
 
-conio.pce: conio.c
-       ../../../bin/cl65 -t pce conio.c --mapfile conio.map -o conio.pce
+%.pce: %.bin
+       dd if=$< bs=8K skip=${COUNT} > $@
+       dd if=$< bs=8K count=${COUNT} >> $@
+
+%.bin: %.c ../../../lib/pce.lib
+       ../../../bin/cl65 -t pce $< -Wl -D__CARTSIZE__=${CARTSIZE} -m $*.map -o $@
 
 clean:
-       $(RM) conio.o conio.pce conio.map
+       $(RM) conio.o conio.???
 
 test: conio.pce
-       mednafen -force_module pce conio.pce
+       mednafen -force_module pce $<