version=2.3.0

## paths
compiler.ulp.path={runtime.tools.ulptool.path}/esp32ulp-elf-binutils/bin/
tools.ulptool.path={runtime.tools.ulptool.path}/

## tool name
tools.ulptool.cmd=esp32ulp_build_recipe.py

## ulp build tool
compiler.s.cmd=python "{tools.ulptool.path}{tools.ulptool.cmd}"

## ulp_main.ld file address
compiler.c.elf.extra_flags="-L{build.path}/sketch/" -T ulp_main.ld "{build.path}/sketch/ulp_main.bin.bin.o"

## add ulptool.h to g++
compiler.cpp.extra_flags="-I{tools.ulptool.path}/include/ulptool"

## compile '.s' (ulp) files
recipe.hooks.core.postbuild.01.pattern={compiler.s.cmd} {compiler.cpreprocessor.flags} -b {build.path} -p {runtime.platform.path} -u {compiler.ulp.path} -x {compiler.path} -t {tools.ulptool.path} --DF_CPU={build.f_cpu} --DARDUINO={runtime.ide.version} --DARDUINO_={build.board} --DARDUINO_ARCH_={build.arch} --DARDUINO_BOARD="{build.board}" --DARDUINO_VARIANT="{build.variant}"

## run esp32.ld linker script through c preprocessor
#recipe.hooks.core.postbuild.02.pattern="{compiler.path}{compiler.c.elf.cmd}" -E -P -C -xc -o "{compiler.sdk.path}/ld/esp32_out.ld" "-I{compiler.sdk.path}/include/config" "{compiler.sdk.path}/ld/esp32.ld"
