[CMake] Dependencies and ADDITIONAL_MAKE_CLEAN_FILES

Phil Smith phil at voltage.com
Tue Sep 23 17:29:38 EDT 2008


I suspect these questions will mostly give y'all your entertainment for the day, but I freely admit my ignorance of things, so here goes.

Dependencies:
I'm working on porting existing code, so CMakeLists.txt already exists, and I've made changes to it that allow me to compile. But I don't understand how dependencies are determined.

For example, we have one file in a directory, call it A.c, that gets compiled; others in that directory don't and should be. But A.c isn't listed explicitly and neither is the directory. A.c does appear in one of the build.make and depend.make files, which I've proven are regenerated by CMAKE, so here's my real question:

How does CMAKE decide on its own that A.c is dependent on B.c, and that compiling A.c thus requires compiling B.c?

I've read the doc and Googled and looked at all the build.make and depend.make files, and there's clearly some figurin' out going on, but I don't understand it. A pointer or two would help here!


ADDITIONAL_MAKE_CLEAN_FILES:
Our cross-compiler generates assembler as a first-stage output, and the nature of the environment is such that it's easier to debug from assembler than C, so we keep a copy of that assembler as <fn>.ASM at compile time. Sometimes we also want the C listings. The thing is, these listings are huge -- can easily use 10GB of space, which I don't have to waste on this machine.

So I'd like to tell "make clean" to delete .ASM and .LST files when it deletes .o files. And ADDITIONAL_MAKE_CLEAN_FILES sounds like it's designed to do that. But again, I can't figure out how to get it to do so. An example would get me going, I'm sure.

Thanks in advance for any information!
--
...phsiii

Phil Smith III



More information about the CMake mailing list