use trimpath and buildmode=pie for binaries
This commit is contained in:
+99
-12
@@ -11,26 +11,113 @@ release-dirs:
|
||||
|
||||
# docker specific packaging flags
|
||||
DOCKER_LDFLAGS += -X "$(OCIS_REPO)/ocis-pkg/config/defaults.BaseDataPathType=path" -X "$(OCIS_REPO)/ocis-pkg/config/defaults.BaseDataPathValue=/var/lib/ocis"
|
||||
release-linux-docker-amd64: $(GOX) release-dirs
|
||||
@$(GOX) -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS) $(DOCKER_LDFLAGS)' -os 'linux' -arch 'amd64' -output '$(DIST)/binaries/$(EXECUTABLE)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
|
||||
|
||||
release-linux-docker-arm: $(GOX) release-dirs
|
||||
@$(GOX) -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS) $(DOCKER_LDFLAGS)' -os 'linux' -arch 'arm' -output '$(DIST)/binaries/$(EXECUTABLE)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
|
||||
release-linux-docker-amd64: release-dirs
|
||||
GOOS=linux \
|
||||
GOARCH=amd64 \
|
||||
go build \
|
||||
-tags 'netgo $(TAGS)' \
|
||||
-buildmode=pie \
|
||||
-trimpath \
|
||||
-ldflags '-extldflags "-static" $(LDFLAGS) $(DOCKER_LDFLAGS)' \
|
||||
-o '$(DIST)/binaries/$(EXECUTABLE)-amd64-linux' \
|
||||
./cmd/$(NAME)
|
||||
|
||||
release-linux-docker-arm64: $(GOX) release-dirs
|
||||
@$(GOX) -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS) $(DOCKER_LDFLAGS)' -os 'linux' -arch 'arm64' -output '$(DIST)/binaries/$(EXECUTABLE)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
|
||||
release-linux-docker-arm: release-dirs
|
||||
GOOS=linux \
|
||||
GOARCH=arm \
|
||||
go build \
|
||||
-tags 'netgo $(TAGS)' \
|
||||
-trimpath \
|
||||
-ldflags '-extldflags "-static" $(LDFLAGS) $(DOCKER_LDFLAGS)' \
|
||||
-o '$(DIST)/binaries/$(EXECUTABLE)-arm-linux' \
|
||||
./cmd/$(NAME)
|
||||
|
||||
release-linux-docker-arm64: release-dirs
|
||||
GOOS=linux \
|
||||
GOARCH=arm64 \
|
||||
go build \
|
||||
-tags 'netgo $(TAGS)' \
|
||||
-buildmode=pie \
|
||||
-trimpath \
|
||||
-ldflags '-extldflags "-static" $(LDFLAGS) $(DOCKER_LDFLAGS)' \
|
||||
-o '$(DIST)/binaries/$(EXECUTABLE)-arm64-linux' \
|
||||
./cmd/$(NAME)
|
||||
|
||||
.PHONY: release-linux
|
||||
release-linux: $(GOX) release-dirs
|
||||
@$(GOX) -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -os 'linux' -arch 'amd64 386 arm64 arm' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
|
||||
release-linux: release-dirs
|
||||
GOOS=linux \
|
||||
GOARCH=amd64 \
|
||||
go build \
|
||||
-tags 'netgo $(TAGS)' \
|
||||
-buildmode=pie \
|
||||
-trimpath \
|
||||
-ldflags '-extldflags "-static" $(LDFLAGS)' \
|
||||
-o '$(DIST)/binaries/$(EXECUTABLE)-amd64-linux' \
|
||||
./cmd/$(NAME)
|
||||
|
||||
GOOS=linux \
|
||||
GOARCH=386 \
|
||||
go build \
|
||||
-tags 'netgo $(TAGS)' \
|
||||
-buildmode=pie \
|
||||
-trimpath \
|
||||
-ldflags '-extldflags "-static" $(LDFLAGS)' \
|
||||
-o '$(DIST)/binaries/$(EXECUTABLE)-386-linux' \
|
||||
./cmd/$(NAME)
|
||||
|
||||
GOOS=linux \
|
||||
GOARCH=arm64 \
|
||||
go build \
|
||||
-tags 'netgo $(TAGS)' \
|
||||
-buildmode=pie \
|
||||
-trimpath \
|
||||
-ldflags '-extldflags "-static" $(LDFLAGS)' \
|
||||
-o '$(DIST)/binaries/$(EXECUTABLE)-arm64-linux' \
|
||||
./cmd/$(NAME)
|
||||
|
||||
GOOS=linux \
|
||||
GOARCH=arm \
|
||||
go build \
|
||||
-tags 'netgo $(TAGS)' \
|
||||
-trimpath \
|
||||
-ldflags '-extldflags "-static" $(LDFLAGS)' \
|
||||
-o '$(DIST)/binaries/$(EXECUTABLE)-arm-linux' \
|
||||
./cmd/$(NAME)
|
||||
|
||||
.PHONY: release-windows
|
||||
release-windows: $(GOX) release-dirs
|
||||
@$(GOX) -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -os 'windows' -arch 'amd64' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
|
||||
release-windows: release-dirs
|
||||
GOOS=windows \
|
||||
GOARCH=amd64 \
|
||||
go build \
|
||||
-tags 'netgo $(TAGS)' \
|
||||
-buildmode=pie \
|
||||
-trimpath \
|
||||
-ldflags '-extldflags "-static" $(LDFLAGS)' \
|
||||
-o '$(DIST)/binaries/$(EXECUTABLE)-amd64-windows' \
|
||||
./cmd/$(NAME)
|
||||
|
||||
.PHONY: release-darwin
|
||||
release-darwin: $(GOX) release-dirs
|
||||
@$(GOX) -tags 'netgo $(TAGS)' -ldflags '$(LDFLAGS)' -os 'darwin' -arch 'amd64 arm64' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
|
||||
release-darwin: release-dirs
|
||||
GOOS=darwin \
|
||||
GOARCH=amd64 \
|
||||
go build \
|
||||
-tags 'netgo $(TAGS)' \
|
||||
-buildmode=pie \
|
||||
-trimpath \
|
||||
-ldflags '$(LDFLAGS)' \
|
||||
-o '$(DIST)/binaries/$(EXECUTABLE)-amd64-darwin' \
|
||||
./cmd/$(NAME)
|
||||
|
||||
GOOS=darwin \
|
||||
GOARCH=arm64 \
|
||||
go build \
|
||||
-tags 'netgo $(TAGS)' \
|
||||
-buildmode=pie \
|
||||
-trimpath \
|
||||
-ldflags '$(LDFLAGS)' \
|
||||
-o '$(DIST)/binaries/$(EXECUTABLE)-arm64-darwin' \
|
||||
./cmd/$(NAME)
|
||||
|
||||
.PHONY: release-copy
|
||||
release-copy:
|
||||
|
||||
Reference in New Issue
Block a user