-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
224 lines (189 loc) · 7.42 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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# ------------------------------------------------
# FB Alpha Retro Loader Makefile (CaptainCPS-X, 2013)
# ------------------------------------------------
ifneq ($(LINUX),1)
ifneq ($(WIN32),1)
export CELL=1
export COLLADA_DOM_PLATFORM=CELL
endif
endif
SDK_VERSION =3_4_0
CELL_SDK ?=/usr/local/cell
CELL_MK_DIR ?= $(CELL_SDK)/samples/mk
PPU_CWARNFLAGS ?= $(CWARNFLAGS_L1)
PPU_CXXWARNFLAGS ?= $(CXXWARNFLAGS_L1)
include $(CELL_MK_DIR)/sdk.makedef.mk
## PSGL specific
PPU_LDLIBDIR += -L$(PPU_PSGL_LIBDIR)
## FW specific
CELL_FW_DIR ?=$(CELL_SDK)/samples/fw
PPU_LDLIBDIR += -L$(CELL_FW_DIR) -Lsource/zlib
ifeq ($(CELL_PSGL_VERSION),gcmhud)
GRAPHICS_SAMPLE_CORE_LIBS = -lPSGLFX -lPSGL -lPSGLU -lgcm_hud -lgcm_pm -lsysmodule_stub -lusbd_stub -lio_stub -lm -lstdc++ -lsysutil_stub -lfs_stub -lsheap_stub -ldbgfont -lresc_stub -lperf
else
GRAPHICS_SAMPLE_CORE_LIBS = -lPSGLFX -lPSGL -lPSGLU -lm -lusbd_stub -lfs_stub -lio_stub -lsysutil_stub -ldbgfont -lresc_stub -lgcm_cmd -lgcm_sys_stub -lsysmodule_stub -lperf
endif
PPU_INCDIRS += -I$(CELL_FW_DIR)/include
# build everything without exceptions so you can link with fw
PPU_CXXSTDFLAGS += -DDATA_IN_HOME_DIR
GCC_PPU_CXXSTDFLAGS += -fno-exceptions
GCC_PPU_LDFLAGS += -fno-exceptions
## PSGL samples specific
COLLADA_DOM_DIR=$(CELL_SDK)/samples/COLLADA_DOM
# where to build the graphics data to
CELL_GRAPHICS_DATA_DIR=$(CELL_DATA_DIR)/graphics
ifeq ($(NO_OPTIMIZATIONS),1)
PPU_OPTIMIZE_LV =
endif
PPU_CSTDFLAGS += -std=gnu99
# --------------------------------------------------------------
PPU_INCDIRS += -I$(CELL_FW_DIR)/include -Iinclude -Isource/ -Isource/rarch -Isource/zlib
PPU_LIBS += $(CELL_FW_DIR)/libfw.a
PPU_CPPFLAGS += -DPSGL -DHAVE_ZLIB_DEFLATE -DMINIZ_NO_ZLIB_COMPATIBLE_NAMES
PPU_CXXSTDFLAGS += -fno-exceptions
PPU_SRCS = source/main.cpp \
source/input.cpp \
source/misc.cpp \
source/fba_rl.cpp \
source/ini.cpp \
source/cfg.cpp \
source/rarch/image.cpp \
source/rarch/rpng.cpp
PPU_SRCS += source/zlib/adler32.c \
source/zlib/compress.c \
source/zlib/crc32.c \
source/zlib/deflate.c \
source/zlib/gzclose.c \
source/zlib/gzlib.c \
source/zlib/gzread.c \
source/zlib/gzwrite.c \
source/zlib/infback.c \
source/zlib/inffast.c \
source/zlib/inflate.c \
source/zlib/inftrees.c \
source/zlib/trees.c \
source/zlib/uncompr.c \
source/zlib/zutil.c
PPU_TARGET := EBOOT.ELF
PPU_LDLIBS := $(GRAPHICS_SAMPLE_CORE_LIBS) -lz -lsysutil_screenshot_stub
# variables -----------------------------------------------------
FPSHADER_ELFS = $(patsubst %.cg, %.cgelf, $(FPSHADER_SRCS))
VPSHADER_ELFS = $(patsubst %.cg, %.cgelf, $(VPSHADER_SRCS))
PSGL_CGNV2ELF = $(PSGL_TOOLS_DIR)/cgnv2elf
# piggy back deletion of our .cgelf files into the cleanup system
# by using the user-clean rule instead of the clean-cg rule
CLEANFILES += $(FPSHADER_ELFS) $(VPSHADER_ELFS)
TARGET += $(FPSHADER_ELFS) $(VPSHADER_ELFS)
# rules ---------------------------------------------------------
include $(CELL_MK_DIR)/sdk.target.mk
$(FPSHADER_ELFS): %.cgelf: %.fpo
$(PSGL_CGNV2ELF) $< $@
$(VPSHADER_ELFS): %.cgelf: %.vpo
$(PSGL_CGNV2ELF) $< $@
# ---------------------------------------------------------------
MAKE_FSELF = $(CELL_SDK)/host-win32/bin/make_fself.exe
MAKE_FSELF_NPDRM = $(CELL_SDK)/host-win32/bin/make_fself_npdrm.exe
MAKE_PACKAGE_NPDRM = $(CELL_SDK)/host-win32/bin/make_package_npdrm.exe
APP_NAME =FB_ALPHA_RL
APP_VER =1.01a
DATE =$(shell date +"%Y%m%d")
PSN_PKG_NPDRM = bin/psn_package_npdrm
SELF_APP_VER =0001000000000000
CONTENT_ID =FBARAL-FBAL00123_00-0000000000000000
MAKE_SELF_NPDRM_340 = scetool.exe \
--sce-type=SELF \
--compress-data=TRUE \
--skip-sections=FALSE \
--key-revision=0001 \
--self-ctrl-flags=4000000000000000000000000000000000000000000000000000000000000002 \
--self-auth-id=1010000001000003 \
--self-app-version=$(SELF_APP_VER) \
--self-add-shdrs=TRUE \
--self-vendor-id=01000002 \
--self-type=NPDRM \
--self-fw-version=0003004000000000 \
--np-license-type=FREE \
--np-content-id=$(CONTENT_ID) \
--np-app-type=EXEC \
--np-real-fname="EBOOT.BIN" \
--np-klicensee=72F990788F9CFF745725F08E4C128387 \
--np-add-sig=FALSE \
--encrypt
MAKE_SELF_NPDRM_355 = scetool.exe \
--sce-type=SELF \
--compress-data=TRUE \
--skip-sections=FALSE \
--key-revision=0001 \
--self-auth-id=1010000001000003 \
--self-app-version=$(SELF_APP_VER) \
--self-add-shdrs=TRUE \
--self-vendor-id=01000002 \
--self-type=NPDRM \
--self-fw-version=0003005500000000 \
--np-license-type=FREE \
--np-content-id=$(CONTENT_ID) \
--np-app-type=EXEC \
--np-real-fname="EBOOT.BIN" \
--np-klicensee=72F990788F9CFF745725F08E4C128387 \
--np-add-sig=FALSE \
--encrypt
MAKE_RELOAD_FSELF_340 = scetool.exe \
--sce-type=SELF \
--compress-data=TRUE \
--skip-sections=FALSE \
--key-revision=0001 \
--self-auth-id=1010000001000003 \
--self-app-version=$(SELF_APP_VER) \
--self-vendor-id=01000002 \
--self-type=APP \
--self-fw-version=0003004000000000 \
--encrypt
MAKE_RELOAD_FSELF_355 = scetool.exe \
--sce-type=SELF \
--compress-data=TRUE \
--skip-sections=FALSE \
--key-revision=0001 \
--self-auth-id=1010000001000003 \
--self-app-version=$(SELF_APP_VER) \
--self-vendor-id=01000002 \
--self-type=APP \
--self-fw-version=0003005500000000 \
--encrypt
MAKE_SELF=make_fself_npdrm.exe
# -------------------------------------------------------------------
fba_340: $(PPU_TARGET)
@$(PPU_STRIP) -s $(PPU_TARGET) -o $(OBJS_DIR)/$(PPU_TARGET)
@cd bin/ && $(MAKE_RELOAD_FSELF_340) ../$(OBJS_DIR)/$(PPU_TARGET) ../release/PS3_GAME/USRDIR/RELOAD.SELF && cd ../
@rm $(PPU_TARGET)
@cd bin/ && $(MAKE_SELF_NPDRM_340) ../$(OBJS_DIR)/$(PPU_TARGET) ../release/PS3_GAME/USRDIR/EBOOT.BIN && cd ../
@echo "Preparing PKG..."
@$(PSN_PKG_NPDRM) release/package.conf release/PS3_GAME/ >nul 2>&1
@mv *.pkg release/$(APP_NAME)_$(APP_VER)_[$(DATE)]_CEX340.pkg
@echo "Done!"
fba_340_upd: $(PPU_TARGET)
@$(PPU_STRIP) -s $(PPU_TARGET) -o $(OBJS_DIR)/$(PPU_TARGET)
@cd bin/ && $(MAKE_RELOAD_FSELF_340) ../$(OBJS_DIR)/$(PPU_TARGET) ../release_upd/PS3_GAME/USRDIR/RELOAD.SELF && cd ../
@rm $(PPU_TARGET)
@cd bin/ && $(MAKE_SELF_NPDRM_340) ../$(OBJS_DIR)/$(PPU_TARGET) ../release_upd/PS3_GAME/USRDIR/EBOOT.BIN && cd ../
@echo "Preparing PKG..."
@$(PSN_PKG_NPDRM) release_upd/package.conf release_upd/PS3_GAME/ >nul 2>&1
@mv *.pkg release_upd/$(APP_NAME)_$(APP_VER)_[$(DATE)]_CEX340_UPD.pkg
@echo "Done!"
fba_355: $(PPU_TARGET)
@$(PPU_STRIP) -s $(PPU_TARGET) -o $(OBJS_DIR)/$(PPU_TARGET)
@cd bin/ && $(MAKE_RELOAD_FSELF_355) ../$(OBJS_DIR)/$(PPU_TARGET) ../release/PS3_GAME/USRDIR/RELOAD.SELF && cd ../
@rm $(PPU_TARGET)
@cd bin/ && $(MAKE_SELF_NPDRM_355) ../$(OBJS_DIR)/$(PPU_TARGET) ../release/PS3_GAME/USRDIR/EBOOT.BIN && cd ../
@echo "Preparing PKG..."
@$(PSN_PKG_NPDRM) release/package.conf release/PS3_GAME/ >nul 2>&1
@mv *.pkg release/$(APP_NAME)_$(APP_VER)_[$(DATE)]_CEX355.pkg
@echo "Done!"
fba_355_upd: $(PPU_TARGET)
@$(PPU_STRIP) -s $(PPU_TARGET) -o $(OBJS_DIR)/$(PPU_TARGET)
@cd bin/ && $(MAKE_RELOAD_FSELF_355) ../$(OBJS_DIR)/$(PPU_TARGET) ../release_upd/PS3_GAME/USRDIR/RELOAD.SELF && cd ../
@rm $(PPU_TARGET)
@cd bin/ && $(MAKE_SELF_NPDRM_355) ../$(OBJS_DIR)/$(PPU_TARGET) ../release_upd/PS3_GAME/USRDIR/EBOOT.BIN && cd ../
@echo "Preparing PKG..."
@$(PSN_PKG_NPDRM) release_upd/package.conf release_upd/PS3_GAME/ >nul 2>&1
@mv *.pkg release_upd/$(APP_NAME)_$(APP_VER)_[$(DATE)]_CEX355_UPD.pkg
@echo "Done!"