-
Notifications
You must be signed in to change notification settings - Fork 32
Makefile
dstoeckel edited this page Feb 25, 2015
·
2 revisions
The current version of BALL uses the CMake build system. We highly recommend that you also use CMake for projects depending on BALL 1.4. For this we provide configure files that can simply be added to you project. (See UsingCMakeExternally). If you already have chosen a different build system, you are unfortunately on your own.
If you use BALL version 1.3, the following much simpler Makefile suffices:
include /home/myhome/BALL/source/common.mak
ADD_CXXFLAGS+=-g
.C:
$(CXX) $(CXXFLAGS) $(LDFLAGS) $(ADD_CXXFLAGS) $(CPP_MODE_FLAGS) $(LIB_CXXFLAGS) $(BALL_INCLUDES) $(ADD_INCLUDES) [email protected] -o $@ $(LIBS)
The code here is a very basic and dumb Makefile you can use to get your BALL programs to build. If your project is somewhat larger, you should consider to use a smarter build system.
#Replace the source files below with your own
SOURCES=source1.C source2.C
#Point this variable to the path where the BALL headers can be found
BALL_INCLUDE_DIR=/path/to/BALL/headers
#Point this variable to the path where the BALL libraries can be found
BALL_LIBRARY_DIR=/path/to/BALL/libs
#Add additional include directories prefixed with -I here
INCDIRS=-I{BALL_INCLUDE_DIR}
#Add additional library paths prefixed with -L here
LIBDIRS=-L${BALL_LIBRARY_DIR}
#Add additional libraries here
LIBS=-lBALL
#Insert the name of your program here
PROGRAM=bla
OBJECTS=${SOURCES:.C:=.o}
${PROGRAM}: ${OBJECTS}
${CXX} ${CXXFLAGS} $^ -o $@ ${LIBDIRS} ${LIBS}
%.o: %.C %.h
${CXX} ${CXXFLAGS} ${INCDIRS} -c $<
%.o: %.C
${CXX} ${CXXFLAGS} ${INCDIRS} -c $<