This repository has been archived by the owner on Apr 4, 2024. It is now read-only.
forked from shauninman/MinUI-Legacy-RG35XX
-
Notifications
You must be signed in to change notification settings - Fork 15
/
makefile
141 lines (112 loc) · 5.05 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
.PHONY: clean
###########################################################
ifeq (,$(PLATFORM))
PLATFORM=$(UNION_PLATFORM)
endif
ifeq (,$(PLATFORM))
$(error please specify PLATFORM, eg. PLATFORM=trimui make)
endif
###########################################################
#BUILD_HASH!=git rev-parse --short HEAD
BUILD_HASH=HEAD
RELEASE_TIME!=TZ=GMT date +%Y%m%d
RELEASE_BASE=FinUI-$(RELEASE_TIME)b
RELEASE_DOT!=find ./releases/. -regex ".*/$(RELEASE_BASE)-[0-9]+-base\.zip" -printf '.' | wc -m
RELEASE_NAME=$(RELEASE_BASE)-$(RELEASE_DOT)
# TODO: this needs to consider the different platforms, eg. rootfs.ext2 should only be copied in rg35xx-toolchain
all: lib sys all-cores tools dtb bundle readmes zip report
repack: bundle readmes zip report
lib:
cd ./src/libmsettings && make
sys:
cd ./src/keymon && make
cd ./src/minarch && make
cd ./src/minui && make
cd ./src/overclock && make
cd ./src/boot && ./build.sh
all-cores:
cd ./cores && make
tools:
cd ./src/clock && make
cd ./src/clear_recent && make
cd ./other/DinguxCommander && make -j
dtb:
cd ./src/dts/ && make
bundle:
# ready build
rm -rf ./build
mkdir -p ./releases
cp -R ./skeleton ./build
# remove authoring detritus
cd ./build && find . -type f -name '.keep' -delete
cd ./build && find . -type f -name '*.meta' -delete
cp ./src/boot/output/dmenu.bin ./build/BASE
cp ./src/boot/output/dmenu.bin ./build/SYSTEM/rg35xx/dat
cp ./src/install/install.sh ./build/SYSTEM/rg35xx/bin
# prepare boot logo
cd ./build/SYSTEM/rg35xx/dat && convert boot_logo.png -type truecolor boot_logo.bmp && rm boot_logo.png && gzip -n boot_logo.bmp
# populate system
cp ~/buildroot/output/images/rootfs.ext2 ./build/SYSTEM/rg35xx
cp ./src/dts/kernel.dtb ./build/SYSTEM/rg35xx/dat
cp ./src/ramdisk/patched-ramdisk.img ./build/SYSTEM/rg35xx/dat/ramdisk.img
cp ./src/ramdisk/charging.png ./build/SYSTEM/rg35xx/dat/
cp ./src/libmsettings/libmsettings.so ./build/SYSTEM/rg35xx/lib
cp ./src/keymon/keymon.elf ./build/SYSTEM/rg35xx/bin
cp ./src/minarch/minarch.elf ./build/SYSTEM/rg35xx/bin
cp ./src/overclock/overclock.elf ./build/SYSTEM/rg35xx/bin
cp ./src/minui/minui.elf ./build/SYSTEM/rg35xx/paks/MinUI.pak
cp ./src/clock/clock.elf ./build/EXTRAS/Tools/rg35xx/Clock.pak
cp ./src/clear_recent/clear_recent.elf "./build/EXTRAS/Tools/rg35xx/Clear Recently Played.pak"
# stock cores
cp ./cores/output/fceumm_libretro.so ./build/SYSTEM/rg35xx/cores
cp ./cores/output/gambatte_libretro.so ./build/SYSTEM/rg35xx/cores
cp ./cores/output/gpsp_libretro.so ./build/SYSTEM/rg35xx/cores
cp ./cores/output/pcsx_rearmed_libretro.so ./build/SYSTEM/rg35xx/cores
cp ./cores/output/picodrive_libretro.so ./build/SYSTEM/rg35xx/cores
cp ./cores/output/snes9x2005_plus_libretro.so ./build/SYSTEM/rg35xx/cores
# extras
cp ./cores/output/mame2003_plus_libretro.so ./build/EXTRAS/Emus/rg35xx/MAME.pak
cp ./cores/output/fake08_libretro.so ./build/EXTRAS/Emus/rg35xx/P8.pak
cp ./cores/output/mgba_libretro.so ./build/EXTRAS/Emus/rg35xx/MGBA.pak
cp ./cores/output/mgba_libretro.so ./build/EXTRAS/Emus/rg35xx/SGB.pak
cp ./cores/output/mednafen_pce_fast_libretro.so ./build/EXTRAS/Emus/rg35xx/PCE.pak
cp ./cores/output/mednafen_supafaust_libretro.so ./build/EXTRAS/Emus/rg35xx/SUPA.pak
cp ./cores/output/mednafen_vb_libretro.so ./build/EXTRAS/Emus/rg35xx/VB.pak
cp ./cores/output/pokemini_libretro.so ./build/EXTRAS/Emus/rg35xx/PKM.pak
cp ./cores/output/race_libretro.so ./build/EXTRAS/Emus/rg35xx/NGP.pak
cp ./cores/output/race_libretro.so ./build/EXTRAS/Emus/rg35xx/NGPC.pak
cp ./other/DinguxCommander/output/DinguxCommander ./build/EXTRAS/Tools/rg35xx/Files.pak
cp -R ./other/DinguxCommander/res ./build/EXTRAS/Tools/rg35xx/Files.pak/
readmes:
fmt -w 40 -s ./skeleton/BASE/README.txt > ./build/BASE/README.txt
fmt -w 40 -s ./skeleton/EXTRAS/README.txt > ./build/EXTRAS/README.txt
zip:
cd ./build/SYSTEM && echo "$(RELEASE_NAME)\n$(BUILD_HASH)" > version.txt
./commits.sh > ./build/SYSTEM/commits.txt
cd ./build && find . -type f -name '.DS_Store' -delete
mkdir -p ./build/PAYLOAD
mv ./build/SYSTEM ./build/PAYLOAD/.system
cd ./build/PAYLOAD && zip -r MinUI.zip .system
mv ./build/PAYLOAD/MinUI.zip ./build/BASE
cd ./build/BASE && zip -r ../../releases/$(RELEASE_NAME)-base.zip Bios Roms Saves dmenu.bin MinUI.zip README.txt INSTALL.txt SHORTCUTS.txt
cd ./build/EXTRAS && zip -r ../../releases/$(RELEASE_NAME)-extras.zip Bios Emus Roms Saves Tools README.txt
rm -fr ./build/FULL
mkdir ./build/FULL
cp -fR ./build/BASE/* ./build/FULL/
cp -fR ./build/EXTRAS/* ./build/FULL/
cd ./build/FULL && zip -r ../../releases/$(RELEASE_NAME)-full.zip Bios Emus Roms Saves Tools dmenu.bin MinUI.zip INSTALL.txt SHORTCUTS.txt
echo "$(RELEASE_NAME)" > ./build/latest.txt
report:
echo "finished building r${RELEASE_TIME}-${RELEASE_DOT}"
clean:
rm -rf ./build
rm -rf ./releases
cd ./src/libmsettings && make clean
cd ./src/keymon && make clean
cd ./src/minui && make clean
cd ./src/minarch && make clean
cd ./src/boot && rm -rf ./output
cd ./cores && make clean
cd ./src/clock && make clean
cd ./src/clear_recent && make clean
cd ./other/DinguxCommander && make clean