Allow overriding npm binary in Makefile

This commit is contained in:
cyqsimon
2026-02-12 17:57:09 +08:00
parent a03a37feb1
commit bc08819525

View File

@@ -1,4 +1,5 @@
MAKEFLAGS := --jobs=1 MAKEFLAGS := --jobs=1
NPM := npm
PYTHON := python3 PYTHON := python3
PIP := pip3 PIP := pip3
VERSION := $(shell git describe --tag) VERSION := $(shell git describe --tag)
@@ -137,7 +138,7 @@ web: web-deps web-build
web-build: web-build:
cd web \ cd web \
&& npm run build \ && $(NPM) run build \
&& mv build/index.html build/app.html \ && mv build/index.html build/app.html \
&& rm -rf ../server/site \ && rm -rf ../server/site \
&& mv build ../server/site \ && mv build ../server/site \
@@ -145,20 +146,20 @@ web-build:
../server/site/config.js ../server/site/config.js
web-deps: web-deps:
cd web && npm install cd web && $(NPM) install
# If this fails for .svg files, optimize them with svgo # If this fails for .svg files, optimize them with svgo
web-deps-update: web-deps-update:
cd web && npm update cd web && $(NPM) update
web-fmt: web-fmt:
cd web && npm run format cd web && $(NPM) run format
web-fmt-check: web-fmt-check:
cd web && npm run format:check cd web && $(NPM) run format:check
web-lint: web-lint:
cd web && npm run lint cd web && $(NPM) run lint
# Main server/client build # Main server/client build