File: Makefile

package info (click to toggle)
golang-google-api 0.0~git20180916.19ff876-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, buster-backports
  • size: 93,464 kB
  • sloc: makefile: 17
file content (34 lines) | stat: -rw-r--r-- 1,163 bytes parent folder | download
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
31
32
33
34
# This Makefile is for library maintainers, not end-developers.
# All the generated code is already checked in.

API_JSON = $(wildcard ../*/*/*-api.json ../*/*/*/*-api.json)

GENERATOR=./google-api-go-generator

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

# Reuse cached API specifications in $TMPDIR and rebuild Go bindings.
cached: $(GENERATOR)
	$(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)
	$(GENERATOR) -api_json_file=$<

# Alias to rebuild and install $(GENERATOR)
generator: $(GENERATOR)

# Marked as .PHONY so that make always invokes go build.
$(GENERATOR):
	go build -o $@

.PHONY: all cached local generator $(GENERATOR)