-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
55 lines (45 loc) · 1.13 KB
/
Makefile
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
PROJECT = chr720
BMP2CHR = ../../tools/bmp2chr/bmp2chr
MAKEROM = ../../tools/makerom/makerom
MAKEPKG = ../../tools/makepkg/makepkg
SDCC_FLAGS = -mz80
SDCC_FLAGS += --opt-code-size
SDCC_FLAGS += --code-loc 0x100
SDCC_FLAGS += --xram-loc 0xC000
SDCC_FLAGS += --xram-size 0x4000
SDCC_FLAGS += --no-std-crt0
SDCC_FLAGS += -Wl../../lib/sdcc/vgs0.lib
all: build
cd ../../src/sdl2 && make
../../src/sdl2/vgs0 game.pkg
build: tools game.pkg
clean:
rm -f *.rel
rm -f *.chr
rm -f *.lst
rm -f *.sym
rm -f *.asm
rm -f *.ihx
rm -f *.map
rm -f *.bin
rm -f *.lk
rm -f *.noi
rm -f ${PROJECT}.rom
rm -f bgm.dat
rm -f se.dat
rm -f game.pkg
tools:
cd ../../tools && make
game.pkg: ${PROJECT}.rom
${MAKEPKG} -o game.pkg -r ${PROJECT}.rom
${PROJECT}.rom: bg.chr fg.chr sprite.chr program.bin
${MAKEROM} ${PROJECT}.rom program.bin bg.chr fg.chr sprite.chr
bg.chr: bg.bmp
${BMP2CHR} bg.bmp bg.chr palette.h
fg.chr: fg.bmp
${BMP2CHR} fg.bmp fg.chr
sprite.chr: sprite.bmp
${BMP2CHR} sprite.bmp sprite.chr
program.bin: program.c ../../lib/sdcc/vgs0.lib ../../lib/sdcc/vgs0lib.h
sdcc ${SDCC_FLAGS} program.c
makebin -s 16384 program.ihx program.bin