VERSION := 1.0.2-beta BUILD := $(shell git rev-parse --short HEAD) GO := go BUILD_FLAGS := -buildmode=pie -trimpath LDFLAGS := -linkmode=external -extldflags="-Wl,-z,relro,-z,now" -X git.nevets.tech/Keys/CertManager/internal.Version=$(VERSION) -X git.nevets.tech/Keys/CertManager/internal.Build=$(BUILD) .PHONY: proto build debug stage proto: @protoc --go_out=./proto --go-grpc_out=./proto proto/hook.proto @protoc --go_out=./proto --go-grpc_out=./proto proto/symlink.proto build: proto $(GO) build $(BUILD_FLAGS) -ldflags="-s -w $(LDFLAGS)" -o ./certman . @cp ./certman ./certman-$(VERSION)-amd64 debug: proto $(GO) build $(BUILD_FLAGS) -ldflags="$(LDFLAGS)" -o ./certman . @cp ./certman ./certman-$(VERSION)-amd64 stage: build @sudo cp ./certman /srv/vm-passthru/certman @ssh steven@192.168.122.44 updateCertman.sh