File: Makefile

package info (click to toggle)
golang-google-api 0.0~git20161128.3cc2e59-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch, stretch-backports
  • size: 64,468 kB
  • ctags: 71,262
  • sloc: makefile: 16
file content (27 lines) | stat: -rw-r--r-- 1,077 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
API_JSON = $(wildcard */*/*-api.json */*/*/*-api.json)

# Download all API specifications and rebuild Go bindings.
# All downloaded files are cached in $TMPDIR for reuse with 'cached' below.
all: generator
	$(GOPATH)/bin/google-api-go-generator -cache=false -install -api=*

# Reuse cached API specifications in $TMPDIR and rebuild Go bindings.
cached: generator
	$(GOPATH)/bin/google-api-go-generator -cache=true -install -api=*

# Only rebuild Go bindings, do not modify API specifications.
# For every existing */*/*-api.json file, */*/*-gen.go will be built.
local: $(API_JSON:-api.json=-gen.go)

# Pattern rule for the 'local' target.
# Translates otherwise unnamed targets with a -gen.go suffix into the
# matching input file with a -api.json suffix. $< is the input file.
%-gen.go: %-api.json generator
	$(GOPATH)/bin/google-api-go-generator -api_json_file=$<

# Rebuild and install $(GOPATH)/bin/google-api-go-generator
generator:
	go install google.golang.org/api/googleapi
	go install google.golang.org/api/google-api-go-generator

.PHONY: all cached local generator