Saturday 5 September 2009

Makefile - using variables and automatically running programs

In this Makefile I've started using variables in preparation for my next update when I compile each source file separately.

I've also added the command './a.out' so that my unit tests run automatically at the end.


CXXFLAGS = -g -Wall -D_REENTRANT

LIBS = -lGL \
-lboost_unit_test_framework \
-lboost_serialization

INCPATH = -Iapp \
-Icritter \
-Ienvironment \
-Igraphics \
-Iui \
-Iutils \
-I/usr/local/Trolltech/Qt-4.4.3/include/QtCore \
-I/usr/local/Trolltech/Qt-4.4.3/include/QtGui \
-I/usr/local/Trolltech/Qt-4.4.3/include/QtOpenGL \
-I/usr/local/Trolltech/Qt-4.4.3/include \
-I/usr/include/GL

all :
g++ $(CXXFLAGS) \
test/TestGenome.cpp \
critter/brain.cp \
critter/BrainParam.cp \
utils/misc.cp \
critter/genome.cp \
$(LIBS) \
$(INCPATH)
./a.out

No comments:

Post a Comment