DEPFILE with Makefile generators

Thanks, @jtxa, for your reply!

I’m sure I misunderstand something, but I’m not sure it’s exactly what you said. In my example, the DEPFILE is generated_file.d That’s what I tell CMake with the DEPFILE clause. I don’t expect that touching that file will trigger a build. The file I’m touching is called depfile.d. Granted, the name would lead one to believe that’s “a depfile.” Indeed, its contents are in “depfile format,” but in this setup it’s being used just as a dependency of generate_file.c

I’m a CMake novice, but I have some experience with make. I’m used to -include’ing .d files, and I was expecting an $(error) statement in there to cause make to blow up. I see now that was not a valid expectaction.

In case someone knows, my actual problem is that I’m working on a big project, I have a custom_command, I put a DEPFILE in it, and things are not behaving the way I expect them to behave.

  1. How can I confirm that the DEPFILE is being read? By make, CMake, or whatever is supposed to read it. To be clear, the depfile I’m using has one target and many dependencies listed for that target. It looks exactly like the output of a gcc -M run.
  2. Once I know the file is being read, how can I tell that it’s being processed correctly? That is, how can I tell that the dependencies in the depfile are being “attached” to the target? That should let me check that, for example, the paths I used are correct.

Thank you!