-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (25 loc) · 1.33 KB
/
Makefile
File metadata and controls
36 lines (25 loc) · 1.33 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
# Makefile for website project
.PHONY: all test cover lint format loc build release clean help
all: lint format test release ## Lint, format, test, then release build
test: ## Run the full test suite (recursive, picks up t/integration/)
prove -rl t/
build: ## Run a plain site build (skips tests; needs only Perl deps)
perl bin/rebuild --notest
release: ## Run a release build with search index (needs tinysearch + wasm-pack)
perl bin/rebuild --release --notest
cover: ## Generate HTML coverage report (one-shot)
cover -test +ignore_re '^t/'
cover -report html -outputdir coverage-report +ignore_re '^t/'
lint: ## Run perlcritic on lib/ and bin/
perlcritic lib bin
format: ## Format Perl source with perltidy (bin/ is filtered to files with a Perl shebang so bash scripts like bin/release are left alone)
find lib -name '*.pm' ! -name '*.bak' -print0 | xargs -0 perltidy --profile=.perltidyrc -b
find bin -type f ! -name '*.bak' -exec grep --null -lE '^#!.*perl' {} + | xargs -0 perltidy --profile=.perltidyrc -b
find lib bin -name '*.bak' -delete
loc: ## Count lines of our own code (lib/, bin/, t/)
cloc lib bin t
clean: ## Remove coverage database and report
cover -delete
rm -rf coverage-report/
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " %-10s %s\n", $$1, $$2}'