Skip to content

Commit

Permalink
Add build subtargets based on arch
Browse files Browse the repository at this point in the history
This commit will group similar targets as per
architecture into subtargets to build. It also adds
`build-all` target to build all OS-Arch cominations.

Allows subtargets without scripting
by parameterizing and optimizing OS-ARCH builds

Signed-off-by: ArkaSaha30 <[email protected]>
  • Loading branch information
ArkaSaha30 authored and arkas1 committed May 29, 2024
1 parent 9914047 commit 78335c9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ include tests/robustness/makefile.mk
build:
GO_BUILD_FLAGS="${GO_BUILD_FLAGS} -v -mod=readonly" ./scripts/build.sh

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

.PHONY: build-all
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:
GO_BUILD_FLAGS="${GO_BUILD_FLAGS} -v -mod=readonly" ./scripts/build_tools.sh
Expand Down

0 comments on commit 78335c9

Please sign in to comment.