-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
91 lines (73 loc) · 3.36 KB
/
Makefile
File metadata and controls
91 lines (73 loc) · 3.36 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
.PHONY: help docs docs-serve docs-clean test format check-format clean deps deps-docs deps-scripts benchmark benchmark-compare
DOCSRC = docs
DOCTARGET = $(DOCSRC)/build
SCRIPTSRC = scripts
FORMATTER = $(SCRIPTSRC)/formatter.jl
JULIA ?= julia
JULIAFLAGS ?= --project=.
JULIAFLAGSDOCS ?= --project=$(DOCSRC)
JULIAFLAGSSCRIPTS ?= --project=$(SCRIPTSRC)
# Colors for terminal output
ifdef NO_COLOR
GREEN :=
YELLOW :=
WHITE :=
RESET :=
else
GREEN := $(shell tput -Txterm setaf 2)
YELLOW := $(shell tput -Txterm setaf 3)
WHITE := $(shell tput -Txterm setaf 7)
RESET := $(shell tput -Txterm sgr0)
endif
# Default target
.DEFAULT_GOAL := help
## Show help for each of the Makefile targets
help:
@echo ''
@echo 'PLACEHOLDERNAME_CHANGE_MAKEFILE_LINE_22.jl Makefile ${YELLOW}targets${RESET}:'
@echo ''
@echo '${GREEN}Documentation commands:${RESET}'
@echo ' ${YELLOW}docs${RESET} Build the documentation'
@echo ' ${YELLOW}docs-init${RESET} Install documentation requirements'
@echo ' ${YELLOW}docs-serve${RESET} Serve documentation locally for preview in browser'
@echo ' ${YELLOW}docs-clean${RESET} Clean the documentation build directory'
@echo ''
@echo '${GREEN}Development commands:${RESET}'
@echo ' ${YELLOW}deps${RESET} Install project dependencies'
@echo ' ${YELLOW}deps-docs${RESET} Install documentation dependencies'
@echo ' ${YELLOW}deps-scripts${RESET} Install script dependencies'
@echo ' ${YELLOW}test${RESET} Run project tests'
@echo ' ${YELLOW}format${RESET} Format Julia code'
@echo ' ${YELLOW}check-format${RESET} Check Julia code formatting (does not modify files)'
@echo ' ${YELLOW}clean${RESET} Clean all generated files'
@echo ''
@echo '${GREEN}Help:${RESET}'
@echo ' ${YELLOW}help${RESET} Show this help message'
@echo ''
@echo '${GREEN}Environment variables:${RESET}'
@echo ' ${YELLOW}NO_COLOR${RESET} Set this variable to any value to disable colored output'
@echo ''
## Documentation commands:
docs: deps-docs ## Build the documentation
$(JULIA) $(JULIAFLAGSDOCS) docs/make.jl
docs-init: deps-docs ## Serve documentation locally for preview in browser
$(JULIA) $(JULIAFLAGSDOCS) -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
docs-serve: deps-docs ## Serve documentation locally for preview in browser
$(JULIA) $(JULIAFLAGSDOCS) -e 'using LiveServer; LiveServer.servedocs(launch_browser=true, port=5678)'
docs-clean: ## Clean the documentation build directory
rm -rf $(DOCTARGET)
## Development commands:
deps: ## Install project dependencies
$(JULIA) $(JULIAFLAGS) -e 'using Pkg; Pkg.instantiate()'
deps-docs: ## Install documentation dependencies
$(JULIA) $(JULIAFLAGSDOCS) -e 'using Pkg; Pkg.develop(path="."); Pkg.instantiate()'
deps-scripts: ## Install script dependencies
$(JULIA) $(JULIAFLAGSSCRIPTS) -e 'using Pkg; Pkg.instantiate()'
test: deps ## Run project tests
$(JULIA) $(JULIAFLAGS) -e 'using Pkg; Pkg.test(test_args = split("$(test_args)") .|> string)'
format: deps-scripts ## Format Julia code
$(JULIA) $(JULIAFLAGSSCRIPTS) $(FORMATTER) --overwrite
check-format: deps-scripts ## Check Julia code formatting (does not modify files)
$(JULIA) $(JULIAFLAGSSCRIPTS) $(FORMATTER)
clean: docs-clean ## Clean all generated files
rm -rf .julia/compiled