summaryrefslogtreecommitdiffstatshomepage
path: root/py/qstr.c
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-04-19 11:30:06 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-04-19 11:37:56 +0300
commitc618f91e22613b2e530f7c21be0be789a7e8eed5 (patch)
tree0711245dae14bbddbead9a6598c8d60deca1ec68 /py/qstr.c
parent8aa3cbf15312987410e2358c4ee93d8bb8cdf715 (diff)
downloadmicropython-c618f91e22613b2e530f7c21be0be789a7e8eed5.tar.gz
micropython-c618f91e22613b2e530f7c21be0be789a7e8eed5.zip
py: Rework QSTR extraction to work in simple and obvious way.
When there're C files to be (re)compiled, they're all passed first to preprocessor. QSTR references are extracted from preprocessed output and split per original C file. Then all available qstr files (including those generated previously) are catenated together. Only if the resulting content has changed, the output file is written (causing almost global rebuild to pick up potentially renumbered qstr's). Otherwise, it's not updated to not cause spurious rebuilds. Related make rules are split to minimize amount of commands executed in the interim case (when some C files were updated, but no qstrs were changed).
Diffstat (limited to 'py/qstr.c')
-rw-r--r--py/qstr.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/py/qstr.c b/py/qstr.c
index ef31a682ee..24793ff8a3 100644
--- a/py/qstr.c
+++ b/py/qstr.c
@@ -93,9 +93,11 @@ const qstr_pool_t mp_qstr_const_pool = {
10, // set so that the first dynamically allocated pool is twice this size; must be <= the len (just below)
MP_QSTRnumber_of, // corresponds to number of strings in array just below
{
+#ifndef __QSTR_EXTRACT
#define QDEF(id, str) str,
#include "genhdr/qstrdefs.generated.h"
#undef QDEF
+#endif
},
};