-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
87 lines (75 loc) · 2.02 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
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
name := GBWARS3
RGBASMFLAGS := -p 0xff
RGBLINKFLAGS := -p 0xff
RGBFIXFLAGS := -O -v -p 0xff
objects := \
main.o \
symbols.o \
source/unit.o \
source/news.o \
source/map_editor.o \
source/maps.o \
source/suspend.o \
source/beginner.o \
source/map_menu.o \
source/main_menu.o \
source/name_screen.o \
source/unit_status.o \
source/descriptions.o \
source/mobile.o \
source/medals.o \
source/config.o \
source/ranks.o \
source/battle_info.o \
source/terrain.o \
source/versus.o
graphics := \
gfx/charmap.2bpp \
gfx/symbols.2bpp \
gfx/units.2bpp \
gfx/days_menu.2bpp \
gfx/title_screen.2bpp \
gfx/action_menu.2bpp \
gfx/system_messages.2bpp \
gfx/map_menu.2bpp \
gfx/name_screen.2bpp \
gfx/file_select_numbers.2bpp \
gfx/file_select_general1.2bpp \
gfx/file_select_modes.2bpp \
gfx/file_select_medals.2bpp \
gfx/file_select_ranks.2bpp \
gfx/config.2bpp \
gfx/vs_menu_type.2bpp \
gfx/unit_status.2bpp \
gfx/mobile_menu.2bpp \
gfx/charmap_news.2bpp \
gfx/results.2bpp \
gfx/file_select_general2.2bpp
gfx/system_messages.2bpp: RGBGFXFLAGS := --trim-end 6
gfx/units.2bpp: RGBGFXFLAGS := --trim-end 5
gfx/days_menu.2bpp: RGBGFXFLAGS := --trim-end 12
gfx/file_select_modes.2bpp: RGBGFXFLAGS := --trim-end 12
gfx/file_select_medals.2bpp: RGBGFXFLAGS := --trim-end 8
gfx/vs_menu_type.2bpp: RGBGFXFLAGS := --trim-end 3
gfx/results.2bpp: RGBGFXFLAGS := --trim-end 3
gfx/file_select_general2.2bpp: RGBGFXFLAGS := --trim-end 4
.PHONY: all
all: $(name).gbc
@test -f $(name).gbc.orig || cp $(name).gbc $(name).gbc.orig
@diff $(name).gbc.orig $(name).gbc
.PHONY: clean
clean:
rm -f $(objects) $(objects:.o=.d)
rm -f $(graphics)
rm -f $(name).gbc $(name).map $(name).sym
$(name).gbc: $(objects) | baserom.gbc
rgblink -O baserom.gbc -m $(@:.gbc=.map) -n $(@:.gbc=.sym) $(RGBLINKFLAGS) -o $@ $^
rgbfix $(RGBFIXFLAGS) $@
%.o: %.asm
rgbasm -MP -M $*.d $(RGBASMFLAGS) -o $@ $<
$(objects): | $(graphics)
%.2bpp: %.png
rgbgfx $(RGBGFXFLAGS) -o $@ $<
baserom.gbc:
@echo "Missing baserom.gbc!" >&2; false
-include $(objects:.o=.d)