|
| 1 | +SHELL=/bin/bash |
| 2 | + |
1 | 3 | # Source files common to all targets. |
2 | 4 | COREFILES = \ |
3 | 5 | $(wildcard common/*.go) \ |
@@ -74,6 +76,8 @@ NPMFILES = \ |
74 | 76 | # Build defaults. |
75 | 77 | GOOS ?= linux |
76 | 78 | GOARCH ?= amd64 |
| 79 | +GOOSES ?= "linux windows" # To override at the cli do: GOOSES="\"darwin bsd\"" |
| 80 | +GOARCHES ?= "amd64 arm64" # To override at the cli do: GOARCHES="\"ppc64 mips\"" |
77 | 81 |
|
78 | 82 | # Build directories. |
79 | 83 | ROOT_DIR = $(shell pwd) |
@@ -167,6 +171,14 @@ CNS_AI_ID = ce672799-8f08-4235-8c12-08563dc2acef |
167 | 171 | cnsaipath=github.com/Azure/azure-container-networking/cns/logger.aiMetadata |
168 | 172 | ENSURE_OUTPUT_DIR_EXISTS := $(shell mkdir -p $(OUTPUT_DIR)) |
169 | 173 |
|
| 174 | +.PHONY: all-binaries-platforms |
| 175 | +all-binaries-platforms: ## Make all platform binaries |
| 176 | + @for goos in "$(GOOSES)"; do \ |
| 177 | + for goarch in "$(GOARCHES)"; do \ |
| 178 | + make all-binaries GOOS=$$goos GOARCH=$$goarch; \ |
| 179 | + done \ |
| 180 | + done |
| 181 | + |
170 | 182 | # Shorthand target names for convenience. |
171 | 183 | azure-cnm-plugin: $(CNM_BUILD_DIR)/azure-vnet-plugin$(EXE_EXT) cnm-archive |
172 | 184 | azure-vnet: $(CNI_BUILD_DIR)/azure-vnet$(EXE_EXT) |
@@ -269,12 +281,6 @@ all-containerized: |
269 | 281 | docker rm $(BUILD_CONTAINER_NAME) |
270 | 282 | docker rmi $(BUILD_CONTAINER_IMAGE):$(VERSION) |
271 | 283 |
|
272 | | -# Make both linux and windows binaries |
273 | | -.PHONY: all-binaries-platforms |
274 | | -all-binaries-platforms: |
275 | | - export GOOS=linux; make all-binaries |
276 | | - export GOOS=windows; make all-binaries |
277 | | - |
278 | 284 |
|
279 | 285 | .PHONY: tools |
280 | 286 | tools: acncli |
|
0 commit comments