File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2828API_JSON_FILES = $(shell find etc -type f -name '* -api.json')
2929MAKO_LIB_DIR = $(MAKO_SRC ) /lib
3030MAKO_LIB_FILES = $(shell find $(MAKO_LIB_DIR ) -type f -name '* .* ')
31- MAKO = PYTHONPATH=$(MAKO_LIB_DIR ) $(TPL ) --template-dir '.'
31+ MAKO = $(TPL ) --template-dir '.'
32+ PYPATH = PYTHONPATH=$(MAKO_LIB_DIR )
3233MAKO_STANDARD_DEPENDENCIES = $(API_SHARED_INFO ) $(MAKO_LIB_FILES ) $(MAKO_RENDER )
3334
3435help :
@@ -60,10 +61,10 @@ $(MAKO_RENDER): $(PYTHON)
6061# Explicitly NOT depending on $(MAKO_LIB_FILES), as it's quite stable and now takes 'too long' thanks
6162# to a URL get call to the google discovery service
6263$(API_DEPS ) : $(API_DEPS_TPL ) $(API_SHARED_INFO ) $(MAKO_RENDER ) $(TYPE_API_INFO ) $(API_LIST )
63- $(MAKO ) -io $(API_DEPS_TPL ) =$@ --data-files $(API_SHARED_INFO ) $(TYPE_API_INFO ) $(API_LIST )
64+ $(PYPATH ) $( MAKO ) -io $(API_DEPS_TPL ) =$@ --data-files $(API_SHARED_INFO ) $(TYPE_API_INFO ) $(API_LIST )
6465
6566$(CLI_DEPS ) : $(API_DEPS_TPL ) $(API_SHARED_INFO ) $(MAKO_RENDER ) $(TYPE_CLI_INFO ) $(API_LIST )
66- $(MAKO ) -io $(API_DEPS_TPL ) =$@ --data-files $(API_SHARED_INFO ) $(TYPE_CLI_INFO ) $(API_LIST )
67+ $(PYPATH ) $( MAKO ) -io $(API_DEPS_TPL ) =$@ --data-files $(API_SHARED_INFO ) $(TYPE_CLI_INFO ) $(API_LIST )
6768
6869deps : $(API_DEPS ) $(CLI_DEPS )
6970
Original file line number Diff line number Diff line change 1010
1111# transform name to be a suitable subcommand
1212def mangle_subcommand (name ):
13- return util .camel_to_under (name ).replace ('_' , '-' ).replace ('.' , '-' )
13+ return util .camel_to_under (util . singular ( name ) ).replace ('_' , '-' ).replace ('.' , '-' )
1414
1515
1616# transform the resource name into a suitable filename to contain the markdown documentation for it
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ extern crate rustc_serialize;
1818${ docopt.new(c)} \
1919
2020fn main() {
21- let _: Args = Args::docopt().decode().unwrap_or_else(|e| e.exit());
21+ let args: Args = Args::docopt().decode().unwrap_or_else(|e| e.exit());
22+ println!("{:?}", args);
2223 println!("Hello, ${ id } !");
2324}
Original file line number Diff line number Diff line change 3232 if mako is not UNDEFINED :
3333 post_processor_arg = ' --post-process-python-module=%s ' % mako.post_processor_module
3434
35+ python_path = ' PYTHONPATH=$(MAKO_LIB_DIR)'
3536 try :
3637 root = directories.mako_src + ' /' + make.id + ' /lib'
3738 lib_files = [os.path.join(root, file_name) for file_name in os.listdir(root)]
39+ python_path += ' :%s ' % root
3840 except OSError :
3941 lib_files = list ()
4042%> \
@@ -89,7 +91,7 @@ ${api_common}: $(RUST_SRC)/${make.id}/cmn.rs $(lastword $(MAKEFILE_LIST)) ${gen_
8991
9092${ gen_root_stamp} : ${ ' ' .join(i[0 ] for i in sds)} ${ ' ' .join(lib_files)} ${ api_json_inputs} $(MAKO_STANDARD_DEPENDENCIES) ${ depends_on_target}
9193 @echo Generating ${ api_target}
92- @$(MAKO) -io ${ ' ' .join(" %s =%s " % (s, d) for s, d in sds)} ${ post_processor_arg} --data-files ${ api_json_inputs}
94+ @${ python_path } $ (MAKO) -io ${ ' ' .join(" %s =%s " % (s, d) for s, d in sds)} ${ post_processor_arg} --data-files ${ api_json_inputs}
9395 @touch $@
9496
9597${ api_target} : ${ api_common}
@@ -134,7 +136,7 @@ gen-all${agsuffix}: ${space_join(0)}
134136
135137% if global_targets:
136138${ doc_index} : docs${ agsuffix} ${ type_specific_json} ## TODO: all type dependencies: docs-api, docs-cli
137- $(MAKO) --var DOC_ROOT=${ doc_root} -io $(MAKO_SRC)/index.html.mako=$@ --data-files $(API_SHARED_INFO) $(API_LIST) ${ type_specific_json}
139+ $(PYPATH) $( MAKO) --var DOC_ROOT=${ doc_root} -io $(MAKO_SRC)/index.html.mako=$@ --data-files $(API_SHARED_INFO) $(API_LIST) ${ type_specific_json}
138140 @echo Documentation index created at '$@'
139141docs-all: ${ doc_index}
140142docs-all-clean:
You can’t perform that action at this time.
0 commit comments