I use something like the following to generate dependency files when building
sdcc -MM foo.c
but I have found that -MM is not excluding system headers, and works the like -M.
$ ~/sdcc/bin/sdcc -MM foo.c
foo.rel: foo.c /home/steven/sdcc/bin/../share/sdcc/include/stdio.h \ /home/steven/sdcc/bin/../share/sdcc/include/stdarg.h \ /home/steven/sdcc/bin/../share/sdcc/include/sdcc-lib.h \ /home/steven/sdcc/bin/../share/sdcc/include/asm/mcs51/features.h foo.h
This could be a problem with how sdcc passes options intended for the preprocessor to sdcpp as I've found that the following works...
sdcpp -MM foo.c
$ ~/sdcc/bin/sdcpp -MM foo.c
foo.rel: foo.c foo.h
This provides a workround in many cases, but the expectation is that sdcc should pass -MM to the preprocessor (like gcc does). Hence I'm calling this as a bug rather than a feature request.
All the above with snapshot #5253 on Linux.
Log in to post a comment.