usedbytes / picowota

A bootloader for OTA WiFi code upload to a Raspberry Pi Pico W
BSD 3-Clause "New" or "Revised" License
116 stars 21 forks source link

CMakeLists.txt: fix dependencies to allow make -j #13

Closed mvds00 closed 1 year ago

mvds00 commented 1 year ago

As ${APP_BIN} and ${APP_HDR_BIN} are not true targets, the dependency on them effectively only required the .bin files to be present.

When building with make -j, this led to the situation that the target ${NAME}_hdr finished before compiling the project, in case there were .bin files left from previous builds, leading to ${NAME}_hdr.bin files containing invalid CRCs.

Setting the dependencies on ${NAME} fixes this issue. The reasoning is that if target ${NAME} is built, ${APP_BIN} should have been generated. There is no need to depend on both ${NAME} and ${NAME}_hdr, as ${NAME}_hdr already depends on ${NAME}.

mvds00 commented 1 year ago

ps. when starting from a clean build dir, make -j will fail exactly because ${APP_BIN} is not a buildable target; make will complain there is no rule to make target project.bin.

usedbytes commented 1 year ago

Thanks for this one - I'd run into it, but never bothered to look into the problem