Browse code

Makefile improvements

+ Convenience rules: srcrelease, deps
- Separate dependency vendoring from building the binary
(re-download dependencies with 'make deps')

Solomon Hykes authored on 2013/04/24 11:41:38
Showing 1 changed files
... ...
@@ -27,24 +27,29 @@ DOCKER_MAIN := $(DOCKER_DIR)/docker
27 27
 DOCKER_BIN_RELATIVE := bin/docker
28 28
 DOCKER_BIN := $(CURDIR)/$(DOCKER_BIN_RELATIVE)
29 29
 
30
-.PHONY: all clean test hack release $(BINRELEASE) $(SRCRELEASE)
30
+.PHONY: all clean test hack release srcrelease $(BINRELEASE) $(SRCRELEASE) $(DOCKER_BIN) $(DOCKER_DIR)
31 31
 
32 32
 all: $(DOCKER_BIN)
33 33
 
34 34
 $(DOCKER_BIN): $(DOCKER_DIR)
35 35
 	@mkdir -p  $(dir $@)
36
-	@(cd $(DOCKER_MAIN); go get $(GO_OPTIONS); go build $(GO_OPTIONS) $(BUILD_OPTIONS) -o $@)
36
+	@(cd $(DOCKER_MAIN); go build $(GO_OPTIONS) $(BUILD_OPTIONS) -o $@)
37 37
 	@echo $(DOCKER_BIN_RELATIVE) is created.
38 38
 
39 39
 $(DOCKER_DIR):
40 40
 	@mkdir -p $(dir $@)
41
+	@rm -f $@
41 42
 	@ln -sf $(CURDIR)/ $@
43
+	@(cd $(DOCKER_MAIN); go get $(GO_OPTIONS))
42 44
 
43 45
 whichrelease:
44 46
 	echo $(RELEASE_VERSION)
45 47
 
46 48
 release: $(BINRELEASE)
49
+srcrelease: $(SRCRELEASE)
50
+deps: $(DOCKER_DIR)
47 51
 
52
+# A clean checkout of $RELEASE_VERSION, with vendored dependencies
48 53
 $(SRCRELEASE):
49 54
 	rm -fr $(SRCRELEASE)
50 55
 	git clone $(GIT_ROOT) $(SRCRELEASE)