-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (36 loc) · 1.2 KB
/
Makefile
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
# Paths
SOURCE_FILE = source/manuscript.ptx
# Targets
.PHONY: setup update all web view pdf clean rebuild help
# Local environment set up
setup:
pip install -r requirements.txt
# Default target: build the pdf and web version and display local
all: pdf web view
# Build the web version of the project
web:
pretext build web --clean --generate --input=$(SOURCE_FILE)
# Generate the PDF version of the project
pdf:
pretext build print --clean --generate --input=$(SOURCE_FILE)
# View the project in a web browser
view:
pretext view
# upgrade pretext to latest version
update:
pretext upgrade
# 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
all: pdf web view ## Build the web version (default target)
web: ## Build the web version of the project
view: ## View the project in a web browser
pdf: ## Generate the PDF version of the project
update: ## Upgrade PRETEXT to latest version
help: ## Display current help