Build system improvements
- build PIE binaries using goreleaser - add snapshot target to Makefile - add -trimpath option to go build
This commit is contained in:
parent
37d3b1e021
commit
7837164e6e
2 changed files with 15 additions and 3 deletions
|
@ -16,6 +16,9 @@ builds:
|
|||
env:
|
||||
- CC=x86_64-linux-gnu-gcc
|
||||
- CXX=x86_64-linux-gnu-g++
|
||||
flags:
|
||||
- -buildmode=pie
|
||||
- -trimpath
|
||||
- id: linux-arm64
|
||||
main: ./cmd/signer
|
||||
binary: cacert-gosigner
|
||||
|
@ -29,6 +32,9 @@ builds:
|
|||
- CC=aarch64-linux-gnu-gcc
|
||||
- CXX=aarch64-linux-gnu-g++
|
||||
- PKG_CONFIG_PATH=/usr/aarch64-linux-gnu/pkgconfig
|
||||
flags:
|
||||
- -buildmode=pie
|
||||
- -trimpath
|
||||
- id: linux-armhf
|
||||
main: ./cmd/signer
|
||||
binary: cacert-gosigner
|
||||
|
@ -42,6 +48,9 @@ builds:
|
|||
- CC=arm-linux-gnueabihf-gcc
|
||||
- CXX=arm-linux-gnueabihf-g++
|
||||
- PKG_CONFIG_PATH=/usr/arm-linux-gnueabihf/pkgconfig
|
||||
flags:
|
||||
- -buildmode=pie
|
||||
- -trimpath
|
||||
archives:
|
||||
- id: cacert-gosigner
|
||||
builds:
|
||||
|
|
9
Makefile
9
Makefile
|
@ -15,12 +15,15 @@ test:
|
|||
go test -race ./...
|
||||
|
||||
clientsim: $(GOFILES)
|
||||
go build -race ./cmd/clientsim
|
||||
go build -race -trimpath ./cmd/clientsim
|
||||
|
||||
signer: $(GOFILES)
|
||||
go build -race -ldflags="-X 'main.date=$(BUILD_TIME)' -X 'main.commit=$(COMMIT)' -X 'main.version=$(VERSION)'" ./cmd/signer
|
||||
go build -race -trimpath -ldflags="-X 'main.date=$(BUILD_TIME)' -X 'main.commit=$(COMMIT)' -X 'main.version=$(VERSION)'" ./cmd/signer
|
||||
|
||||
clean:
|
||||
rm -f signer clientsim pkg/messages/resolver.msgpackgen.go
|
||||
|
||||
.PHONY: test lint all clean
|
||||
snapshot:
|
||||
goreleaser build --rm-dist --snapshot
|
||||
|
||||
.PHONY: test lint all clean snapshot
|
||||
|
|
Loading…
Reference in a new issue