-
Notifications
You must be signed in to change notification settings - Fork 2
/
makefile
34 lines (26 loc) · 955 Bytes
/
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
rom_title = snake
rom_file = bin/$(rom_title).gb
imgs = $(wildcard img/src/*.png)
dats = $(patsubst img/src/%.png,img/tiles_%.asm,$(imgs))
ensure_directory_exists = @mkdir -p $(@D)
# ------------------------------------------------------------------------------
# Primary Targets
# ------------------------------------------------------------------------------
game: $(rom_file)
clean:
rm -rf obj
rm -rf bin
rm img/*.asm
# ------------------------------------------------------------------------------
# Dependency Targets
# ------------------------------------------------------------------------------
$(rom_file): $(dats) obj/main.o
$(ensure_directory_exists)
rgblink -m bin/$(rom_title).map -n bin/$(rom_title).sym -o $@ obj/main.o
rgbfix -p 0xFF -v $@
img/tiles_%.asm: img/src/%.png img/src/%.json
node builder/gfx $< $@
obj/main.o: main.asm
$(ensure_directory_exists)
rgbasm -h -E -M $(@:.o=.d) -o $@ $<
include $(wildcard obj/*.d)