summaryrefslogtreecommitdiff
path: root/GNUmakefile
diff options
context:
space:
mode:
authorJulien Dessaux2023-02-09 19:23:03 +0100
committerJulien Dessaux2023-02-09 19:23:03 +0100
commit6fe80c9af80c8cdb757d94356ab48d15dc728b76 (patch)
tree15d3c0896651c7ca51c33da7c3918ba70cb837d4 /GNUmakefile
parentUpdated makefile best practices (diff)
downloadjeux-de-mots-6fe80c9af80c8cdb757d94356ab48d15dc728b76.tar.gz
jeux-de-mots-6fe80c9af80c8cdb757d94356ab48d15dc728b76.tar.bz2
jeux-de-mots-6fe80c9af80c8cdb757d94356ab48d15dc728b76.zip
Improved makefile
Diffstat (limited to 'GNUmakefile')
-rw-r--r--GNUmakefile15
1 files changed, 7 insertions, 8 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 315e899..74a2a57 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -6,9 +6,10 @@ SHELL:=bash
.DELETE_ON_ERROR:
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
+.DEFAULT_GOAL := help
.PHONY: check
-check: ## make check # Check syntax of entry points
+check: node_modules ## make check # Check syntax with eslint
eslint main.js fixtures.js tests/
(cd static; eslint index.js)
@@ -16,18 +17,14 @@ check: ## make check # Check syntax of entry points
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
-.PHONY: init
-init: ## make init # initialize project dependencies
- npm install
-
.PHONY: serve
-serve: ## make serve # run a self reloading development web server
+serve: node_modules ## make serve # run a self reloading development web server
rm -f jdm.db sessions.db
NODE_ENV=development node fixtures.js
NODE_ENV=development nodemon main.js
.PHONY: run
-run: ## make run # run a production web server
+run: node_modules ## make run # run a production web server
NODE_ENV=production node main.js
.PHONY: test
@@ -37,4 +34,6 @@ test: check ## make test # run tests
NODE_ENV=test vitest --config .vite.config.ts
@rm -f testjdm.db testsessions.db
-.DEFAULT_GOAL := help
+node_modules: package-lock.json package.json
+ npm install
+ @touch node_modules