-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathBOOTSTRAP.txt
More file actions
93 lines (60 loc) · 2.4 KB
/
BOOTSTRAP.txt
File metadata and controls
93 lines (60 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
PasBuild Bootstrap Instructions
================================
PasBuild is a self-hosting build tool, meaning it can build itself once
bootstrapped. This file contains instructions for the initial compilation
before PasBuild can be used to build itself.
Prerequisites
-------------
- Free Pascal Compiler (FPC) 3.2.2 or later installed and available in PATH
- Verify installation: fpc -iV
Bootstrap Steps
---------------
1. Create the output directories:
Linux/macOS/FreeBSD/Unix:
mkdir -p target/units
Windows:
mkdir target\units
2. Process resources (copy and filter version.inc):
Linux/macOS/FreeBSD/Unix:
mkdir -p target
sed 's/\${project.version}/1.0.0/g' src/main/resources/version.inc > target/version.inc
Windows (PowerShell):
mkdir target
(Get-Content src\main\resources\version.inc) -replace '\$\{project\.version\}', '1.0.0' | Set-Content target\version.inc
Windows (Command Prompt - manual):
mkdir target
echo '1.0.0' > target\version.inc
3. Compile PasBuild using FPC directly:
Linux/macOS/FreeBSD/Unix:
fpc -Mobjfpc -O1 -FEtarget -FUtarget/units -Fitarget -Fusrc/main/pascal src/main/pascal/PasBuild.pas
Windows:
fpc -Mobjfpc -O1 -FEtarget -FUtarget\units -Fitarget -Fusrc\main\pascal src\main\pascal\PasBuild.pas
4. Verify the build:
Linux/macOS/FreeBSD/Unix:
./target/PasBuild --version
Windows:
target\PasBuild.exe --version
5. Once bootstrapped, you can use PasBuild to build itself:
Linux/macOS/FreeBSD/Unix:
./target/PasBuild compile
Windows:
target\PasBuild.exe compile
Troubleshooting
---------------
- If you get "fpc: command not found", ensure FPC is installed and in your PATH
- If compilation fails, check that you're in the project root directory
- The output executable will be in the target/ directory
- Unit files (.ppu, .o) will be in target/units/
Clean Build
-----------
To clean and rebuild from scratch:
Linux/macOS/FreeBSD/Unix:
rm -rf target
mkdir -p target/units
sed 's/\${project.version}/1.0.0/g' src/main/resources/version.inc > target/version.inc
fpc -Mobjfpc -O1 -FEtarget -FUtarget/units -Fitarget -Fusrc/main/pascal src/main/pascal/PasBuild.pas
Windows:
rmdir /s /q target
mkdir target\units
echo '1.0.0' > target\version.inc
fpc -Mobjfpc -O1 -FEtarget -FUtarget\units -Fitarget -Fusrc\main\pascal src\main\pascal\PasBuild.pas