Add debug build and install recipes
- Add build-debug for a faster, unoptimised native build - Add install-debug to install that build to ~/.local/bin - Move the PATH setup into a _path recipe shared by both installs
This commit is contained in:
1 parent
a00c87bf04
commit
f14a1900af
1 file changed
+13
@@ -21,6 +21,19 @@ prove:
|
||||
# Install Orbit to ~/.local/bin and set up its package PATH for Bash.
|
||||
install: build
|
||||
install -Dm755 _build/native/release/build/main/main.exe "$HOME/.local/bin/orbit"
|
||||
@just _path
|
||||
|
||||
# Build without optimisation (much faster to compile than `build`).
|
||||
build-debug:
|
||||
moon build --target native
|
||||
|
||||
# Install the unoptimised build to ~/.local/bin, for trying out a change.
|
||||
install-debug: build-debug
|
||||
install -Dm755 _build/native/debug/build/main/main.exe "$HOME/.local/bin/orbit"
|
||||
@just _path
|
||||
|
||||
# Add Orbit's package bin directory to PATH in ~/.bashrc, once.
|
||||
_path:
|
||||
@line='export PATH="${ORBIT_ROOT:-$HOME/.orbit}/bin:$PATH"'; rc="$HOME/.bashrc"; \
|
||||
if [ ! -f "$rc" ] || ! grep -Fqx -- "$line" "$rc"; then \
|
||||
printf '\n%s\n' "$line" >> "$rc"; \
|
||||
|
||||
Reference in new issue
Block a user