2017-01-17 17:19:36 +00:00
|
|
|
TARGET := retroarch_vita
|
2017-01-17 22:12:36 +00:00
|
|
|
DEBUG ?= 0
|
2020-05-31 15:10:26 +00:00
|
|
|
HAVE_FILE_LOGGER = 1
|
2017-01-17 17:19:36 +00:00
|
|
|
GRIFFIN_BUILD = 0
|
|
|
|
WHOLE_ARCHIVE_LINK = 0
|
|
|
|
|
|
|
|
VITA_TITLE_ID := RETROARCH
|
|
|
|
VITA_TITLE_NAME := RetroArch
|
|
|
|
|
|
|
|
PC_DEVELOPMENT_IP_ADDRESS =
|
2017-01-17 22:12:36 +00:00
|
|
|
PC_DEVELOPMENT_UDP_PORT =
|
2017-01-17 17:19:36 +00:00
|
|
|
|
|
|
|
OBJ :=
|
|
|
|
|
2019-12-29 13:24:17 +00:00
|
|
|
DEFINES := -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS
|
2019-07-25 12:31:01 +00:00
|
|
|
INCDIRS :=
|
2017-01-17 17:19:36 +00:00
|
|
|
|
|
|
|
ifeq ($(GRIFFIN_BUILD), 1)
|
|
|
|
OBJ += griffin/griffin.o
|
2017-01-17 22:12:36 +00:00
|
|
|
DEFINES += -DHAVE_GRIFFIN=1
|
2020-07-01 19:04:05 +00:00
|
|
|
DEFINES += -DHAVE_REWIND
|
2020-06-30 17:35:41 +00:00
|
|
|
DEFINES += -DHAVE_NEON -DHAVE_MENU -DHAVE_CONFIGFILE -DHAVE_PATCH -DHAVE_CHEATS -DHAVE_XMB -DHAVE_MATERIALUI -DHAVE_LIBRETRODB DEFINES -DHAVE_KEYMAPPER
|
2019-12-29 13:24:17 +00:00
|
|
|
DEFINES += -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DHAVE_CC_RESAMPLER
|
2017-01-17 22:12:36 +00:00
|
|
|
ifeq ($(DEBUG), 1)
|
|
|
|
DEFINES += -DHAVE_NETLOGGER
|
|
|
|
endif
|
2019-07-25 07:56:57 +00:00
|
|
|
INCDIRS += -I. -Ideps/7zip -Ilibretro-common/include -Ilibretro-common/include/compat/zlib -Ideps/stb
|
2017-01-17 17:19:36 +00:00
|
|
|
else
|
2020-07-01 19:04:05 +00:00
|
|
|
HAVE_REWIND := 1
|
2019-12-29 13:24:17 +00:00
|
|
|
HAVE_UPDATE_ASSETS := 1
|
|
|
|
HAVE_ONLINE_UPDATER := 1
|
2017-01-17 17:19:36 +00:00
|
|
|
HAVE_NEON := 1
|
2019-11-20 11:13:33 +00:00
|
|
|
HAVE_MATH_NEON := 1
|
2020-07-02 00:13:04 +00:00
|
|
|
HAVE_DSP_FILTER := 1
|
2017-01-17 17:19:36 +00:00
|
|
|
HAVE_FILTERS_BUILTIN := 1
|
|
|
|
HAVE_LANGEXTRA := 1
|
|
|
|
HAVE_RPNG := 1
|
|
|
|
HAVE_RJPEG := 1
|
|
|
|
HAVE_RBMP := 1
|
|
|
|
HAVE_RTGA := 1
|
|
|
|
HAVE_ZLIB := 1
|
|
|
|
HAVE_7ZIP := 1
|
|
|
|
HAVE_VITA2D := 1
|
2019-11-12 10:52:04 +00:00
|
|
|
HAVE_VITAGL := 1
|
2017-01-17 17:19:36 +00:00
|
|
|
HAVE_NETWORKING := 1
|
|
|
|
HAVE_SOCKET_LEGACY := 1
|
|
|
|
HAVE_MENU := 1
|
2017-01-17 22:12:36 +00:00
|
|
|
HAVE_MENU_COMMON := 1
|
2020-02-17 20:28:42 +00:00
|
|
|
HAVE_GFX_WIDGETS := 1
|
2020-02-02 20:27:38 +00:00
|
|
|
HAVE_CONFIGFILE := 1
|
2020-06-30 13:54:31 +00:00
|
|
|
HAVE_PATCH := 1
|
2020-06-30 17:35:41 +00:00
|
|
|
HAVE_CHEATS := 1
|
2017-01-17 22:12:36 +00:00
|
|
|
HAVE_OVERLAY := 1
|
2019-05-12 23:57:26 +00:00
|
|
|
HAVE_VIDEO_LAYOUT := 0
|
2017-01-17 17:19:36 +00:00
|
|
|
HAVE_MATERIALUI := 1
|
|
|
|
HAVE_XMB := 1
|
2017-01-17 22:12:36 +00:00
|
|
|
HAVE_RGUI := 1
|
2017-01-17 17:19:36 +00:00
|
|
|
HAVE_STB_FONT := 1
|
|
|
|
HAVE_THREADS := 1
|
|
|
|
HAVE_LIBRETRODB := 1
|
2017-01-17 22:12:36 +00:00
|
|
|
HAVE_CC_RESAMPLER := 1
|
2017-07-06 10:19:17 +00:00
|
|
|
HAVE_CHEEVOS := 1
|
2019-07-13 00:11:07 +00:00
|
|
|
HAVE_RUNAHEAD := 1
|
2017-01-17 17:19:36 +00:00
|
|
|
RARCH_CONSOLE := 1
|
2017-12-07 04:54:54 +00:00
|
|
|
HAVE_STATIC_VIDEO_FILTERS = 1
|
|
|
|
HAVE_STATIC_AUDIO_FILTERS = 1
|
2020-03-15 10:26:29 +00:00
|
|
|
HAVE_AUDIOMIXER := 1
|
2020-06-30 15:36:03 +00:00
|
|
|
HAVE_RWAV := 1
|
2017-01-17 17:19:36 +00:00
|
|
|
|
2017-01-17 22:12:36 +00:00
|
|
|
ifeq ($(DEBUG), 1)
|
|
|
|
HAVE_NETLOGGER = 1
|
|
|
|
endif
|
|
|
|
|
2017-01-17 17:19:36 +00:00
|
|
|
include Makefile.common
|
2018-12-19 18:14:16 +00:00
|
|
|
CFLAGS += $(DEF_FLAGS)
|
2017-01-17 17:19:36 +00:00
|
|
|
BLACKLIST :=
|
|
|
|
OBJ := $(filter-out $(BLACKLIST),$(OBJ))
|
2019-07-25 12:31:01 +00:00
|
|
|
INCDIRS += $(INCLUDE_DIRS)
|
2017-01-17 17:19:36 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(strip $(VITASDK)),)
|
|
|
|
$(error "Please set VITASDK in your environment. export VITASDK=<path to>vitasdk")
|
|
|
|
endif
|
|
|
|
|
2017-01-17 22:12:36 +00:00
|
|
|
export PATH := $(PATH):$(VITASDK)/bin
|
2017-01-17 17:19:36 +00:00
|
|
|
|
|
|
|
PREFIX := arm-vita-eabi-
|
|
|
|
|
|
|
|
CC := $(PREFIX)gcc
|
|
|
|
CXX := $(PREFIX)g++
|
|
|
|
AS := $(PREFIX)as
|
|
|
|
AR := $(PREFIX)ar
|
|
|
|
OBJCOPY := $(PREFIX)objcopy
|
|
|
|
STRIP := $(PREFIX)strip
|
|
|
|
NM := $(PREFIX)nm
|
2020-05-09 07:46:12 +00:00
|
|
|
LD := $(CC)
|
2017-01-17 17:19:36 +00:00
|
|
|
|
|
|
|
LIBDIRS := -L.
|
|
|
|
|
|
|
|
ARCHFLAGS := -march=armv7-a -mfpu=neon -mfloat-abi=hard -DVITA
|
2019-12-13 10:29:14 +00:00
|
|
|
CFLAGS += $(ARCHFLAGS) -mword-relocations -fno-optimize-sibling-calls -O2
|
2017-01-17 17:19:36 +00:00
|
|
|
|
|
|
|
ifeq ($(DEBUG), 1)
|
2019-10-01 17:46:49 +00:00
|
|
|
CFLAGS += -g
|
2017-01-17 17:19:36 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ASFLAGS := $(CFLAGS)
|
2017-01-17 22:12:36 +00:00
|
|
|
LDFLAGS := -Wl,-q
|
2017-01-17 17:19:36 +00:00
|
|
|
|
2019-10-04 13:21:37 +00:00
|
|
|
CFLAGS += -Wall -ffast-math -g
|
2020-07-01 15:47:13 +00:00
|
|
|
CFLAGS += -DRARCH_INTERNAL -DHAVE_SCREENSHOTS -DRARCH_CONSOLE
|
2020-07-02 00:13:04 +00:00
|
|
|
CFLAGS += -DHAVE_DSP_FILTER
|
2017-01-17 17:19:36 +00:00
|
|
|
CFLAGS += -DHAVE_FILTERS_BUILTIN $(DEFINES)
|
|
|
|
|
|
|
|
ifneq ($(PC_DEVELOPMENT_IP_ADDRESS),)
|
|
|
|
CFLAGS += -DPC_DEVELOPMENT_IP_ADDRESS='"$(PC_DEVELOPMENT_IP_ADDRESS)"'
|
|
|
|
endif
|
|
|
|
|
2017-01-17 22:12:36 +00:00
|
|
|
ifneq ($(PC_DEVELOPMENT_UDP_PORT),)
|
|
|
|
CFLAGS += -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
|
2017-01-17 17:19:36 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(WHOLE_ARCHIVE_LINK), 1)
|
|
|
|
WHOLE_START := -Wl,--whole-archive
|
|
|
|
WHOLE_END := -Wl,--no-whole-archive
|
|
|
|
endif
|
|
|
|
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
|
|
|
|
|
2019-10-01 17:46:49 +00:00
|
|
|
VITA_LIBS := -lSceDisplay_stub -lSceGxm_stub -lSceNet_stub -lSceNetCtl_stub -lSceAppUtil_stub \
|
2019-03-23 00:30:43 +00:00
|
|
|
-lSceSysmodule_stub -lSceCtrl_stub -lSceHid_stub -lSceTouch_stub -lSceAudio_stub \
|
2019-10-31 08:33:16 +00:00
|
|
|
-lScePower_stub -lSceRtc_stub -lSceCommonDialog_stub -lScePgf_stub -lSceMotion_stub \
|
2020-05-09 07:46:12 +00:00
|
|
|
-lSceFiber_stub -lSceMotion_stub -lSceAppMgr_stub -lstdc++ -lpthread -lpng -lz
|
2017-01-17 17:19:36 +00:00
|
|
|
|
|
|
|
LIBS := $(WHOLE_START) -lretro_vita $(WHOLE_END) $(VITA_LIBS) -lm -lc
|
|
|
|
|
|
|
|
TARGETS := $(TARGET).vpk
|
|
|
|
|
|
|
|
DEPFLAGS = -MT $@ -MMD -MP -MF $*.Tdepend
|
|
|
|
POSTCOMPILE = mv -f $*.Tdepend $*.depend
|
|
|
|
|
|
|
|
all: $(TARGETS)
|
|
|
|
|
|
|
|
%.o: %.cpp
|
|
|
|
%.o: %.cpp %.depend
|
|
|
|
$(CXX) -c -o $@ $< $(CXXFLAGS) $(INCDIRS) $(DEPFLAGS)
|
|
|
|
$(POSTCOMPILE)
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
%.o: %.c %.depend
|
|
|
|
$(CC) -c -o $@ $< $(CFLAGS) $(INCDIRS) $(DEPFLAGS)
|
|
|
|
$(POSTCOMPILE)
|
|
|
|
|
|
|
|
%.o: %.S
|
|
|
|
%.o: %.S %.depend
|
|
|
|
$(CC) -c -o $@ $< $(ASFLAGS) $(INCDIRS) $(DEPFLAGS)
|
|
|
|
$(POSTCOMPILE)
|
|
|
|
|
|
|
|
%.o: %.s
|
|
|
|
%.o: %.s %.depend
|
|
|
|
$(CC) -c -o $@ $< $(ASFLAGS) $(INCDIRS) $(DEPFLAGS)
|
|
|
|
$(POSTCOMPILE)
|
|
|
|
|
|
|
|
%.depend: ;
|
|
|
|
|
|
|
|
$(TARGET).elf: $(OBJ) libretro_vita.a
|
|
|
|
$(LD) $(OBJ) $(LDFLAGS) $(LIBDIRS) $(LIBS) -o $@
|
|
|
|
|
|
|
|
%.velf: %.elf
|
2019-10-04 13:21:37 +00:00
|
|
|
cp $< $<.unstripped.elf
|
|
|
|
$(PREFIX)strip -g $<
|
2017-01-17 17:19:36 +00:00
|
|
|
vita-elf-create $< $@
|
|
|
|
|
|
|
|
%.self: %.velf
|
|
|
|
vita-make-fself -c -s $< $@
|
|
|
|
|
|
|
|
%.vpk: %.self
|
2019-10-04 10:11:52 +00:00
|
|
|
vita-mksfoex -s TITLE_ID=$(VITA_TITLE_ID) "$(VITA_TITLE_NAME)" -d ATTRIBUTE2=12 param.sfo
|
2017-01-17 17:19:36 +00:00
|
|
|
vita-pack-vpk -s param.sfo -b $< $@
|
|
|
|
|
|
|
|
clean:
|
2019-10-04 13:21:37 +00:00
|
|
|
rm -f $(OBJ) $(TARGET).elf $(TARGET).elf.unstripped.elf $(TARGET).velf $(TARGET).self param.sfo $(TARGET).vpk
|
2017-01-17 17:19:36 +00:00
|
|
|
rm -f $(OBJ:.o=.depend)
|
|
|
|
|
|
|
|
# Useful for developers
|
|
|
|
vpksend: $(TARGET).vpk
|
|
|
|
curl -T $< ftp://$(PSVITAIP):1337/ux0:/
|
|
|
|
|
|
|
|
send: $(TARGET).self
|
|
|
|
curl -T $< ftp://$(PSVITAIP):1337/ux0:/app/$(VITA_TITLE_ID)/eboot.bin
|
|
|
|
|
2020-05-31 15:10:26 +00:00
|
|
|
launch: $(TARGET).self
|
|
|
|
curl -T $< ftp://$(PSVITAIP):1337/ux0:/app/$(VITA_TITLE_ID)/eboot.bin
|
|
|
|
echo "launch $(VITA_TITLE_ID)" | nc ${PSVITAIP} 1338
|
|
|
|
|
2017-01-17 17:19:36 +00:00
|
|
|
.PHONY: clean all send vpksend
|
|
|
|
.PRECIOUS: %.depend
|
|
|
|
|
|
|
|
-include $(OBJ:.o=.depend)
|