-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (35 loc) · 1.71 KB
/
Copy pathMakefile
File metadata and controls
48 lines (35 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Convenience wrapper around the npm/sync steps for the docs site.
#
# The reference and hardware-target docs (src/docs-guides/references/,
# the generated targets data) are generated, gitignored, and produced by
# the sync scripts. `docusaurus start` does NOT run those syncs, so a bare
# `npm start` fails on the missing sidebar ids. `make dev` runs the sync
# first, then starts the server, so it boots clean every time.
#
# Both `start` and `serve` bind to the LAN and print a QR code once the site is
# up, so a phone on the same Wi-Fi can scan it. See src/scripts/dev-server.js.
SRC := src
NPM := npm --prefix $(SRC)
.DEFAULT_GOAL := all
.PHONY: all help install sync thumbs dev start build serve clean
all: build serve ## Build, then serve it at http://localhost:3000 (bare `make`)
help: ## Show the available targets
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN{FS = ":.*?## "}{printf " make %-9s %s\n", $$1, $$2}'
install: ## Install dependencies (root + src via postinstall)
npm install
sync: ## Generate the reference + hardware-target docs
$(NPM) run sync-references
$(NPM) run sync-targets
thumbs: ## Regenerate the dithered Field Notes thumbnails (fetches src/.tools/didder)
./scripts/thumbnails.sh
dev: sync start ## Sync generated docs, then start the dev server (localhost + LAN QR)
start: ## Start the dev server without re-syncing (fast re-run once synced)
$(NPM) run start
build: ## Full production build (runs the syncs, then docusaurus build)
$(NPM) run build
serve: ## Serve the last production build (localhost + LAN QR)
$(NPM) run serve
clean: ## Clear the Docusaurus cache and the generated docs
$(NPM) run clear
rm -rf $(SRC)/docs-guides/references $(SRC)/.cache-references