Skip to content

Commit

Permalink
Add Makefile for tas-installer
Browse files Browse the repository at this point in the history
  • Loading branch information
osmman committed Dec 11, 2023
1 parent a713a3e commit bc79ba7
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

CHART_VERSION ?= ""
CHART_URL ?= "./charts/trusted-artifact-signer"

LDFLAGS=-X securesign/sigstore-ocp/tas-installer/cmd.helmChartVersion=$(CHART_VERSION) \
-X securesign/sigstore-ocp/tas-installer/cmd.helmChartUrl=$(CHART_URL)

PLATFORMS=darwin linux windows
ARCHITECTURES=amd64 arm64

.PHONY: build
build: build-tas-installer

.PHONY: test
test: test-tas-installer

.PHONY: cross
cross: cross-tas-installer

.PHONY: build-tas-installer
build-tas-installer:
CGO_ENABLED=0 go build -C ./tas-installer -trimpath -ldflags "$(LDFLAGS)" -o ../tas-install

.PHONY: test-tas-installer
test-tas-installer:
cd ./tas-installer && go test ./...

.PHONY: cross-tas-installer
cross-tas-installer:
$(foreach GOOS, $(PLATFORMS),\
$(foreach GOARCH, $(ARCHITECTURES), $(shell export GOOS=$(GOOS); export GOARCH=$(GOARCH); \
go build -C ./tas-installer -trimpath -ldflags "$(LDFLAGS)" -o ../tas-install-$(GOOS)-$(GOARCH))))

.PHONY: clean
clean:
rm -f tas-install
rm -f tas-install-*

0 comments on commit bc79ba7

Please sign in to comment.