forked from DanielSant0s/AthenaEnv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
204 lines (147 loc) · 6.04 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
.SILENT:
define HEADER
:=. .=:
:#+. .+%-
:#%+ =%#:
.#%#- -#%#.
*%%#: :#%%*
#%%%*. .+%%%#
-%%%%%+. +%%%%%-
:%%%%%%%+. .+%%%%%%%:
-%%%%%%%%%*=. .=*%%%%%%%%%=
#%%#*++*#%%%%#=. .=#%%%%#*++*#%%#
-%*: .-+%%%*: :*%%%*-. .*%=
:%+ .. :+#%+. +%#+: .. +%-
## .-- :+#: :#*: --. #%
-%+ .+- .=- -=. -+. +%-
-%= .:---==-**: .**-==---:. =%-
.%= .:-%= %%%%%#- -#%%%%% =%-:. =%:
*# =* :*##+. :: .: .+##*: *= #*
.#- =*. := =: .*= -#.
+- -++=====. .=====++- -+
:-. .-:
AthenaEnv project
endef
export HEADER
EE_BIN = athena.elf
EE_BIN_PKD = athena_pkd.elf
EE_LIBS = -L$(PS2SDK)/ports/lib -L$(PS2DEV)/gsKit/lib/ -Lmodules/ds34bt/ee/ -Lmodules/ds34usb/ee/ -lpatches -lfileXio -lcdvd -lpad -ldebug -lmath3d -ljpeg -lfreetype -lgskit_toolkit -lgskit -ldmakit -lpng -lz -lmc -laudsrv -lelf-loader -lds34bt -lds34usb
EE_INCS += -I$(PS2DEV)/gsKit/include -I$(PS2SDK)/ports/include -I$(PS2SDK)/ports/include/freetype2 -I$(PS2SDK)/ports/include/zlib
EE_INCS += -Imodules/ds34bt/ee -Imodules/ds34usb/ee
EE_CFLAGS += -Wno-sign-compare -fno-strict-aliasing -fno-exceptions -D_R5900
ifeq ($(RESET_IOP),1)
EE_CFLAGS += -DRESET_IOP
endif
ifeq ($(DEBUG),1)
EE_CFLAGS += -DDEBUG
endif
BIN2S = $(PS2SDK)/bin/bin2s
EXT_LIBS = modules/ds34usb/ee/libds34usb.a modules/ds34bt/ee/libds34bt.a
APP_CORE = src/main.o src/pad.o src/graphics.o src/atlas.o src/fntsys.o src/sound.o src/system.o \
src/render.o src/calc_3d.o src/gsKit3d_sup.o
ATHENA_MODULES = src/duktape/duktape.o src/duktape/duk_console.o src/duktape/duk_module_node.o \
src/ath_env.o src/ath_screen.o src/ath_graphics.o src/ath_pads.o src/ath_sound.o \
src/ath_system.o src/ath_timer.o src/ath_render.o
IOP_MODULES = src/sio2man.o src/mcman.o src/mcserv.o src/padman.o src/libsd.o src/usbd.o src/audsrv.o \
src/bdm.o src/bdmfs_vfat.o src/usbmass_bd.o src/cdfs.o src/ds34bt.o src/ds34usb.o
EE_OBJS = $(IOP_MODULES) $(APP_CORE) $(ATHENA_MODULES)
#-------------------- Embedded IOP Modules ------------------------#
src/sio2man.s: $(PS2SDK)/iop/irx/sio2man.irx
echo "Embedding SIO2MAN Driver..."
$(BIN2S) $< $@ sio2man_irx
src/mcman.s: $(PS2SDK)/iop/irx/mcman.irx
echo "Embedding MCMAN Driver..."
$(BIN2S) $< $@ mcman_irx
src/mcserv.s: $(PS2SDK)/iop/irx/mcserv.irx
echo "Embedding MCSERV Driver..."
$(BIN2S) $< $@ mcserv_irx
src/padman.s: $(PS2SDK)/iop/irx/padman.irx
echo "Embedding PADMAN Driver..."
$(BIN2S) $< $@ padman_irx
src/libsd.s: $(PS2SDK)/iop/irx/libsd.irx
echo "Embedding LIBSD Driver..."
$(BIN2S) $< $@ libsd_irx
src/usbd.s: $(PS2SDK)/iop/irx/usbd.irx
echo "Embedding USB Driver..."
$(BIN2S) $< $@ usbd_irx
src/audsrv.s: $(PS2SDK)/iop/irx/audsrv.irx
echo "Embedding AUDSRV Driver..."
$(BIN2S) $< $@ audsrv_irx
src/bdm.s: $(PS2SDK)/iop/irx/bdm.irx
echo "Embedding Block Device Manager(BDM)..."
$(BIN2S) $< $@ bdm_irx
src/bdmfs_vfat.s: $(PS2SDK)/iop/irx/bdmfs_vfat.irx
echo "Embedding BDM VFAT Driver..."
$(BIN2S) $< $@ bdmfs_vfat_irx
src/usbmass_bd.s: $(PS2SDK)/iop/irx/usbmass_bd.irx
echo "Embedding BD USB Mass Driver..."
$(BIN2S) $< $@ usbmass_bd_irx
src/cdfs.s: $(PS2SDK)/iop/irx/cdfs.irx
echo "Embedding CDFS Driver..."
$(BIN2S) $< $@ cdfs_irx
modules/ds34bt/ee/libds34bt.a: modules/ds34bt/ee
echo "Building DS3/4 Bluetooth Library..."
$(MAKE) -C $<
modules/ds34bt/iop/ds34bt.irx: modules/ds34bt/iop
echo "Building DS3/4 Bluetooth Driver..."
$(MAKE) -C $<
src/ds34bt.s: modules/ds34bt/iop/ds34bt.irx
echo "Embedding DS3/4 Bluetooth Driver..."
$(BIN2S) $< $@ ds34bt_irx
modules/ds34usb/ee/libds34usb.a: modules/ds34usb/ee
echo "Building DS3/4 USB Library..."
$(MAKE) -C $<
modules/ds34usb/iop/ds34usb.irx: modules/ds34usb/iop
echo "Building DS3/4 USB Driver..."
$(MAKE) -C $<
src/ds34usb.s: modules/ds34usb/iop/ds34usb.irx
echo "Embedding DS3/4 USB Driver..."
$(BIN2S) $< $@ ds34usb_irx
#-------------------------- App Content ---------------------------#
all: $(EXT_LIBS) $(EE_BIN)
@echo "$$HEADER"
echo "Building $(EE_BIN)..."
$(EE_STRIP) $(EE_BIN)
echo "Compressing $(EE_BIN_PKD)...\n"
ps2-packer $(EE_BIN) $(EE_BIN_PKD) > /dev/null
mv $(EE_BIN) bin/
mv $(EE_BIN_PKD) bin/
debug: $(EE_BIN)
echo "Building $(EE_BIN) with debug symbols..."
clean:
echo "\nCleaning $(EE_BIN)..."
rm -f bin/$(EE_BIN)
echo "\nCleaning $(EE_BIN_PKD)..."
rm -f bin/$(EE_BIN_PKD)
echo "\nCleaning objects..."
rm -f $(EE_OBJS)
echo "Cleaning SIO2MAN Driver..."
rm -f src/sio2man.s
echo "Cleaning MCMAN Driver..."
rm -f src/mcman.s
echo "Cleaning MCSERV Driver..."
rm -f src/mcserv.s
echo "Cleaning PADMAN Driver..."
rm -f src/padman.s
echo "Cleaning LIBSD Driver..."
rm -f src/libsd.s
echo "Cleaning Block Device Manager(BDM)..."
rm -f src/bdm.s
echo "Cleaning USB Driver..."
rm -f src/usbd.s
echo "Embedding AUDSRV Driver..."
rm -f src/audsrv.s
echo "Cleaning BDM VFAT Driver..."
rm -f src/bdmfs_vfat.s
echo "Embedding BD USB Mass Driver..."
rm -f src/usbmass_bd.s
echo "Cleaning CDFS Driver..."
rm -f src/cdfs.s
echo "Cleaning DS3/4 Drivers..."
rm -f src/ds34bt.s
rm -f src/ds34usb.s
$(MAKE) -C modules/ds34usb clean
$(MAKE) -C modules/ds34bt clean
rebuild: clean all
include $(PS2SDK)/samples/Makefile.pref
include $(PS2SDK)/samples/Makefile.eeglobal