-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·57 lines (40 loc) · 1.11 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
56
57
.PHONY: all tools compare clean tidy
.SUFFIXES:
.SECONDEXPANSION:
.PRECIOUS:
.SECONDARY:
ROM := carrotcrazy.gbc
OBJS := main.o wram.o
MD5 := md5sum -c
all: $(ROM) compare
ifeq (,$(filter tools clean tidy,$(MAKECMDGOALS)))
Makefile: tools
endif
%.o: dep = $(shell tools/scan_includes $(@D)/$*.asm)
%.o: %.asm $$(dep)
rgbasm -h -o $@ $<
$(ROM): $(OBJS)
rgblink -p 0xFF -n $(ROM:.gbc=.sym) -m $(ROM:.gbc=.map) -o $@ $(OBJS)
rgbfix -jvc -k "70" -l 0x33 -m 0x19 -p 0xFF -r 0 -t "BUGS BUNNY" $@
compare: $(ROM)
@$(MD5) rom.md5
tools:
$(MAKE) -C tools
tidy:
rm -f $(ROM) $(OBJS) $(ROM:.gbc=.sym) $(ROM:.gbc=.map)
$(MAKE) -C tools clean
# TODO: need to clean up spritesheet artifacts
clean: tidy
find . \( -iname '*.1bpp' -o -iname '*.2bpp' -o -iname '*.lz' \) -exec rm {} +
%.interleave.2bpp: %.interleave.png
rgbgfx -o $@ $<
tools/gfx --interleave --png $< -o $@ $@
%.2bpp: %.png
rgbgfx -o $@ $<
%.1bpp: %.png
rgbgfx -d1 -o $@ $<
%.lz: %
tools/rnc q p $< $@ -m=2
%.inc %.spritesheet.interleave.png: %.spritesheet.png %.ms
tools/metasprite compile $^ $*.spritesheet.interleave.png $*.inc
include graphics_rules.mk