1- .PHONY : json-to-xml clean help api-deps regen-apis license
1+ .PHONY : json-to-xml clean help api-deps regen-apis license update-json cargo
22.SUFFIXES :
33
44include Makefile.helpers
@@ -8,13 +8,15 @@ VENV_DIR := .pyenv
88PYTHON := $(VENV_DIR ) /bin/python
99PIP := $(VENV_DIR ) /bin/pip
1010MAKO_RENDER := etc/bin/mako-render
11+ API_VERSION_GEN := etc/bin/api_version_to_yaml.py
1112TPL := $(PYTHON ) $(MAKO_RENDER )
1213
1314MAKO_SRC = src/mako
1415RUST_SRC = src/rust
1516API_DEPS_TPL = $(MAKO_SRC ) /deps.mako
1617API_DEPS = .api.deps
1718API_SHARED_INFO = etc/api/shared.yaml
19+ API_LIST = etc/api/api-list.yaml
1820API_JSON_FILES = $(shell find etc -type f -name '* -api.json')
1921MAKO_LIB_DIR = $(MAKO_SRC ) /lib
2022MAKO_LIB_FILES = $(shell find $(MAKO_LIB_DIR ) -type f -name '* .* ')
@@ -23,23 +25,30 @@ help:
2325 $(info using template engine: '$(TPL ) ')
2426 $(info )
2527 $(info Targets)
26- $(info help - print this help )
27- $(info api-deps - generate a file to tell make what API file dependencies will be )
28+ $(info apis - make all APIs )
29+ $(info cargo - run cargo on all APIs, use ARGS="args ..." to specify cargo arguments )
2830 $(info regen-apis - clear out all generated apis, and regenerate them)
31+ $(info clean-apis - delete all generated APIs)
2932 $(info help-api - show all api targets to build individually)
33+ $(info help - print this help)
3034 $(info license - regenerate the main license file)
35+ $(info update-json - copy API definitions from source GOOGLE_GO_APIS_REPO=<path>)
36+ $(info api-deps - generate a file to tell make what API file dependencies will be)
3137
3238$(PYTHON ) :
3339 virtualenv $(VENV_DIR )
3440 $(PIP ) install mako pyyaml
3541
3642$(MAKO_RENDER ) : $(PYTHON )
3743
38- $(API_DEPS ) : $(API_SHARED_INFO ) $(API_DEPS_TPL ) $(MAKO_LIB_FILES ) $(MAKO_RENDER )
39- PYTHONPATH=$(MAKO_LIB_DIR ) $(TPL ) --template-dir ' .' -io $(API_DEPS_TPL ) =$@ --data-files $(API_SHARED_INFO )
44+ $(API_DEPS ) : $(API_SHARED_INFO ) $(API_DEPS_TPL ) $(MAKO_LIB_FILES ) $(MAKO_RENDER ) $( API_LIST )
45+ PYTHONPATH=$(MAKO_LIB_DIR ) $(TPL ) --template-dir ' .' -io $(API_DEPS_TPL ) =$@ --data-files $(API_SHARED_INFO ) $( API_LIST )
4046
4147api-deps : $(API_DEPS )
4248
49+ $(API_LIST ) : $(API_VERSION_GEN )
50+ $(API_VERSION_GEN ) etc/api $@ $@
51+
4352include $(API_DEPS )
4453
4554LICENSE.md : $(MAKO_SRC ) /LICENSE.md.mako $(API_SHARED_INFO )
@@ -53,4 +62,7 @@ clean: clean-apis
5362 -rm -Rf $(VENV_DIR )
5463 -rm $(API_DEPS )
5564
65+ update-json :
66+ etc/bin/update-json.sh $(GOOGLE_GO_APIS_REPO ) etc/api
67+
5668
0 commit comments