Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.

Commit be5e648

Browse files
authored
Merge pull request #88 from r2d4/calculate-checksums
Add rule to calculate checksums of binaries
2 parents f1ef660 + a7fa5ee commit be5e648

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ PROJECT := container-diff
2727
REPOPATH ?= $(ORG)/$(PROJECT)
2828
RELEASE_BUCKET ?= $(PROJECT)
2929

30-
SUPPORTED_PLATFORMS := linux-amd64 darwin-amd64 windows-amd64.exe
30+
SUPPORTED_PLATFORMS := linux-$(GOARCH) darwin-$(GOARCH) windows-$(GOARCH).exe
3131
BUILD_PACKAGE = $(REPOPATH)
3232

3333
# These build tags are from the containers/image library.
@@ -42,7 +42,10 @@ $(BUILD_DIR)/$(PROJECT): $(BUILD_DIR)/$(PROJECT)-$(GOOS)-$(GOARCH)
4242
cp $(BUILD_DIR)/$(PROJECT)-$(GOOS)-$(GOARCH) $@
4343

4444
$(BUILD_DIR)/$(PROJECT)-%-$(GOARCH): $(GO_FILES) $(BUILD_DIR)
45-
GOOS=$* GOARCH=$(GOARCH) go build -tags $(GO_BUILD_TAGS) -ldflags $(GO_LDFLAGS) -o $@ $(BUILD_PACKAGE)
45+
GOOS=$* GOARCH=$(GOARCH) CGO_ENABLED=0 go build -tags $(GO_BUILD_TAGS) -ldflags $(GO_LDFLAGS) -o $@ $(BUILD_PACKAGE)
46+
47+
%.sha256: %
48+
shasum -a 256 $< &> $@
4649

4750
%.exe: %
4851
mv $< $@
@@ -51,7 +54,7 @@ $(BUILD_DIR):
5154
mkdir -p $(BUILD_DIR)
5255

5356
.PHONY: cross
54-
cross: $(foreach platform, $(SUPPORTED_PLATFORMS), $(BUILD_DIR)/$(PROJECT)-$(platform))
57+
cross: $(foreach platform, $(SUPPORTED_PLATFORMS), $(BUILD_DIR)/$(PROJECT)-$(platform).sha256)
5558

5659
.PHONY: test
5760
test: $(BUILD_DIR)/$(PROJECT)

0 commit comments

Comments
 (0)