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

Added dynamic application setup option using specific Makefile targets

parent 7fdb6596
No related branches found
No related tags found
No related merge requests found
......@@ -37,7 +37,7 @@ CPPFLAGS += $(shell $(STARSPHERE_INSTALL)/bin/freetype-config --cflags)
CPPFLAGS += -I$(STARSPHERE_INSTALL)/include/BOINC -I/usr/include
DEPS = Makefile
OBJS = Starsphere.o StarsphereS5R3.o EinsteinS5R3Adapter.o starlist.o snr_list.o pulsar_list.o $(RESOURCESPEC).o
OBJS = Starsphere.o StarsphereS5R3.o StarsphereRadio.o EinsteinS5R3Adapter.o EinsteinRadioAdapter.o starlist.o snr_list.o pulsar_list.o $(RESOURCESPEC).o
DEBUGFLAGSCPP = -pg -ggdb -O0
RESOURCESPEC = resources
......@@ -47,20 +47,26 @@ CPPFLAGS += -I$(STARSPHERE_SRC) -I$(STARSPHERE_SRC)/../framework
# primary role based tagets
default: release
debug: starsphere
release: clean starsphere
starsphere: starsphere_EinsteinS5R3 starsphere_EinsteinRadio
memcheck: clean debug starsphere
callgrind: clean debug starsphere
release: clean starsphere
# target specific options
debug: CPPFLAGS += $(DEBUGFLAGSCPP)
memcheck: CPPFLAGS += $(DEBUGFLAGSCPP) -DDEBUG_VALGRIND
callgrind: CPPFLAGS += $(DEBUGFLAGSCPP) -DDEBUG_VALGRIND
release: CPPFLAGS += -D NDEBUG -O3 -Wall -Wno-switch-enum
release: LDFLAGS +=
starsphere_EinsteinS5R3: CPPFLAGS += -D SCIENCE_APP=EinsteinS5R3
starsphere_EinsteinRadio: CPPFLAGS += -D SCIENCE_APP=EinsteinRadio
memcheck: CPPFLAGS += $(DEBUGFLAGSCPP) -D DEBUG_VALGRIND
callgrind: CPPFLAGS += $(DEBUGFLAGSCPP) -D DEBUG_VALGRIND
# file based targets
starsphere: $(DEPS) $(STARSPHERE_SRC)/main.cpp $(OBJS)
$(CXX) -g $(CPPFLAGS) $(LDFLAGS) $(STARSPHERE_SRC)/main.cpp -o starsphere $(OBJS) $(LIBS)
starsphere_EinsteinS5R3: $(DEPS) $(STARSPHERE_SRC)/main.cpp $(OBJS)
$(CXX) -g $(CPPFLAGS) $(LDFLAGS) $(STARSPHERE_SRC)/main.cpp -o starsphere_EinsteinS5R3 $(OBJS) $(LIBS)
starsphere_EinsteinRadio: $(DEPS) $(STARSPHERE_SRC)/main.cpp $(OBJS)
$(CXX) -g $(CPPFLAGS) $(LDFLAGS) $(STARSPHERE_SRC)/main.cpp -o starsphere_EinsteinRadio $(OBJS) $(LIBS)
Starsphere.o: $(DEPS) $(STARSPHERE_SRC)/Starsphere.cpp $(STARSPHERE_SRC)/Starsphere.h
$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/Starsphere.cpp
......@@ -68,9 +74,15 @@ Starsphere.o: $(DEPS) $(STARSPHERE_SRC)/Starsphere.cpp $(STARSPHERE_SRC)/Starsph
StarsphereS5R3.o: $(DEPS) $(STARSPHERE_SRC)/StarsphereS5R3.cpp $(STARSPHERE_SRC)/StarsphereS5R3.h
$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/StarsphereS5R3.cpp
StarsphereRadio.o: $(DEPS) $(STARSPHERE_SRC)/StarsphereRadio.cpp $(STARSPHERE_SRC)/StarsphereRadio.h
$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/StarsphereRadio.cpp
EinsteinS5R3Adapter.o: Makefile $(STARSPHERE_SRC)/EinsteinS5R3Adapter.cpp $(STARSPHERE_SRC)/EinsteinS5R3Adapter.h
$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/EinsteinS5R3Adapter.cpp
EinsteinRadioAdapter.o: Makefile $(STARSPHERE_SRC)/EinsteinRadioAdapter.cpp $(STARSPHERE_SRC)/EinsteinRadioAdapter.h
$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/EinsteinRadioAdapter.cpp
starlist.o: $(DEPS) $(STARSPHERE_SRC)/starlist.C
$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/starlist.C
......@@ -94,7 +106,7 @@ callgrind:
valgrind --tool=callgrind --track-fds=yes --time-stamp=yes $(PWD)/starsphere
install:
cp starsphere $(STARSPHERE_INSTALL)/bin
cp starsphere_* $(STARSPHERE_INSTALL)/bin
clean:
rm -f $(RESOURCESPEC).cpp $(OBJS) starsphere
rm -f $(RESOURCESPEC).cpp $(OBJS) starsphere_*
......@@ -37,7 +37,7 @@ CPPFLAGS += $(shell $(STARSPHERE_INSTALL)/bin/freetype-config --cflags)
CPPFLAGS += -I$(STARSPHERE_INSTALL)/include/BOINC -I/usr/include
DEPS = Makefile
OBJS = Starsphere.o StarsphereS5R3.o EinsteinS5R3Adapter.o starlist.o snr_list.o pulsar_list.o $(RESOURCESPEC).o
OBJS = Starsphere.o StarsphereS5R3.o StarsphereRadio.o EinsteinS5R3Adapter.o EinsteinRadioAdapter.o starlist.o snr_list.o pulsar_list.o $(RESOURCESPEC).o
DEBUGFLAGSCPP = -pg -ggdb -O0
RESOURCESPEC = resources
......@@ -47,19 +47,26 @@ CPPFLAGS += -I$(STARSPHERE_SRC) -I$(STARSPHERE_SRC)/../framework
# primary role based tagets
default: release
debug: starsphere
release: clean starsphere
starsphere: starsphere_EinsteinS5R3 starsphere_EinsteinRadio
memcheck: clean debug starsphere
callgrind: clean debug starsphere
release: clean starsphere
# target specific options
debug: CPPFLAGS += $(DEBUGFLAGSCPP)
release: CPPFLAGS += -D NDEBUG -O3 -Wall -Wno-switch-enum
release: LDFLAGS +=
starsphere_EinsteinS5R3: CPPFLAGS += -D SCIENCE_APP=EinsteinS5R3
starsphere_EinsteinRadio: CPPFLAGS += -D SCIENCE_APP=EinsteinRadio
memcheck: CPPFLAGS += $(DEBUGFLAGSCPP) -D DEBUG_VALGRIND
callgrind: CPPFLAGS += $(DEBUGFLAGSCPP) -D DEBUG_VALGRIND
release: CPPFLAGS += -DNDEBUG -O3 -Wall -Wno-switch-enum
# file based targets
starsphere: $(DEPS) $(STARSPHERE_SRC)/main.cpp $(OBJS)
$(CXX) -g $(CPPFLAGS) $(LDFLAGS) $(STARSPHERE_SRC)/main.cpp -o starsphere $(OBJS) $(LIBS)
starsphere_EinsteinS5R3: $(DEPS) $(STARSPHERE_SRC)/main.cpp $(OBJS)
$(CXX) -g $(CPPFLAGS) $(LDFLAGS) $(STARSPHERE_SRC)/main.cpp -o starsphere_EinsteinS5R3 $(OBJS) $(LIBS)
starsphere_EinsteinRadio: $(DEPS) $(STARSPHERE_SRC)/main.cpp $(OBJS)
$(CXX) -g $(CPPFLAGS) $(LDFLAGS) $(STARSPHERE_SRC)/main.cpp -o starsphere_EinsteinRadio $(OBJS) $(LIBS)
Starsphere.o: $(DEPS) $(STARSPHERE_SRC)/Starsphere.cpp $(STARSPHERE_SRC)/Starsphere.h
$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/Starsphere.cpp
......@@ -67,9 +74,15 @@ Starsphere.o: $(DEPS) $(STARSPHERE_SRC)/Starsphere.cpp $(STARSPHERE_SRC)/Starsph
StarsphereS5R3.o: $(DEPS) $(STARSPHERE_SRC)/StarsphereS5R3.cpp $(STARSPHERE_SRC)/StarsphereS5R3.h
$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/StarsphereS5R3.cpp
StarsphereRadio.o: $(DEPS) $(STARSPHERE_SRC)/StarsphereRadio.cpp $(STARSPHERE_SRC)/StarsphereRadio.h
$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/StarsphereRadio.cpp
EinsteinS5R3Adapter.o: Makefile $(STARSPHERE_SRC)/EinsteinS5R3Adapter.cpp $(STARSPHERE_SRC)/EinsteinS5R3Adapter.h
$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/EinsteinS5R3Adapter.cpp
EinsteinRadioAdapter.o: Makefile $(STARSPHERE_SRC)/EinsteinRadioAdapter.cpp $(STARSPHERE_SRC)/EinsteinRadioAdapter.h
$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/EinsteinRadioAdapter.cpp
starlist.o: $(DEPS) $(STARSPHERE_SRC)/starlist.C
$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/starlist.C
......@@ -93,7 +106,7 @@ callgrind:
valgrind --tool=callgrind --track-fds=yes --time-stamp=yes $(PWD)/starsphere
install:
cp starsphere $(STARSPHERE_INSTALL)/bin
cp starsphere_* $(STARSPHERE_INSTALL)/bin
clean:
rm -f $(RESOURCESPEC).cpp $(OBJS) starsphere
......@@ -37,7 +37,7 @@ CPPFLAGS += $(shell $(STARSPHERE_INSTALL)/bin/freetype-config --cflags)
CPPFLAGS += -I$(STARSPHERE_INSTALL)/include/BOINC
DEPS = Makefile
OBJS = Starsphere.o StarsphereS5R3.o EinsteinS5R3Adapter.o starlist.o snr_list.o pulsar_list.o $(RESOURCESPEC).o
OBJS = Starsphere.o StarsphereS5R3.o StarsphereRadio.o EinsteinS5R3Adapter.o EinsteinRadioAdapter.o starlist.o snr_list.o pulsar_list.o $(RESOURCESPEC).o
DEBUGFLAGSCPP = -pg -ggdb -O0
RESOURCESPEC = resources
......@@ -47,20 +47,26 @@ CPPFLAGS += -I$(STARSPHERE_SRC) -I$(STARSPHERE_SRC)/../framework
# primary role based tagets
default: release
debug: starsphere
release: clean starsphere
starsphere: starsphere_EinsteinS5R3 starsphere_EinsteinRadio
memcheck: clean debug starsphere
callgrind: clean debug starsphere
release: clean starsphere
# target specific options
debug: CPPFLAGS += $(DEBUGFLAGSCPP)
memcheck: CPPFLAGS += $(DEBUGFLAGSCPP) -DDEBUG_VALGRIND
callgrind: CPPFLAGS += $(DEBUGFLAGSCPP) -DDEBUG_VALGRIND
release: CPPFLAGS += -D NDEBUG -O3 -Wall -Wno-switch-enum
release: LDFLAGS +=
starsphere_EinsteinS5R3: CPPFLAGS += -D SCIENCE_APP=EinsteinS5R3
starsphere_EinsteinRadio: CPPFLAGS += -D SCIENCE_APP=EinsteinRadio
memcheck: CPPFLAGS += $(DEBUGFLAGSCPP) -D DEBUG_VALGRIND
callgrind: CPPFLAGS += $(DEBUGFLAGSCPP) -D DEBUG_VALGRIND
# file based targets
starsphere: $(DEPS) $(STARSPHERE_SRC)/main.cpp $(OBJS)
$(CXX) -g $(CPPFLAGS) $(LDFLAGS) $(STARSPHERE_SRC)/main.cpp -o starsphere $(OBJS) $(LIBS)
starsphere_EinsteinS5R3: $(DEPS) $(STARSPHERE_SRC)/main.cpp $(OBJS)
$(CXX) -g $(CPPFLAGS) $(LDFLAGS) $(STARSPHERE_SRC)/main.cpp -o starsphere_EinsteinS5R3 $(OBJS) $(LIBS)
starsphere_EinsteinRadio: $(DEPS) $(STARSPHERE_SRC)/main.cpp $(OBJS)
$(CXX) -g $(CPPFLAGS) $(LDFLAGS) $(STARSPHERE_SRC)/main.cpp -o starsphere_EinsteinRadio $(OBJS) $(LIBS)
Starsphere.o: $(DEPS) $(STARSPHERE_SRC)/Starsphere.cpp $(STARSPHERE_SRC)/Starsphere.h
$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/Starsphere.cpp
......@@ -68,9 +74,15 @@ Starsphere.o: $(DEPS) $(STARSPHERE_SRC)/Starsphere.cpp $(STARSPHERE_SRC)/Starsph
StarsphereS5R3.o: $(DEPS) $(STARSPHERE_SRC)/StarsphereS5R3.cpp $(STARSPHERE_SRC)/StarsphereS5R3.h
$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/StarsphereS5R3.cpp
StarsphereRadio.o: $(DEPS) $(STARSPHERE_SRC)/StarsphereRadio.cpp $(STARSPHERE_SRC)/StarsphereRadio.h
$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/StarsphereRadio.cpp
EinsteinS5R3Adapter.o: Makefile $(STARSPHERE_SRC)/EinsteinS5R3Adapter.cpp $(STARSPHERE_SRC)/EinsteinS5R3Adapter.h
$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/EinsteinS5R3Adapter.cpp
EinsteinRadioAdapter.o: Makefile $(STARSPHERE_SRC)/EinsteinRadioAdapter.cpp $(STARSPHERE_SRC)/EinsteinRadioAdapter.h
$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/EinsteinRadioAdapter.cpp
starlist.o: $(DEPS) $(STARSPHERE_SRC)/starlist.C
$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/starlist.C
......@@ -94,7 +106,7 @@ callgrind:
valgrind --tool=callgrind --track-fds=yes --time-stamp=yes $(PWD)/starsphere
install:
cp starsphere $(STARSPHERE_INSTALL)/bin
cp starsphere_* $(STARSPHERE_INSTALL)/bin
clean:
rm -f $(RESOURCESPEC).cpp $(OBJS) starsphere
......@@ -29,12 +29,21 @@
int main(int argc, char **argv)
{
// choose application to be build/used
GraphicsEngineFactory::Applications scienceApplication;
#ifdef SCIENCE_APP
scienceApplication = GraphicsEngineFactory::SCIENCE_APP;
#else
scienceApplication = GraphicsEngineFactory::EinsteinS5R3;
#endif
// prepare main objects
WindowManager window;
ResourceFactory factory;
AbstractGraphicsEngine *graphics = GraphicsEngineFactory::createInstance(
GraphicsEngineFactory::Starsphere,
GraphicsEngineFactory::EinsteinS5R3);
scienceApplication);
if(!graphics) {
cerr << "Requested graphics engine could not be found/instantiated!" << endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment