Makefile.macos 5.38 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
###########################################################################
#   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
STARSPHERE_SRC?=$(PWD)
STARSPHERE_INSTALL?=$(PWD)

# config values
CXX ?= g++

# variables
LIBS = -lframework -loglft -L$(STARSPHERE_INSTALL)/lib
LIBS += $(shell $(STARSPHERE_INSTALL)/bin/freetype-config --libs)
31
LIBS += $(shell $(STARSPHERE_INSTALL)/bin/xml2-config --libs)
32
LIBS += -lboinc_api -lboinc -L$(STARSPHERE_INSTALL)/lib
33
34
LIBS += $(shell $(STARSPHERE_INSTALL)/bin/sdl-config --static-libs)

35
36
LDFLAGS = -static-libgcc

Oliver Bock's avatar
Oliver Bock committed
37
CPPFLAGS = -I$(STARSPHERE_INSTALL)/include
38
39
CPPFLAGS += $(shell $(STARSPHERE_INSTALL)/bin/sdl-config --cflags)
CPPFLAGS += $(shell $(STARSPHERE_INSTALL)/bin/freetype-config --cflags)
40
CPPFLAGS += $(shell $(STARSPHERE_INSTALL)/bin/xml2-config --cflags)
41
CPPFLAGS += -I$(STARSPHERE_INSTALL)/include/BOINC -I/usr/include
42
43

DEPS = Makefile
44
OBJS = Starsphere.o StarsphereS5R3.o StarsphereRadio.o EinsteinS5R3Adapter.o EinsteinRadioAdapter.o starlist.o snr_list.o pulsar_list.o SetMacSSLevel.o $(RESOURCESPEC).o
45
46
47
48
49
50
51
52
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
53
54
release: clean starsphere
starsphere: starsphere_EinsteinS5R3 starsphere_EinsteinRadio
55
56
57
58
memcheck: clean debug starsphere
callgrind: clean debug starsphere

# target specific options
Oliver Bock's avatar
Oliver Bock committed
59
60
debug: CPPFLAGS += -pg -ggdb3 -O0 -Wall -Wno-switch-enum
release: CPPFLAGS += -DNDEBUG -ggdb3 -O3 -Wall -Wno-switch-enum
61
62
63
64
65
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
66
67

# file based targets
68
69
70
71
72
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)
73
74
75
76
77
78
79

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

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

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

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

89
90
91
92
93
94
95
96
starlist.o: $(DEPS) $(STARSPHERE_SRC)/starlist.C
	$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/starlist.C

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

pulsar_list.o: $(DEPS) $(STARSPHERE_SRC)/pulsar_list.C
	$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/pulsar_list.C
97
98
99
    
SetMacSSLevel.o: $(DEPS) $(STARSPHERE_SRC)/SetMacSSLevel.m
	$(CXX) -g $(CPPFLAGS) -c $(STARSPHERE_SRC)/SetMacSSLevel.m
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114

# resource compiler
$(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

callgrind:
	valgrind --tool=callgrind --track-fds=yes --time-stamp=yes $(PWD)/starsphere

install:
115
	cp -R starsphere_* $(STARSPHERE_INSTALL)/bin
116
117

clean:
118
	rm -Rf $(RESOURCESPEC).cpp $(OBJS) starsphere_*