1
1
GO15VENDOREXPERIMENT =1
2
2
export GO15VENDOREXPERIMENT
3
3
4
- DOCKER ?= $(shell command -v docker 2>/dev/null)
5
- PANDOC ?= $(shell command -v pandoc 2>/dev/null)
6
-
7
- ifeq "$(strip $(PANDOC ) ) " ''
8
- ifneq "$(strip $(DOCKER))" ''
9
- PANDOC = $(DOCKER) run \
10
- -it \
11
- --rm \
12
- -v $(shell pwd)/:/input/:ro \
13
- -v $(shell pwd)/$(OUTPUT_DIRNAME)/:/$(OUTPUT_DIRNAME)/ \
14
- -u $(shell id -u) \
15
- --workdir /input \
16
- vbatts/pandoc
17
- PANDOC_SRC := /input/
18
- PANDOC_DST := /
19
- endif
20
- endif
21
-
22
- # These docs are in an order that determines how they show up in the PDF/HTML docs.
23
- DOC_FILES := \
24
- README.md \
25
- code-of-conduct.md \
26
- project.md \
27
- media-types.md \
28
- descriptor.md \
29
- image-layout.md \
30
- layer.md \
31
- config.md \
32
- manifest.md
33
-
34
- FIGURE_FILES := \
35
- img/media-types.png
36
-
37
- OUTPUT_DIRNAME ?= output/
38
- DOC_FILENAME ?= oci-image-spec
39
-
40
4
EPOCH_TEST_COMMIT ?= v0.2.0
41
5
42
6
default : help
43
7
44
8
help :
45
9
@echo " Usage: make <target>"
46
10
@echo
47
- @echo " * 'docs' - produce document in the $( OUTPUT_DIRNAME) directory"
48
- @echo " * 'fmt' - format the json with indentation"
49
- @echo " * 'validate-examples' - validate the examples in the specification markdown files"
50
- @echo " * 'oci-image-tool' - build the oci-image-tool binary"
51
- @echo " * 'schema-fs' - regenerate the virtual schema http/FileSystem"
11
+ @echo " * 'tools' - build the oci image tools binaries"
52
12
@echo " * 'check-license' - check license headers in source files"
53
13
@echo " * 'lint' - Execute the source code linter"
54
14
@echo " * 'test' - Execute the unit tests"
55
15
@echo " * 'update-deps' - Update vendored dependencies"
56
- @echo " * 'img/*.png' - Generate PNG from dot file"
57
-
58
- fmt :
59
- for i in schema/* .json ; do jq --indent 2 -M . " $$ {i}" > xx && cat xx > " $$ {i}" && rm xx ; done
60
-
61
- docs : $(OUTPUT_DIRNAME ) /$(DOC_FILENAME ) .pdf $(OUTPUT_DIRNAME ) /$(DOC_FILENAME ) .html
62
-
63
- ifeq "$(strip $(PANDOC ) ) " ''
64
- $(OUTPUT_DIRNAME ) /$(DOC_FILENAME ) .pdf : $(DOC_FILES ) $(FIGURE_FILES )
65
- $(error cannot build $@ without either pandoc or docker)
66
- else
67
- $(OUTPUT_DIRNAME ) /$(DOC_FILENAME ) .pdf : $(DOC_FILES ) $(FIGURE_FILES )
68
- @mkdir -p $(OUTPUT_DIRNAME ) / && \
69
- $(PANDOC ) -f markdown_github -t latex -o $(PANDOC_DST ) $@ $(patsubst % ,$(PANDOC_SRC ) % ,$(DOC_FILES ) )
70
- ls -sh $(shell readlink -f $@ )
71
-
72
- $(OUTPUT_DIRNAME ) /$(DOC_FILENAME ) .html : $(DOC_FILES ) $(FIGURE_FILES )
73
- @mkdir -p $(OUTPUT_DIRNAME ) / && \
74
- cp -ap img/ $(shell pwd) /$(OUTPUT_DIRNAME ) /&& \
75
- $(PANDOC ) -f markdown_github -t html5 -o $(PANDOC_DST ) $@ $(patsubst % ,$(PANDOC_SRC ) % ,$(DOC_FILES ) )
76
- ls -sh $(shell readlink -f $@ )
77
- endif
78
-
79
- code-of-conduct.md :
80
- curl -o $@ https://raw.githubusercontent.com/opencontainers/tob/d2f9d68c1332870e40693fe077d311e0742bc73d/code-of-conduct.md
81
-
82
- validate-examples :
83
- go test -run TestValidate ./schema
84
-
85
- oci-image-tool :
86
- go build ./cmd/oci-image-tool
87
-
88
- schema-fs :
89
- @echo " generating schema fs"
90
- @cd schema && printf " %s\n\n%s\n" " $$ (cat ../.header)" " $$ (go generate)" > fs.go
91
16
92
17
check-license :
93
18
@echo " checking license headers"
94
19
@./.tool/check-license
95
20
21
+ tools :
22
+ go build ./cmd/oci-create-runtime-bundle
23
+ go build ./cmd/oci-unpack
24
+ go build ./cmd/oci-image-validate
25
+
96
26
lint :
97
27
@echo " checking lint"
98
28
@./.tool/lint
@@ -108,9 +38,6 @@ update-deps:
108
38
# see http://sed.sourceforge.net/sed1line.txt
109
39
find vendor -type f -exec sed -i -e :a -e ' /^\n*$$/{$$d;N;ba' -e ' }' " {}" \;
110
40
111
- img/% .png : img/% .dot
112
- dot -Tpng $^ > $@
113
-
114
41
.PHONY : .gitvalidation
115
42
116
43
# When this is running in travis, it will only check the travis commit range
124
51
125
52
.PHONY : install.tools
126
53
127
- install.tools : .install.gitvalidation .install.glide .install.glide-vc
54
+ install.tools : .install.gitvalidation .install.glide .install.glide-vc .install.gometalinter
128
55
129
56
.install.gitvalidation :
130
57
go get github.com/vbatts/git-validation
@@ -135,15 +62,19 @@ install.tools: .install.gitvalidation .install.glide .install.glide-vc
135
62
.install.glide-vc :
136
63
go get github.com/sgotti/glide-vc
137
64
65
+ .install.gometalinter :
66
+ go get github.com/alecthomas/gometalinter
67
+ gometalinter --install --update
68
+
138
69
clean :
139
70
rm -rf * ~ $(OUTPUT_DIRNAME )
140
- rm -f oci-image-tool
71
+ rm -f oci-create-runtime-bundle
72
+ rm -f oci-unpack
73
+ rm -f oci-image-validate
141
74
142
75
.PHONY : \
143
- validate-examples \
144
- oci-image-tool \
76
+ tools \
145
77
check-license \
146
78
clean \
147
79
lint \
148
- docs \
149
80
test
0 commit comments