hyperpom 0.1.2

AArch64 fuzzing library based on the Apple Silicon hypervisor
Documentation
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"

KEYCHAIN := $(CERT_KEYCHAIN)

build-debug:
	$(CARGO) fmt
	$(CARGO) build
	$(CODESIGN) --entitlements entitlements.xml -f -s "$(KEYCHAIN)" "$(TARGET_DEBUG)"

build-release:
	$(CARGO) fmt
	$(CARGO) build --release
	$(CODESIGN) --entitlements entitlements.xml -f -s "$(KEYCHAIN)" "$(TARGET_RELEASE)"

build-test:
	$(CARGO) test --no-run
	$(CODESIGN) --entitlements entitlements.xml -f -s "$(KEYCHAIN)" \
		$(shell $(CARGO) test --no-run --message-format=json | \
			jq -r "select(.profile.test == true) | .filenames[]")

build-test-release:
	$(CARGO) test --no-run --release
	$(CODESIGN) --entitlements entitlements.xml -f -s "$(KEYCHAIN)" \
		$(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 clean-target
	$(CARGO) clean