Working on update to f256dev. Windows mostly finished.

This commit is contained in:
Scott Duensing 2024-05-13 19:55:51 -05:00
parent c5f8467dbf
commit a717e5d66a
9 changed files with 189 additions and 153 deletions

4
.gitignore vendored
View file

@ -45,9 +45,7 @@ generated/
overlay overlay
overlayhelper overlayhelper
f256lib.h f256lib.h
/distro/llvm-mos /distro/f256dev.7z
/distro/llvm-mos-f256.7z
/distro/llvm-mos-f256.tar.xz
# These aren't for public use or aren't ready. # These aren't for public use or aren't ready.
build-foenix-ide.sh build-foenix-ide.sh

View file

@ -67,8 +67,10 @@ pushd distro
fi fi
mkdir -p .builddir mkdir -p .builddir
pushd .builddir pushd .builddir
mkdir -p llvm-mos/mos-platform/f256 mkdir -p f256dev/llvm-mos/mos-platform/f256
mkdir -p llvm-mos/bin mkdir -p f256dev/llvm-mos/bin
pushd f256dev
cp -Rf ${INSTALL}/mos-platform/f256/* llvm-mos/mos-platform/f256/. cp -Rf ${INSTALL}/mos-platform/f256/* llvm-mos/mos-platform/f256/.
cp -f ${INSTALL}/bin/mos-f256.cfg llvm-mos/bin/. cp -f ${INSTALL}/bin/mos-f256.cfg llvm-mos/bin/.
@ -80,18 +82,23 @@ pushd distro
cp -f ${ROOT}/f256lib.h . cp -f ${ROOT}/f256lib.h .
cp -f ${ROOT}/pgz-thunk.py . cp -f ${ROOT}/pgz-thunk.py .
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 ../../f256build.sh .
cp -f ../f256run.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
buildOverlayTool windows x86_64 $(pwd)/overlay.windows buildOverlayTool windows x86_64 $(pwd)/overlay.windows
tar cJf ../llvm-mos-f256.tar.xz . popd
7z a ../llvm-mos-f256.7z .
if [[ -f ../f256dev.7z ]]; then
rm ../f256dev.7z
fi
7z a ../f256dev.7z .
popd popd
popd popd

View file

@ -76,7 +76,10 @@ USAGE
===== =====
As shown above, f256build is used to build projects using the default linker As shown above, f256build is used to build projects using the default linker
settings. If you do not have linker settings in your project already, the settings.
***FIX*** If you do not have linker settings in your project already, the
defaults will be added (in a file named f256.ld in your project directory). defaults will be added (in a file named f256.ld in your project directory).
Unless you need to use embedded binary data in your project, the defaults are Unless you need to use embedded binary data in your project, the defaults are
all you need. Embedded data examples are included. See SPRITES and TILEMAP in all you need. Embedded data examples are included. See SPRITES and TILEMAP in
@ -110,3 +113,15 @@ wiki: http://wiki.f256foenix.com/
As a last resort, you can email me, Scott Duensing, at scott@kangaroopunch.com As a last resort, you can email me, Scott Duensing, at scott@kangaroopunch.com
and I'll probably ask you to join the Discord. :-) and I'll probably ask you to join the Discord. :-)
HISTORY
=======
* xx-MAY-2024 - Everything now installs into a single folder for safe updating.
Linker scripts not added to projects by default any longer.
* 09-MAY-2024 - Updated MacOS and Linux installation script to also search for
'pip3' as well as 'pip'.
* 01-MAY-2024 - Initial release for Linux, MacOS, and Windows.

View file

@ -31,8 +31,8 @@ goto top
set REMOTE1=https://github.com/llvm-mos/llvm-mos-sdk/releases/latest/download/llvm-mos-windows.7z set REMOTE1=https://github.com/llvm-mos/llvm-mos-sdk/releases/latest/download/llvm-mos-windows.7z
set LOCAL1=llvm-mos-windows.7z set LOCAL1=llvm-mos-windows.7z
set REMOTE2=https://kangaroopunch.com/files/serve/shared/llvm-mos-f256.7z set REMOTE2=https://kangaroopunch.com/files/serve/shared/f256dev.7z
set LOCAL2=llvm-mos-f256.7z set LOCAL2=f256dev.7z
set REMOTE3=https://aka.ms/vs/16/release/vc_redist.x64.exe set REMOTE3=https://aka.ms/vs/16/release/vc_redist.x64.exe
set LOCAL3=vc_redist.x64.exe set LOCAL3=vc_redist.x64.exe
@ -41,10 +41,7 @@ set REMOTE4=https://github.com/pweingar/FoenixMgr/archive/refs/heads/master.zip
set LOCAL4=master.zip set LOCAL4=master.zip
if exist llvm-mos\ ( if exist f256dev\ rd /s /q f256dev
echo You already have an llvm-mos directory. Exiting.
exit /B
)
if exist "%ProgramFiles%\7-Zip\7z.exe" ( if exist "%ProgramFiles%\7-Zip\7z.exe" (
set UNPACK="%ProgramFiles%\7-Zip\7z.exe" set UNPACK="%ProgramFiles%\7-Zip\7z.exe"
@ -89,15 +86,20 @@ if errorlevel 1 (
%LOCAL3% /install /passive %LOCAL3% /install /passive
%UNPACK% x -y %LOCAL1% md f256dev
pushd f256dev
%UNPACK% x -y ..\%LOCAL1%
%UNPACK% x -y ..\%LOCAL4%
popd
%UNPACK% x -y %LOCAL2% %UNPACK% x -y %LOCAL2%
%UNPACK% x -y %LOCAL4%
del %LOCAL1% del %LOCAL1%
del %LOCAL2% del %LOCAL2%
del %LOCAL3% del %LOCAL3%
del %LOCAL4% del %LOCAL4%
pushd f256dev
del overlay.linux del overlay.linux
del overlay.macos del overlay.macos
ren overlay.windows overlay.exe ren overlay.windows overlay.exe
@ -109,16 +111,22 @@ pushd FoenixMgr
pip.exe install -r requirements.txt pip.exe install -r requirements.txt
popd popd
echo @"%%~dp0mos-clang++.exe" --config mos-f256.cfg %%* > llvm-mos\bin\mos-f256-clang++.bat
echo @"%%~dp0mos-clang-cpp.exe" --config mos-f256.cfg %%* > llvm-mos\bin\mos-f256-clang-cpp.bat
echo @"%%~dp0mos-clang.exe" --config mos-f256.cfg %%* > llvm-mos\bin\mos-f256-clang.bat
popd
echo @"%~dp0f256dev\f256build.bat" "%%~dp0" %%* > f256build.bat
echo @"%~dp0f256dev\f256run.bat" "%%~dp0" %%* > f256run.bat
if not exist foenixmgr.ini (
echo [DEFAULT] > foenixmgr.ini echo [DEFAULT] > foenixmgr.ini
echo port=COM3 >> foenixmgr.ini echo port=COM3 >> foenixmgr.ini
echo labels=sample.lbl >> foenixmgr.ini echo labels=sample.lbl >> foenixmgr.ini
echo flash_address=380000 >> foenixmgr.ini echo flash_address=380000 >> foenixmgr.ini
echo chunk_size=1024 >> foenixmgr.ini echo chunk_size=1024 >> foenixmgr.ini
echo cpu=65c02 >> foenixmgr.ini echo cpu=65c02 >> foenixmgr.ini
)
echo @"%%~dp0mos-clang++.exe" --config mos-f256.cfg %%* > llvm-mos\bin\mos-f256-clang++.bat
echo @"%%~dp0mos-clang-cpp.exe" --config mos-f256.cfg %%* > llvm-mos\bin\mos-f256-clang-cpp.bat
echo @"%%~dp0mos-clang.exe" --config mos-f256.cfg %%* > llvm-mos\bin\mos-f256-clang.bat
echo. echo.
echo ----------------------------------------------------------------------------- echo -----------------------------------------------------------------------------

View file

@ -26,23 +26,27 @@ goto top
:top :top
set ROOT=%cd% setlocal EnableDelayedExpansion
if "%~1%" neq "" goto checkSrc set ROOT=%~dp0
if "%ROOT:~-1%" == "\" set "ROOT=%ROOT:~0,-1%"
if "%~2" neq "" goto checkSrc
echo. echo.
echo No project folder provided. echo No project folder provided.
exit /b exit /b
:checkSrc :checkSrc
if exist "%1%\src\*.c" goto foundSrc if exist "%~2\src\*.c" goto foundSrc
echo. echo.
echo No src folder containing C files found. echo No src folder containing C files found.
exit /b exit /b
:foundSrc :foundSrc
set PROJECT=%ROOT%\%1% set PROJECT=%~1%~2
set SOURCE=%PROJECT%\src set SOURCE=%PROJECT%\src
set BUILD=%PROJECT%\.builddir set BUILD=%PROJECT%\.builddir
if "%PROJECT:~-1%" == "\" set "PROJECT=%PROJECT:~0,-1%" if "%PROJECT:~-1%" == "\" set "PROJECT=%PROJECT:~0,-1%"
for %%f in ("%PROJECT%") do set "NAME=%%~nxf" for %%f in ("%PROJECT%") do set "NAME=%%~nxf"
pushd "%PROJECT%" pushd "%PROJECT%"
@ -50,10 +54,11 @@ pushd "%PROJECT%"
mkdir .builddir mkdir .builddir
cd .builddir cd .builddir
"%ROOT%\overlay.exe" 5 "%BUILD%" "%SOURCE%" "%ROOT%\overlay.exe" 5 "%BUILD%" "%SOURCE%"
if not exist "%PROJECT%\f256.ld" copy /y "%ROOT%\llvm-mos\mos-platform\f256\lib\link.ld" "%PROJECT%\f256.ld" > NUL if exist "%PROJECT%\f256.ld" copy /y "%PROJECT%\f256.ld" f256.ld > NUL
if not exist f256.ld copy /y "%ROOT%\llvm-mos\mos-platform\f256\lib\link.ld" f256.ld > NUL
set OLDPATH=%PATH% set OLDPATH=%PATH%
set PATH=%~dp0llvm-mos\bin;%PATH% set PATH=%~dp0llvm-mos\bin;%PATH%
call mos-f256-clang.bat -T ..\f256.ld -Wl,-Map=%NAME%.map -o %NAME% -I"%ROOT%" -Os -Wall -lm *.c call mos-f256-clang.bat -v *.c -o %NAME% -I"%ROOT%" -Tf256.ld -Wl,-Map=%NAME%.map -Os -Wall -lm
if errorlevel 1 goto failed if errorlevel 1 goto failed
ren %NAME% %NAME%.pgz ren %NAME% %NAME%.pgz
llvm-nm.exe %NAME%.elf > %NAME%.sym llvm-nm.exe %NAME%.elf > %NAME%.sym

View file

@ -26,15 +26,18 @@ goto top
:top :top
set ROOT=%cd% setlocal EnableDelayedExpansion
if "%~1%" neq "" goto checkPgz set ROOT=%~dp0
if "%ROOT:~-1%" == "\" set "ROOT=%ROOT:~0,-1%"
if "%~2%" neq "" goto checkPgz
echo. echo.
echo No project folder provided. echo No project folder provided.
exit /b exit /b
:checkPgz :checkPgz
set PROJECT=%ROOT%\%1% set PROJECT=%~1%~2
if "%PROJECT:~-1%" == "\" set "PROJECT=%PROJECT:~0,-1%" if "%PROJECT:~-1%" == "\" set "PROJECT=%PROJECT:~0,-1%"
for %%f in ("%PROJECT%") do set "NAME=%%~nxf" for %%f in ("%PROJECT%") do set "NAME=%%~nxf"
if exist "%PROJECT%\%NAME%.pgz" goto foundPgz if exist "%PROJECT%\%NAME%.pgz" goto foundPgz