Files
docker-machine/mk/build.mk
Nathan LeClaire c8edb33ecd Move towards using external binaries / RPC plugins
- First RPC steps

- Work on some flaws in RPC model

- Remove unused TLS settings from Engine and Swarm options

- Add code to correctly encode data over the network

- Add client driver for RPC

- Rename server driver file

- Start to make marshal make sense

- Fix silly RPC method args and add client

- Fix some issues with RPC calls, and marshaling

- Simplify plugin main.go

- Move towards 100% plugin in CLI

- Ensure that plugin servers are cleaned up properly

- Make flag parsing for driver flags work properly

Includes some work carried from @dmp42 updating the build process and
tests to use the new method.

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-10-16 16:34:56 -07:00

32 lines
1.2 KiB
Makefile

build-clean:
rm -Rf $(PREFIX)/bin/*
extension = $(patsubst windows,.exe,$(filter windows,$(1)))
# Cross builder helper
define gocross
GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 go build \
-o $(PREFIX)/bin/docker-machine_$(1)-$(2)/docker-$(patsubst cmd/%.go,%,$3)$(call extension,$(GOOS)) \
-a $(VERBOSE_GO) -tags "static_build netgo $(BUILDTAGS)" -installsuffix netgo \
-ldflags "$(GO_LDFLAGS) -extldflags -static" $(GO_GCFLAGS) $(3);
endef
# XXX building with -a fails in debug (with -N -l) ????
# Independent targets for every bin
$(PREFIX)/bin/docker-%: ./cmd/%.go $(shell find . -type f -name '*.go')
$(GO) build -o $@$(call extension,$(GOOS)) $(VERBOSE_GO) -tags "$(BUILDTAGS)" -ldflags "$(GO_LDFLAGS)" $(GO_GCFLAGS) $<
# Cross-compilation targets
build-x-%: ./cmd/%.go $(shell find . -type f -name '*.go')
$(foreach GOARCH,$(TARGET_ARCH),$(foreach GOOS,$(TARGET_OS),$(call gocross,$(GOOS),$(GOARCH),$<)))
# Build just machine
build-machine: $(PREFIX)/bin/docker-machine
# Build all plugins
build-plugins: $(patsubst ./cmd/%.go,$(PREFIX)/bin/docker-%,$(filter-out %_test.go, $(wildcard ./cmd/machine-driver-*.go)))
# Overall cross-build
build-x: $(patsubst ./cmd/%.go,build-x-%,$(filter-out %_test.go, $(wildcard ./cmd/*.go)))