Patch Makefile to have a var for web root

This commit is contained in:
2025-11-19 13:09:51 -06:00
parent c8cf70bd52
commit a5734b0174
2 changed files with 36 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
From: Robert Garrett <robertgarrett404@gmail.com>
Date: Wed, 19 Nov 2025 12:49:33 -0600
Subject: Patch Makefile to have a var for web root
---
Makefile | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
index 742d029..8935b7e 100644
--- a/Makefile
+++ b/Makefile
@@ -7,8 +7,9 @@
CARGO_TARGET := wasm32-unknown-unknown
CARGO_PROFILE := wasm-release
-# Override DESTDIR to set a custom install path (such as your web root)
+# Actually, this is so Debian can install the program into it's "build home"
DESTDIR ?= .
+WEBROOT ?= boids # THIS is the web root
SRC_DIR = ./src
SRCS := $(wildcard $(SRC_DIR)/**)
@@ -67,7 +68,7 @@ full-clean: clean
# Installation goal. It's meant to be a helper utility for moving the built
# output into the web root. Only supports the "bundle-able" mode.
install: web
- install -dm0755 $(DESTDIR)
- install -m0644 out/boids.js $(DESTDIR)/
- install -m0644 out/boids_bg.wasm.gz $(DESTDIR)/
- install -m0644 out/boids.html $(DESTDIR)/
+ install -dm0755 $(DESTDIR)/$(WEBROOT)
+ install -m0644 out/boids.js $(DESTDIR)/$(WEBROOT)/
+ install -m0644 out/boids_bg.wasm.gz $(DESTDIR)/$(WEBROOT)/
+ install -m0644 out/boids.html $(DESTDIR)/$(WEBROOT)/

View File

@@ -1,3 +1,4 @@
0001-Alter-blake3-to-emit-Built-Using-info.patch
0002-Use-pure-Rust-implementation-of-Blake3-parts.patch
0003-Use-mini-as-release-profile.patch
0004-Patch-Makefile-to-have-a-var-for-web-root.patch