Building in the source tree. I don't like it. Do you?

Steven T. Hatton hattons at globalsymmetry.com
Fri Feb 13 10:48:04 UTC 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

A long time ago I was trying to compile someting called KDE alph-4.  I 
couldn't get it to build on Solaris, so I posted to the kde users list.  The 
person who responded told me I needed to recompile gcc to make it work.  He 
gave me basic instructions on how to do this.  One aspect of those 
instructions as that I should create a build-directory at the same level as 
the root of the source tree, and cd into build-directory, 
then ../source-directory/configure $MY_CONFIG_ARGS && make && make install.

Most source will support this practice.  At first I was very insecure about 
trying something which seemed a radical departure from the norm.  I've since 
taken an extreme liking to that approach to compiling.  While working with 
KDevelop, I've discovered that the cvs tree frequently fails when attempting 
to build in this manner.  I believe that failure represents a bug, but this 
may well be a matter of personal taste.

I've also noticed that the default project configuration mixes source and 
object files.  I know there is/was a way around this, but IIRC, it is not 
intuitively obvious, and not supported directly by the (GUI) tools. IOW, 
there's no option to click which says 'select a build directory for 
compilation results'.  I'm not really sure if the same kind of separation of 
'real' source and moc generated files could be accomplished, but it seems 
desirable.  I guess the general theme of what I'm driving at is the original 
source tree should be virtually unchanged by the build process.  If generated 
code /does/ end up in the source tree, it should be placed in a separate 
directory, if possible.

What do others think of these suggestions.

STH
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFALJ02H2SF0i7rrGwRAjHmAKCnDCoQJxIsqz+xARJRp5kde8RT8QCfZiRs
49TO6J2/s1qtLknbJzN3eKE=
=H6pP
-----END PGP SIGNATURE-----




More information about the KDevelop-devel mailing list