How to package and deploy the FORGE toolchain for testing or distribution outside the development environment.
To deploy FORGE, you need exactly 4 items:
| Item | Description |
|---|---|
forge |
The compiled binary |
runtime/ |
C runtime library (needed by forge build) |
vendor/ |
Vendored GUI libraries (only for GUI=1 builds) |
examples/ |
Example programs (optional, for testing) |
# Standard build (no GUI)
make clean
make
# OR — with GUI support
make clean
make GUI=1For a more optimized binary:
make clean
make release # Without GUI
make release GUI=1 # With GUImkdir forge-dist# The binary (REQUIRED)
cp forge forge-dist/
# The runtime library (REQUIRED for `forge build`)
cp -r runtime/ forge-dist/runtime/
# Vendored GUI libraries (REQUIRED only if built with GUI=1)
cp -r vendor/ forge-dist/vendor/
# Examples (OPTIONAL — good for testing)
cp -r examples/ forge-dist/examples/
# User documentation (OPTIONAL)
cp -r user_docs/ forge-dist/user_docs/cd forge-dist
# Test interpreter
./forge run examples/gui_hello.fg # GUI test (if GUI=1 build)
# Test a simple console program
echo 'proc main() -> void:
print("Hello from deployed FORGE!")
' > /tmp/test_deploy.fg
./forge run /tmp/test_deploy.fg
# Test compiler (requires gcc on the target machine)
./forge build /tmp/test_deploy.fg -o /tmp/test_deploy
/tmp/test_deployHere is exactly what should be in your distribution folder:
forge-dist/
├── forge # The toolchain binary (~1.2 MB)
├── runtime/
│ ├── forge_runtime.h # Runtime header
│ ├── forge_runtime.c # Runtime implementation
│ ├── forge_gui.h # GUI module header
│ └── forge_gui.c # GUI module implementation
├── vendor/ # (only for GUI builds)
│ ├── README.md
│ └── raylib/
│ ├── include/
│ │ ├── raylib.h
│ │ ├── raymath.h
│ │ ├── rlgl.h
│ │ ├── rcamera.h
│ │ └── raygui.h
│ └── lib/
│ └── libraylib.a # Pre-built static library
├── examples/ # (optional)
│ ├── gui_hello.fg
│ └── nmea_terminal.fg
└── user_docs/ # (optional)
├── FORGE_Usage_Guide.md
├── FORGE_GUI_Library_Guide.md
├── quick_reference.md
└── ...
The main toolchain. Handles run, build, check, fmt, emit, and repl commands.
This is the only file needed to interpret .fg programs (forge run).
Contains the C runtime library source code. This is needed when using
forge build to compile FORGE programs to native executables, because the
generated C code #includes these headers and links against the runtime.
Without this folder: forge run still works, but forge build will fail.
Contains vendored copies of raylib (static library + headers) and raygui
(header). Only needed if the forge binary was compiled with GUI=1.
Without this folder (non-GUI build): Everything works normally.
| Requirement | Details |
|---|---|
| Linux x86_64 | The binary is compiled for this architecture |
| No other dependencies | Self-contained for non-GUI programs |
| Requirement | Details |
|---|---|
| Linux x86_64 | Binary architecture |
| OpenGL | Usually pre-installed (libGL.so) |
| X11 | Usually pre-installed (libX11.so) |
| pthreads | Part of glibc |
| Requirement | Details |
|---|---|
| GCC or Clang | Used to compile generated C code |
runtime/ folder |
Must be accessible (beside the binary or via --runtime flag) |
Copy this to create a ready-to-distribute tarball:
# From the FORGE project directory, after building:
mkdir -p forge-dist && \
cp forge forge-dist/ && \
cp -r runtime/ forge-dist/runtime/ && \
cp -r vendor/ forge-dist/vendor/ && \
cp -r examples/ forge-dist/examples/ && \
cp -r user_docs/ forge-dist/user_docs/ && \
tar -czf forge-dist.tar.gz forge-dist/ && \
echo "Created forge-dist.tar.gz ($(du -sh forge-dist.tar.gz | cut -f1))"On the target machine:
tar -xzf forge-dist.tar.gz
cd forge-dist
./forge run examples/gui_hello.fgThe current vendored libraylib.a is built for Linux x86_64. To deploy on
a different platform, you would need to rebuild raylib for that target. See
vendor/README.md for instructions.
FORGE Deployment Guide v0.1 — Fragillidae Software