From 86483497e9b32da252265d7658a688d299124fac Mon Sep 17 00:00:00 2001 From: Robert Garrett Date: Thu, 6 Nov 2025 14:18:18 -0600 Subject: [PATCH] Add an install target --- Makefile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f4f1d4d0..e99f015a 100644 --- a/Makefile +++ b/Makefile @@ -7,10 +7,13 @@ CARGO_TARGET := wasm32-unknown-unknown CARGO_PROFILE := wasm-release +# Override DESTDIR to set a custom install path (such as your web root) +DESTDIR ?= . + SRC_DIR = ./src SRCS := $(wildcard $(SRC_DIR)/**) -.PHONY: clean full-clean tarball tarball-standalone web web-standalone +.PHONY: clean full-clean install tarball tarball-standalone web web-standalone # "Standalone" version # (i.e., it includes an index.html so it can be placed on a server as-is) @@ -59,3 +62,11 @@ clean: # this, I guess. full-clean: clean cargo 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 $(DESTDIR)/ + install -m0644 out/boids.html $(DESTDIR)/