forked from neurodroid/stimfit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.static
276 lines (235 loc) · 8.56 KB
/
Makefile.static
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
########################################################################
# Makefile for static compilation Stimfit
# no auto-tools (autoconf, automake, libtool, shave etc.) are needed.
#
# No global installation (sudo make install) is needed, but
# stimfit can be started immediately after compilation.
#
# This is most useful for debugging, when several instances of stimfit
# should be available.
#
# Usage:
# cd ~/src/stimfit/ # change into stimfit's root directory
# make -f Makefile.static # build stimfit
# make -B -f Makefile.static # rebuild everything
#
# WXCONF=/usr/bin/wx-config make -f Makefile.static
# # build built with non-default WX
#
# ./stimfit # start stimfit
#
# win32 built
# CROSS=i686-pc-mingw32- make -f Makefile.static
# WXCONF=i686-pc-mingw32-wx-config make -f Makefile.static
# win64 built
# CROSS=x86_64-static-mingw32- make -f Makefile.static
# WXCONF=x86_64-static-mingw32-wx-config make -f Makefile.static
#
# The use of WXCONF is deprecated, and might be removed in future
# Limitations:
# - no support for ASCII, SON format
# - PYTHON shell, matplotlib (print) are not supported
# - configure not supported
#
# Copyright (C) 2012,2013,2014,2015 Alois Schloegl
# This is part of the stimfit project http://code.google.com/p/stimfit/
#
########################################################################
ifeq (,$(WXCONF))
# default wx-config
WXCONF = $(CROSS)wx-config
else
ifneq (,$(findstring mingw,$(WXCONF)))
# for backwords compatibility to older MXE scripts
CROSS = $(subst wx-config,,$(WXCONF))
endif
endif
DEFINES += -DWITH_BIOSIG
DEFINES += -DHAVE_LAPACK
#DEFINES += -DWITHOUT_ABF
#DEFINES += -DWITHOUT_AXG
DEFINES += -DWITH_PSLOPE
#DEFINES += -DTEST_MINIMAL
#DEFINES += -DPYTHON -DWITH_PYTHON
WXVERSION = $(basename $(shell $(WXCONF) --version))
WXDIR = $(dir $(WXCONF))../include/wx-$(WXVERSION)/
DEFINES += -I$(WXDIR)
PY_VERSION := 2.7
##############################################################
### SOURCES
##############################################################
vpath %.cpp ./src/stimfit:./src/stimfit/gui:./src/stimfit/gui/dlgs:./src/stimfit/gui/usrdlg:./src/libstfnum:./src/libstfio/:./src/libstfio/cfs/:./src/libstfio/atf/:./src/libstfio/abf/:./src/libstfio/abf/axon2:./src/libstfio/abf/axon/Common:./src/libstfio/abf/axon/AxAbfFio32:./src/libstfio/abf/axon/AxAtfFio32/:./src/libstfio/biosig/:./src/libstfio/hdf5/:./src/libstfio/heka/:./src/libstfio/igor:./src/libstfio/ascii/:./src/libstfio/axg/
vpath %.c ./src/libstfnum/levmar/:./src/libstfio/igor/:./src/libstfio/cfs/
vpath %.cpp ./src/libstfnum/:./src/libstfnum/levmar/:./src/stimfit/gui/:./src/stimfit/gui/dlgs/:./src/libstfio/:./src/libstfio/biosig/:./src/libstfio/igor/:./src/libstfio/cfs/
SOURCES = ./src/stimfit/stf.cpp \
./src/libstfnum/stfnum.cpp \
./src/libstfnum/funclib.cpp \
./src/libstfnum/measure.cpp \
./src/libstfnum/fit.cpp \
./src/libstfnum/levmar/lm.c \
./src/libstfnum/levmar/Axb.c \
./src/libstfnum/levmar/misc.c \
./src/libstfnum/levmar/lmbc.c \
./src/libstfnum/levmar/lmlec.c \
./src/stimfit/gui/doc.cpp \
./src/stimfit/gui/zoom.cpp \
./src/stimfit/gui/childframe.cpp \
./src/stimfit/gui/app.cpp \
./src/stimfit/gui/parentframe.cpp \
./src/stimfit/gui/dlgs/cursorsdlg.cpp \
./src/stimfit/gui/dlgs/eventdlg.cpp \
./src/stimfit/gui/dlgs/smalldlgs.cpp \
./src/stimfit/gui/dlgs/fitseldlg.cpp \
./src/stimfit/gui/copygrid.cpp \
./src/stimfit/gui/usrdlg/usrdlg.cpp \
./src/stimfit/gui/graph.cpp \
./src/stimfit/gui/unopt.cpp \
./src/stimfit/gui/view.cpp \
./src/stimfit/gui/table.cpp \
./src/stimfit/gui/printout.cpp \
./src/stimfit/gui/main.cpp \
./src/stimfit/gui/stfcheckbox.cpp \
./src/libstfio/igor/igorlib.cpp \
./src/libstfio/cfs/cfslib.cpp \
./src/libstfio/section.cpp \
./src/libstfio/recording.cpp \
./src/libstfio/hdf5/hdf5lib.cpp \
./src/libstfio/channel.cpp \
./src/libstfio/stfio.cpp \
./src/libstfio/igor/WriteWave.c \
./src/libstfio/igor/CrossPlatformFileIO.c \
./src/libstfio/cfs/cfs.c
SOURCES_OPTIONAL = \
./src/libstfio/heka/hekalib.cpp \
SOURCES_ABF = ./src/libstfio/atf/atflib.cpp \
./src/libstfio/abf/abflib.cpp \
./src/libstfio/abf/axon2/ProtocolReaderABF2.cpp \
./src/libstfio/abf/axon2/abf2headr.cpp \
./src/libstfio/abf/axon2/SimpleStringCache.cpp \
./src/libstfio/abf/axon/Common/FileReadCache.cpp \
./src/libstfio/abf/axon/Common/unix.cpp \
./src/libstfio/abf/axon/Common/FileIO.cpp \
./src/libstfio/abf/axon/AxAtfFio32/axatffio32.cpp \
./src/libstfio/abf/axon/AxAtfFio32/fileio2.cpp \
./src/libstfio/abf/axon/AxAbfFio32/abferror.cpp \
./src/libstfio/abf/axon/AxAbfFio32/abfheadr.cpp \
./src/libstfio/abf/axon/AxAbfFio32/filedesc.cpp \
./src/libstfio/abf/axon/AxAbfFio32/msbincvt.cpp \
./src/libstfio/abf/axon/AxAbfFio32/abfutil.cpp \
./src/libstfio/abf/axon/AxAbfFio32/abffiles.cpp \
./src/libstfio/abf/axon/AxAbfFio32/Oldheadr.cpp \
./src/libstfio/abf/axon/AxAbfFio32/abfhwave.cpp \
./src/libstfio/abf/axon/AxAbfFio32/csynch.cpp
EXCLUDED = ./src/libstfio/ascii/asciilib.cpp \
./src/libstfio/abf/axon/AxAtfFio32/fileio2.cpp \
./src/libstfnum/levmar/lmbc_core.c \
./src/libstfnum/levmar/lmlec_core.c \
./src/libstfnum/levmar/misc_core.c \
./src/libstfnum/levmar/lm_core.c \
./src/libstfnum/levmar/Axb_core.c \
./src/stimfit/gui/dclatex.cpp \
TESTSRC = ./src/test/section.cpp \
./src/test/recording.cpp \
./src/test/measure.cpp \
./src/test/channel.cpp \
./src/test/gtest/src/gtest.cc \
./src/test/gtest/src/gtest-port.cc \
./src/test/gtest/src/gtest-test-part.cc \
./src/test/gtest/src/gtest-typed-test.cc \
./src/test/gtest/src/gtest.cc \
./src/test/gtest/src/gtest-printers.cc \
./src/test/gtest/src/gtest-death-test.cc \
./src/test/gtest/src/gtest-all.cc \
./src/test/gtest/src/gtest_main.cc \
./src/test/gtest/src/gtest-filepath.cc
SOURCES_AXG = ./src/libstfio/axg/axglib.cpp \
./src/libstfio/axg/AxoGraph_ReadWrite.cpp \
./src/libstfio/axg/fileUtils.cpp \
./src/libstfio/axg/stringUtils.cpp \
./src/libstfio/axg/byteswap.cpp \
### DEPENDENCIES ###
ifneq (,$(findstring HAVE_LAPACK, $(DEFINES)))
LIBS += -llapack -lblas
endif
ifeq (,$(findstring WITHOUT_ABF, $(DEFINES)))
SOURCES += $(SOURCES_ABF)
endif
ifeq (,$(findstring WITHOUT_AXG, $(DEFINES)))
SOURCES += $(SOURCES_AXG)
endif
ifeq (,$(findstring mingw, $(WXCONF)))
TARGET = stimfit
OBJEXT = o
else
### MINGW ###
TARGET = stimfit.exe
OBJEXT = obj
endif
ifeq (,$(findstring TEST_MINIMAL, $(DEFINES)))
SOURCES += $(SOURCES_OPTIONAL)
endif
ifneq (,$(findstring WITH_PYTHON, $(DEFINES)))
SOURCES += ./src/stimfit/py/pystf.cxx ./src/stimfit/py/pystf_wrap.cxx ./src/pystfio/pystfio.cxx
DEFINES += -I/usr/include/python$(PY_VERSION)
DEFINES += -I/usr/lib/pymodules/python$(PY_VERSION)/numpy/core/include
LDFLAGS += -L/usr/lib/python$(PY_VERSION)/
LIBS += -lpython$(PY_VERSION)
endif
CC = $(shell $(WXCONF) --cc)
CXX = $(shell $(WXCONF) --cxx)
CFLAGS = $(DEFINES) $(shell $(WXCONF) --cflags) -fstack-protector
CXXFLAGS = $(DEFINES) $(shell $(WXCONF) --cxxflags) -std=gnu++11 -fstack-protector
LIBS += $(shell $(WXCONF) --libs net,adv,aui,core,base)
## HDF5 related stuff ##
ifneq ($(CROSS),)
## Debian/Wheezy
LIBS += -lhdf5_hl -lhdf5
else
ifneq ($(wildcard /usr/lib/libhdf5*),)
## Debian/Wheezy
LIBS += -lhdf5_hl -lhdf5
else
ifneq ($(wildcard /usr/lib/x86_64-linux-gnu/libhdf5_serial*),)
## Debian/Jessie
CXXFLAGS += -I/usr/include/hdf5/serial
LDFLAGS += -L/usr/lib/x86_64-linux-gnu/
LIBS += -lhdf5_serial_hl -lhdf5_serial
endif
endif
endif
## BIOSIG related stuff ##
ifneq (,$(findstring WITH_BIOSIG2, $(DEFINES)))
LIBS += -lbiosig2
else
ifneq (,$(findstring WITH_BIOSIG, $(DEFINES)))
LIBS += -lbiosig
endif
endif
ifneq (,$(findstring WITH_BIOSIG, $(DEFINES)))
SOURCES += ./src/libstfio/biosig/biosiglib.cpp
LIBS += $(shell $(CROSS)pkg-config --libs libbiosig)
endif
LIBS += -lfftw3
ifeq (mingw,$(findstring mingw, $(WXCONF)))
LIBS += -lgfortran -lquadmath
LIBS += -liberty -liconv
endif
##############################################################
### BUILT
##############################################################
OBJECTS = $(addsuffix .$(OBJEXT), $(basename $(SOURCES)))
$(TARGET): $(OBJECTS)
$(CXX) $(OBJECTS) $(CXXFLAGS) $(LDFLAGS) $(LIBS) -o "$@"
%.c: %.h
%.cpp: %.h
%.$(OBJEXT): %.c
$(CC) -c $(CFLAGS) -c -o "$@" "$<"
%.$(OBJEXT): %.cpp
$(CXX) -c $(CXXFLAGS) -c -o "$@" "$<"
%.$(OBJEXT): %.cc
$(CXX) -c $(CXXFLAGS) -c -o "$@" "$<"
%.$(OBJEXT): %.cxx
$(CXX) -c $(CXXFLAGS) -c -o "$@" "$<"
clean:
find src -name "*.$(OBJEXT)" -exec rm {} \;
rm stimfit