File: Makefile

package info (click to toggle)
golang-github-pjbgf-sha1cd 0.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,576 kB
  • sloc: ansic: 2,188; asm: 1,527; makefile: 28
file content (40 lines) | stat: -rw-r--r-- 853 bytes parent folder | download
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
FUZZ_TIME ?= 1m

export CGO_ENABLED := 1

.PHONY: test
test:
	go test ./...

.PHONY: bench
bench:
	go test -benchmem -run=^$$ -bench ^Benchmark ./...

.PHONY: fuzz
fuzz:
	go test -tags gofuzz -fuzz=. -fuzztime=$(FUZZ_TIME) ./test/

# Cross build project in arm/v7.
build-arm:
	docker build -t sha1cd-arm -f Dockerfile.arm .
	docker run --rm sha1cd-arm

# Cross build project in arm64.
build-arm64:
	docker build -t sha1cd-arm64 -f Dockerfile.arm64 .
	docker run --rm sha1cd-arm64

# Build with cgo disabled.
build-nocgo:
	CGO_ENABLED=0 go build ./cgo

# Run cross-compilation to assure supported architectures.
cross-build: build-arm build-arm64 build-nocgo

generate:
	go run sha1cdblock_amd64_asm.go -out sha1cdblock_amd64.s
	sed -i 's;&\samd64;&\n// +build !noasm,gc,amd64;g' sha1cdblock_amd64.s

verify: generate
	git diff --exit-code
	go vet ./...