2018-10-25 15:45:15 +00:00
|
|
|
|
# This build was put together and is maintained by ModMyClassic.com for Libretro.
|
2018-10-25 15:47:46 +00:00
|
|
|
|
# The purpose is to give Libretro a proper "official" build platform for classic consoles.
|
2018-10-25 15:45:15 +00:00
|
|
|
|
# If you need any help in building for the classics or have any questions then please visit
|
|
|
|
|
# https://modmyclassic.com/comp and we will help in any way possible!
|
|
|
|
|
|
2018-10-25 12:47:22 +00:00
|
|
|
|
# Building Prerequisites ##############
|
|
|
|
|
# arm-linux-gnueabihf-gcc-8
|
|
|
|
|
# arm-linux-gnueabihf-g++-8
|
|
|
|
|
# arm-linux-gnueabihf-as
|
|
|
|
|
# arm-linux-gnueabihf-strip
|
|
|
|
|
# patchelf
|
|
|
|
|
# bc
|
2018-10-23 15:43:28 +00:00
|
|
|
|
|
|
|
|
|
# Classic Readme Variables ############
|
2018-10-25 12:47:22 +00:00
|
|
|
|
CLASSIC_MODS_VER := Official_Retroarch_v1_7_5c_COptimised
|
|
|
|
|
CLASSIC_MODS_NAME := RetroArch v1.7.5c (Official Classic Optimised)
|
2018-10-25 13:20:20 +00:00
|
|
|
|
CLASSIC_VERSION := 1.7.5c \(Classic+\)
|
2018-10-23 16:28:23 +00:00
|
|
|
|
MOD_CREATOR := Libretro + ModMyClassic
|
2018-10-23 15:43:28 +00:00
|
|
|
|
MOD_CATEGORY := RetroArch
|
|
|
|
|
GIT_COMMIT := $(shell echo "`git rev-parse --short HEAD``git diff-index --quiet HEAD -- || echo '-dirty'`")
|
|
|
|
|
|
|
|
|
|
# Platform dependant Variables ########
|
|
|
|
|
HAKCHI_DIR := RA_Platform-Hakchi
|
|
|
|
|
HAKCHI_GIT := https://github.com/Classicmods/RA_Platform-Hakchi
|
|
|
|
|
|
|
|
|
|
# General Shared Variables ############
|
|
|
|
|
TARGET := retroarch
|
|
|
|
|
CC_V = arm-linux-gnueabihf-gcc-8
|
|
|
|
|
CXX_V = arm-linux-gnueabihf-g++-8
|
|
|
|
|
AS_V = arm-linux-gnueabihf-as
|
|
|
|
|
CC_AS_V = arm-linux-gnueabihf-gcc-8
|
|
|
|
|
|
2018-10-23 16:16:15 +00:00
|
|
|
|
# Libretro Defines ####################
|
2018-10-25 12:11:55 +00:00
|
|
|
|
#HAVE_CLASSIC = Classic Hook, disable some features
|
|
|
|
|
#HAVE_C_A7A7 = Classic Armv7 Cortex A7 optimisation override
|
|
|
|
|
#HAVE_HAKCHI = Hakchi Hook, change default configurations etc (TODO)
|
2018-10-23 16:16:15 +00:00
|
|
|
|
|
2018-10-23 15:43:28 +00:00
|
|
|
|
all: $(TARGET)
|
|
|
|
|
|
|
|
|
|
retroarch:
|
2018-10-25 12:47:22 +00:00
|
|
|
|
#Backup vanilla version files + ammend version
|
|
|
|
|
cp version.all version_BACKUP.all && cp version.dtd version_BACKUP.dtd
|
2018-10-25 13:20:20 +00:00
|
|
|
|
sed -i -e 's/RARCH_VERSION="[^"]*"/RARCH_VERSION="$(CLASSIC_VERSION)"/g' version.all
|
|
|
|
|
sed -i -e 's/PACKAGE_VERSION "[^"]*"/PACKAGE_VERSION "$(CLASSIC_VERSION)"/g' version.all
|
|
|
|
|
sed -i -e 's/ENTITY version "[^"]*"/ENTITY version "$(CLASSIC_VERSION)"/g' version.dtd
|
2018-10-23 15:43:28 +00:00
|
|
|
|
#Build the RetroArch Binary for cross platform classics (ARMv7 Cortex A7)
|
|
|
|
|
patchelf --version #Check if you have patchelf installed... (sudo apt-get install patchelf)
|
2018-10-25 13:20:20 +00:00
|
|
|
|
./configure --host=arm-linux-gnueabihf --enable-mali_fbdev --disable-freetype --enable-opengles --enable-udev --enable-alsa --enable-neon --enable-floathard --disable-discord
|
2018-10-25 12:11:55 +00:00
|
|
|
|
make CC=$(CC_V) CXX=$(CXX_V) AS=$(AS_V) CC_AS=$(CC_AS_V) LDFLAGS_SDL=-lSDL2 HAVE_CLASSIC=1 HAVE_C_A7A7=1 HAVE_HAKCHI=1 -j #Cook it
|
2018-10-25 12:47:22 +00:00
|
|
|
|
arm-linux-gnueabihf-strip -v retroarch
|
2018-10-23 15:43:28 +00:00
|
|
|
|
patchelf --replace-needed libSDL2-2.0.so.0 libSDL2.so retroarch #libSDL2-2.0.so.0 sym link doesn't exist on native build. Just patch the binary...
|
|
|
|
|
|
|
|
|
|
#HAKCHI BUILD (NESC, SNESC)
|
2018-10-25 15:45:15 +00:00
|
|
|
|
#FYI this build was originally known as RetroArch 'Neo' for Hakchi.
|
2018-10-23 15:43:28 +00:00
|
|
|
|
@echo "** BUILDING CLASSIC_MODS HAKCHI - $(CLASSIC_MODS_VER) HMOD PACKAGE **"
|
|
|
|
|
rm -fr /tmp/$(HAKCHI_DIR)
|
|
|
|
|
cd /tmp/; git clone $(HAKCHI_GIT)
|
|
|
|
|
cp retroarch /tmp/$(HAKCHI_DIR)/bin/retroarch
|
|
|
|
|
echo $$(echo "Built by: " $$USER @ $$(date) \\\\\\ Git Commit: $(GIT_COMMIT)) > /tmp/$(HAKCHI_DIR)/etc/libretro/retroarch_version
|
|
|
|
|
cp /tmp/$(HAKCHI_DIR)/readme.md /tmp/$(HAKCHI_DIR)/readme_COPY.md
|
|
|
|
|
printf "%s\n" \
|
|
|
|
|
"---" \
|
|
|
|
|
"Name: $(CLASSIC_MODS_NAME)" \
|
|
|
|
|
"Creator: $(MOD_CREATOR)" \
|
|
|
|
|
"Category: $(MOD_CATEGORY)" \
|
|
|
|
|
"Version: $(CLASSIC_MODS_VER)" \
|
|
|
|
|
"Built on: $(shell date)" \
|
|
|
|
|
"Git commit: $(GIT_COMMIT)" \
|
|
|
|
|
"---" > /tmp/$(HAKCHI_DIR)/readme.md
|
|
|
|
|
cat /tmp/$(HAKCHI_DIR)/readme_COPY.md >> /tmp/$(HAKCHI_DIR)/readme.md
|
|
|
|
|
rm /tmp/$(HAKCHI_DIR)/readme_COPY.md
|
2018-10-23 15:55:23 +00:00
|
|
|
|
@echo "** COMPRESSING $(CLASSIC_MODS_VER) HMOD PACKAGE **"
|
2018-10-23 15:43:28 +00:00
|
|
|
|
cd /tmp/$(HAKCHI_DIR)/; tar -czvf "$(CLASSIC_MODS_VER).hmod" *
|
|
|
|
|
mv /tmp/$(HAKCHI_DIR)/$(CLASSIC_MODS_VER).hmod .
|
2018-10-23 15:55:23 +00:00
|
|
|
|
@echo "** BUILT CLASSIC_MODS HAKCHI - $(CLASSIC_MODS_VER) HMOD PACKAGE **"
|
2018-10-23 16:17:07 +00:00
|
|
|
|
rm -fr /tmp/$(HAKCHI_DIR) #clean up tmp
|
2018-10-23 16:16:15 +00:00
|
|
|
|
|
|
|
|
|
#COMMODORE 64 MINI BUILD (WIP)
|
2018-10-25 12:47:22 +00:00
|
|
|
|
|
|
|
|
|
#Clean down dirty files
|
|
|
|
|
rm -f version.all version.dtd
|
|
|
|
|
mv version_BACKUP.all version.all && mv version_BACKUP.dtd version.dtd
|
2018-10-23 16:16:15 +00:00
|
|
|
|
@echo "*********************************************************************"
|
|
|
|
|
@echo "*** Classic ARM7 Cortex A7 build and packages built successfully! ***"
|
|
|
|
|
@echo "****************** Winner, Winner, Chicken Dinner! ******************"
|
|
|
|
|
@echo "*********************************************************************"
|
2018-10-23 15:43:28 +00:00
|
|
|
|
clean:
|
|
|
|
|
rm -rf obj-unix
|
|
|
|
|
rm -f *.d
|
|
|
|
|
rm -f *.o
|
|
|
|
|
rm -f audio/*.o
|
|
|
|
|
rm -f conf/*.o
|
|
|
|
|
rm -f gfx/*.o
|
|
|
|
|
rm -f gfx/drivers_font/*.o
|
|
|
|
|
rm -f gfx/drivers_font_renderer/*.o
|
|
|
|
|
rm -f gfx/drivers_context/*.o
|
|
|
|
|
rm -f gfx/py_state/*.o
|
|
|
|
|
rm -f compat/*.o
|
|
|
|
|
rm -f record/*.o
|
|
|
|
|
rm -f input/*.o
|
|
|
|
|
rm -f tools/*.o
|
|
|
|
|
rm -f $(BINDIR)/retroarch
|
|
|
|
|
rm -f $(BINDIR)/retroarch-joyconfig
|
|
|
|
|
rm -f $(PNDDIR)/readme.html
|
|
|
|
|
rm -f retroarch
|
|
|
|
|
rm -f $(CLASSIC_MODS_VER).hmod
|
2018-10-25 13:20:20 +00:00
|
|
|
|
rm -f version.all version.dtd
|
2018-10-25 15:47:46 +00:00
|
|
|
|
mv -f version_BACKUP.all version.all || echo "Backup Doesn't Exist - Ignoring..."
|
|
|
|
|
mv -f version_BACKUP.dtd version.dtd || echo "Backup Doesn't Exist - Ignoring..."
|
2018-10-25 13:20:20 +00:00
|
|
|
|
rm -f *_BACKUP*
|