Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Commit

Permalink
Build ARM for all OSes
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Gehrs committed May 12, 2022
1 parent 5a4c2cd commit 484a760
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,19 @@ GO := $(GO_PREFIX) go
LINT_TARGETS ?= $(shell $(GO) list -f '{{.Dir}}' ./... | sed -e"s|${CURDIR}/\(.*\)\$$|\1/...|g" )
SYSTEM := $(shell uname -s | tr A-Z a-z)_$(shell uname -m | sed "s/x86_64/amd64/")

ARCHS := amd64 arm64
OS_SYSTEMS := darwin linux windows

# The current version of golangci-lint.
# See: https://github.com/golangci/golangci-lint/releases
GOLANGCI_LINT_VERSION := 1.38.0

define NEWLINE


endef


# Executes the linter on all our go files inside of the project
.PHONY: lint
lint: bin/golangci-lint-$(GOLANGCI_LINT_VERSION)
Expand Down Expand Up @@ -41,6 +50,8 @@ bin/golangci-lint-$(GOLANGCI_LINT_VERSION):
# Builds binaries for windows, macOS, and linux
.PHONY: build
build:
GOOS=darwin $(GO) build -o bin/darwin-aws-cfg-generator aws-cfg-generator/main.go
GOOS=linux $(GO) build -o bin/linux-aws-cfg-generator aws-cfg-generator/main.go
GOOS=windows $(GO) build -o bin/windows-aws-cfg-generator aws-cfg-generator/main.go
$(foreach os, $(OS_SYSTEMS), \
$(foreach a, $(ARCHS), \
env GOOS=$(os) GOARCH=$(a) CGO_ENABLED=0 $(GO) build -o bin/$(os)-$(a)-aws-cfg-generator aws-cfg-generator/main.go; $(NEWLINE) \
) \
)

0 comments on commit 484a760

Please sign in to comment.