Thread: Complex Source Management and Compillation

  1. #1
    Registered User
    Join Date
    Jul 2008
    Posts
    58

    Complex Source Management and Compillation

    I'm rather new to compiling and creating large projects that include many source files, header files, resource files etc... since i've only really programmed code that fits within one to two files, extensive games, VGA fractal programs etc... however since I've really gotten into C++ I want to learn how to manage many files that can be easly altered and manipulated to change a desired effect. Like makeing .h files for each fractal type withing a fractal rendering program for example.

    When I download other peoples source and binary files I find that 90% of the time I can't compile for my life their projects! I want to be able to compile a linux distro, or any project I want that I can download. I think that I don't know enough about how the workings of project managment go, and therefor I lack skill in programming that I really want!

    I would like to know how to manage source files, and work with the GNU compiler GCC. I use DevCpp for everything, but I want to know how to compile the likes of Blender the 3D application, or other open source applications of the like. Understanding how to do this I belive would make me a better programmer and I would really appreciate any help on the matter!!!

    -In advance, THANK YOU!

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    In general, in Linux, you'd use a makefile to process the compiling of source code and linking of the resulting object files into one or more executable files.

    Some project use "makefile generators" such as Automake and configuration tools such as ./configure to set up things for the compile. This is for "really complex" projects.

    Of course, most of the time the reason I fail to build things is down to two things:
    1. The source code isn't compatible with the current version of tools and libraries I've got.
    2. I haven't got some library that the project relies on.

    Dev-CPP's management of "projects" automatically creates/maintains a sort of makefile for the project - but if you take on someone elses project, I'm not sure it can read arbitrary/complex makefiles to understand how the project should be built - after all, a makefile can do just about anything you want it to do [ download source from a web-site, send e-mails, create resource files, run make itself, etc, etc ]

    Edit: The overall answer to your question is far too complex to answer in this forum - large projects are usually not created in an instant, so they develop, and to build a large project takes a team of people. Someone in that team will (you hope) be somewhat of a specialist on how to maintain the overall project build system - whether that is a makefile or some other concept.

    --
    Mats
    Last edited by matsp; 08-29-2008 at 08:34 AM.
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed