diff --git a/Makefile b/Makefile index 1fcd8a66e5..86285c9659 100644 --- a/Makefile +++ b/Makefile @@ -246,7 +246,8 @@ build/data/%.o: data/%.s $(AS) $(ASFLAGS) $< -o $@ build/assets/text/%.enc.h: assets/text/%.h assets/text/charmap.txt - python3 tools/msgenc.py assets/text/charmap.txt $< $@ + $(CPP) -P -dD -fpreprocessed $< > $(@:.enc.h=.h) + python3 tools/msgenc.py assets/text/charmap.txt $(@:.enc.h=.h) $@ build/assets/text/fra_message_data_static.o: build/assets/text/message_data.enc.h build/assets/text/ger_message_data_static.o: build/assets/text/message_data.enc.h diff --git a/tools/msgenc.py b/tools/msgenc.py index 80cdd653c0..b2b9cab168 100644 --- a/tools/msgenc.py +++ b/tools/msgenc.py @@ -5,41 +5,51 @@ import argparse, ast, re -charmap = {} - -string_regex = re.compile(r"([\"'`])(?:[\s\S])*?(?:(?