Debian Codegraph @

Makefile

raw
1 FUZZ_TIME ?= 1m
2
3 export CGO_ENABLED := 1
4
5 .PHONY: test
6 test:
7 go test ./...
8
9 .PHONY: bench
10 bench:
11 go test -benchmem -run=^$$ -bench ^Benchmark ./...
12
13 .PHONY: fuzz
14 fuzz:
15 go test -tags gofuzz -fuzz=. -fuzztime=$(FUZZ_TIME) ./test/
16
17 # Cross build project in arm/v7.
18 build-arm:
19 docker build -t sha1cd-arm -f Dockerfile.arm .
20 docker run --rm sha1cd-arm
21
22 # Cross build project in arm64.
23 build-arm64:
24 docker build -t sha1cd-arm64 -f Dockerfile.arm64 .
25 docker run --rm sha1cd-arm64
26
27 # Build with cgo disabled.
28 build-nocgo:
29 CGO_ENABLED=0 go build ./cgo
30
31 # Run cross-compilation to assure supported architectures.
32 cross-build: build-arm build-arm64 build-nocgo
33
34 generate:
35 go run sha1cdblock_amd64_asm.go -out sha1cdblock_amd64.s
36 sed -i 's;&\samd64;&\n// +build !noasm,gc,amd64;g' sha1cdblock_amd64.s
37
38 verify: generate
39 git diff --exit-code
40 go vet ./...