From 9629874038aae217f0ea2d0587db703c5e8abdae Mon Sep 17 00:00:00 2001 From: M Hightower <27247790+mhightower83@users.noreply.github.com> Date: Thu, 12 Sep 2019 19:33:40 -0700 Subject: [PATCH] Run makecorever.py before specific prebuild hooks. (#6504) * Run makecorever.py before specific prebuild hooks. When a sketch needs information that is in `core_version.h`, you have to build a dummy sketch 1st to get `core_version.h` created. Since `core_version.h` is created after the sketch is compiled. Moved rebuild recipe hook for running `makecorever.py` core to run before all _specific_ prebuild hooks. While this form of prebuild hook is not explicitly listed, it seems like an intuitive expectation. Recipie hooks of this form: ``` recipe.hooks.prebuild.NUMBER.pattern=... ``` build before recipies of this form: ``` recipe.hooks.SPECIFIC.prebuild.NUMBER.pattern=... ``` where `SPECIFIC` would be: sketch, libraries, core, linking, ... * Added hack comment to platform.txt. --- platform.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform.txt b/platform.txt index e11d4c3fe..25c14c97e 100644 --- a/platform.txt +++ b/platform.txt @@ -85,7 +85,8 @@ compiler.elf2hex.extra_flags= ## generate file with git version number ## needs git recipe.hooks.sketch.prebuild.pattern="{runtime.tools.python3.path}/python3" "{runtime.tools.signing}" --mode header --publickey "{build.source.path}/public.key" --out "{build.path}/core/Updater_Signing.h" -recipe.hooks.core.prebuild.pattern="{runtime.tools.python3.path}/python3" "{runtime.tools.makecorever}" --build_path "{build.path}" --platform_path "{runtime.platform.path}" --version "unix-{version}" +# This is quite a working hack. This form of prebuild hook, while intuitive, is not explicitly documented. +recipe.hooks.prebuild.10.pattern="{runtime.tools.python3.path}/python3" "{runtime.tools.makecorever}" --build_path "{build.path}" --platform_path "{runtime.platform.path}" --version "unix-{version}" ## Build the app.ld linker file recipe.hooks.linking.prelink.1.pattern="{compiler.path}{compiler.c.cmd}" -CC -E -P {build.vtable_flags} "{runtime.platform.path}/tools/sdk/ld/eagle.app.v6.common.ld.h" -o "{build.path}/local.eagle.app.v6.common.ld"