summaryrefslogtreecommitdiffstats
path: root/src/makefile
diff options
context:
space:
mode:
authorsyn <isaqtm@gmail.com>2021-02-10 23:19:10 +0300
committersyn <isaqtm@gmail.com>2021-02-10 23:19:10 +0300
commitfe72c896a648cfff14bc1b606bcc486ccba0fc22 (patch)
tree801ef9a7ec1df24240a23c861e37381120a31bb0 /src/makefile
parentb666618a881a4acade77b3d9885a4d2b6f75f812 (diff)
downloadtdlib-autogen-fe72c896a648cfff14bc1b606bcc486ccba0fc22.tar.gz
New generating code
Diffstat (limited to 'src/makefile')
-rw-r--r--src/makefile15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/makefile b/src/makefile
new file mode 100644
index 0000000..4899cc2
--- /dev/null
+++ b/src/makefile
@@ -0,0 +1,15 @@
+DEFAULT_ENV = gen-env8
+
+VENV ?= $(shell pwd)/$(DEFAULT_ENV)
+PYTHON = VIRTUAL_ENV=$(VIRTUAL_ENV) $(VENV)/bin/python3
+
+all: core messaging
+
+core: venv
+ $(PYTHON) generate.py --target targets/core.json | rustfmt > core.rs
+
+messaging: venv
+ $(PYTHON) generate.py | rustfmt > messaging.rs
+
+venv:
+ [ -d $(VENV) ] || (python3 -m venv $(DEFAULT_ENV) && VIRTUAL_ENV=$(VENV) $(VENV)/bin/pip install lark-parser)