|
1 | 1 | extension = $(patsubst windows,.exe,$(filter windows,$(1))) |
2 | 2 |
|
3 | 3 | define gocross |
4 | | - GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 $(GO) build \ |
5 | | - -o $(PREFIX)/bin/docker-$(patsubst cmd/%.go,%,$3)_$(1)-$(2)$(call extension,$(GOOS)) \ |
| 4 | + GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 \ |
| 5 | + $(GO) build \ |
| 6 | + -o $(PREFIX)/bin/docker-machine_$(1)-$(2)$(call extension,$(GOOS)) \ |
6 | 7 | -a $(VERBOSE_GO) -tags "static_build netgo $(BUILDTAGS)" -installsuffix netgo \ |
7 | | - -ldflags "$(GO_LDFLAGS) -extldflags -static" $(GO_GCFLAGS) $(3); |
| 8 | + -ldflags "$(GO_LDFLAGS) -extldflags -static" $(GO_GCFLAGS) ./cmd/machine.go; |
8 | 9 | endef |
9 | 10 |
|
10 | 11 | build-clean: |
11 | 12 | rm -Rf $(PREFIX)/bin/* |
12 | 13 |
|
13 | | -build-x: ./cmd/machine.go |
14 | | - $(foreach GOARCH,$(TARGET_ARCH),$(foreach GOOS,$(TARGET_OS),$(call gocross,$(GOOS),$(GOARCH),$<))) |
| 14 | +build-x: $(shell find . -type f -name '*.go') |
| 15 | + $(foreach GOARCH,$(TARGET_ARCH),$(foreach GOOS,$(TARGET_OS),$(call gocross,$(GOOS),$(GOARCH)))) |
15 | 16 |
|
16 | | -$(PREFIX)/bin/docker-machine$(call extension,$(GOOS)): ./cmd/machine.go |
| 17 | +$(PREFIX)/bin/docker-machine$(call extension,$(GOOS)): $(shell find . -type f -name '*.go') |
17 | 18 | $(GO) build \ |
18 | 19 | -o $@ \ |
19 | 20 | $(VERBOSE_GO) -tags "$(BUILDTAGS)" \ |
20 | | - -ldflags "$(GO_LDFLAGS)" $(GO_GCFLAGS) $< |
| 21 | + -ldflags "$(GO_LDFLAGS)" $(GO_GCFLAGS) ./cmd/machine.go |
21 | 22 |
|
22 | | -build: $(PREFIX)/bin/docker-machine |
| 23 | +build: $(PREFIX)/bin/docker-machine$(call extension,$(GOOS)) |
0 commit comments