|
| 1 | +########################################################################### |
| 2 | +# Copyright (C) 2008 by Oliver Bock # |
| 3 | +# oliver.bock[AT]aei.mpg.de # |
| 4 | +# # |
| 5 | +# This file is part of Einstein@Home (Radio Pulsar Edition). # |
| 6 | +# # |
| 7 | +# Einstein@Home is free software: you can redistribute it and/or modify # |
| 8 | +# it under the terms of the GNU General Public License as published # |
| 9 | +# by the Free Software Foundation, version 2 of the License. # |
| 10 | +# # |
| 11 | +# Einstein@Home is distributed in the hope that it will be useful, # |
| 12 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of # |
| 13 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # |
| 14 | +# GNU General Public License for more details. # |
| 15 | +# # |
| 16 | +# You should have received a copy of the GNU General Public License # |
| 17 | +# along with Einstein@Home. If not, see <http://www.gnu.org/licenses/>. # |
| 18 | +# # |
| 19 | +########################################################################### |
| 20 | + |
| 21 | +# path settings |
| 22 | +EINSTEIN_RADIO_SRC?=$(PWD) |
| 23 | +EINSTEIN_RADIO_INSTALL?=$(PWD) |
| 24 | + |
| 25 | +# config values |
| 26 | +CXX ?= g++ |
| 27 | + |
| 28 | +# variables |
| 29 | +LIBS += -Wl,-Bstatic |
| 30 | +LIBS += -L$(EINSTEIN_RADIO_INSTALL)/lib64 -L$(EINSTEIN_RADIO_INSTALL)/lib |
| 31 | +LIBS += $(shell $(EINSTEIN_RADIO_INSTALL)/bin/gsl-config --libs) |
| 32 | +LIBS += $(shell export PKG_CONFIG_PATH=$(EINSTEIN_RADIO_INSTALL)/lib/pkgconfig && pkg-config --libs fftw3f) |
| 33 | +LIBS += $(shell $(EINSTEIN_RADIO_INSTALL)/bin/xml2-config --libs) |
| 34 | +LIBS += -lboinc_api -lboinc |
| 35 | +LIBS += -lbfd -liberty |
| 36 | +LIBS += -L/usr/lib |
| 37 | +LIBS += -lstdc++ |
| 38 | +LIBS += -Wl,-Bdynamic |
| 39 | +LIBS += -lpthread -lm -lc |
| 40 | +LIBS += $(EINSTEIN_RADIO_INSTALL)/lib/libz.a |
| 41 | + |
| 42 | +LDFLAGS += -static-libgcc |
| 43 | + |
| 44 | +CXXFLAGS += -I$(EINSTEIN_RADIO_INSTALL)/include |
| 45 | +CXXFLAGS += $(shell $(EINSTEIN_RADIO_INSTALL)/bin/gsl-config --cflags) |
| 46 | +CXXFLAGS += $(shell export PKG_CONFIG_PATH=$(EINSTEIN_RADIO_INSTALL)/lib/pkgconfig && pkg-config --cflags fftw3f) |
| 47 | +CXXFLAGS += $(shell $(EINSTEIN_RADIO_INSTALL)/bin/xml2-config --cflags) |
| 48 | +CXXFLAGS += -I$(EINSTEIN_RADIO_INSTALL)/include/boinc |
| 49 | +CXXFLAGS += -DHAVE_INLINE -DBOINCIFIED |
| 50 | +CXXFLAGS += -DUSE_CPU_RESAMP -DUSE_FFTW_FFT |
| 51 | + |
| 52 | +DEPS = Makefile |
| 53 | +OBJS = demod_binary.o demod_binary_resamp_cpu.o demod_binary_fft_fftw.o demod_binary_hs_cpu.o rngmed.o erp_boinc_ipc.o erp_getopt.o erp_getopt1.o erp_utilities.o erp_execinfo_plus.o hs_common.o |
| 54 | +EINSTEINBINARY_TARGET ?= einsteinbinary |
| 55 | +TARGET = $(EINSTEINBINARY_TARGET) |
| 56 | + |
| 57 | +# primary role based tagets |
| 58 | +default: release |
| 59 | +debug: $(TARGET) |
| 60 | +profile: clean $(TARGET) |
| 61 | +release: clean $(TARGET) |
| 62 | + |
| 63 | +# target specific options |
| 64 | +debug: CXXFLAGS += -DLOGLEVEL=debug -pg -ggdb3 -rdynamic -O0 -Wall |
| 65 | +profile: CXXFLAGS += -DNDEBUG -DLOGLEVEL=info -ggdb3 -rdynamic -O3 -Wall -fprofile-generate |
| 66 | +release: CXXFLAGS += -DNDEBUG -DLOGLEVEL=info -ggdb3 -rdynamic -O3 -Wall -fprofile-use |
| 67 | + |
| 68 | +# file based targets |
| 69 | +profile: |
| 70 | + @echo "Removing previous profiling data..." |
| 71 | + rm -f *_profile.* |
| 72 | + rm -f *.gcda |
| 73 | + @echo "Gathering profiling data (this takes roughly one minute)..." |
| 74 | + ./$(TARGET) -t $(EINSTEIN_RADIO_SRC)/../test/templates_400Hz_2_short.bank -l $(EINSTEIN_RADIO_SRC)/data/zaplist_232.txt -A 0.04 -P 3.0 -W -z -i $(EINSTEIN_RADIO_SRC)/../test/J1907+0740_dm_482.binary -c status_profile.cpt -o results_profile.cand |
| 75 | + @echo "Finished gathering profiling data..." |
| 76 | + |
| 77 | +$(TARGET): $(DEPS) $(EINSTEIN_RADIO_SRC)/erp_boinc_wrapper.cpp $(OBJS) |
| 78 | + $(CXX) -g $(CXXFLAGS) $(LDFLAGS) $(EINSTEIN_RADIO_SRC)/erp_boinc_wrapper.cpp -o $(TARGET) $(OBJS) $(LIBS) |
| 79 | + |
| 80 | +demod_binary.o: $(DEPS) $(EINSTEIN_RADIO_SRC)/demod_binary.c $(EINSTEIN_RADIO_SRC)/demod_binary.h |
| 81 | + $(CXX) -g $(CXXFLAGS) -c $(EINSTEIN_RADIO_SRC)/demod_binary.c |
| 82 | + |
| 83 | +demod_binary_resamp_cpu.o: $(DEPS) $(EINSTEIN_RADIO_SRC)/demod_binary_resamp_cpu.c $(EINSTEIN_RADIO_SRC)/demod_binary_resamp_cpu.h |
| 84 | + $(CXX) -g $(CXXFLAGS) -c $(EINSTEIN_RADIO_SRC)/demod_binary_resamp_cpu.c |
| 85 | + |
| 86 | +hs_common.o: $(DEPS) $(EINSTEIN_RADIO_SRC)/hs_common.c $(EINSTEIN_RADIO_SRC)/hs_common.h |
| 87 | + $(CXX) -g $(CXXFLAGS) -c $(EINSTEIN_RADIO_SRC)/hs_common.c |
| 88 | + |
| 89 | +demod_binary_hs_cpu.o: $(DEPS) $(EINSTEIN_RADIO_SRC)/demod_binary_hs_cpu.c $(EINSTEIN_RADIO_SRC)/demod_binary_hs_cpu.h $(EINSTEIN_RADIO_SRC)/hs_common.h |
| 90 | + $(CXX) -g $(CXXFLAGS) -c $(EINSTEIN_RADIO_SRC)/demod_binary_hs_cpu.c |
| 91 | + |
| 92 | +demod_binary_fft_fftw.o: $(DEPS) $(EINSTEIN_RADIO_SRC)/demod_binary_fft_fftw.c $(EINSTEIN_RADIO_SRC)/demod_binary_fft_fftw.h |
| 93 | + $(CXX) -g $(CXXFLAGS) -c $(EINSTEIN_RADIO_SRC)/demod_binary_fft_fftw.c |
| 94 | + |
| 95 | +rngmed.o: $(DEPS) $(EINSTEIN_RADIO_SRC)/rngmed.c $(EINSTEIN_RADIO_SRC)/rngmed.h |
| 96 | + $(CXX) -g $(CXXFLAGS) -c $(EINSTEIN_RADIO_SRC)/rngmed.c |
| 97 | + |
| 98 | +erp_boinc_ipc.o: $(DEPS) $(EINSTEIN_RADIO_SRC)/erp_boinc_ipc.cpp $(EINSTEIN_RADIO_SRC)/erp_boinc_ipc.h |
| 99 | + $(CXX) -g $(CXXFLAGS) -c $(EINSTEIN_RADIO_SRC)/erp_boinc_ipc.cpp |
| 100 | + |
| 101 | +erp_getopt.o: $(DEPS) $(EINSTEIN_RADIO_SRC)/erp_getopt.c $(EINSTEIN_RADIO_SRC)/erp_getopt.h $(EINSTEIN_RADIO_SRC)/erp_getopt_int.h |
| 102 | + $(CXX) -g $(CXXFLAGS) -c $(EINSTEIN_RADIO_SRC)/erp_getopt.c |
| 103 | + |
| 104 | +erp_getopt1.o: $(DEPS) $(EINSTEIN_RADIO_SRC)/erp_getopt1.c $(EINSTEIN_RADIO_SRC)/erp_getopt.h $(EINSTEIN_RADIO_SRC)/erp_getopt_int.h |
| 105 | + $(CXX) -g $(CXXFLAGS) -c $(EINSTEIN_RADIO_SRC)/erp_getopt1.c |
| 106 | + |
| 107 | +erp_utilities.o: $(DEPS) $(EINSTEIN_RADIO_SRC)/erp_utilities.cpp $(EINSTEIN_RADIO_SRC)/erp_utilities.h |
| 108 | + $(CXX) -g $(CXXFLAGS) -c $(EINSTEIN_RADIO_SRC)/erp_utilities.cpp |
| 109 | + |
| 110 | +erp_execinfo_plus.o: $(DEPS) $(EINSTEIN_RADIO_SRC)/erp_execinfo_plus.c $(EINSTEIN_RADIO_SRC)/erp_execinfo_plus.h |
| 111 | + $(CXX) -g $(CXXFLAGS) -c $(EINSTEIN_RADIO_SRC)/erp_execinfo_plus.c |
| 112 | + |
| 113 | +install: |
| 114 | + mkdir -p $(EINSTEIN_RADIO_INSTALL)/../dist |
| 115 | + cp $(TARGET) $(EINSTEIN_RADIO_INSTALL)/../dist |
| 116 | + |
| 117 | +clean: |
| 118 | + rm -f $(OBJS) $(TARGET) |
| 119 | + |
0 commit comments