I have a long-standing problem with various S32DS projects (for S32k architecture - specifically s32k14x), where, if I change a source file, and rebuild via 'build project', then the toolchain does not see the changed dependency, and does not generate new built output (elf/hex/s19). The build/make output is as follows:
10:54:59 **** Incremental Build of configuration Debug for project S32K_Bootloader ****
make -j8
make: 'src/adc_poll.o' is up to date.
10:55:00 Build Finished. 0 errors, 0 warnings. (took 809ms)
If, however, I clean and then build, I get a fresh new build output that reflects my change.
This seems to tend to happen to my projects when I transition to a new PC (every 5 years or so). I suspect that the issue has something to do with projects getting created in an older version of S32DS, and then being imported into a newer version - but I'm not positive. I'm currently using S32DS for S32 Platform, Version 3.4. The project in question was initially created in may 2018 (probably with whatever S32DS version was current at that time
This has happened to about half a dozen projects over the years, and seems to also occur with S32DS for Power Architecture.
I've found that if I remake the project in S32DS (ie start with a new project, and then re-add all my source files, change all my project settings, etc), then incremental builds work properly. This is a pain , though, and I have some buried project settings changes, custom linker scripts, startup files, etc and i'm always nervous I've forgotten something.
I've looked at the various make artifacts, and have never been able to identify the problem. subdir.mk correctly includes the .c file that I changed (main.c), the main.d include main.c as a dependency, and yet when I change main.c, The build stops at 'xxx is up to date', make seems to think nothing has changed to necessitate a new build, and no new build artifact is created.
I've attached a 'minimum viable' demonstration project. If I import this project into s32ds (s32k platform) v3.4, and do a clean build, then change the 'i+=1;' in main.c, to 'i+=2' (i is volatile), then to an incremental build, then i get no new build artifact.
Does anyone have any idea why this is happening? Even some ideas on what/where to look would be valuable.