-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
79 lines (57 loc) · 1.48 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
.SUFFIXES:
.PHONY:
# EA Input File
EVENT_MAIN := Main.event
# ROMs
ROM_SOURCE := FE8U.gba
ROM_TARGET := HACK.gba
include tools.mk
# Common cache directory
# Used to generate dependency files in
CACHE_DIR := .cache_dir
$(shell mkdir -p $(CACHE_DIR) > /dev/null)
CLEAN_FILES :=
CLEAN_DIRS :=
# ===============
# = MAIN TARGET =
# ===============
hack: $(ROM_TARGET)
.PHONY: hack
# =================
# = THE BUILDFILE =
# =================
# EA depends
EVENT_DEPENDS := $(shell $(EADEP) $(EVENT_MAIN) -I $(realpath .)/Tools/EventAssembler --add-missings)
# Additional EA commandline flags
# EAFLAGS := -raws:Tools/EA-Raws --nocash-sym
EAFLAGS :=
$(ROM_TARGET): $(EVENT_MAIN) $(EVENT_DEPENDS) $(ROM_SOURCE)
$(NOTIFY_PROCESS)
@cp -f $(ROM_SOURCE) $(ROM_TARGET)
@$(EA) A FE8 -output:$(ROM_TARGET) -input:$(EVENT_MAIN) $(EAFLAGS) || (rm $(ROM_TARGET) && false)
@cat "$(ROM_SOURCE:.gba=.sym)" >> "$(ROM_TARGET:.gba=.sym)" || true
ifeq ($(MAKECMDGOALS),clean)
CLEAN_FILES += $(ROM_TARGET) $(ROM_TARGET:.gba=.sym) $(EVENT_SYMBOLS)
endif
# ===================
# = COMPONENT RULES =
# ===================
include spritans.mk
include writans.mk
include game-data.mk
include wizardry.mk
# ==============
# = MAKE CLEAN =
# ==============
clean:
@rm -f $(CLEAN_FILES)
@rm -rf $(CLEAN_DIRS)
@rm -rf $(CACHE_DIR)
@echo all clean!
.PHONY: clean
# ========================
# = INCLUDE DEPENDENCIES =
# ========================
ifneq ($(MAKECMDGOALS),clean)
-include $(wildcard $(CACHE_DIR)/*.d)
endif