Mercurial > repos > public > sbplib_julia
comparison Makefile @ 844:ee0404433fc3 feature/setup_documenter
Add a opendocs target
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 14 Jan 2022 11:33:25 +0100 |
parents | f4e67a74f923 |
children | b4f542b4f2e4 |
comparison
equal
deleted
inserted
replaced
843:f4e67a74f923 | 844:ee0404433fc3 |
---|---|
1 JULIA=julia --startup-file=no | 1 JULIA_DEFAULT=julia --startup-file=no |
2 JULIA?=$(JULIA_DEFAULT) | |
3 | |
4 # Set the default browser | |
5 WHICH_XDG_OPEN=$(shell which xdg-open) | |
6 WHICH_OPEN=$(shell which open) | |
7 BROWSER_DEFAULT = $(if $(WHICH_XDG_OPEN), xdg-open) | |
8 BROWSER_DEFAULT := $(if $(BROWSER_DEFAULT), $(BROWSER_DEFAULT), open) | |
9 BROWSER?=$(BROWSER_DEFAULT) | |
2 | 10 |
3 help: | 11 help: |
4 @echo 'Targets:' | 12 @echo 'Targets:' |
5 @echo ' help - Show this help.' | 13 @echo ' help - Show this help.' |
6 @echo ' docs - Generate docs for webserver deployment.' | 14 @echo ' docs - Generate docs for webserver deployment.' |
7 @echo ' localdocs - Generate docs for local viewing.' | 15 @echo ' localdocs - Generate docs for local viewing.' |
16 @echo ' opendocs - Open documentation in the browser.' | |
8 @echo '' | 17 @echo '' |
9 @echo 'Variables:' | 18 @echo 'Variables:' |
10 @echo ' JULIA - Controls which command is used to run julia' | 19 @echo ' JULIA - Controls which command is used to run julia' |
20 @echo ' Default $(JULIA_DEFAULT)' | |
21 @echo ' BROWSER - Sets the command for how to open html files' | |
22 @echo ' Default: xdg-open if it exists otherwise open' | |
11 @echo '' | 23 @echo '' |
12 @echo 'Variables can be set on the commandline using the -e flag for make, e.g.' | 24 @echo 'Variables can be set on the commandline using the -e flag for make, e.g.' |
13 @echo ' make localdocs -e JULIA=path/to/julia' | 25 @echo ' make localdocs -e JULIA=path/to/julia' |
26 @echo 'or as shell environment variables.' | |
14 | 27 |
15 docs: | 28 docs: |
16 $(JULIA) --project=docs docs/make.jl --prettyurls | 29 $(JULIA) --project=docs docs/make.jl --prettyurls |
17 | 30 |
18 localdocs: | 31 localdocs: |
19 $(JULIA) --project=docs docs/make.jl | 32 $(JULIA) --project=docs docs/make.jl |
20 | 33 |
34 opendocs: | |
35 $(BROWSER) docs/build/index.html | |
36 | |
21 clean: | 37 clean: |
22 rm -r docs/build | 38 rm -r docs/build |
23 | 39 |
24 .PHONY: help docs docs-local clean | 40 .PHONY: help docs localdocs opendocs clean |
41 | |
42 # TODO: | |
43 # Make a real target for docs/build | |
44 # Possibly store the local and nonlocal in different build folders |