-
Notifications
You must be signed in to change notification settings - Fork 110
/
config.mk
60 lines (51 loc) · 1.47 KB
/
config.mk
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
GAME_VERSION ?= HEARTGOLD
GAME_REMASTER ?= 0
GAME_LANGUAGE ?= ENGLISH
ifeq ($(GAME_VERSION),HEARTGOLD)
buildname := heartgold
shortname := gold
TITLE_NAME := POKEMON HG
GAME_CODE := IPK
else
ifeq ($(GAME_VERSION),SOULSILVER)
buildname := soulsilver
shortname := silver
TITLE_NAME := POKEMON SS
GAME_CODE := IPG
else
$(error Unrecognized game version: $(GAME_VERSION))
endif
endif
ifneq ($(GAME_REMASTER),0)
buildname := $(buildname).rev$(GAME_REMASTER)
endif
ifeq ($(GAME_LANGUAGE),ENGLISH)
buildname := $(buildname).us
GAME_CODE := $(GAME_CODE)E
else
$(error Unsupported game language: $(GAME_LANGUAGE))
endif
BUILD_DIR := build/$(buildname)
ELFNAME := main
GF_DEFINES := -D$(GAME_VERSION) -DGAME_REMASTER=$(GAME_REMASTER) -D$(GAME_LANGUAGE)
ifeq ($(NO_GF_ASSERT),)
GF_DEFINES += -DPM_KEEP_ASSERTS
endif
GLB_DEFINES := -DSDK_ARM9 -DSDK_CODE_ARM -DSDK_FINALROM
# CLI_DEFINES="-DMY_DEFINE=1 -DMY_OTHER_DEFINE=2 ..."
DEFINES = $(GF_DEFINES) $(GLB_DEFINES) $(CLI_DEFINES)
# Secure CRC
ifeq ($(buildname),heartgold.us)
SECURE_CRC := 0xA0FF
endif
ifeq ($(buildname),soulsilver.us)
SECURE_CRC := 0x86A5
endif
ifndef SECURE_CRC
$(error Unsupported ROM: $(GAME_VERSION) $(GAME_LANGUAGE))
endif
# At present this repository only supports the 1.0 US ROMs
SUPPORTED_ROMS := heartgold.us soulsilver.us
ifneq ($(filter $(buildname),$(SUPPORTED_ROMS)),$(buildname))
$(error $(buildname) is not supported, choose from: $(SUPPORTED_ROMS))
endif