forked from Chadderz121/wii-ct-code
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
154 lines (131 loc) · 4.06 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#==============================================================================
# makefile by Alex Chadwick
#
# makefile script for the CTGP-R Mario Kart Wii modification software.
#==============================================================================
#==============================================================================
# Settings
#==============================================================================
ONLINE_REGION ?= 255
ENABLE_CTWW ?= 1
ENABLE_FILTER ?= 1
ENABLE_BSHELL ?= 1
ENABLE_SOM ?= 1
ENABLE_CTS ?= 1
#==============================================================================
# Programs
#==============================================================================
ifneq ($(strip $(DEVKITPPC)),)
PATH := $(DEVKITPPC)/bin:$(PORTLIBS)/bin:$(PATH)
endif
PREFIX ?= powerpc-eabi-
AS = $(PREFIX)as
CC = $(PREFIX)gcc
LD = $(PREFIX)ld
OD = $(PREFIX)objdump
OC = $(PREFIX)objcopy
Q ?= @
LOG ?= @echo $@
.SECONDARY:
#==============================================================================
# Output configuration
#==============================================================================
region ?= *
BAD0 ?= bad0
BAD1 ?= bad1
TARGETS ?= bad0 bad1
SFLAGS += -mregnames
ifeq ("$(region)","E")
game = rmce
TARGETDIR ?= bin/$(game)
BUILD ?= build/$(game)
BUILD_ALL ?= build
SFLAGS += --defsym region=U -I $(BUILD)
ALL = $(BUILD) $(TARGETS)
else ifeq ("$(region)","J")
game = rmcj
TARGETDIR ?= bin/$(game)
BUILD ?= build/$(game)
BUILD_ALL ?= build
SFLAGS += --defsym region=J -I $(BUILD)
ALL = $(BUILD) $(TARGETS)
else ifeq ("$(region)","P")
game = rmcp
TARGETDIR ?= bin/$(game)
BUILD ?= build/$(game)
BUILD_ALL ?= build
SFLAGS += --defsym region=P -I $(BUILD)
ALL = $(BUILD) $(TARGETS)
else ifeq ("$(region)","*")
ALL = rmce rmcj rmcp
else
$(error 'region' is not 'E', 'J', 'P' or '*')
endif
SETTINGS := GAME=$(game) REGION=$(region) ONLINE_REGION=$(ONLINE_REGION) \
ENABLE_CTWW=$(ENABLE_CTWW) \
ENABLE_FILTER=$(ENABLE_FILTER) ENABLE_BSHELL=$(ENABLE_BSHELL) \
ENABLE_SOM=$(ENABLE_SOM) ENABLE_CTS=$(ENABLE_CTS)
SFLAGS += $(addprefix --defsym ,$(SETTINGS))
#==============================================================================
#==============================================================================
# Rules
#==============================================================================
#==============================================================================
# Overall
#==============================================================================
.PHONY: help all clean allregions rmcp rmce rmcj
help:
$Qecho "CT-CODE build system."
$Qecho " by Chadderz"
$Qecho ""
$Qecho "make all - make all files for all regions."
$Qecho "make rmcp - make just the files for RMCP (or similar for other regions)."
$Qecho "make clean - remove all generated files."
$Qecho ""
$Qecho "all outputs go into the bin/rmcp/ directory (or similar for other regions)."
$Qecho "temprorary files go into the build/ directory."
all: $(ALL)
rmce: bin/rmce build/rmce
$(LOG)
$Q-make --no-print-directory region=E all
rmcj: bin/rmcj build/rmcj
$(LOG)
$Q-make --no-print-directory region=J all
rmcp: bin/rmcp build/rmcp
$(LOG)
$Q-make --no-print-directory region=P all
bin/rmce: bin
$(LOG)
$Q-mkdir $@
bin/rmcj: bin
$(LOG)
$Q-mkdir $@
bin/rmcp: bin
$(LOG)
$Q-mkdir $@
bin:
$(LOG)
$Q-mkdir $@
build/rmce: build
$(LOG)
$Q-mkdir $@
build/rmcj: build
$(LOG)
$Q-mkdir $@
build/rmcp: build
$(LOG)
$Q-mkdir $@
build:
$(LOG)
$Q-mkdir $@
clean:
$(LOG)
$Q-rm -rf build bin
#==============================================================================
# bad0
#==============================================================================
include $(BAD0)/makefile.mk
#==============================================================================
# bad1
#==============================================================================
include $(BAD1)/makefile.mk