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