[CMake] makefile generator
Jesper Eskilson
jesper at eskilson.se
Thu Apr 19 09:40:31 EDT 2007
2007/4/19, Bill Hoffman <bill.hoffman at kitware.com>:
> Jesper Eskilson wrote:
> >
> >>
> >
> > Can you (or anyone else) elaborate on this? What features are abscent
> > from other makes which are necessary to avoid recursive make calls?
> > I've got a fair amount of experience of writing complex makefiles for
> > gmake, but very little experience with other makes.
> >
> > I like fast incremental builds over the entire project, i.e. I would
> > like to be able to do "make all' and have it completed in under 2-3
> > seconds. In Visual Studio this is impossible, but my hope was the that
> > Makefile generator could get me somewhere around that mark.
> >
> > (I'm trying to figure out how much effort it would be to write my own
> > generator, but I'm not sure what backend build engine I should target,
> > if I should write it from scratch, or try to adapt one of the existing
> > generators).
> >
> > Anyway, despite some of its quirks, CMake is great. The simple fact
> > that cmake gets me away from visual studio project files is worth
> > alot.
> >
>
> Here is a simple example:
>
>
> foo: foo.h
> ....
>
> If you remove foo.h, make will give an error that foo.h does not exist
> and fail to build.
> Cmake does the following to get around this:
>
> make check_build_system (check for missing files etc, this step could
> regenerate all makefiles)
> At this point you have to run another make, because all of the makefiles
> may have been changed.
> Gmake will reload changed makefiles, but nmake and other makes will not.
>
>
> Look back at Brad's steps :
>
> 1.) Top level invoked by user. Check build system integrity.
> 2.) Inter-target dependency rules. Build targets in a valid order.
> 3.) Intra-target dependency rules for a single target.
> a.) Update generated sources.
> Update implicit dependencies (do scanning if necessary).
> b.) Build sources and link target.
>
> These steps are unavoidable. I would not waste your time with a new
> generator, it will
> not have full functionality.
I actually was thinking about not generating makefiles at all, but
look into some other backend build engine. Using Ant crossed my mind.
> We really tried to eliminate recursive
> make, and have
> considered writing a paper "why recursive make is a necessary evil" to
> counter
> the popular but misleading "why recursive make is bad". The makefiles we
> have still handle inter-target depends at a high level and do not depend
> on the
> order of recursive make to build things correctly. However, do to
> generated
> file issues and dependency maintenance you still have to invoke more
> copies of make.
>
> -Bill
>
>
Ok, thanks.
--
/Jesper
More information about the CMake
mailing list