-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
154 lines (139 loc) · 6.22 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
CXXFLAGS = -Wall
swig_flags = -Wall -c++ -python -outputtuple
swig-manual_dir = build/swig-manual
object_dir = .obj
object_filenames = assortativity.o \
betweenness_bin.o \
betweenness_wei.o \
breadth.o \
breadthdist.o \
cat.o \
charpath.o \
clustering_coef_bd.o \
clustering_coef_bu.o \
clustering_coef_wd.o \
clustering_coef_wu.o \
connectivity_length.o \
convert.o \
cycprob.o \
debug.o \
degrees_dir.o \
degrees_und.o \
density_dir.o \
density_und.o \
distance_bin.o \
distance_wei.o \
efficiency.o \
eigenvector_centrality.o \
erange.o \
find_motif34.o \
findpaths.o \
findwalks.o \
fve.o \
jdegree.o \
latmio_dir.o \
latmio_dir_connected.o \
latmio_und.o \
latmio_und_connected.o \
macaque.o \
make_motif34lib.o \
makeevenCIJ.o \
makefractalCIJ.o \
makelatticeCIJ.o \
makerandCIJ_bd.o \
makerandCIJ_bu.o \
makerandCIJ_wd.o \
makerandCIJ_wu.o \
makerandCIJdegreesfixed.o \
makeringlatticeCIJ.o \
maketoeplitzCIJ.o \
matching_ind.o \
matlab/compare.o \
matlab/convert.o \
matlab/functions.o \
matlab/index.o \
matlab/operators.o \
matlab/utility.o \
modularity_louvain.o \
modularity_newman.o \
module_degree_zscore.o \
motif3funct_bin.o \
motif3funct_wei.o \
motif3struct_bin.o \
motif3struct_wei.o \
motif4funct_bin.o \
motif4funct_wei.o \
motif4struct_bin.o \
motif4struct_wei.o \
normalized_path_length.o \
participation_coef.o \
randmio_dir.o \
randmio_dir_connected.o \
randmio_und.o \
randmio_und_connected.o \
reachdist.o \
status.o \
strengths_dir.o \
strengths_und.o \
threshold_absolute.o \
threshold_proportional.o \
utility.o
objects = $(addprefix $(object_dir)/, $(object_filenames))
include Makefile.vars
.PHONY: all clean install uninstall swig swig-clean swig-install swig-manual swig-manual-clean swig-manual-install
all: libbct.a
libbct.a: $(objects)
$(AR) rcs libbct.a $^
$(object_dir)/%.o: %.cpp bct.h matlab/matlab.h
$(CXX) $(CXXFLAGS) -c -o $@ $<
$(object_dir)/matlab/%.o: matlab/%.cpp matlab/matlab.h
$(CXX) $(CXXFLAGS) -c -o $@ $<
clean:
-rm -f $(objects) libbct.a
install: libbct.a
if [ ! -d $(install_dir)/include/bct ]; then \
mkdir $(install_dir)/include/bct; \
mkdir $(install_dir)/include/bct/matlab; \
fi
if [[ "$(CXXFLAGS)" == *GSL_FLOAT* ]]; then \
cat bct_float.h bct.h > $(install_dir)/include/bct/bct_float.h; \
elif [[ "$(CXXFLAGS)" == *GSL_DOUBLE* ]]; then \
cat bct_double.h bct.h > $(install_dir)/include/bct/bct.h; \
elif [[ "$(CXXFLAGS)" == *GSL_LONG_DOUBLE* ]]; then \
cat bct_long_double.h bct.h > $(install_dir)/include/bct/bct_long_double.h; \
fi
cp matlab/matlab.h $(install_dir)/include/bct/matlab
cp matlab/sort.h $(install_dir)/include/bct/matlab
cp precision.h $(install_dir)/include/bct
if [[ "$(CXXFLAGS)" == *GSL_FLOAT* ]]; then \
cp libbct.a $(install_dir)/lib/libbct_float.a; \
elif [[ "$(CXXFLAGS)" == *GSL_DOUBLE* ]]; then \
cp libbct.a $(install_dir)/lib/libbct.a; \
elif [[ "$(CXXFLAGS)" == *GSL_LONG_DOUBLE* ]]; then \
cp libbct.a $(install_dir)/lib/libbct_long_double.a; \
fi
uninstall:
-rm -rf $(install_dir)/include/bct
-rm $(install_dir)/lib/libbct_float.a
-rm $(install_dir)/lib/libbct.a
-rm $(install_dir)/lib/libbct_long_double.a
swig: $(objects)
python setup.py build_ext
swig-clean:
-rm -rf bct_gsl_wrap.cpp bct_gsl.py bct_py_wrap.cpp bct_py.py build
swig-install:
python setup.py install
swig-manual:
if [ ! -d $(swig-manual_dir) ]; then \
mkdir -p $(swig-manual_dir); \
fi
swig $(swig_flags) -o bct_gsl_wrap.cpp bct_gsl.i
swig $(swig_flags) -o bct_py_wrap.cpp bct_py.i
$(CXX) $(CXXFLAGS) $(swig_cxx_flags) -c -I$(python_include_dir) -o $(swig-manual_dir)/bct_gsl_wrap.o bct_gsl_wrap.cpp
$(CXX) $(CXXFLAGS) $(swig_cxx_flags) -c -I$(python_include_dir) -o $(swig-manual_dir)/bct_py_wrap.o bct_py_wrap.cpp
$(CXX) $(CXXFLAGS) -L$(install_dir)/lib -lbct -lgsl -lgslcblas $(swig_lib_flags) -o $(swig-manual_dir)/_bct_gsl.so $^ $(swig-manual_dir)/bct_gsl_wrap.o
$(CXX) $(CXXFLAGS) -L$(install_dir)/lib -lbct -lgsl -lgslcblas $(swig_lib_flags) -o $(swig-manual_dir)/_bct_py.so $^ $(swig-manual_dir)/bct_py_wrap.o
swig-manual-clean:
-rm -rf bct_gsl_wrap.cpp bct_gsl.py bct_py_wrap.cpp bct_py.py build
swig-manual-install:
cp bct_gsl.py bct_py.py $(swig-manual_dir)/_bct_gsl.so $(swig-manual_dir)/_bct_py.so $(python_package_dir)