1 # Copyright 2020-2021 Ian Jackson and contributors to Otter
2 # SPDX-License-Identifier: GPL-3.0-or-later
3 # There is NO WARRANTY.
12 SPHINXBUILD ?= sphinx-build
16 ifneq (,$(wildcard ../Cargo.nail))
18 NAILING_CARGO ?= nailing-cargo
19 CARGO = $(NAILING_CARGO)
20 BUILD_SUBDIR ?= ../Build
21 TARGET_DIR = $(BUILD_SUBDIR)/$(notdir $(PWD))/target
22 NAILING_CARGO_JUST_RUN ?= $(NAILING_CARGO) --just-run -q ---
28 rsrcs = $(shell $(foreach x,$(MAKEFILE_FIND_X),set -$x;)\
29 find -H $1 \( -name Cargo.toml -o -name Cargo.lock -o -name Cargo.lock.example -o -name \*.rs \) )
30 stamp=@mkdir -p stamp; touch $@
34 check: all rndaddtoentcnt-build
36 cargo-build: stamp/cargo-build
38 stamp/cargo-build: $(call rsrcs,.)
39 $(NAILING_CARGO) build $(CARGO_BUILD_OPTIONS)
42 doc: docs/html/index.html
43 @echo 'Documentation can now be found here:'
44 @echo ' file://$(PWD)/$<'
46 docs/html/index.html: docs/conf.py $(wildcard docs/*.md docs/*.rst docs/*.png)
47 $(SPHINXBUILD) -M html docs docs $(SPHINXOPTS)
49 rndaddtoentcnt-build: uml/rndaddtoentcnt/rndaddtoentcnt
52 rm -rf stamp/* doc/html
53 $(NAILING_CARGO) clean
55 .PHONY: cargo-build rndaddtoentcnt-build all doc clean