-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
74 lines (59 loc) · 2.4 KB
/
Makefile
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
.PHONY: test ma-release-build build-release clean clean-build clean-test-data update test-domain test-io test-kernel test-tfw install
PWD := $(shell pwd)
BUILD_DIR := $(dir $(PWD))builds
PROJECT := ''
OS_ARCH_TARGET := ''
ma-release-build:
@echo "\n\033[1;96m Starting the Multi-Architecture Process \033[0m\n"
make clean-build
@echo "\n\033[1;96m Executing the Cargo Build process. \033[0m\n"
cargo build --release --package $(PROJECT) --target $(OS_ARCH_TARGET)
@echo "\n\033[1;96m Build COMPLETE! \033[0m\n"
build-release:
@echo "\n\033[1;96m Starting the Release Build \033[0m\n"
make clean-build
mkdir -p $(BUILD_DIR)
@echo "\n\033[1;96m Executing the Cargo Release Build process. \033[0m\n"
cargo build --release --target-dir $(BUILD_DIR)
@echo "\n\033[1;96m Release Build COMPLETE! \033[0m\n"
install:
@echo "\n\033[1;96m Copying the NAPE binary to /usr/local/bin \033[0m\n"
cp ../builds/release/nape /usr/local/bin
@echo "\n\033[1;96m Copying COMPLETE! \033[0m\n"
clean:
@echo "\n\033[1;96m Cleaning all target data \033[0m\n"
cargo clean
make clean-test-data
clean-build:
@echo "\n\033[1;96m Removing existing files from the build directory. \033[0m\n"
rm -rf $(BUILD_DIR)/*
@echo "\n\033[1;96m All files removed from the build directory. \033[0m\n"
clean-test-data:
@echo "\n\033[1;96m Deleting all previous testing outputs \033[0m\n"
find . -type f -name "*.profraw" -exec rm -f {} +
find . -type f -name "*.profdata" -exec rm -f {} +
update:
@echo "\n\033[1;96m Updating Rust Dependencies \033[0m\n"
cargo update
test:
make clean-test-data
@echo "\n\033[1;96m Running Tests \033[0m\n"
RUSTFLAGS="-A dead_code -A unused_imports -C instrument-coverage" cargo test -- --test-threads=8
test-nape-cli:
@echo "\n\033[1;96m Running Tests - NAPE Collection CLI Only \033[0m\n"
RUSTFLAGS="-A dead_code -A unused_imports" cargo test -p nape_cli --lib -- --test-threads=8
test-domain:
@echo "\n\033[1;96m Running Tests - Domain Package Only \033[0m\n"
RUSTFLAGS="-A dead_code -A unused_imports" cargo test -p nape_domain --lib -- --test-threads=8
test-kernel:
@echo "\n\033[1;96m Running Tests - Kernel Package Only \033[0m\n"
RUSTFLAGS="-A dead_code -A unused_imports" cargo test -p nape_kernel --lib -- --test-threads=8
# Serve rule (generic)
.PHONY: % serve
% serve:
@echo "Serving $(@: serve=)"
$(MAKE) -C $(@: serve=) serve
.PHONY: % fmt
% fmt:
@echo "Serving $(@: fmt=)"
$(MAKE) -C $(@: fmt=) fmt