chiark / gitweb /
Add 'uml/rndaddtoentcnt/' from commit '3cef9b224336ac4147aade20738420193e525fc5'
[hippotat.git] / Makefile
1 # Copyright 2020-2021 Ian Jackson and contributors to Otter
2 # SPDX-License-Identifier: GPL-3.0-or-later
3 # There is NO WARRANTY.
4
5 SHELL=/bin/bash
6
7 default: all
8
9 CARGO           ?= cargo
10 TARGET_DIR      ?= target
11
12 SPHINXBUILD     ?= sphinx-build
13
14 ifneq (,$(wildcard ../Cargo.nail))
15
16 NAILING_CARGO ?= nailing-cargo
17 CARGO = $(NAILING_CARGO)
18 BUILD_SUBDIR ?= ../Build
19 TARGET_DIR = $(BUILD_SUBDIR)/$(notdir $(PWD))/target
20 NAILING_CARGO_JUST_RUN ?= $(NAILING_CARGO) --just-run -q ---
21
22 else
23
24 endif # Cargo.nail
25
26 rsrcs = $(shell $(foreach x,$(MAKEFILE_FIND_X),set -$x;)\
27     find -H $1 \( -name Cargo.toml -o -name Cargo.lock -o -name Cargo.lock.example -o -name \*.rs \) )
28 stamp=@mkdir -p stamp; touch $@
29
30 all:    cargo-build doc
31
32 cargo-build: stamp/cargo-build
33
34 stamp/cargo-build: $(call rsrcs,.)
35         $(NAILING_CARGO) build $(CARGO_BUILD_OPTIONS)
36         $(stamp)
37
38 doc:    docs/html/index.html
39         @echo 'Documentation can now be found here:'
40         @echo '  file://$(PWD)/$<'
41
42 docs/html/index.html: docs/conf.py $(wildcard docs/*.md docs/*.rst docs/*.png)
43         $(SPHINXBUILD) -M html docs docs $(SPHINXOPTS)
44
45 clean:
46         rm -rf stamp/* doc/html
47         $(NAILING_CARGO) clean
48
49 .PHONY: cargo-build all doc clean