Linux and Mac installers working.

This commit is contained in:
Scott Duensing 2024-05-01 16:49:03 -05:00
parent 61dc4de41c
commit 885c71d207
6 changed files with 81 additions and 14 deletions

View file

@ -83,6 +83,8 @@ pushd distro
cp -f ../README . cp -f ../README .
cp -f ../f256build.bat . cp -f ../f256build.bat .
cp -f ../f256run.bat . cp -f ../f256run.bat .
cp -f ../f256build.sh .
cp -f ../f256run.sh .
buildOverlayTool linux x86_64 $(pwd)/overlay.linux buildOverlayTool linux x86_64 $(pwd)/overlay.linux
buildOverlayTool macos aarch64 $(pwd)/overlay.macos buildOverlayTool macos aarch64 $(pwd)/overlay.macos

View file

@ -18,15 +18,19 @@ On Windows, you will need:
* WinRAR (https://www.rarlab.com/) or 7-Zip (https://www.7zip.com/) installed. * WinRAR (https://www.rarlab.com/) or 7-Zip (https://www.7zip.com/) installed.
* Python 3.x (https://www.python.org/) installed and in your PATH. * Python 3.x (https://www.python.org/) installed and in your PATH.
MacOS and Linux:
* Ensure you have Python 3.x installed.
INSTALLATION INSTALLATION
============ ============
Download the appropriate installation script: Download the appropriate installation script:
* 64 bit Intel Windows: f256-install-windows.bat * 64 bit Intel Windows: f256-install.bat
* 64 bit Intel Linux: f256-install-linux.sh * 64 bit Intel Linux: f256-install.sh
* 64 bit ARM MacOS: f256-install-macos.sh * 64 bit ARM MacOS: f256-install.sh
Create a new, empty directory, with no spaces in the name (or in the names of Create a new, empty directory, with no spaces in the name (or in the names of
the parent directories) and place this file into it. From that folder, execute the parent directories) and place this file into it. From that folder, execute
@ -65,6 +69,8 @@ C:\FOENIX folder as follows:
UNIX folks, flip your slashes! UNIX folks, flip your slashes!
f256build.sh code/myprogram
USAGE USAGE
===== =====

View file

@ -22,9 +22,26 @@
# SOFTWARE. # SOFTWARE.
# #
#
# This script is intended for use on Linux and MacOS.
#
REMOTE1=https://github.com/llvm-mos/llvm-mos-sdk/releases/latest/download/llvm-mos-linux.tar.xz
LOCAL1=llvm-mos-linux.tar.xz MACTEST=$(uname -a | grep Darwin)
if [[ $? == 0 ]]; then
MACTEST=$(uname -a | grep arm64)
if [[ $? == 0 ]]; then
MAC=1
fi
fi
if [[ -z ${MAC} ]]; then
REMOTE1=https://github.com/llvm-mos/llvm-mos-sdk/releases/latest/download/llvm-mos-linux.tar.xz
LOCAL1=llvm-mos-linux.tar.xz
else
REMOTE1=https://github.com/llvm-mos/llvm-mos-sdk/releases/latest/download/llvm-mos-macos.tar.xz
LOCAL1=llvm-mos-macos.tar.xz
fi
REMOTE2=https://kangaroopunch.com/files/serve/shared/llvm-mos-f256.tar.xz REMOTE2=https://kangaroopunch.com/files/serve/shared/llvm-mos-f256.tar.xz
LOCAL2=llvm-mos-f256.tar.xz LOCAL2=llvm-mos-f256.tar.xz
@ -38,14 +55,25 @@ if [[ -d $(basename -s .tar.xz ${LOCAL1}) ]]; then
exit 1 exit 1
fi fi
PYTHON=$(which pythonx) PYTHON=$(which python)
if [[ $? != 0 ]]; then if [[ $? == 1 ]]; then
echo "Unable to find Python. Exiting." PYTHON=$(which python3)
if [[ $? == 1 ]]; then
echo "Unable to find Python 3.x. Exiting."
exit 1
fi
fi
PYVER=$(${PYTHON} --version | grep "Python 3")
if [[ $? == 1 ]]; then
echo "Unable to find Python 3.x. Exiting."
exit 1
fi fi
PIP=$(which pip) PIP=$(which pip)
if [[ $? != 0 ]]; then if [[ $? == 1 ]]; then
echo "Unable to find pip. Exiting." echo "Unable to find pip. Exiting."
exit 1
fi fi
CURL=$(which curl) CURL=$(which curl)
@ -74,8 +102,13 @@ rm ${LOCAL2}
rm ${LOCAL3} rm ${LOCAL3}
rm -f overlay.windows rm -f overlay.windows
rm -f overlay.macos if [[ -z ${MAC} ]]; then
mv overlay.linux overlay rm -f overlay.macos
mv overlay.linux overlay
else
rm -f overlay.linux
mv overlay.macos overlay
fi
rm -f *.bat rm -f *.bat

View file

@ -22,6 +22,10 @@
# SOFTWARE. # SOFTWARE.
# #
#
# This script is intended for use on Linux and MacOS.
#
ROOT=$(pwd) ROOT=$(pwd)
@ -35,6 +39,15 @@ if ! compgen -G "${1}/src/*.c" > /dev/null; then
exit 1 exit 1
fi fi
PYTHON=$(which python)
if [[ $? == 1 ]]; then
PYTHON=$(which python3)
if [[ $? == 1 ]]; then
echo "Unable to find Python 3.x. Exiting."
exit 1
fi
fi
PROJECT=${ROOT}/${1} PROJECT=${ROOT}/${1}
SOURCE=${PROJECT}/src SOURCE=${PROJECT}/src
BUILD=${PROJECT}/.builddir BUILD=${PROJECT}/.builddir
@ -55,7 +68,7 @@ pushd "${PROJECT}" > /dev/null
mv ${NAME} ${NAME}.pgz mv ${NAME} ${NAME}.pgz
llvm-nm ${NAME}.elf > ${NAME}.sym llvm-nm ${NAME}.elf > ${NAME}.sym
llvm-objdump --syms -d --print-imm-hex ${NAME}.elf > ${NAME}.lst llvm-objdump --syms -d --print-imm-hex ${NAME}.elf > ${NAME}.lst
python ${ROOT}/pgz-thunk.py ${NAME}.pgz ${PYTHON} ${ROOT}/pgz-thunk.py ${NAME}.pgz
mv ${NAME}.pgz ../. mv ${NAME}.pgz ../.
fi fi
popd > /dev/null popd > /dev/null

View file

@ -22,6 +22,10 @@
# SOFTWARE. # SOFTWARE.
# #
#
# This script is intended for use on Linux and MacOS.
#
ROOT=$(pwd) ROOT=$(pwd)
@ -30,6 +34,15 @@ if [[ -z ${1} ]]; then
exit 1 exit 1
fi fi
PYTHON=$(which python)
if [[ $? == 1 ]]; then
PYTHON=$(which python3)
if [[ $? == 1 ]]; then
echo "Unable to find Python 3.x. Exiting."
exit 1
fi
fi
PROJECT=${ROOT}/${1} PROJECT=${ROOT}/${1}
NAME=$(basename ${PROJECT}) NAME=$(basename ${PROJECT})
if [[ ! -f "${PROJECT}/${NAME}.pgz" ]]; then if [[ ! -f "${PROJECT}/${NAME}.pgz" ]]; then
@ -37,5 +50,5 @@ if [[ ! -f "${PROJECT}/${NAME}.pgz" ]]; then
exit 1 exit 1
fi fi
python "${ROOT}/FoenixMgr/FoenixMgr/fnxmgr.py" --boot FLASH ${PYTHON} "${ROOT}/FoenixMgr/FoenixMgr/fnxmgr.py" --boot FLASH
python "${ROOT}/FoenixMgr/FoenixMgr/fnxmgr.py" --run-pgz "${PROJECT}/${NAME}.pgz" ${PYTHON} "${ROOT}/FoenixMgr/FoenixMgr/fnxmgr.py" --run-pgz "${PROJECT}/${NAME}.pgz"