Skip to content

Commit

Permalink
Correct build-package target
Browse files Browse the repository at this point in the history
  • Loading branch information
thom-at-redhat committed Apr 24, 2024
1 parent b5d5f1f commit df3d903
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,23 @@ build-all:
$(GO) build -o receptor --tags no_backends,no_services,no_tls_config ./cmd/receptor-cl && \
$(GO) build -o receptor ./cmd/receptor-cl

BINNAME='receptor'
CHECKSUM_PROGRAM='sha256sum'
GOARCH=$(ARCH)
GOOS=$(OS)
DIST := receptor_$(shell echo '$(VERSION)' | sed 's/^v//')_$(GOOS)_$(GOARCH)
build-package:
@echo "Building and packaging binary for $(GOOS)/$(GOARCH) as dist/$(DIST).tar.gz" && \
mkdir -p dist/$(DIST) && \
GOOS=$(GOOS) GOARCH=$(GOARCH) CGO_ENABLED=0 $(GO) build -o dist/$(DIST)/$(BINNAME) $(DEBUGFLAGS) -ldflags "-X 'github.com/ansible/receptor/internal/version.Version=$(VERSION)'" $(TAGPARAM) ./cmd/receptor-cl && \
GOOS=$(GOOS) GOARCH=$(GOARCH) CGO_ENABLED=0 $(GO) build \
-o dist/$(DIST)/$(BINNAME) \
$(DEBUGFLAGS) \
-ldflags "-X 'github.com/ansible/receptor/internal/version.Version=$(VERSION)'" \
$(TAGPARAM) \
./cmd/receptor-cl && \
tar -C dist/$(DIST) -zcf dist/$(DIST).tar.gz $(BINNAME) && \
cd dist/ && sha256sum $(DIST).tar.gz >> checksums.txt
cd dist/ && \
$(CHECKSUM_PROGRAM) $(DIST).tar.gz >> checksums.txt

RUNTEST ?=
ifeq ($(RUNTEST),)
Expand Down

0 comments on commit df3d903

Please sign in to comment.