Makefile 5.54 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
###########################################################################
#   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/>. #
#                                                                         #
###########################################################################

21
22
23
24
25
# path settings
STARSPHERE_SRC?=$(PWD)
STARSPHERE_INSTALL?=$(PWD)

# config values
Oliver Bock's avatar
Oliver Bock committed
26
CXX ?= g++
27

Oliver Bock's avatar
Oliver Bock committed
28
# variables
29
LIBS += -Wl,-Bstatic -lframework -loglft -L$(STARSPHERE_INSTALL)/lib
30
LIBS += $(shell $(STARSPHERE_INSTALL)/bin/freetype-config --libs)
Oliver Bock's avatar
Oliver Bock committed
31
LIBS += $(shell $(STARSPHERE_INSTALL)/bin/xml2-config --libs)
32
33
34
35
36
37
LIBS += -lboinc_api -lboinc
LIBS += -lstdc++
LIBS += -L/usr/lib
LIBS += -Wl,-Bdynamic $(shell $(STARSPHERE_INSTALL)/bin/sdl-config --static-libs)
LIBS += -lGL -lGLU
LIBS += -lpthread -lm -lc
38

39
LDFLAGS += -static-libgcc
40

41
CPPFLAGS += -I$(STARSPHERE_INSTALL)/include
42
43
CPPFLAGS += $(shell $(STARSPHERE_INSTALL)/bin/sdl-config --cflags)
CPPFLAGS += $(shell $(STARSPHERE_INSTALL)/bin/freetype-config --cflags)
Oliver Bock's avatar
Oliver Bock committed
44
CPPFLAGS += $(shell $(STARSPHERE_INSTALL)/bin/xml2-config --cflags)
Oliver Bock's avatar
Oliver Bock committed
45
CPPFLAGS += -I$(STARSPHERE_INSTALL)/include/boinc -I/usr/include
46

47
DEPS = Makefile
48
OBJS = Starsphere.o StarsphereS5R3.o StarsphereRadio.o EinsteinS5R3Adapter.o EinsteinRadioAdapter.o starlist.o snr_list.o pulsar_list.o $(RESOURCESPEC).o
49
RESOURCESPEC = resources
50

51
52
53
# 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

Oliver Bock's avatar
Oliver Bock committed
54
# primary role based tagets
Oliver Bock's avatar
Oliver Bock committed
55
default: release
Oliver Bock's avatar
Oliver Bock committed
56
debug: starsphere
57
release: clean starsphere
Oliver Bock's avatar
Oliver Bock committed
58
starsphere: starsphere_Einstein_LVC starsphere_Einstein_ABP
59
60
memcheck: clean debug starsphere
callgrind: clean debug starsphere
Oliver Bock's avatar
Oliver Bock committed
61
62

# target specific options
Oliver Bock's avatar
Oliver Bock committed
63
64
debug: CPPFLAGS += -pg -ggdb3 -O0 -Wall -Wno-switch-enum
release: CPPFLAGS += -DNDEBUG -ggdb3 -O3 -Wall -Wno-switch-enum
Oliver Bock's avatar
Oliver Bock committed
65
66
starsphere_Einstein_LVC: CPPFLAGS += -D SCIENCE_APP=EinsteinS5R3
starsphere_Einstein_ABP: CPPFLAGS += -D SCIENCE_APP=EinsteinRadio
67
68
memcheck: CPPFLAGS += $(DEBUGFLAGSCPP) -D DEBUG_VALGRIND
callgrind: CPPFLAGS += $(DEBUGFLAGSCPP) -D DEBUG_VALGRIND
69

Oliver Bock's avatar
Oliver Bock committed
70
# file based targets
Oliver Bock's avatar
Oliver Bock committed
71
72
starsphere_Einstein_LVC: $(DEPS) $(STARSPHERE_SRC)/main.cpp $(OBJS)
	$(CXX) -g $(CPPFLAGS) $(LDFLAGS) $(STARSPHERE_SRC)/main.cpp -o "graphics_app=einstein_RUNLABEL_VERSION_graphics_i686-pc-linux-gnu" $(OBJS) $(LIBS)
73

Oliver Bock's avatar
Oliver Bock committed
74
75
starsphere_Einstein_ABP: $(DEPS) $(STARSPHERE_SRC)/main.cpp $(OBJS)
	$(CXX) -g $(CPPFLAGS) $(LDFLAGS) $(STARSPHERE_SRC)/main.cpp -o "graphics_app=einsteinbinary_RUNLABEL_VERSION_graphics_i686-pc-linux-gnu" $(OBJS) $(LIBS)
76

77
78
Starsphere.o: $(DEPS) $(STARSPHERE_SRC)/Starsphere.cpp $(STARSPHERE_SRC)/Starsphere.h
	$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/Starsphere.cpp
79

80
81
StarsphereS5R3.o: $(DEPS) $(STARSPHERE_SRC)/StarsphereS5R3.cpp $(STARSPHERE_SRC)/StarsphereS5R3.h
	$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/StarsphereS5R3.cpp
82

83
84
85
StarsphereRadio.o: $(DEPS) $(STARSPHERE_SRC)/StarsphereRadio.cpp $(STARSPHERE_SRC)/StarsphereRadio.h
	$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/StarsphereRadio.cpp

86
87
EinsteinS5R3Adapter.o: Makefile $(STARSPHERE_SRC)/EinsteinS5R3Adapter.cpp $(STARSPHERE_SRC)/EinsteinS5R3Adapter.h
	$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/EinsteinS5R3Adapter.cpp
88

89
90
91
EinsteinRadioAdapter.o: Makefile $(STARSPHERE_SRC)/EinsteinRadioAdapter.cpp $(STARSPHERE_SRC)/EinsteinRadioAdapter.h
	$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/EinsteinRadioAdapter.cpp

92
93
starlist.o: $(DEPS) $(STARSPHERE_SRC)/starlist.C
	$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/starlist.C
94

95
96
snr_list.o: $(DEPS) $(STARSPHERE_SRC)/snr_list.C
	$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/snr_list.C
97

98
99
pulsar_list.o: $(DEPS) $(STARSPHERE_SRC)/pulsar_list.C
	$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/pulsar_list.C
100

101
# resource compiler
102
103
104
$(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
105
106
107


# tools
Oliver Bock's avatar
Oliver Bock committed
108
memcheck:
Oliver Bock's avatar
Oliver Bock committed
109
	valgrind --tool=memcheck --track-fds=yes --time-stamp=yes --log-file=$(PWD)/memcheck.out.%p --leak-check=full $(PWD)/graphics_app=einstein_RUNLABEL_VERSION_graphics_i686-pc-linux-gnu
Oliver Bock's avatar
Oliver Bock committed
110
111

callgrind:
Oliver Bock's avatar
Oliver Bock committed
112
	valgrind --tool=callgrind --track-fds=yes --time-stamp=yes $(PWD)/graphics_app=einstein_RUNLABEL_VERSION_graphics_i686-pc-linux-gnu
113

114
install:
Oliver Bock's avatar
Oliver Bock committed
115
116
	mkdir -p $(STARSPHERE_INSTALL)/../dist
	cp graphics_app* $(STARSPHERE_INSTALL)/../dist
117

118
clean:
Oliver Bock's avatar
Oliver Bock committed
119
	rm -f $(RESOURCESPEC).cpp $(OBJS) graphics_app*