@@ -108,9 +108,16 @@ azure-vnet: $(CNI_BUILD_DIR)/azure-vnet$(EXE_EXT)
108108azure-vnet-ipam : $(CNI_BUILD_DIR ) /azure-vnet-ipam$(EXE_EXT )
109109azure-cni-plugin : azure-vnet azure-vnet-ipam cni-archive
110110azure-cns : $(CNS_BUILD_DIR ) /azure-cns$(EXE_EXT ) cns-archive
111+ # Azure-NPM only supports Linux for now.
112+ ifeq ($(GOOS ) ,linux)
111113azure-npm : $(NPM_BUILD_DIR ) /azure-npm$(EXE_EXT ) npm-archive
114+ endif
112115
116+ ifeq ($(GOOS ) ,linux)
113117all-binaries : azure-cnm-plugin azure-cni-plugin azure-cns azure-npm
118+ else
119+ all-binaries : azure-cnm-plugin azure-cni-plugin azure-cns
120+ endif
114121
115122# Clean all build artifacts.
116123.PHONY : clean
@@ -134,8 +141,8 @@ $(CNS_BUILD_DIR)/azure-cns$(EXE_EXT): $(CNSFILES)
134141 go build -v -o $(CNS_BUILD_DIR ) /azure-cns$(EXE_EXT ) -ldflags " -X main.version=$( VERSION) -s -w" $(CNS_DIR ) /* .go
135142
136143# Build the Azure NPM plugin.
137- $(NPM_BUILD_DIR ) /azure-npm : $(NPMFILES )
138- go build -v -o $(NPM_BUILD_DIR ) /azure-npm -ldflags " -X main.version=$( VERSION) -s -w" $(NPM_DIR ) /* .go
144+ $(NPM_BUILD_DIR ) /azure-npm$( EXE_EXT ) : $(NPMFILES )
145+ go build -v -o $(NPM_BUILD_DIR ) /azure-npm$( EXE_EXT ) -ldflags " -X main.version=$( VERSION) -s -w" $(NPM_DIR ) /* .go
139146
140147# Build all binaries in a container.
141148.PHONY : all-binaries-containerized
@@ -235,11 +242,10 @@ cns-archive:
235242 cd $(CNS_BUILD_DIR ) && $(ARCHIVE_CMD ) $(CNS_ARCHIVE_NAME ) azure-cns$(EXE_EXT )
236243 chown $(BUILD_USER ) :$(BUILD_USER ) $(CNS_BUILD_DIR ) /$(CNS_ARCHIVE_NAME )
237244
238- # Create a NPM archive for the target platform.
245+ # Create a NPM archive for the target platform. Only Linux is supported for now.
239246.PHONY : npm-archive
240247npm-archive :
241248ifeq ($(GOOS ) ,linux)
242- # Azure-NPM only supports Linux for now.
243249 chmod 0755 $(NPM_BUILD_DIR)/azure-npm$(EXE_EXT)
244250 cd $(NPM_BUILD_DIR) && $(ARCHIVE_CMD) $(NPM_ARCHIVE_NAME) azure-npm$(EXE_EXT)
245251 chown $(BUILD_USER):$(BUILD_USER) $(NPM_BUILD_DIR)/$(NPM_ARCHIVE_NAME)
0 commit comments