Skip to content

Commit

Permalink
py/mkrules.mk: List hash files as byproducts.
Browse files Browse the repository at this point in the history
These are produced by the "cat" command to makeqstrdefs.py, to allow it to
not update unchanged files.  cmake doesn't know about them and so they are
not removed on a "clean".

This triggered a bug in makeqstrdefs.py where it would not recreate a
deleted output file (which is removed by clean) if a stale hash file with a
valid hash still existed.

Listing them as byproducts will cause them to be deleted on clean.

Signed-off-by: Trent Piepho <[email protected]>
  • Loading branch information
xyzzy42 authored and dpgeorge committed Dec 15, 2023
1 parent 85c0216 commit 0d93392
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions py/mkrules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ add_custom_command(
add_custom_command(
OUTPUT ${MICROPY_QSTRDEFS_COLLECTED}
COMMAND ${Python3_EXECUTABLE} ${MICROPY_PY_DIR}/makeqstrdefs.py cat qstr _ ${MICROPY_GENHDR_DIR}/qstr ${MICROPY_QSTRDEFS_COLLECTED}
BYPRODUCTS "${MICROPY_QSTRDEFS_COLLECTED}.hash"
DEPENDS ${MICROPY_QSTRDEFS_SPLIT}
VERBATIM
COMMAND_EXPAND_LISTS
Expand Down Expand Up @@ -136,6 +137,7 @@ add_custom_command(
add_custom_command(
OUTPUT ${MICROPY_MODULEDEFS_COLLECTED}
COMMAND ${Python3_EXECUTABLE} ${MICROPY_PY_DIR}/makeqstrdefs.py cat module _ ${MICROPY_GENHDR_DIR}/module ${MICROPY_MODULEDEFS_COLLECTED}
BYPRODUCTS "${MICROPY_MODULEDEFS_COLLECTED}.hash"
DEPENDS ${MICROPY_MODULEDEFS_SPLIT}
VERBATIM
COMMAND_EXPAND_LISTS
Expand All @@ -161,6 +163,7 @@ add_custom_command(
add_custom_command(
OUTPUT ${MICROPY_ROOT_POINTERS_COLLECTED}
COMMAND ${Python3_EXECUTABLE} ${MICROPY_PY_DIR}/makeqstrdefs.py cat root_pointer _ ${MICROPY_GENHDR_DIR}/root_pointer ${MICROPY_ROOT_POINTERS_COLLECTED}
BYPRODUCTS "${MICROPY_ROOT_POINTERS_COLLECTED}.hash"
DEPENDS ${MICROPY_ROOT_POINTERS_SPLIT}
VERBATIM
COMMAND_EXPAND_LISTS
Expand Down

0 comments on commit 0d93392

Please sign in to comment.