-
Notifications
You must be signed in to change notification settings - Fork 155
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (34 loc) · 980 Bytes
/
Copy pathMakefile
File metadata and controls
52 lines (34 loc) · 980 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# controlled leading whitespace, per the GNU make manual
nullstring :=
space := $(nullstring) # end of the line
ifdef RELEASE
cargo_flags = $(space)--offline --locked --release
endif
ifdef TOOLCHAIN
cargo_toolchain = $(space)+$(TOOLCHAIN)
endif
all: postbuild
fmt: cargo-fmt cpp-fmt FORCE
build: FORCE
cargo$(cargo_toolchain) build$(cargo_flags)
cargo-fmt: FORCE
cargo fmt
cargo-test: FORCE
cargo$(cargo_toolchain) test$(cargo_flags) --all-features
cargo-clean: FORCE
cargo clean
cpp-fmt: FORCE
find src -name "*.cpp" -o -name "*.h" | xargs clang-format -i
postbuild: build FORCE
cd postbuild && $(MAKE) -f Makefile
postbuild-install: FORCE
cd postbuild && $(MAKE) -f Makefile install
postbuild-clean: FORCE
cd postbuild && $(MAKE) -f Makefile clean
postbuild-distclean: FORCE
cd postbuild && $(MAKE) -f Makefile distclean
check: cargo-test
install: postbuild-install
clean: cargo-clean postbuild-clean
distclean: cargo-clean postbuild-distclean
FORCE: