chiark / gitweb /
reporter: introduce TooManyWarnings
[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 CFLAGS          += -Wall
15
16 ifneq (,$(wildcard ../Cargo.nail))
17
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 ---
23
24 else
25
26 endif # Cargo.nail
27
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 $@
31
32 all:    cargo-build doc
33
34 check:  all rndaddtoentcnt-build
35
36 cargo-build: stamp/cargo-build
37
38 stamp/cargo-build: $(call rsrcs,.)
39         $(NAILING_CARGO) build $(CARGO_BUILD_OPTIONS)
40         $(stamp)
41
42 doc:    docs/html/index.html
43         @echo 'Documentation can now be found here:'
44         @echo '  file://$(PWD)/$<'
45
46 docs/html/index.html: docs/conf.py $(wildcard docs/*.md docs/*.rst docs/*.png)
47         $(SPHINXBUILD) -M html docs docs $(SPHINXOPTS)
48
49 rndaddtoentcnt-build: uml/rndaddtoentcnt/rndaddtoentcnt
50
51 clean:
52         rm -rf stamp/* doc/html
53         $(NAILING_CARGO) clean
54
55 .PHONY: cargo-build rndaddtoentcnt-build all doc clean