What is a Build System

vickyrare

vickyrare
Apr 21, 2009
103
0
21
Karachi
What is a Build System:

As the name suggests, a system which build something, but what something, good question. Obviously software. So a build system is used to build complex piece of software. If you are building a home brew software applications then you probably don't need a build system, but you are building an industry standard software application then there is no way around, you must have a build system.

A build system in a nutshell takes the software through all necessary stage such as compiling, linking, running both batch and unit tests and at the end packaging the software application in the form of an installer.

A build system is a sort of software that can be built in-house or can be bought or can be an open source software. A problem with in-house system is that you have to build and maintain it by hand which can become a nightmare to maintain. Open source build system are good, but then may be it does not fully fulfills your requirement.

Nearly all big software companies use some kind of build system. A build system minimizes the complexity of creating the software by shielding the programmer from how the software will be built and allows them to concentrate on the programming side of the application.

The build system must be able to handle all kind of languages such as C, C++, Java and vice versa.
A build system basically keep track of all dependencies and make sure that only the piece of code which been changed is built as you cannot afford to built everyone.

The company I worked with uses a mixture of both in-house and open source build system. It work well for us as in-houses allow us to customize our requirements and then on top of that open source offers more functionality. Our build system takes nearly 5 hours to get the final installer.

As an industry standard software potentially involves thousand of files, you don't want to compile and link zillions of file although you only changed a single file.

You basically modularize your software, you don't want to compile everything once you have change a line of code. If you are working on a code related to rendering then only the rendering library has to be compiled. The build system takes care of all this headaches, whats's needed from the programmer is the modularization of the code. Large and complex software's can take potentially days if build from ground up.

Game programmers should be able to understand and use a build system.

Various Build System:

make:

The origin of make is unix based. Its a really old build system which still work quite well. The scripts created are not platform independent, so they will not work out of the box on other platforms. Scripts are written as plain text.

NMake:

Nmake comes with Visual Studio. Its a make type build system which operates on nmake scripts.

Ant:

Ant was introduced to overcome some of the inherent problems found in original make. It is platform dependent as it is written in Java. Scripts are written in xml format.

CMake:

Cmake is not a real build system, but it allows user to get platform independent scripts for all major build systems. You run cmake on top of your source code and get build scripts for make, nmake and other build systems. But make and nmake are the mostly used build technology.

An example build script for make.

Code:
# A test Makefile

CC = g++
FLAGS = -Wall
OBJS = abc.o
INCDIR = ../../include

abc.exe :    ${OBJS}  
    ${CC} ${FLAGS} -o $@  ${OBJS}

abc.o : abc.c    
    ${CC} -c $< 
clean:
    rm -f *.o
You have 3 targets in this Makefile which are

abc.exe creates executable abc.exe
abc.o compiles the file abc.c
clean cleans *.o files

To use the makefile, type make. When called with no arguments, the first target in the makefile is built, producing the executable ‘abc.exe’.

To use the target abc.o type

Code:
make abc.o
To use the target clean type
Code:
make clean
To read further about build systems, follow these links

http://en.wikipedia.org/wiki/Build_system

http://en.wikipedia.org/wiki/Nmake#Modern_versions

http://en.wikipedia.org/wiki/Apache_Ant

http://en.wikipedia.org/wiki/Cmake

http://www.network-theory.co.uk/docs/gccin...ccintro_16.html

http://en.wikipedia.org/wiki/Make_(software)
 
Last edited:
General chit-chat
Help Users
We have disabled traderscore and are working on a fix. There was a bug with the plugin | Click for Discord
  • No one is chatting at the moment.
    NaNoW NaNoW: ....