.PHONY: all
all: dependencies compile ;
.PHONY: dependencies
dependencies: node_modules assets ;
.PHONY: compile
compile: static well-known ;

node_modules: package.json package-lock.json
	npm install --cache .npm --prefer-offline
package-lock.json: package.json
	npm install --cache .npm --prefer-offline
static: node_modules assets esbuild.config.mjs jsconfig.json postcss.config.js
	echo "$${PROJECT_DIR}"
	npm run build
well-known: static ;

assets: assets/favicons assets/icons;
assets/favicons:
	./utils/faviconize.pl assets/favicon.svg long assets/favicons
assets/icons: node_modules assets/icons-src/fontawesome.json
	./utils/renamer.pl node_modules/@fortawesome/fontawesome-free/svgs/solid assets/icons-src/fontawesome.json assets/icons/fradrive
	./utils/renamer.pl node_modules/@fortawesome/fontawesome-free/svgs/regular assets/icons-src/fontawesome.json assets/icons/fradrive
	-cp assets/icons-src/*.svg assets/icons/fradrive