forked from SAT-R/sa2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.mk
104 lines (90 loc) · 2 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
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
### Build Configuration ###
# Default platform variables
PLATFORM ?= gba
CPU_ARCH ?= arm
MIDI_COMMENTS := "arm"
THUMB_SUPPORT ?= 1 # Supports ARM's Thumb instruction set
COMPARE ?= 1
ifeq ($(CPU_ARCH),arm)
ifneq ($(PLATFORM),gba)
THUMB_SUPPORT ?= 0
endif
MIDI_COMMENTS := "arm"
# This is 'i386' because that's the arch's name in GNU Linker scripts
else ifeq ($(CPU_ARCH),i386)
THUMB_SUPPORT ?= 0
MIDI_COMMENTS := "x86"
else
$(error unknown arch: $(CPU_ARCH))
endif
LDSCRIPT := ldscript
NON_MATCHING ?= 0
ifeq ($(PLATFORM),gba)
ifeq ($(DEBUG),1)
# Debug
PORTABLE := 0
NON_MATCHING := 1
ENABLE_DECOMP_CREDITS := 1
COMPARE ?= 0
LDSCRIPT := $(LDSCRIPT).txt
else
# Original
PORTABLE := 0
NON_MATCHING := 0
ENABLE_DECOMP_CREDITS := 0
COMPARE ?= 1
LDSCRIPT := $(LDSCRIPT).txt
endif
else
# Other
PORTABLE := 1
NON_MATCHING := 1
ENABLE_DECOMP_CREDITS := 1
COMPARE ?= 0
LDSCRIPT := $(LDSCRIPT).txt
endif
# Default game variables
GAME_REVISION ?= 0
GAME_REGION ?= USA
DEBUG ?= 0
# For gbafix
MAKER_CODE := 78
# Version
BUILD_NAME := sa2
TITLE := SONICADVANC2
GAME_CODE := A2N
# Revision
ifeq ($(GAME_REVISION), 0)
BUILD_NAME := $(BUILD_NAME)
else
$(error unknown revision $(GAME_REVISION))
endif
# Region
ifeq ($(GAME_REGION), USA)
BUILD_NAME := $(BUILD_NAME)
GAME_CODE := $(GAME_CODE)E
else
ifeq ($(GAME_REGION), JAPAN)
BUILD_NAME := $(BUILD_NAME)_japan
GAME_CODE := $(GAME_CODE)J
MAKER_CODE := 8P
else
ifeq ($(GAME_REGION), EUROPE)
BUILD_NAME := $(BUILD_NAME)_europe
GAME_CODE := $(GAME_CODE)P
MAKER_CODE := 8P
TITLE := SONIC ADVANC
else
$(error unknown region $(GAME_REGION))
endif
endif
endif
ifeq ($(CREATE_PDB),1)
# If the user wants a PDB, the output needs to include debug info
# TODO: Is there a way to ECHO here?
DEBUG := 1
endif
# Debug
ifeq ($(DEBUG), 1)
BUILD_NAME := $(BUILD_NAME)_debug
endif