-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.orbis
213 lines (174 loc) · 5.88 KB
/
Makefile.orbis
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
TARGET := retroarch_orbis
DEBUG ?= 0
GRIFFIN_BUILD = 0
WHOLE_ARCHIVE_LINK = 0
HAVE_STATIC_DUMMY ?= 0
HAVE_GLES3 ?= 0
HAVE_MOUSE ?= 0
HAVE_KEYBOARD ?= 0
PS4_TITLE_ID := RETROARCH
PS4_TITLE_NAME := RetroArch
PC_DEVELOPMENT_IP_ADDRESS = 192.168.1.137
PC_DEVELOPMENT_UDP_PORT = 18194
AUTH_INFO = 000000000000000000000000001C004000FF000000000080000000000000000000000000000000000000008000400040000000000000008000000000000000080040FFFF000000F000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
OBJ += deps/xxHash/xxhash.o \
# input/drivers/ps4_input.o \
# input/drivers_joypad/ps4_joypad.o \
# audio/drivers/psp_audio.o \
# gfx/drivers_context/orbis_ctx.o \
# frontend/drivers/platform_orbis.o
ifeq ($(HAVE_GLES3),1)
DEFINES += -DHAVE_OPENGLES3
endif
ifeq ($(HAVE_STATIC_DUMMY),1)
DEFINES += -DHAVE_STATIC_DUMMY
endif
ifeq ($(GRIFFIN_BUILD), 1)
OBJ += griffin/griffin.o
DEFINES += -DHAVE_GRIFFIN=1
DEFINES += -DHAVE_MENU -DHAVE_LIBRETRODB -DHAVE_CONFIGFILE
DEFINES += -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DHAVE_CC_RESAMPLER
DEFINES += -DHAVE_CORE_INFO_CACHE
ifeq ($(DEBUG), 1)
DEFINES += -DHAVE_NETLOGGER
endif
else
HAVE_FILTERS_BUILTIN := 1
HAVE_LANGEXTRA := 1
HAVE_IMAGEVIEWER := 1
HAVE_RPNG := 1
HAVE_RJPEG := 1
HAVE_RBMP := 1
HAVE_RTGA := 1
HAVE_ZLIB := 1
HAVE_BUILTINZLIB := 1
HAVE_OVERLAY := 1
HAVE_7ZIP := 1
HAVE_EGL := 1
HAVE_GFX_WIDGETS := 1
HAVE_GLSL := 1
HAVE_SHADERPIPELINE := 1
HAVE_OPENGL := 1
HAVE_OPENGLES := 1
HAVE_OPENGLES2 := 1
HAVE_NETWORKING := 0
HAVE_IFINFO := 0
HAVE_SOCKET_LEGACY := 1
HAVE_MENU := 1
HAVE_MENU_COMMON := 1
HAVE_RGUI := 1
HAVE_STB_FONT := 1
HAVE_STB_VORBIS := 1
HAVE_DR_FLAC := 1
HAVE_DR_MP3 := 1
HAVE_MATERIALUI := 1
HAVE_XMB := 1
HAVE_OZONE := 1
HAVE_RGUI := 1
HAVE_THREADS := 1
HAVE_THREAD_ATTR := 1
HAVE_LIBRETRODB := 1
HAVE_CC_RESAMPLER := 1
HAVE_CHEEVOS := 0
HAVE_RUNAHEAD := 1
RARCH_CONSOLE := 1
HAVE_MAIN := 1
HAVE_ONLINE_UPDATER := 1
HAVE_COMPRESSION := 1
HAVE_UPDATE_ASSETS := 1
HAVE_UPDATE_CORES := 1
HAVE_UPDATE_CORE_INFO := 1
HAVE_CONFIGFILE := 1
HAVE_CHD := 1
HAVE_STATIC_VIDEO_FILTERS = 1
HAVE_STATIC_AUDIO_FILTERS = 1
HAVE_CORE_INFO_CACHE := 1
ifeq ($(DEBUG), 1)
HAVE_NETLOGGER = 1
endif
include Makefile.common
CFLAGS += $(DEF_FLAGS)
OBJ := $(filter-out $(BLACKLIST),$(OBJ))
endif
ifeq ($(strip $(ORBISDEV)),)
$(error "Please set ORBISDEV in your environment. export ORBISDEV=<path to>orbisdev")
endif
PREFIX := orbis-
CC := clang
CXX := clang++
AS := $(PREFIX)as
AR := $(PREFIX)ar
OBJCOPY := $(PREFIX)objcopy
STRIP := $(PREFIX)strip
NM := $(PREFIX)nm
LD := clang
LIBDIRS += -L. -Lcores -Lbuild -L$(ORBISDEV)/usr/lib
INCDIRS += -I. -Idefines -Ideps -Ideps/7zip -Ideps/libz -Ilibretro-common/include -Ideps/stb \
-Ilibretro-common/include/compat/zlib -Ideps/rcheevos/include -I$(ORBISDEV)/usr/include -I$(ORBISDEV)/usr/include/c++/v1 -I$(ORBISDEV)/usr/include/orbis
ARCHFLAGS += --target=x86_64-scei-ps4 -DORBIS -D__ORBIS__ -D__PS4__ -D_BSD_SOURCE
DEFINES += -DRARCH_INTERNAL -DRARCH_CONSOLE -DHAVE_FILTERS_BUILTIN \
-DHAVE_XMB -DHAVE_RGUI -DHAVE_OZONE \
-DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_CORES -DHAVE_UPDATE_CORE_INFO -DHAVE_UPDATE_ASSETS \
# Compiling with -Werror and disabling some warnings
DEFINES += -Werror -Wno-macro-redefined -Wno-typedef-redefinition -Wno-non-literal-null-conversion -Wno-void-pointer-to-int-cast \
-Wno-format -Wno-tautological-constant-out-of-range-compare -Wno-implicit-function-declaration
ifeq ($(HAVE_KEYBOARD), 1)
DEFINES += -DHAVE_KEYBOARD
PS4_LIBS += -lSceDbgKeyboard_stub
endif
ifeq ($(HAVE_MOUSE),1)
DEFINES += -DHAVE_MOUSE
PS4_LIBS += -lSceMouse_stub
endif
ifneq ($(PC_DEVELOPMENT_IP_ADDRESS),)
DEFINES += -DPC_DEVELOPMENT_IP_ADDRESS='"$(PC_DEVELOPMENT_IP_ADDRESS)"'
endif
ifneq ($(PC_DEVELOPMENT_UDP_PORT),)
DEFINES += -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
endif
ifeq ($(WHOLE_ARCHIVE_LINK), 1)
WHOLE_START := --whole-archive
WHOLE_END := --no-whole-archive
endif
PS4_LIBS += -luser_mem_sys -lkernel_stub -lSceLibcInternal_stub -lunwind -lc++ -lc++abi -lc++experimental \
-lorbisLink -lkernelUtil -ldebugnet -lorbisNfs -lSceSysmodule_stub -lSceSystemService_stub -lSceNet_stub \
-lSceUserService_stub -lScePigletv2VSH_stub -lSceVideoOut_stub -lSceGnmDriver_stub -lorbisPad \
-lScePad_stub -lSceAudioOut_stub -lSceIme_stub -lSceNetCtl_stub -lSQLite
ifeq ($(HAVE_STATIC_DUMMY),1)
LIBS := $(PS4_LIBS)
else
LIBS := $(WHOLE_START) -lretro_orbis $(WHOLE_END) $(PS4_LIBS)
endif
CFLAGS := $(ARCHFLAGS) $(INCDIRS) $(DEFINES)
CXXFLAGS := $(ARCHFLAGS) $(INCDIRS) $(DEFINES)
LDFLAGS := $(LIBDIRS) -Wl,--gc-sections -Wl,-z -Wl,max-page-size=0x4000 -Wl,--dynamic-linker="/libexec/ld-elf.so.1" -Wl,-pie -Wl,--eh-frame-hdr -target x86_64-scei-ps4-elf -T $(ORBISDEV)/usr/lib/linker.x
ifeq ($(DEBUG), 1)
CFLAGS += -O0 -fno-inline
CXXFLAGS += -O0 -fno-inline
else
CFLAGS += -O3
CXXFLAGS += -O3
endif
TARGETS := $(TARGET).self
all: $(TARGETS)
OBJOUT = -o
%.o: %.c
$(CC) $(CFLAGS) -c $(OBJOUT)$@ $<
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c $(OBJOUT)$@ $<
%.o: %.S
$(CC) $(CFLAGS) -c $(OBJOUT)$@ $<
%.o: %.s
$(CC) -c $(OBJOUT)$@ $<
$(TARGET).elf: $(OBJ)
$(LD) $(ORBISDEV)/usr/lib/crt0.o $(OBJ) $(LDFLAGS) $(LIBS) -o $(TARGET).elf
$(TARGET).oelf: $(TARGET).elf
@orbis-elf-create $(TARGET).elf $(TARGET).oelf
$(TARGET).self: $(TARGET).oelf
python $(ORBISDEV)/bin/make_fself.py --auth-info $(AUTH_INFO) $(TARGET).oelf $(TARGET).self
install:
@cp $(TARGET).self $(SELF_PATH_INSTALL)/homebrew.self
@echo "Installed!"
clean:
rm -f $(OBJ) $(TARGET).elf $(TARGET).oelf $(TARGET).self
.PHONY: clean all