View Single Post
  #6   (View Single Post)  
Old 13th February 2011
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

Well for the kind of way *I* like to do C/C++ builds, it's rather a pile of shiat.

I like to have a directory OUT of source tree for storing object files, a directory or two for source (depending on whether there are any external headers), plus a separate folder to place the files that need to be "Distributed" in. I also like to use the same build instructions for EACH toolkit and OS when possible.

This usually leads to a tree that looks like:

Code:
ProjectName/
  README
  HACKING
  COPYING
  include/
    external include files to go in $PREFIX/include/ and be used like "#include <projectname/filename.ext>" in the projects own source.
  source/  # or src
    module name/
      source and internal headers for this module
  build/
    config/
      arch/
        toolkit name/
          osname/
            module name/
              object files created from building that module for the given configuration (e.g. release, debug, etc) for the given arch and OS.
  dist/
    config/
      arch/
        toolkit name/
          osname/
            everything needed to run in that environment

Trying to do that with scons took about 3 days of abuse and more than a few kludges to deal with platform specific issues it should have handled itself. By that, I mean it knowing how to compile/link stuff with the correct smarts enough that I'm not better off writing the whole thing as a perl script.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote