-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathMakefile.static.in
271 lines (225 loc) · 8.48 KB
/
Makefile.static.in
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
########################################################################
# Makefile for static compilation Stimfit
# no automake, or libtool, 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
# ./autogen.sh
# ./configure --with-biosig --disable-python --with-pslope
# make -f Makefile.static # build stimfit(-lite) i.e. w/o python support
# make -f Makefile.static install # install stimfit into bindir
#
# WXCONF=/usr/bin/wx-config make -f Makefile.static
# # build built with non-default WX
#
# PREFIX=/usr/local make -f Makefile.static
#
# ./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:
# - PYTHON shell, matplotlib (print) are not supported
#
# Copyright (C) 2012,2013,2014,2015,2021,2025 Alois Schloegl
# This is part of the stimfit project http://stimfit.org
#
########################################################################
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 += -DWITH_PSLOPE
#DEFINES += -DTEST_MINIMAL
#DEFINES += -DPYTHON -DWITH_PYTHON
WXVERSION = $(basename $(shell $(WXCONF) --version))
PY_VERSION := $(shell py3versions -i | sed 's/python//g')
##############################################################
### 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/convertdlg.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/libstfio/igor/igorlib.cpp \
./src/libstfio/cfs/cfslib.cpp \
./src/libstfio/section.cpp \
./src/libstfio/recording.cpp \
./src/libstfio/hdf5/hdf5lib.cpp \
./src/libstfio/intan/intanlib.cpp \
./src/libstfio/intan/common.cpp \
./src/libstfio/intan/streams.cpp \
./src/libstfio/channel.cpp \
./src/libstfio/stfio.cpp \
./src/libstfio/igor/WriteWave.c \
./src/libstfio/igor/CrossPlatformFileIO.c \
./src/libstfio/biosig/biosiglib.cpp \
./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 \
# needed because of exportATF
SOURCES += $(SOURCES_ABF)
SOURCES += $(SOURCES_AXG)
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 += $(SOURCES_PYSTFIO)
CFLAGS += $(shell python$(PY_VERSION)-config --cflags)
DEFINES += -I$(shell python$(PY_VERSION)-config --prefix)/lib/pymodules/python$(PY_VERSION)/numpy/core/include
LDFLAGS += $(shell python$(PY_VERSION)-config --ldflags)
LIBS += $(shell python$(PY_VERSION)-config --libs)
endif
CC ?= $(shell $(WXCONF) --cc)
CXX ?= $(shell $(WXCONF) --cxx)
LD = $(shell $(WXCONF) --ld)
CFLAGS += $(DEFINES) $(shell $(WXCONF) --cflags) -fstack-protector -O2
CPPFLAGS += $(DEFINES) $(shell $(WXCONF) --cppflags) -std=c++17 -fstack-protector -O2
LIBS += $(shell $(WXCONF) --libs net,adv,aui,core,base)
SWIG = @SWIG@
SWIG_PYTHON_OPT = @SWIG_PYTHON_OPT@
prefix ?= $(PREFIX)
exec_prefix = ${prefix}
datarootdir = ${prefix}/share
datadir = ${datarootdir}
libdir = ${exec_prefix}/lib
includedir = ${prefix}/include
bindir = ${exec_prefix}/bin
mandir = ${datarootdir}/man
PKGCONF ?= $(CROSS)pkg-config
HDF5_CFLAGS = @HDF5_CFLAGS@
CPPFLAGS += $(HDF5_CFLAGS)
LIBHDF5_LDFLAGS = @LIBHDF5_LDFLAGS@
LIBS += $(LIBHDF5_LDFLAGS)
LIBLAPACK_LDFLAGS = @LIBLAPACK_LDFLAGS@
LIBS += $(LIBLAPACK_LDFLAGS)
CXXFLAGS += $(CFLAGS) $(CPPFLAGS)
## BIOSIG related stuff ##
LIBS += $(shell $(PKGCONF) --libs libbiosig)
LIBS += -lfftw3
ifeq (mingw,$(findstring mingw, $(WXCONF)))
LIBS += -lgfortran -lquadmath
endif
@BUILD_PYTHON_TRUE@PYTHON_DEST_DIR = ${prefix}${PYTHON_TARGET_DIR}
##############################################################
### BUILT
##############################################################
OBJECTS = $(addsuffix .$(OBJEXT), $(basename $(SOURCES)))
$(TARGET): $(OBJECTS)
$(LD) "$@" $(OBJECTS) $(LDFLAGS) $(LIBS)
%.c: %.h
%.cpp: %.h
%.$(OBJEXT): %.c
$(CC) -o "$@" $(CFLAGS) -c "$<"
%.$(OBJEXT): %.cc
$(CC) -o "$@" $(CFLAGS) -c "$<"
%.$(OBJEXT): %.cpp
$(CXX) -o "$@" $(CPPFLAGS) -c "$<"
%.$(OBJEXT): %.cxx
$(CXX) -o "$@" $(CXXFLAGS) -c "$<"
clean:
find src -name "*.$(OBJEXT)" -exec rm {} \;
rm -f stimfit
install: $(TARGET)
install $(TARGET) $(bindir)
uninstall:
rm $(bindir)/stimfit