feat(mako): mako autosetup and improved executable

Now we can write mako templates, with a similar feature set as
pyratemp. Except that its syntax is nicer, allows to do everything
and that there is syntax highlight support.

Let's see how it fares
This commit is contained in:
Sebastian Thiel
2015-03-01 16:01:46 +01:00
parent 7b38b4c12f
commit 20410adb78
5 changed files with 323 additions and 1674 deletions

View File

@@ -2,11 +2,14 @@
include Makefile.helpers
PYTHON = python2.7
TPL = etc/bin/pyratemp.py
VENV := virtualenv
VENV_DIR := .pyenv
PYTHON := $(VENV_DIR)/bin/python
PIP := $(VENV_DIR)/bin/pip
MAKO_RENDER := ./etc/bin/mako-render
TPL := $(PYTHON) $(MAKO_RENDER)
API_DEPS_TPL = src/pyra/deps.pyra
API_MAIN_TPL = src/pyra/main.pyra
API_DEPS_TPL = src/mako/deps.mako
API_DEPS = .api.deps
API_SHARED_INFO = ./etc/api/shared.yaml
API_JSON_FILES = $(shell find ./etc -type f -name '*-api.json')
@@ -20,14 +23,21 @@ help:
$(info api-deps - generate a file to tell make what API file dependencies will be)
$(info help-api - show all api targets to build individually)
$(API_DEPS): $(API_SHARED_INFO) $(API_DEPS_TPL)
$(TPL) -f $(API_SHARED_INFO) $(API_DEPS_TPL) > $@
$(PYTHON):
virtualenv $(VENV_DIR)
$(PIP) install mako pyyaml
$(MAKO_RENDER): $(PYTHON)
$(API_DEPS): $(API_SHARED_INFO) $(API_DEPS_TPL) $(MAKO_RENDER)
$(TPL) --data-files $(API_SHARED_INFO) $(API_DEPS_TPL) > $@
api-deps: $(API_DEPS)
include $(API_DEPS)
clean: clean-api
clean:
-rm -Rf $(VENV_DIR)
-rm $(API_DEPS)