feat: replace inline C string literals with auto-generated .wren.inc includes

Replace the manually embedded C string constants for builtin Wren modules with
a new build system that automatically generates `.wren.inc` header files from
`.wren` source files. The old `script/generate_builtins.py` is removed and
replaced by `script/wren_to_c_string.py`, which produces standalone include
files with a `PREAMBLE` containing the module name and source path. The Makefile
gains pattern rules to rebuild these `.wren.inc` files whenever the
corresponding `.wren` source changes, and the `builtin` phony target is removed
since the generation is now automatic. The `wren.mk` wildcard lists are updated
to include the new `.wren.inc` files as dependencies. The `timer.c` and
`wren_core.c` source files now `#include` their respective `.wren.inc` headers
instead of defining the string literals inline, and the `timer.wren` trailing
newline is removed.
This commit is contained in:
Bob Nystrom
2015-09-13 17:03:02 +00:00
parent 95ec9c63bd
commit 95626bb136
15 changed files with 455 additions and 441 deletions
-5
View File
@@ -46,11 +46,6 @@ test: debug
@ $(MAKE) -f script/wren.mk MODE=debug test
@ ./script/test.py $(suite)
# Take the contents of the scripts under builtin/ and copy them into their
# respective wren_<name>.c source files.
builtin:
@ ./script/generate_builtins.py
# Generate the Wren site.
docs:
@ ./script/generate_docs.py