Skip to content
Snippets Groups Projects
Commit 80a3151d authored by Oliver Bock's avatar Oliver Bock
Browse files

Added automated build of the starsphere application

* Amended and added Makefiles where necessary
** Fixed/optimized Makefiles with regard to static linking
** Added install targets
* Implemented build_starsphere() in build script
* The framework part is built as a static library

Notes:
* ORC might eventually be an API (library) rather than an executable
* There are minor dependencies between the framework and the graphics implementations due to GraphicsEngineFactory
** This currently prevents the framework to become truely independent (BOINC integration)
** Plugins could be a solution to this...
parent 48ae9602
No related branches found
No related tags found
No related merge requests found
......@@ -56,6 +56,9 @@ prepare_generic()
mkdir -p build/freetype2 >> $ROOT/setup.log
mkdir -p build/oglft >> $ROOT/setup.log
mkdir -p build/boinc >> $ROOT/setup.log
mkdir -p build/framework >> $ROOT/setup.log
mkdir -p build/orc >> $ROOT/setup.log
mkdir -p build/starsphere >> $ROOT/setup.log
echo "Preparing install tree..." | tee -a $ROOT/setup.log
mkdir -p install/bin >> $ROOT/setup.log
......@@ -180,7 +183,33 @@ build_mingw()
build_starsphere()
{
echo "Not yet implemented: build_starsphere()"
echo "Building Starsphere [ORC] (this may take a while)..." | tee -a $ROOT/setup.log
export ORC_SRC=$ROOT/src/orc
export ORC_INSTALL=$ROOT/install
cd $ROOT/build/orc
cp $ROOT/src/orc/Makefile . >> $ROOT/setup.log
make >> $ROOT/setup.log
make install >> $ROOT/setup.log
echo "Successfully built and installed Starsphere [ORC]!" | tee -a $ROOT/setup.log
echo "Building Starsphere [Framework] (this may take a while)..." | tee -a $ROOT/setup.log
export FRAMEWORK_SRC=$ROOT/src/framework
export FRAMEWORK_INSTALL=$ROOT/install
cd $ROOT/build/framework
cp $ROOT/src/framework/Makefile . >> $ROOT/setup.log
make >> $ROOT/setup.log
make install >> $ROOT/setup.log
echo "Successfully built and installed Starsphere [Framework]!" | tee -a $ROOT/setup.log
echo "Building Starsphere [Application] (this may take a while)..." | tee -a $ROOT/setup.log
export STARSPHERE_SRC=$ROOT/src/starsphere
export STARSPHERE_INSTALL=$ROOT/install
cd $ROOT/build/starsphere
cp $ROOT/src/starsphere/Makefile . >> $ROOT/setup.log
cp $ROOT/src/starsphere/*.res . >> $ROOT/setup.log
make >> $ROOT/setup.log
make install >> $ROOT/setup.log
echo "Successfully built and installed Starsphere [Application]!" | tee -a $ROOT/setup.log
}
build_linux()
......
###########################################################################
# Copyright (C) 2008 by Oliver Bock #
# oliver.bock[AT]aei.mpg.de #
# #
# This file is part of Einstein@Home. #
# #
# Einstein@Home is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published #
# by the Free Software Foundation, version 2 of the License. #
# #
# Einstein@Home is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with Einstein@Home. If not, see <http://www.gnu.org/licenses/>. #
# #
###########################################################################
# path settings
FRAMEWORK_SRC?=$(PWD)
FRAMEWORK_INSTALL?=$(PWD)
# config values
CXX?=g++
# variables
CPPFLAGS = $(shell $(FRAMEWORK_INSTALL)/bin/sdl-config --cflags)
CPPFLAGS += $(shell $(FRAMEWORK_INSTALL)/bin/freetype-config --cflags)
CPPFLAGS += -I$(FRAMEWORK_INSTALL)/include/BOINC -I/usr/include
DEPS = Makefile
OBJS = AbstractGraphicsEngine.o GraphicsEngineFactory.o WindowManager.o Resource.o ResourceFactory.o BOINCClientAdapter.o
DEBUGFLAGSCPP = -pg -ggdb -O0
# TODO: GraphicsEngineFactory obviously depends on the actual implementations (here starsphere)! need to change the structure! what about plugins?
CPPFLAGS += -I$(FRAMEWORK_SRC) -I$(FRAMEWORK_SRC)/../starsphere
# primary role based tagets
default: release
debug: libframework.a
memcheck: clean debug
callgrind: clean debug
release: clean libframework.a
# target specific options
debug: CPPFLAGS += $(DEBUGFLAGSCPP)
release: CPPFLAGS += -DNDEBUG -O3 -Wall -Wno-switch-enum
release: LDFLAGS += -s
# file based targets
libframework.a: $(OBJS)
ar rcs libframework.a $(OBJS)
AbstractGraphicsEngine.o: $(DEPS) $(FRAMEWORK_SRC)/AbstractGraphicsEngine.cpp $(FRAMEWORK_SRC)/AbstractGraphicsEngine.h
$(CXX) -g ${CPPFLAGS} -c $(FRAMEWORK_SRC)/AbstractGraphicsEngine.cpp
GraphicsEngineFactory.o: $(DEPS) $(FRAMEWORK_SRC)/GraphicsEngineFactory.cpp $(FRAMEWORK_SRC)/GraphicsEngineFactory.h
$(CXX) -g ${CPPFLAGS} -c $(FRAMEWORK_SRC)/GraphicsEngineFactory.cpp
WindowManager.o: $(DEPS) $(FRAMEWORK_SRC)/WindowManager.cpp $(FRAMEWORK_SRC)/WindowManager.h
$(CXX) -g ${CPPFLAGS} -c $(FRAMEWORK_SRC)/WindowManager.cpp
BOINCClientAdapter.o: $(DEPS) $(FRAMEWORK_SRC)/BOINCClientAdapter.cpp $(FRAMEWORK_SRC)/BOINCClientAdapter.h
$(CXX) -g ${CPPFLAGS} -c $(FRAMEWORK_SRC)/BOINCClientAdapter.cpp
ResourceFactory.o: $(DEPS) $(FRAMEWORK_SRC)/ResourceFactory.cpp $(FRAMEWORK_SRC)/ResourceFactory.h
$(CXX) -g ${CPPFLAGS} -c $(FRAMEWORK_SRC)/ResourceFactory.cpp
Resource.o: $(DEPS) $(FRAMEWORK_SRC)/Resource.cpp $(FRAMEWORK_SRC)/Resource.h
$(CXX) -g ${CPPFLAGS} -c $(FRAMEWORK_SRC)/Resource.cpp
# tools
install:
cp libframework.a $(ORC_INSTALL)/lib
clean:
rm -f $(OBJS) libframework.a
......@@ -18,11 +18,15 @@
# #
###########################################################################
# path settings
ORC_SRC?=$(PWD)
ORC_INSTALL?=$(PWD)
# config values
CXX?=g++
DEBUGFLAGSCPP=-DDEBUG -pg -ggdb -O0
OBJS=ResourceCompiler.o orc.o
DEPS=Makefile ResourceCompiler.h
OBJS=ResourceCompiler.o
DEPS=Makefile
# primary role based tagets
default: release
......@@ -35,14 +39,14 @@ release: CPPFLAGS += -O3 -Wall -Wno-switch-enum
release: LDFLAGS += -s
# file specific targets
orc: $(DEPS) ResourceCompiler.cpp orc.cpp ${OBJS}
$(CXX) -g ${CPPFLAGS} ResourceCompiler.cpp orc.cpp -o orc
orc: $(DEPS) $(ORC_SRC)/orc.cpp $(OBJS)
$(CXX) -g $(CPPFLAGS) $(ORC_SRC)/orc.cpp -o orc $(OBJS)
orc.o: $(DEPS) orc.cpp
$(CXX) -g ${CPPFLAGS} -c orc.cpp
ResourceCompiler.o: $(DEPS) $(ORC_SRC)/ResourceCompiler.cpp $(ORC_SRC)/ResourceCompiler.h
$(CXX) -g $(CPPFLAGS) -c $(ORC_SRC)/ResourceCompiler.cpp
ResourceCompiler.o: $(DEPS) ResourceCompiler.cpp
$(CXX) -g ${CPPFLAGS} -c ResourceCompiler.cpp
install:
cp orc $(ORC_INSTALL)/bin
clean:
rm -f ${OBJS} orc
\ No newline at end of file
rm -f $(OBJS) orc
###########################################################################
# Copyright (C) 2004 David Hammer, Eric Myers, Bruce Allen #
# Copyright (C) 2008 Bernd Machenschalk #
# #
# Copyright (C) 2008 by Oliver Bock #
# oliver.bock[AT]aei.mpg.de #
# #
......@@ -21,18 +18,32 @@
# #
###########################################################################
# point this to where you installed BOINC (--prefix you gave to configure, defaults to $BOINC_PREFIX)
BOINC_PREFIX ?= /home/oliver/development/aei/boinc
# path settings
STARSPHERE_SRC?=$(PWD)
STARSPHERE_INSTALL?=$(PWD)
# config values
CXX ?= g++
# variables
LIBS = -L${BOINC_PREFIX}/lib -Bstatic $(shell sdl-config --static-libs) $(shell freetype-config --libs) -lOGLFT -lboinc_api -lboinc -Wl,-Bdynamic -lGL -lGLU
CPPFLAGS = -DOGLFT_NO_SOLID -DOGLFT_NO_QT -I/usr/include $(shell sdl-config --cflags) $(shell freetype-config --cflags) -I${BOINC_PREFIX}/include/BOINC
LIBS = -Wl,-Bstatic -lframework -lOGLFT -L$(STARSPHERE_INSTALL)/lib
LIBS += $(shell $(STARSPHERE_INSTALL)/bin/freetype-config --libs)
LIBS += -lboinc_api -lboinc -L/usr/lib
LIBS += -Wl,-Bdynamic $(shell $(STARSPHERE_INSTALL)/bin/sdl-config --static-libs) -lGL -lGLU
CPPFLAGS = -I$(FRAMEWORK_INSTALL)/include
CPPFLAGS += $(shell $(STARSPHERE_INSTALL)/bin/sdl-config --cflags)
CPPFLAGS += $(shell $(STARSPHERE_INSTALL)/bin/freetype-config --cflags)
CPPFLAGS += -I$(BOINC_PREFIX)/include/BOINC -I/usr/include
DEPS = Makefile
OBJS = starlist.o snr_list.o pulsar_list.o AbstractGraphicsEngine.o GraphicsEngineFactory.o Starsphere.o StarsphereS5R3.o WindowManager.o ${RESOURCESPEC}.o Resource.o ResourceFactory.o BOINCClientAdapter.o EinsteinS5R3Adapter.o
OBJS = Starsphere.o StarsphereS5R3.o EinsteinS5R3Adapter.o starlist.o snr_list.o pulsar_list.o $(RESOURCESPEC).o
DEBUGFLAGSCPP = -pg -ggdb -O0
RESOURCESPEC = resources
# TODO: GraphicsEngineFactory obviously depends on the actual implementations (here starsphere)! need to change the structure! what about plugins?
CPPFLAGS += -I$(STARSPHERE_SRC) -I$(STARSPHERE_SRC)/../framework
# primary role based tagets
default: release
debug: starsphere
......@@ -48,58 +59,42 @@ release: CPPFLAGS += -DNDEBUG -O3 -Wall -Wno-switch-enum
release: LDFLAGS += -s
# file based targets
starsphere: $(DEPS) main.cpp $(OBJS)
$(CXX) -g ${CPPFLAGS} ${LDFLAGS} main.cpp -o starsphere ${OBJS} ${LIBS}
Starsphere.o: $(DEPS) Starsphere.cpp
$(CXX) -g ${CPPFLAGS} -c Starsphere.cpp
StarsphereS5R3.o: $(DEPS) StarsphereS5R3.cpp
$(CXX) -g ${CPPFLAGS} -c StarsphereS5R3.cpp
starsphere: $(DEPS) $(STARSPHERE_SRC)/main.cpp $(OBJS)
$(CXX) -g $(CPPFLAGS) $(LDFLAGS) $(STARSPHERE_SRC)/main.cpp -o starsphere $(OBJS) $(LIBS)
AbstractGraphicsEngine.o: AbstractGraphicsEngine.cpp
$(CXX) -g ${CPPFLAGS} -c AbstractGraphicsEngine.cpp
Starsphere.o: $(DEPS) $(STARSPHERE_SRC)/Starsphere.cpp $(STARSPHERE_SRC)/Starsphere.h
$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/Starsphere.cpp
GraphicsEngineFactory.o: GraphicsEngineFactory.cpp
$(CXX) -g ${CPPFLAGS} -c GraphicsEngineFactory.cpp
StarsphereS5R3.o: $(DEPS) $(STARSPHERE_SRC)/StarsphereS5R3.cpp $(STARSPHERE_SRC)/StarsphereS5R3.h
$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/StarsphereS5R3.cpp
WindowManager.o: Makefile WindowManager.cpp
$(CXX) -g ${CPPFLAGS} -c WindowManager.cpp
EinsteinS5R3Adapter.o: Makefile $(STARSPHERE_SRC)/EinsteinS5R3Adapter.cpp $(STARSPHERE_SRC)/EinsteinS5R3Adapter.h
$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/EinsteinS5R3Adapter.cpp
BOINCClientAdapter.o: Makefile BOINCClientAdapter.cpp
$(CXX) -g ${CPPFLAGS} -c BOINCClientAdapter.cpp
starlist.o: $(DEPS) $(STARSPHERE_SRC)/starlist.C
$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/starlist.C
EinsteinS5R3Adapter.o: Makefile EinsteinS5R3Adapter.cpp
$(CXX) -g ${CPPFLAGS} -c EinsteinS5R3Adapter.cpp
snr_list.o: $(DEPS) $(STARSPHERE_SRC)/snr_list.C
$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/snr_list.C
starlist.o: $(DEPS) starlist.C
$(CXX) -g ${CPPFLAGS} -c starlist.C
snr_list.o: $(DEPS) snr_list.C
$(CXX) -g ${CPPFLAGS} -c snr_list.C
pulsar_list.o: $(DEPS) pulsar_list.C
$(CXX) -g ${CPPFLAGS} -c pulsar_list.C
pulsar_list.o: $(DEPS) $(STARSPHERE_SRC)/pulsar_list.C
$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/pulsar_list.C
# resource compiler
ResourceFactory.o: ${RESOURCESPEC}.o Resource.o ResourceFactory.cpp ResourceFactory.h
$(CXX) -g ${CPPFLAGS} -c ResourceFactory.cpp -o ResourceFactory.o
Resource.o: Resource.cpp Resource.h
$(CXX) -g ${CPPFLAGS} -c Resource.cpp -o Resource.o
${RESOURCESPEC}.o: ${RESOURCESPEC}.orc
orc/orc ${RESOURCESPEC}.orc ${RESOURCESPEC}.cpp
$(CXX) -g ${CPPFLAGS} -c ${RESOURCESPEC}.cpp -o ${RESOURCESPEC}.o
$(RESOURCESPEC).o: $(STARSPHERE_SRC)/$(RESOURCESPEC).orc
$(STARSPHERE_INSTALL)/bin/orc $(STARSPHERE_SRC)/$(RESOURCESPEC).orc $(RESOURCESPEC).cpp
$(CXX) -g $(CPPFLAGS) -c $(RESOURCESPEC).cpp -o $(RESOURCESPEC).o
# tools
memcheck:
valgrind --tool=memcheck --track-fds=yes --time-stamp=yes --log-file=${PWD}/memcheck.out.%p --leak-check=full ${PWD}/starsphere
valgrind --tool=memcheck --track-fds=yes --time-stamp=yes --log-file=$(PWD)/memcheck.out.%p --leak-check=full $(PWD)/starsphere
callgrind:
valgrind --tool=callgrind --track-fds=yes --time-stamp=yes ${PWD}/starsphere
valgrind --tool=callgrind --track-fds=yes --time-stamp=yes $(PWD)/starsphere
clean:
rm -f ${RESOURCESPEC}.cpp $(OBJS) starsphere
install:
cp starsphere $(STARSPHERE_INSTALL)/bin
clean:
rm -f $(RESOURCESPEC).cpp $(OBJS) starsphere
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment