-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (41 loc) · 1.7 KB
/
Copy pathMakefile
File metadata and controls
52 lines (41 loc) · 1.7 KB
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
.PHONY: build test validate validate-contracts validate-maturity validate-negative-fixtures validate-wallguard-clean-room-synthesis dist release-dry-run clean
BIN := holmes
DIST_DIR := dist
VERSION ?= 0.1.0-dev
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
DATE ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
GOOS ?= $(shell go env GOOS 2>/dev/null || uname -s | tr A-Z a-z)
GOARCH ?= $(shell go env GOARCH 2>/dev/null || uname -m)
DIST_NAME := $(BIN)_$(VERSION)_$(GOOS)_$(GOARCH)
LDFLAGS := -X main.version=$(VERSION) -X main.commit=$(COMMIT) -X main.date=$(DATE)
build:
mkdir -p bin
go build -ldflags "$(LDFLAGS)" -o bin/$(BIN) ./cmd/holmes
test:
go test ./...
validate-maturity:
python3 tools/validate_maturity.py
validate-contracts:
python3 tools/validate_holmes.py
python3 tools/validate_wallguard_clean_room_synthesis.py
validate-wallguard-clean-room-synthesis:
python3 tools/validate_wallguard_clean_room_synthesis.py
validate-negative-fixtures:
python3 tools/run_negative_fixtures.py
validate: build validate-maturity validate-contracts validate-negative-fixtures
bin/$(BIN) --version
bin/$(BIN) doctor
bin/$(BIN) self-test
bin/$(BIN) emit-evidence >/tmp/holmes-evidence.json
bin/$(BIN) analyze examples/sample.txt >/tmp/holmes-analysis.json
bin/$(BIN) search "truth and evidence" >/tmp/holmes-search.json
bin/$(BIN) graph examples/sample.txt >/tmp/holmes-graph.json
bin/$(BIN) govern examples/sample.txt >/tmp/holmes-govern.json
dist: validate
mkdir -p $(DIST_DIR)
cp bin/$(BIN) $(DIST_DIR)/$(DIST_NAME)
(cd $(DIST_DIR) && sha256sum $(DIST_NAME) > $(DIST_NAME).sha256)
release-dry-run: dist
@echo "release dry-run complete: $(DIST_DIR)/$(DIST_NAME)"
clean:
rm -rf bin $(DIST_DIR)