Put defs into a generated file.

This is only part of the solution, we still need to update joy.h and
KEYWORDS.txt when defs.txt changes, and we need to handle names that
have non-C-identifier characters in them.

But it's a start...
This commit is contained in:
Simon Forman
2023-02-05 13:04:31 -08:00
parent 6eae43c27f
commit 78b59dda35
5 changed files with 143 additions and 91 deletions
+4 -1
View File
@@ -1,4 +1,4 @@
OBJS=joy.o keywords.o
OBJS=joy.o keywords.o definitions.o
# On FreeBSD gc and gmp are installed in /usr/local/:
STATIC_GCLIB=/usr/local/lib/libgc.a /usr/local/lib/libgmp.a
@@ -17,6 +17,9 @@ joy: ${OBJS} $(STATIC_GCLIB)
joy.o: joy.h
definitions.c: defs.txt convert_defs.py
python convert_defs.py > definitions.c
# Gperf doesn't add anything to '{""}' unused entries in the wordlist.
# This causes "warning: missing field 'func' initializer [-Wmissing-field-initializers]"