-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
130 lines (95 loc) · 3.54 KB
/
Makefile
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# Makefile.local must define the following variables
# BINDIR install dir for executables
# LIBDIR install dir for C++ libraries
# INCDIR install dir for C++ headers
# PYDIR install dir for python/cython modules
# CPP g++ compiler command line (must support c++0x, and -lpthread or -pthread if necessary)
#
# See Makefile.local.example for an example.
include Makefile.local
ifndef CPP
$(error Fatal: Makefile.local must define CPP variable)
endif
ifndef LIBDIR
$(error Fatal: Makefile.local must define LIBDIR variable)
endif
ifndef INCDIR
$(error Fatal: Makefile.local must define INCDIR variable)
endif
ifndef BINDIR
$(error Fatal: Makefile.local must define BINDIR variable)
endif
ifndef PYDIR
$(error Fatal: Makefile.local must define PYDIR variable)
endif
####################################################################################################
BINFILES=run-vdif-assembler
LIBFILES=libch_vdif_assembler.so
LIBCYTHON=ch_vdif_assembler_cython.so
PYMODULES=ch_vdif_assembler.py
SCRIPTS=show-moose-acquisitions.py index_vdif_waterfalls.py
TESTBINFILES=test-timestamp-unwrapper test-kernels test-downsampled-intensity time-kernels peek-at-kernels
INCFILES=ch_vdif_assembler.hpp \
ch_vdif_assembler_internals.hpp \
ch_vdif_assembler_kernels.hpp \
ch_vdif_assembler_dspsr.hpp
OFILES=assembler_nerve_center.o \
assembler_thread.o \
disk_reader_thread.o \
disk_writer_thread.o \
downsampled_intensity.o \
dspsr_handle.o \
intensity_beam.o \
misc.o \
network_thread.o \
processing_thread.o \
rfi_histogrammer.o \
sim_thread.o \
timing_thread.o \
unit_testing_thread.o \
waterfall_plotter.o
LIBS=
ifeq ($(HAVE_CH_FRB_IO),y)
CPP += -DHAVE_CH_FRB_IO
LIBS += -lch_frb_io
endif
LIBS += -lhdf5 -lpng
####################################################################################################
all: $(BINFILES) $(LIBFILES) $(LIBCYTHON) $(TESTBINFILES)
cython: $(LIBCYTHON)
%.o: %.cpp $(INCFILES)
$(CPP) -c -o $@ $<
%_cython.cpp: %_cython.pyx ch_vdif_assembler_pxd.pxd ch_vdif_assembler_cython.hpp $(INCFILES)
cython --cplus $<
libch_vdif_assembler.so: $(OFILES)
$(CPP) -o $@ -shared $^
ch_vdif_assembler_cython.so: ch_vdif_assembler_cython.cpp libch_vdif_assembler.so
$(CPP) -shared -o $@ $< -lch_vdif_assembler $(LIBS)
run-vdif-assembler: run-vdif-assembler.o libch_vdif_assembler.so
$(CPP) -o $@ $< -lch_vdif_assembler $(LIBS)
test-timestamp-unwrapper: test-timestamp-unwrapper.cpp ch_vdif_assembler_internals.hpp
$(CPP) -o $@ $<
test-kernels: test-kernels.cpp ch_vdif_assembler_kernels.hpp
$(CPP) -o $@ $<
test-downsampled-intensity: test-downsampled-intensity.cpp ch_vdif_assembler_internals.hpp libch_vdif_assembler.so
$(CPP) -o $@ $< -lch_vdif_assembler $(LIBS)
time-kernels: time-kernels.cpp ch_vdif_assembler_kernels.hpp
$(CPP) -o $@ $<
peek-at-kernels: peek-at-kernels.cpp ch_vdif_assembler_kernels.hpp
$(CPP) -o $@ $<
test: $(TESTBINFILES)
for f in $(TESTBINFILES); do ./$$f; done
install: $(INCFILES) $(BINFILES) $(LIBFILES) $(LIBCYTHON)
mkdir -p $(INCDIR) $(LIBDIR) $(BINDIR) $(PYDIR)
cp -f $(INCFILES) $(INCDIR)/
cp -f $(LIBFILES) $(LIBDIR)/
cp -f $(BINFILES) $(SCRIPTS) $(BINDIR)/
cp -f $(LIBCYTHON) $(PYMODULES) $(PYDIR)/
#cp -f run-vdif-assembler show-moose-acquisitions.py $(BINDIR)/
uninstall:
for f in $(INCFILES); do rm -f $(INCDIR)/$$f; done
for f in $(LIBFILES); do rm -f $(LIBDIR)/$$f; done
for f in $(BINFILES) $(SCRIPTS); do rm -f $(BINDIR)/$$f; done
for f in $(LIBCYTHON) $(PYMODULES); do rm -f $(PYDIR)/$$f; done
clean:
rm -f *~ *.o *_cython.cpp *.so *.pyc $(BINFILES) $(TESTBINFILES)