#--------------------------------------------------------------
# Start with a clean slate.
rm -Rf FPC_Source/
git clone git@gitlab.com:freepascal.org/fpc/source.git --depth 1 FPC_Source
cd FPC_Source/
#--------------------------------------------------------------
#--------------------------------------------------------------
# Build cross compiler.
make clean OS_TARGET=sinclairql CPU_TARGET=m68k
make crossall OS_TARGET=sinclairql CPU_TARGET=m68k
#-------------------------------------------------------------
#--------------------------------------------------------------
# Install the cross comiler.
make crossinstall OS_TARGET=sinclairql CPU_TARGET=m68k INSTALL_PREFIX=/home/norman/bin
#--------------------------------------------------------------
#--------------------------------------------------------------
# Symlink it to "fpc-ql".
ln -s lib/fpc/n.n.n/ppcross68k fpc-ql
#--------------------------------------------------------------
#--------------------------------------------------------------
# Build RTL with the cross compiler.
make rtl_cleanall OS_TARGET=sinclairql CPU_TARGET=m68k
make rtl_all RELEASE=1 FPC=fpc-ql OS_TARGET=sinclairql CPU_TARGET=m68k
#--------------------------------------------------------------
#--------------------------------------------------------------
# Build the QL units with the cross compiler.
make packages_clean OS_TARGET=sinclairql CPU_TARGET=m68k
make packages RELEASE=1 FPC=fpc-ql OS_TARGET=sinclairql CPU_TARGET=m68k
#--------------------------------------------------------------
#--------------------------------------------------------------
# Do my work here. I've created a new "screen" unit for the QL.
# But even if I do nothing, the problem still occurs.
#--------------------------------------------------------------
#--------------------------------------------------------------
# Build the QL units with the cross compiler - BEFORE updating fpmake.pp.
make packages_clean OS_TARGET=sinclairql CPU_TARGET=m68k
make packages RELEASE=1 FPC=fpc-ql OS_TARGET=sinclairql CPU_TARGET=m68k
#--------------------------------------------------------------
#--------------------------------------------------------------
# Amend packages/qlunits/fpmake.pp
# Here I'm simply touching it, I could amend it to add my unit name to the build.
ls -l packages/qlunits/fpmake.pp
-rw-rw-r-- 1 norman norman 1270 Apr 18 13:45 packages/qlunits/fpmake.pp
touch packages/qlunits/fpmake.pp
ls -l packages/qlunits/fpmake.pp
-rw-rw-r-- 1 norman norman 1270 Apr 18 13:53 packages/qlunits/fpmake.pp
#--------------------------------------------------------------
#--------------------------------------------------------------
# Build the QL units with the cross compiler - AFTER updating fpmake.pp.
make packages_clean OS_TARGET=sinclairql CPU_TARGET=m68k
make packages RELEASE=1 FPC=fpc-ql OS_TARGET=sinclairql CPU_TARGET=m68k
#--------------------------------------------------------------