Debian Codegraph @

Makefile

raw symbols SCIP
1 PKG_NAME=$(shell grep name Cargo.toml | head -n 1 | awk -F \" '{print $$2}')
2 DOCS_DEFAULT_MODULE=$(subst -,_,$(PKG_NAME))
3 ifeq (, $(shell which cargo-check 2> /dev/null))
4 DEFAULT_TARGET=build
5 else
6 DEFAULT_TARGET=build
7 endif
8
9 default: $(DEFAULT_TARGET)
10
11 ALL_TARGETS += build $(EXAMPLES) test doc
12 ifneq ($(RELEASE),)
13 $(info RELEASE BUILD: $(PKG_NAME))
14 CARGO_FLAGS += --release
15 else
16 $(info DEBUG BUILD: $(PKG_NAME); use `RELEASE=true make [args]` for release build)
17 endif
18
19 EXAMPLES = $(shell cd examples 2>/dev/null && ls *.rs 2>/dev/null | sed -e 's/.rs$$//g' )
20
21 all: $(ALL_TARGETS)
22
23 .PHONY: run test build doc clean clippy
24 run test build clean:
25 cargo $@ $(CARGO_FLAGS)
26
27 check:
28 $(info Running check; use `make build` to actually build)
29 cargo $@ $(CARGO_FLAGS)
30
31 clippy:
32 cargo build --features clippy
33
34 .PHONY: bench
35 bench:
36 cargo $@ $(filter-out --release,$(CARGO_FLAGS))
37
38 .PHONY: travistest
39 travistest: test
40
41 .PHONY: longtest
42 longtest:
43 @echo "Running longtest. Press Ctrl+C to stop at any time"
44 @sleep 2
45 @i=0; while i=$$((i + 1)) && echo "Iteration $$i" && make test ; do :; done
46
47 .PHONY: $(EXAMPLES)
48 $(EXAMPLES):
49 cargo build --example $@ $(CARGO_FLAGS)
50
51 .PHONY: doc
52 doc: FORCE
53 cargo doc
54
55 .PHONY: publishdoc
56 publishdoc:
57 rm -rf target/doc
58 make doc
59 echo '<meta http-equiv="refresh" content="0;url='${DOCS_DEFAULT_MODULE}'/index.html">' > target/doc/index.html
60 ghp-import -n target/doc
61 git push -f origin gh-pages
62
63 .PHONY: docview
64 docview: doc
65 xdg-open target/doc/$(PKG_NAME)/index.html
66
67 .PHONY: FORCE
68 FORCE: