File: Makefile

package info (click to toggle)
golang-github-docker-go 1.5.2~git20160303.d30aec9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 444 kB
  • sloc: makefile: 23
file content (30 lines) | stat: -rw-r--r-- 601 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
GO_VERSION=1.6
GO_SRC=/tmp/go/src
PATCH_DIR=$(CURDIR)/patches

.PHONY: clean download_go_src run_patch update docker

define apply_patch
mkdir -p $(CURDIR)/$(2);
cp -r ${GO_SRC}/$(1)/* $(CURDIR)/$(2)/;
git apply $(PATCH_DIR)/*;
endef

download_go_src:
	curl -sSL https://golang.org/dl/go${GO_VERSION}.src.tar.gz | tar -v -C /tmp -xz

run_patch: download_go_src
	@rm -rf canonical/json
	$(call apply_patch,encoding/json,canonical/json,json)

update: run_patch clean

docker:
	docker build --rm --force-rm -t docker/go .

test: docker
	docker run --rm docker/go go test ./...


clean:
	rm -rf ${GO_SRC}