forked from google/osv-scalibr
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (29 loc) · 1.06 KB
/
Makefile
File metadata and controls
38 lines (29 loc) · 1.06 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
export PATH := $(PATH):$(shell go env GOPATH)/bin
scalibr:
# CGO is required for certain dependencies such as
# go-sqlite3 used by the RPM extractor.
CGO_ENABLED=1 go build binary/scalibr/scalibr.go
lint:
go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.10.1 run ./...
lint-plugger:
go run linter/plugger/main.go \
-interface github.com/google/osv-scalibr/plugin.Plugin \
-interface github.com/google/osv-scalibr/veles.Validator \
-interface github.com/google/osv-scalibr/veles.Detector \
./...
test:
CGO_ENABLED=1 go test ./...
test_bench:
# add `-benchmem -cpuprofile=cpu.prof -memprofile=mem.prof` to extract cpu and memory profiling
# then check check pprof with `go tool pprof -http=:8080 cpu.prof`
CGO_ENABLED=1 go test github.com/google/osv-scalibr/veles/secrets/common/ntuple -bench=BenchmarkDetector
protos:
ifeq ($(OS),Windows_NT)
powershell.exe -exec bypass -File .\build_protos.ps1
else
./build_protos.sh
endif
scalibr-static:
CGO_ENABLED=1 go build -ldflags="-extldflags=-static" binary/scalibr/scalibr.go
clean:
rm -f scalibr