Difference between revisions of "FPC recompilation automation"
From Free Pascal wiki
Jump to navigationJump to search (Created page with "When you want to change something in FPC, you will probably need to repeat several commands many times to rebuild FPC and test your changes. Here is a script to automate this...") |
m (small fix) |
||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | When you want to change something in FPC, you will | + | When you want to change something in FPC, you will have to repeat several commands many times to rebuild FPC and test your changes. Here is a script to automate this process. |
+ | |||
+ | |||
+ | __TOC__ | ||
+ | |||
= FPC rebuilding script for Windows = | = FPC rebuilding script for Windows = | ||
− | Save the following script as | + | Save the following script as '''rebuild-trunk.bat'''. Tested on Windows 10 x64, FPC 3.3.1 with 3.2.2 bootstrap, and 32 bit FPCUPDELUXE 1.8.2u. |
<syntaxhighlight lang="dos"> | <syntaxhighlight lang="dos"> | ||
@echo off | @echo off | ||
− | echo ******************************************************************* | + | echo *************************************************************************** |
− | echo * | + | echo * * |
− | echo * TRUNK REBUILDER 1.0 | + | echo * TRUNK REBUILDER 1.0 * |
− | echo * by Zeljko Avramovic (c) 2021 | + | echo * by Zeljko Avramovic (c) 2021 * |
− | echo * | + | echo * * |
− | echo * used for easy FPC RTL changes recompilation automation | + | echo * used for easy FPC RTL changes recompilation automation * |
− | echo * | + | echo * * |
− | echo * 1. Download FPC and LAZ trunks with FPCUPDELUXE | + | echo * 1. Download FPC and LAZ trunks with FPCUPDELUXE * |
− | echo * 2. Set FPCUPDELUXEDIR and | + | echo * 2. Set FPCUPDELUXEDIR, BOOTSTRAPDIR and THREADS variables in BAT file * |
− | echo * 3. Change RTL or any other FPC source files | + | echo * 3. Change RTL or any other FPC source files * |
− | echo * 4. Run this BAT file to rebuild FPC | + | echo * 4. Run this BAT file to rebuild FPC * |
− | echo * 5. Rebuild Lazarus if needed (only if your changes affect it) | + | echo * 5. Rebuild Lazarus if needed (only if your changes affect it) * |
− | echo * | + | echo * * |
− | echo ******************************************************************* | + | echo *************************************************************************** |
REM adjust these variables according to your system: | REM adjust these variables according to your system: | ||
Line 31: | Line 35: | ||
set STARTTIME=%time% | set STARTTIME=%time% | ||
− | + | cd /d %FPCUPDELUXEDIR%\fpcsrc | |
− | cd | ||
echo. | echo. | ||
Line 48: | Line 51: | ||
echo ***************** | echo ***************** | ||
echo. | echo. | ||
− | %BOOTSTRAPDIR%\make.exe all -j | + | %BOOTSTRAPDIR%\make.exe all -j %THREADS% FPMAKEOPT="-T %THREADS%" |
set ERR=2 (MAKE) | set ERR=2 (MAKE) | ||
if %ERRORLEVEL% neq 0 goto :error | if %ERRORLEVEL% neq 0 goto :error | ||
Line 57: | Line 60: | ||
echo ***************** | echo ***************** | ||
echo. | echo. | ||
− | %BOOTSTRAPDIR%\make.exe install INSTALL_PREFIX=%FPCDIR% -j | + | %BOOTSTRAPDIR%\make.exe install INSTALL_PREFIX=%FPCDIR% -j %THREADS% FPMAKEOPT="-T %THREADS%" |
set ERR=3 (INSTALL) | set ERR=3 (INSTALL) | ||
if %ERRORLEVEL% neq 0 goto :error | if %ERRORLEVEL% neq 0 goto :error | ||
Line 78: | Line 81: | ||
REM beep | REM beep | ||
− | echo � | + | echo �</syntaxhighlight> |
− | </syntaxhighlight> | ||
= FPC rebuilding script for Linux = | = FPC rebuilding script for Linux = | ||
T.B.D. | T.B.D. |
Latest revision as of 20:32, 29 May 2022
When you want to change something in FPC, you will have to repeat several commands many times to rebuild FPC and test your changes. Here is a script to automate this process.
FPC rebuilding script for Windows
Save the following script as rebuild-trunk.bat. Tested on Windows 10 x64, FPC 3.3.1 with 3.2.2 bootstrap, and 32 bit FPCUPDELUXE 1.8.2u.
@echo off
echo ***************************************************************************
echo * *
echo * TRUNK REBUILDER 1.0 *
echo * by Zeljko Avramovic (c) 2021 *
echo * *
echo * used for easy FPC RTL changes recompilation automation *
echo * *
echo * 1. Download FPC and LAZ trunks with FPCUPDELUXE *
echo * 2. Set FPCUPDELUXEDIR, BOOTSTRAPDIR and THREADS variables in BAT file *
echo * 3. Change RTL or any other FPC source files *
echo * 4. Run this BAT file to rebuild FPC *
echo * 5. Rebuild Lazarus if needed (only if your changes affect it) *
echo * *
echo ***************************************************************************
REM adjust these variables according to your system:
set BOOTSTRAPDIR=c:\Prg\Lazarus\fpc.3.2.2\bin\i386-win32
set FPCUPDELUXEDIR=c:\Prg\Lazarus\TrunkAll
set THREADS=8
set FPCDIR=%FPCUPDELUXEDIR%\fpc
set STARTDIR=%cd%
set STARTTIME=%time%
cd /d %FPCUPDELUXEDIR%\fpcsrc
echo.
echo *****************
echo * 1. CLEAN *
echo *****************
echo.
%BOOTSTRAPDIR%\make.exe distclean -j %THREADS% FPMAKEOPT="-T %THREADS%"
set ERR=1 (CLEAN)
if %ERRORLEVEL% neq 0 goto :error
echo.
echo *****************
echo * 2. MAKE *
echo *****************
echo.
%BOOTSTRAPDIR%\make.exe all -j %THREADS% FPMAKEOPT="-T %THREADS%"
set ERR=2 (MAKE)
if %ERRORLEVEL% neq 0 goto :error
echo.
echo *****************
echo * 3. INSTALL *
echo *****************
echo.
%BOOTSTRAPDIR%\make.exe install INSTALL_PREFIX=%FPCDIR% -j %THREADS% FPMAKEOPT="-T %THREADS%"
set ERR=3 (INSTALL)
if %ERRORLEVEL% neq 0 goto :error
echo.
echo *****************
echo * 4. FINISHED *
echo *****************
echo.
echo %STARTTIME%
echo %TIME%
set ERR=0 (OK)
goto :end
:error
echo {{{ ERROR %ERR% }}}
:end
cd %STARTDIR%
REM beep
echo �
FPC rebuilding script for Linux
T.B.D.