Skip to content

Commit

Permalink
parameterize, optimize OS-ARCH builds
Browse files Browse the repository at this point in the history
Signed-off-by: ArkaSaha30 <[email protected]>
  • Loading branch information
arkas1 authored and ArkaSaha30 committed May 28, 2024
1 parent 3e20426 commit 125d47c
Showing 1 changed file with 10 additions and 39 deletions.
49 changes: 10 additions & 39 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,21 @@
all: build
include tests/robustness/makefile.mk

PLATFORMS=linux-amd64 linux-386 linux-arm linux-arm64 linux-ppc64le linux-s390x darwin-amd64 darwin-arm64 windows-amd64 windows-arm64

.PHONY: build
build:
GO_BUILD_FLAGS="${GO_BUILD_FLAGS} -v -mod=readonly" ./scripts/build.sh

.PHONY: build-linux-amd64
build-linux-amd64:
GOOS=linux GOARCH=amd64 GO_BUILD_FLAGS="${GO_BUILD_FLAGS} -v -mod=readonly" ./scripts/build.sh

.PHONY: build-linux-386
build-linux-386:
GOOS=linux GOARCH=386 GO_BUILD_FLAGS="${GO_BUILD_FLAGS} -v -mod=readonly" ./scripts/build.sh

.PHONY: build-darwin-amd64
build-darwin-amd64:
GOOS=darwin GOARCH=amd64 GO_BUILD_FLAGS="${GO_BUILD_FLAGS} -v -mod=readonly" ./scripts/build.sh

.PHONY: build-darwin-arm64
build-darwin-arm64:
GOOS=darwin GOARCH=arm64 GO_BUILD_FLAGS="${GO_BUILD_FLAGS} -v -mod=readonly" ./scripts/build.sh

.PHONY: build-windows-amd64
build-windows-amd64:
GOOS=windows GOARCH=amd64 GO_BUILD_FLAGS="${GO_BUILD_FLAGS} -v -mod=readonly" ./scripts/build.sh

.PHONY: build-linux-arm
build-linux-arm:
GOOS=linux GOARCH=arm GO_BUILD_FLAGS="${GO_BUILD_FLAGS} -v -mod=readonly" ./scripts/build.sh

.PHONY: build-linux-arm64
build-linux-arm64:
GOOS=linux GOARCH=arm64 GO_BUILD_FLAGS="${GO_BUILD_FLAGS} -v -mod=readonly" ./scripts/build.sh

.PHONY: build-linux-ppc64le
build-linux-ppc64le:
GOOS=linux GOARCH=ppc64le GO_BUILD_FLAGS="${GO_BUILD_FLAGS} -v -mod=readonly" ./scripts/build.sh

.PHONY: build-linux-s390x
build-linux-s390x:
GOOS=linux GOARCH=s390x GO_BUILD_FLAGS="${GO_BUILD_FLAGS} -v -mod=readonly" ./scripts/build.sh


.PHONY: build-all
build-all: build-linux-amd64 build-linux-386 build-darwin-amd64 build-darwin-arm64 build-windows-amd64 \
build-linux-arm build-linux-arm64 build-linux-ppc64le build-linux-s390x
build-all:
@for platform in $(PLATFORMS); do \
$(MAKE) build-$${platform}; \
done

.PHONY: build-%
build-%:
GOOS=$$(echo $* | cut -d- -f 1) GOARCH=$$(echo $* | cut -d- -f 2) GO_BUILD_FLAGS="${GO_BUILD_FLAGS} -v -mod=readonly" ./scripts/build.sh

.PHONY: tools
tools:
Expand Down

0 comments on commit 125d47c

Please sign in to comment.