This repository has been archived by the owner on Nov 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.sh
74 lines (63 loc) · 2.39 KB
/
build.sh
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
#!/bin/bash
##
#/****************************************************************************
# WiiUFtpServer (fork of FTP everywhere by Laf111@2021)
# ***************************************************************************/
VERSION_MAJOR=12
VERSION_MINOR=2
VERSION_PATCH=0
export WiiUFtpServerVersion=$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH
buildDate=$(date +"%Y%m%d%H%M%S")
clear
uname -a
date +"%Y-%m-%dT%H:%M:%S"
echo " "
echo ========================
echo - WiiUFtpServer $WiiUFtpServerVersion -
echo ========================
echo " "
echo checking env ...
echo -----------------------------------------------------
check=$(env | grep "DEVKITPRO")
if [ "$check" == "" ]; then
echo "ERROR: DEVKITPRO not found in the current environement !"
echo " Please define DEVKITPRO"
more ./Makefile | grep "Please set DEVKITPRO"
exit 100
else
if [ -d $DEVKITPRO ]; then
if [ -f $DEVKITPRO/installed.ini ]; then
echo "DEVKITPRO : ["$(more $DEVKITPRO/installed.ini | grep -i "Version=" | sed "s|Version=||g")"] in $DEVKITPRO"
line=$(more $DEVKITPRO/wut/include/wut.h | grep "* wut")
fi
else
echo "$DEVKITPRO is invalid"
exit 101
fi
fi
check=$(env | grep "DEVKITPPC")
if [ "$check" == "" ]; then
export DEVKITPPC=$DEVKITPRO/devkitPPC
fi
rm -f ./_sdCard/wiiu/apps/WiiUFtpServer/WiiUFtpServer.elf > /dev/null 2>&1
echo =====================================================
echo "building..."
echo -----------------------------------------------------
make clean
make
if [ $? -eq 0 ]; then
# set version in ./_sdCard/wiiu/apps/WiiUFtpServer/meta.xml
sed -i "s|<version>.*<|<version>$WiiUFtpServerVersion<|g" ./_sdCard/wiiu/apps/WiiUFtpServer/meta.xml
find ./_sdCard/wiiu/apps/WiiUFtpServer/NandBackup -name dummy.txt -exec rm -f {} \; > /dev/null 2>&1
sed -i "s|release_date>[0-9]\{14\}|release_date>$buildDate|g" ./_sdCard/wiiu/apps/WiiUFtpServer/meta.xml
echo -----------------------------------------------------
echo ""
cp -rf ./WiiUFtpServer.elf ./_sdCard/wiiu/apps/WiiUFtpServer > /dev/null 2>&1
echo "HBL package in ./_sdCard/wiiu/apps/WiiUFtpServer : "$(ls ./_sdCard/wiiu/apps/WiiUFtpServer)
else
echo ERRORS happened when building RPX file, exit 2
exit 2
fi
echo =====================================================
echo done sucessfully, exit 0
exit 0