mirror of https://github.com/docker/docs.git
make build should build if any go file is touched
Signed-off-by: David Gageot <david@gageot.net>
This commit is contained in:
parent
72d2fb6b27
commit
35ff801ae4
17
mk/build.mk
17
mk/build.mk
|
@ -1,22 +1,23 @@
|
||||||
extension = $(patsubst windows,.exe,$(filter windows,$(1)))
|
extension = $(patsubst windows,.exe,$(filter windows,$(1)))
|
||||||
|
|
||||||
define gocross
|
define gocross
|
||||||
GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 $(GO) build \
|
GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 \
|
||||||
-o $(PREFIX)/bin/docker-$(patsubst cmd/%.go,%,$3)_$(1)-$(2)$(call extension,$(GOOS)) \
|
$(GO) build \
|
||||||
|
-o $(PREFIX)/bin/docker-machine_$(1)-$(2)$(call extension,$(GOOS)) \
|
||||||
-a $(VERBOSE_GO) -tags "static_build netgo $(BUILDTAGS)" -installsuffix netgo \
|
-a $(VERBOSE_GO) -tags "static_build netgo $(BUILDTAGS)" -installsuffix netgo \
|
||||||
-ldflags "$(GO_LDFLAGS) -extldflags -static" $(GO_GCFLAGS) $(3);
|
-ldflags "$(GO_LDFLAGS) -extldflags -static" $(GO_GCFLAGS) ./cmd/machine.go;
|
||||||
endef
|
endef
|
||||||
|
|
||||||
build-clean:
|
build-clean:
|
||||||
rm -Rf $(PREFIX)/bin/*
|
rm -Rf $(PREFIX)/bin/*
|
||||||
|
|
||||||
build-x: ./cmd/machine.go
|
build-x: $(shell find . -type f -name '*.go')
|
||||||
$(foreach GOARCH,$(TARGET_ARCH),$(foreach GOOS,$(TARGET_OS),$(call gocross,$(GOOS),$(GOARCH),$<)))
|
$(foreach GOARCH,$(TARGET_ARCH),$(foreach GOOS,$(TARGET_OS),$(call gocross,$(GOOS),$(GOARCH))))
|
||||||
|
|
||||||
$(PREFIX)/bin/docker-machine$(call extension,$(GOOS)): ./cmd/machine.go
|
$(PREFIX)/bin/docker-machine$(call extension,$(GOOS)): $(shell find . -type f -name '*.go')
|
||||||
$(GO) build \
|
$(GO) build \
|
||||||
-o $@ \
|
-o $@ \
|
||||||
$(VERBOSE_GO) -tags "$(BUILDTAGS)" \
|
$(VERBOSE_GO) -tags "$(BUILDTAGS)" \
|
||||||
-ldflags "$(GO_LDFLAGS)" $(GO_GCFLAGS) $<
|
-ldflags "$(GO_LDFLAGS)" $(GO_GCFLAGS) ./cmd/machine.go
|
||||||
|
|
||||||
build: $(PREFIX)/bin/docker-machine
|
build: $(PREFIX)/bin/docker-machine$(call extension,$(GOOS))
|
||||||
|
|
Loading…
Reference in New Issue