aboutsummaryrefslogtreecommitdiff
path: root/data/Makefile
blob: 10d8d0dfeea5c377cb143192ed499fd0d966cff8 (plain)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
G=../generated
GENERATED=$(G)/font.h $(G)/menubg.h $(G)/player.h $(G)/explo.h $(G)/splash.h \
    $(G)/palette.h $(G)/tiles.h $(G)/stage.h $(G)/items.h \
    $(G)/doors.h $(G)/platform.h $(G)/oni.h $(G)/ninja.h $(G)/spirit.h \
    $(G)/vampire.h $(G)/flame.h $(G)/spider.h $(G)/demon.h $(G)/switch.h $(G)/fireball.h \
    $(G)/cloud.h \
    $(G)/songs_pak.h

OUTPUT=../build

export PATH:=../tools:$(PATH)

all: $(OUTPUT)/loading.bin $(GENERATED)

$(OUTPUT)/loading.bin: loading.png
	png2crtc $< $(OUTPUT)/loading.scr 7 0
	dump-pal.py $< $(OUTPUT)/pal.bin
	echo -n "SCRX" > $(OUTPUT)/loading.bin
	cat $(OUTPUT)/pal.bin >> $(OUTPUT)/loading.bin
	apultra -v $(OUTPUT)/loading.scr $(OUTPUT)/loading.pak
	cat $(OUTPUT)/loading.pak >> $(OUTPUT)/loading.bin

$(G)/songs_pak.h: songs_pak.akl
	apultra -v $< $(OUTPUT)/songs_pak.ap
	bin2h.py $(OUTPUT)/songs_pak.ap songs_pak > $@

$(G)/font.h: font.png
	img2sprite.py --height 8 --width 4 -i spfont $< > $@

$(G)/menubg.h: menu.png
	img2sprite.py --height 50 --width 88 -b $< > $(OUTPUT)/menubg.bin
	apultra -v $(OUTPUT)/menubg.bin $(OUTPUT)/menu.ap
	bin2h.py $(OUTPUT)/menu.ap menubg > $@

$(G)/player.h: player.png
	img2sprite.py -i player --transparent-color 7 --height 24 $< > $@

$(G)/explo.h: explo.png
	img2sprite.py -i explo --transparent-color 7 --height 16 $< > $@

$(G)/splash.h: splash.png
	img2sprite.py -i splash --transparent-color 3 --height 16 $< > $@

$(G)/tiles.h: tiles.png
	img2sprite.py -i bgtiles --height 8 $< > $@

$(G)/stage.h: stage.json
	map.py --max-ents 9 --aplib $< map > $@

$(G)/items.h: items.png
	img2sprite.py -i items --transparent-color 7 --height 16 $< > $@

$(G)/doors.h: doors.png
	img2sprite.py -i doors --transparent-color 5 --height 8 $< > $@

$(G)/platform.h: platform.png
	img2sprite.py -i platform --transparent-color 1 --height 8 $< > $@

$(G)/oni.h: oni.png
	img2sprite.py -i oni --transparent-color 1 --height 16 $< > $@

$(G)/ninja.h: ninja.png
	img2sprite.py -i ninja --transparent-color 7 --height 24 $< > $@

$(G)/spirit.h: spirit.png
	img2sprite.py -i spirit --transparent-color 7 --height 24 $< > $@

$(G)/vampire.h: vampire.png
	img2sprite.py -i vampire --transparent-color 7 --height 16 $< > $@

$(G)/flame.h: flame.png
	img2sprite.py -i flame --transparent-color 7 --height 16 $< > $@

$(G)/spider.h: spider.png
	img2sprite.py -i spider --transparent-color 7 --height 8 $< > $@

$(G)/demon.h: demon.png
	img2sprite.py -i demon --transparent-color 11 --height 24 $< > $@

$(G)/fireball.h: fireball.png
	img2sprite.py -i fireball --transparent-color 7 --height 8 $< > $@

$(G)/cloud.h: cloud.png
	img2sprite.py -i cloud --transparent-color 7 --height 24 $< > $@

$(G)/switch.h: switch.png
	img2sprite.py -i switch_sprite --transparent-color 7 --height 16 $< > $@

$(G)/palette.h: tiles.png
	dump-pal.py --header --hardware $< pal_hw > $@

.PHONY: clean all
clean:
	rm -f $(GENERATED)