build: Add -i flag to go build

It got accidentally dropped, but is crucial for happiness.
See: https://purpleidea.com/blog/2017/02/26/faster-golang-builds/
This commit is contained in:
James Shubin
2018-02-15 12:24:56 -05:00
parent b34b359860
commit 33a4fd6fbe

View File

@@ -142,7 +142,7 @@ GOARCH=$(lastword $(subst -, ,$*))
build/mgmt-%: $(GO_FILES) | bindata lang build/mgmt-%: $(GO_FILES) | bindata lang
@echo "Building: $(PROGRAM), os/arch: $*, version: $(SVERSION)..." @echo "Building: $(PROGRAM), os/arch: $*, version: $(SVERSION)..."
@# reassigning GOOS and GOARCH to make build command copy/pastable @# reassigning GOOS and GOARCH to make build command copy/pastable
env GOOS=${GOOS} GOARCH=${GOARCH} time go build -ldflags "-X main.program=$(PROGRAM) -X main.version=$(SVERSION) ${LDFLAGS}" -o $@ $(BUILD_FLAGS); env GOOS=${GOOS} GOARCH=${GOARCH} time go build -i -ldflags "-X main.program=$(PROGRAM) -X main.version=$(SVERSION) ${LDFLAGS}" -o $@ $(BUILD_FLAGS);
# create a list of binary file names to use as make targets # create a list of binary file names to use as make targets
crossbuild_targets = $(addprefix build/mgmt-,$(subst /,-,${GOOSARCHES})) crossbuild_targets = $(addprefix build/mgmt-,$(subst /,-,${GOOSARCHES}))