msdk
msdk copied to clipboard
Makefile does not recompile despite dependent header file changes on MSYS2
I am not seeing recompilation happen if I edit a header file and then recompile. Minimal example to repro using VS Code hello_world example.
- Clean and build the hello_world project. Observe the build task terminal output:
Loaded project.mk
CC main.c
CC C:/MaximSDK/Libraries/Boards/MAX32670/EvKit_V1/Source/board.c
CC C:/MaximSDK/Libraries/Boards/MAX32670/EvKit_V1/../Source/stdio.c
CC C:/MaximSDK/Libraries/Boards/MAX32670/EvKit_V1/../Source/led.c
CC C:/MaximSDK/Libraries/Boards/MAX32670/EvKit_V1/../Source/pb.c
AS C:/MaximSDK/Libraries/CMSIS/Device/Maxim/MAX32670/Source/GCC/startup_max32670.S
CC C:/MaximSDK/Libraries/Boards/MAX32670/EvKit_V1/Source/rom_stub.c
CC C:/MaximSDK/Libraries/CMSIS/Device/Maxim/MAX32670/Source/heap.c
CC C:/MaximSDK/Libraries/CMSIS/Device/Maxim/MAX32670/Source/system_max32670.c
LD <mydir>/examples/max32670_hello_world/build/max32670_hello_world.elf
arm-none-eabi-size --format=berkeley <mydir>/examples/max32670_hello_world/build/max32670_hello_world.elf
text data bss dec hex filename
35676 2500 628 38804 9794 <mydir>/examples/max32670_hello_world/build/max32670_hello_world.elf
- Open <MaximSDK>/Libraries/Boards/MAX32670/EvKit_V1/Include/board.h and change CONSOLE_BAUD to some other value, e.g. 9600.
- Build again (without cleaning). Observe that no compilation occurs in the task terminal output:
Loaded project.mk
arm-none-eabi-size --format=berkeley <mydir>/examples/max32670_hello_world/build/max32670_hello_world.elf
text data bss dec hex filename
35676 2500 628 38804 9794 <mydir>/examples/max32670_hello_world/build/max32670_hello_world.elf
- Confirm via serial terminal that baud is still the original value, not the new value.
The same behavior is seen if, instead of modifying board.h, I include a new main.h file in my copy of the example and override the CONSOLE_BAUD there.
I looked into tweaking gcc.mk to address this (e.g. using an approach like this) but I could not get it to work due to lack of experience with GNU-make. I do see that the *.d dependencies are already being generated as part of the existing MSDK build approach, but it still appears as though changes to (some?) headers do not prompt recompilation via the makefile like I would have expected.