|
| 1 | +.PHONY: help docs docs-serve docs-clean test format check-format clean deps deps-docs deps-scripts benchmark benchmark-compare |
| 2 | + |
| 3 | + |
| 4 | +DOCSRC = docs |
| 5 | +DOCTARGET = $(DOCSRC)/build |
| 6 | + |
| 7 | +JULIA ?= julia |
| 8 | +JULIAFLAGS ?= --project=. |
| 9 | +JULIAFLAGSDOCS ?= --project=$(DOCSRC) |
| 10 | + |
| 11 | +# Colors for terminal output |
| 12 | +ifdef NO_COLOR |
| 13 | +GREEN := |
| 14 | +YELLOW := |
| 15 | +WHITE := |
| 16 | +RESET := |
| 17 | +else |
| 18 | +GREEN := $(shell tput -Txterm setaf 2) |
| 19 | +YELLOW := $(shell tput -Txterm setaf 3) |
| 20 | +WHITE := $(shell tput -Txterm setaf 7) |
| 21 | +RESET := $(shell tput -Txterm sgr0) |
| 22 | +endif |
| 23 | + |
| 24 | +# Default target |
| 25 | +.DEFAULT_GOAL := help |
| 26 | + |
| 27 | +## Show help for each of the Makefile targets |
| 28 | +help: |
| 29 | + @echo '' |
| 30 | + @echo 'PLACEHOLDERNAME_CHANGE_MAKEFILE_LINE_22.jl Makefile ${YELLOW}targets${RESET}:' |
| 31 | + @echo '' |
| 32 | + @echo '${GREEN}Documentation commands:${RESET}' |
| 33 | + @echo ' ${YELLOW}docs${RESET} Build the documentation' |
| 34 | + @echo ' ${YELLOW}docs-init${RESET} Install documentation requirements' |
| 35 | + @echo ' ${YELLOW}docs-serve${RESET} Serve documentation locally for preview in browser' |
| 36 | + @echo ' ${YELLOW}docs-clean${RESET} Clean the documentation build directory' |
| 37 | + @echo '' |
| 38 | + @echo '${GREEN}Development commands:${RESET}' |
| 39 | + @echo ' ${YELLOW}deps${RESET} Install project dependencies' |
| 40 | + @echo ' ${YELLOW}deps-docs${RESET} Install documentation dependencies' |
| 41 | + @echo ' ${YELLOW}test${RESET} Run project tests' |
| 42 | + @echo ' ${YELLOW}clean${RESET} Clean all generated files' |
| 43 | + @echo '' |
| 44 | + @echo '${GREEN}Help:${RESET}' |
| 45 | + @echo ' ${YELLOW}help${RESET} Show this help message' |
| 46 | + @echo '' |
| 47 | + @echo '${GREEN}Environment variables:${RESET}' |
| 48 | + @echo ' ${YELLOW}NO_COLOR${RESET} Set this variable to any value to disable colored output' |
| 49 | + @echo '' |
| 50 | + |
| 51 | +## Documentation commands: |
| 52 | +docs: deps-docs ## Build the documentation |
| 53 | + $(JULIA) $(JULIAFLAGSDOCS) docs/make.jl |
| 54 | + |
| 55 | +docs-init: deps-docs ## Serve documentation locally for preview in browser |
| 56 | + $(JULIA) $(JULIAFLAGSDOCS) -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' |
| 57 | + |
| 58 | +docs-serve: deps-docs ## Serve documentation locally for preview in browser |
| 59 | + $(JULIA) $(JULIAFLAGSDOCS) -e 'using LiveServer; LiveServer.servedocs(launch_browser=true, port=5678)' |
| 60 | + |
| 61 | +docs-clean: ## Clean the documentation build directory |
| 62 | + rm -rf $(DOCTARGET) |
| 63 | + |
| 64 | +## Development commands: |
| 65 | +deps: ## Install project dependencies |
| 66 | + $(JULIA) $(JULIAFLAGS) -e 'using Pkg; Pkg.instantiate()' |
| 67 | + |
| 68 | +deps-docs: ## Install documentation dependencies |
| 69 | + $(JULIA) $(JULIAFLAGSDOCS) -e 'using Pkg; Pkg.develop(path="."); Pkg.instantiate()' |
| 70 | + |
| 71 | +test: deps ## Run project tests |
| 72 | + $(JULIA) $(JULIAFLAGS) -e 'using Pkg; Pkg.test(test_args = split("$(test_args)") .|> string)' |
| 73 | + |
| 74 | +clean: docs-clean ## Clean all generated files |
| 75 | + rm -rf .julia/compiled |
0 commit comments