-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
56 lines (42 loc) · 1.34 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
CODESIGN := codesign
CARGO := cargo +nightly
TARGET := hyperpom
TARGET_DEBUG := target/debug/$(TARGET)
TARGET_RELEASE := target/release/$(TARGET)
TMP_DIR := ./tmp
CORPUS_DIR := "$(TMP_DIR)/corpus"
WORK_DIR := "$(TMP_DIR)/work"
ENTITLEMENTS := entitlements.xml
build-debug:
$(CARGO) fmt
$(CARGO) build
build-release:
$(CARGO) fmt
$(CARGO) build --release
build-test:
$(CARGO) test --no-run
$(CODESIGN) --sign - --entitlements "$(ENTITLEMENTS)" --deep --force \
$(shell $(CARGO) test --no-run --message-format=json | \
jq -r "select(.profile.test == true) | .filenames[]")
build-test-release:
$(CARGO) test --no-run --release
$(CODESIGN) --sign - --entitlements "$(ENTITLEMENTS)" --deep --force \
$(shell $(CARGO) test --no-run --release --message-format=json | \
jq -r "select(.profile.test == true) | .filenames[]")
tmp-dirs:
mkdir -p $(CORPUS_DIR)
mkdir -p $(WORK_DIR)
test: clean-dirs tmp-dirs build-test
$(CARGO) test $(filter-out $@,$(MAKECMDGOALS)) -- --nocapture \
--test-threads=1
tests: clean-dirs tmp-dirs build-test
$(CARGO) test --tests -- --nocapture --test-threads=1
tests-release: build-test-release
$(CARGO) test --release --tests -- --nocapture --test-threads=1
tests-threads: build-test
$(CARGO) test --tests -- --nocapture
clean-dirs:
rm -rf $(CORPUS_DIR)
rm -rf $(WORK_DIR)
clean: clean-dirs
$(CARGO) clean