25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

35 lines
1.1 KiB

  1. # This Makefile is for library maintainers, not end-developers.
  2. # All the generated code is already checked in.
  3. API_JSON = $(wildcard ../*/*/*-api.json ../*/*/*/*-api.json)
  4. GENERATOR=./google-api-go-generator
  5. # Download all API specifications and rebuild Go bindings.
  6. # All downloaded files are cached in $TMPDIR for reuse with 'cached' below.
  7. all: $(GENERATOR)
  8. $(GENERATOR) -cache=false -install -api=*
  9. # Reuse cached API specifications in $TMPDIR and rebuild Go bindings.
  10. cached: $(GENERATOR)
  11. $(GENERATOR) -cache=true -install -api=*
  12. # Only rebuild Go bindings, do not modify API specifications.
  13. # For every existing */*/*-api.json file, */*/*-gen.go will be built.
  14. local: $(API_JSON:-api.json=-gen.go)
  15. # Pattern rule for the 'local' target.
  16. # Translates otherwise unnamed targets with a -gen.go suffix into the
  17. # matching input file with a -api.json suffix. $< is the input file.
  18. %-gen.go: %-api.json $(GENERATOR)
  19. $(GENERATOR) -api_json_file=$<
  20. # Alias to rebuild and install $(GENERATOR)
  21. generator: $(GENERATOR)
  22. # Marked as .PHONY so that make always invokes go build.
  23. $(GENERATOR):
  24. go build -o $@
  25. .PHONY: all cached local generator $(GENERATOR)