-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
66 lines (54 loc) · 1.84 KB
/
Copy pathMakefile
File metadata and controls
66 lines (54 loc) · 1.84 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Paths
SOURCE_FILE = source/main.ptx
VERBOSITY = DEBUG
# Targets
.PHONY: help setup upgrade clean all web pdf view
# Local environment set up
setup:
pip install -r requirements.txt
# clean: Clean up generated/cached files
clean:
# Clean up any generated files
rm -rf .cache
rm -rf generated-assets
rm -rf output
rm -rf logs
# Default target: build the pdf and web version and display local
all: pdf web view
# Build the web version of the project
web:
pretext --verbosity=$(VERBOSITY) build web --clean --generate --input=$(SOURCE_FILE)
# Build deployable web version of the project
deploy:
pretext --verbosity=$(VERBOSITY) build web --clean --generate --deploys --input=$(SOURCE_FILE)
# Stage the deployable web version of the project
stage:
pretext --verbosity=$(VERBOSITY) deploy --stage-only
# Generate the PDF version of the project
pdf:
pretext --verbosity=$(VERBOSITY) build print --clean --generate --input=$(SOURCE_FILE)
# View the project in a web browser
view:
pretext view
# upgrade pretext to latest version
upgrade:
pretext upgrade
pretext --version
# Display help dynamically
help:
@clear
@echo "Available commands:"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " %-15s %s\n", $$1, $$2}'
@echo
@echo "Default target: make all"
# Add comments for dynamic help
setup: ## set up local environment
clean: ## Clean up generated/cached files
all: pdf web view ## Build the web version (default target)
web: ## Build the web version of the project
deploy: ## Build deployable web version of the project
stage: ## Stage the deployable web version
view: ## View the project in a web browser
pdf: ## Generate the PDF version of the project
upgrade: ## Upgrade PRETEXT to latest version
help: ## Display current help