mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-10 15:04:19 +00:00
windows toolchain from ofw
https://github.com/flipperdevices/flipperzero-firmware/pull/1351
This commit is contained in:
parent
f5d9d78bd1
commit
89e077125b
4 changed files with 44 additions and 10 deletions
3
.gitattributes
vendored
3
.gitattributes
vendored
|
@ -1 +1,4 @@
|
|||
* text=auto eol=lf
|
||||
*.bat eol=crlf
|
||||
*.ps1 eol=crlf
|
||||
*.cmd eol=crlf
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -47,4 +47,4 @@ null.d
|
|||
build/
|
||||
|
||||
# Toolchain
|
||||
toolchain*/
|
||||
/toolchain
|
||||
|
|
19
fbt.cmd
19
fbt.cmd
|
@ -1,11 +1,12 @@
|
|||
@echo off
|
||||
|
||||
set SCONS_EP=%~dp0\lib\scons\scripts\scons.py
|
||||
|
||||
if exist ".git" (
|
||||
echo Updating git submodules
|
||||
git submodule update --init
|
||||
)
|
||||
|
||||
set "toolchainRoot=%~dp0toolchain\i686-windows"
|
||||
set "SCONS_DEFAULT_FLAGS=-Q --warn=target-not-built"
|
||||
python %SCONS_EP% %SCONS_DEFAULT_FLAGS% %*
|
||||
if not exist "%~dp0.git" (
|
||||
echo ".git" directory not found, please clone repo via "git clone --recursive"
|
||||
exit /B 1
|
||||
)
|
||||
git submodule update --init
|
||||
if not exist "%toolchainRoot%" (
|
||||
powershell -ExecutionPolicy Bypass -File %~dp0scripts\toolchain\windows-toolchain-download.ps1
|
||||
)
|
||||
cmd /V /C "set "PATH=%toolchainRoot%\python;%toolchainRoot%\bin;%toolchainRoot%\protoc\bin;%toolchainRoot%\openocd\bin;%PATH%" && python lib\scons\scripts\scons.py %SCONS_DEFAULT_FLAGS% %*"
|
30
scripts/toolchain/windows-toolchain-download.ps1
Normal file
30
scripts/toolchain/windows-toolchain-download.ps1
Normal file
|
@ -0,0 +1,30 @@
|
|||
Set-StrictMode -Version 2.0
|
||||
$ErrorActionPreference = "Stop"
|
||||
[Net.ServicePointManager]::SecurityProtocol = "tls12, tls11, tls"
|
||||
$repo_root = (Get-Item "$PSScriptRoot\..\..").FullName
|
||||
$toolchain_url = "https://update.flipperzero.one/builds/toolchain/gcc-arm-none-eabi-10.3-2022.06-i686-windows-flipper.zip"
|
||||
$toolchain_zip = "gcc-arm-none-eabi-10.3-2022.06-i686-windows-flipper.zip"
|
||||
|
||||
if (Test-Path -LiteralPath "$repo_root\toolchain\i686-windows") {
|
||||
Write-Host -NoNewline "Removing old Windows toolchain.."
|
||||
Remove-Item -LiteralPath "$repo_root\toolchain\i686-windows" -Force -Recurse
|
||||
Write-Host "done!"
|
||||
}
|
||||
if (!(Test-Path -Path "$repo_root\$toolchain_zip" -PathType Leaf)) {
|
||||
Write-Host -NoNewline "Downloading Windows toolchain.."
|
||||
Invoke-WebRequest -Uri "$toolchain_url" -OutFile "$repo_root\$toolchain_zip"
|
||||
Write-Host "done!"
|
||||
}
|
||||
|
||||
if (!(Test-Path -LiteralPath "$repo_root\toolchain")) {
|
||||
New-Item "$repo_root\toolchain" -ItemType Directory
|
||||
}
|
||||
|
||||
Write-Host -NoNewline "Unziping Windows toolchain.."
|
||||
Expand-Archive -LiteralPath "$toolchain_zip" -DestinationPath "$repo_root\" -Force
|
||||
Move-Item -Path "$repo_root\gcc-arm-none-eabi-10.3-2022.06" -Destination "$repo_root\toolchain\i686-windows"
|
||||
Write-Host "done!"
|
||||
|
||||
Write-Host -NoNewline "Clearing temporary files.."
|
||||
Remove-Item -LiteralPath "$repo_root\$toolchain_zip" -Force
|
||||
Write-Host "done!"
|
Loading…
Reference in a new issue