Makefile.mingw 5.42 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
###########################################################################
#   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
29
LIBS += -Wl,-Bstatic
Oliver Bock's avatar
Oliver Bock committed
30
LIBS += -lframework -loglft -L$(STARSPHERE_INSTALL)/lib
31
LIBS += $(shell $(STARSPHERE_INSTALL)/bin/freetype-config --libs)
32
LIBS += $(shell $(STARSPHERE_INSTALL)/bin/xml2-config --libs)
Oliver Bock's avatar
Oliver Bock committed
33
34
35
36
37
LIBS += -lws2_32 # required by libxml2
LIBS += -lboinc
LIBS += -Wl,-Bdynamic
LIBS += $(shell $(STARSPHERE_INSTALL)/bin/sdl-config --static-libs)
LIBS += -lopengl32 -lglu32
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)
44
CPPFLAGS += $(shell $(STARSPHERE_INSTALL)/bin/xml2-config --cflags)
Oliver Bock's avatar
Oliver Bock committed
45
CPPFLAGS += -I$(STARSPHERE_INSTALL)/include/boinc
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 $(RESOURCESPEC)_mingw.o
49
50
51
52
53
54
55
56
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
57
release: clean starsphere
Oliver Bock's avatar
Oliver Bock committed
58
starsphere: starsphere_Einstein_LVC starsphere_Einstein_ABP
59
60
61
62
memcheck: clean debug starsphere
callgrind: clean debug starsphere

# target specific options
63
64
debug: CPPFLAGS += -pg -gstabs3 -O0 -Wall -Wno-switch-enum
release: CPPFLAGS += -DNDEBUG -gstabs3 -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
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_windows_intelx86.exe" $(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_windows_intelx86.exe" $(OBJS) $(LIBS)
76
77
78
79
80
81
82

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

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

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

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

92
93
94
95
96
97
98
99
100
101
102
103
104
105
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

# 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

106
107
108
$(RESOURCESPEC)_mingw.o: $(STARSPHERE_SRC)/$(RESOURCESPEC).rc
	cp $(STARSPHERE_SRC)/*.ico .
	$(STARSPHERE_INSTALL)/bin/i586-pc-mingw32-windres -O coff -o $(RESOURCESPEC)_mingw.o $(STARSPHERE_SRC)/$(RESOURCESPEC).rc
109
110
111

# tools
install:
Oliver Bock's avatar
Oliver Bock committed
112
113
	mkdir -p $(STARSPHERE_INSTALL)/../dist
	cp graphics_app* $(STARSPHERE_INSTALL)/../dist
114
115

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