-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathlalsuite_swig.am
311 lines (259 loc) · 10.5 KB
/
lalsuite_swig.am
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
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
# Common SWIG build rules
# Author: Karl Wette, 2011--2014
BUILT_SOURCES =
DEFAULT_INCLUDES =
EXTRA_DIST =
EXTRA_HEADERS =
pkginclude_HEADERS =
include $(top_srcdir)/gnuscripts/lalsuite_header_links.am
include $(top_srcdir)/gnuscripts/lalsuite_test.am
.PHONY: force-swig-rule-execution
.PHONY: swig-clean-local
.PHONY: swig-distclean-local
.PHONY: swig-dummy-depfiles
.PHONY: swig-octave-all-local
.PHONY: swig-octave-clean-local
.PHONY: swig-octave-install-hook
.PHONY: swig-octave-uninstall-hook
.PHONY: run-octave
.PHONY: debug-octave-test
.PHONY: swig-python-all-local
.PHONY: swig-python-clean-local
.PHONY: swig-python-install-hook
.PHONY: swig-python-uninstall-hook
.PHONY: run-python
.PHONY: debug-python-test
header-links: header-links-local
EXTRA_DIST += \
SWIGTest$(PACKAGE_NAME)Octave.m \
SWIGTest$(PACKAGE_NAME)Python.py \
generate_swig_iface.py \
$(END_OF_LIST)
pkginclude_HEADERS += \
SWIG$(PACKAGE_NAME)Alpha.i \
SWIG$(PACKAGE_NAME)Omega.i \
SWIG$(PACKAGE_NAME)Test.h \
$(END_OF_LIST)
swig_depfiles =
swig-dummy-depfiles: $(swig_depfiles)
if AMDEP
$(swig_depfiles):
@$(MKDIR_P) $(SWIG_DEPDIR) && echo '# generated by swig-dummy-depfiles' > $@.tmp && mv -f $@.tmp $@
endif
distclean-local: swig-distclean-local
swig-distclean-local:
-rm -rf $(SWIG_DEPDIR)
if AMDEP
swig_deps_if =
else
swig_deps_if = : swig-deps-false-
endif
DEBUG_TESTS_ENVIRONMENT = \
$(TESTS_ENVIRONMENT) \
export NASTY_ERROR_HANDLERS; NASTY_ERROR_HANDLERS=1; \
$(END_OF_LIST)
if SWIG_BUILD
swig_verbose = $(swig_verbose_$(SWIGVERBOSE))
swig_verbose_ = $(swig_verbose_0)
swig_verbose_0 =
swig_verbose_1 = -v
swig_iface = swig$(PACKAGE).i
swig_preproc_flags = -Werror -Wextra -w201,302 -I$(top_builddir)/include -includeall -ignoremissing -xml -xmllite -MP -MD -MT $@
swig_flags = $(swig_verbose) -Werror -Wextra -w314,506,511 -I$(top_builddir)/include $(SWIG_CPPFLAGS) $(LAL_SYSTEM_INCLUDES) -MP -MD -MT $@
swig_cppflags = -shared -I. -I$(top_builddir)/include $(SWIG_CPPFLAGS)
swig_ldflags = -module -avoid-version -version-info 0:0:0 $(SWIG_LDFLAGS) $(AM_LDFLAGS)
swig_libtoolflags = --tag=disable-static
swig_ifacedir = $(pkgincludedir)
nodist_swig_iface_HEADERS = $(swig_iface)
swig_config_header = swiglal_config.h
swig_public_config_undef_header = swiglal_$(PACKAGE_NAME)Config_undef.h
BUILT_SOURCES += \
$(swig_config_header) \
$(swig_public_config_undef_header) \
$(END_OF_LIST)
header-links-local:
$(AM_V_at)rm -f $(top_builddir)/include/lal/$(swig_iface) && \
$(LN_S) $(abs_builddir)/$(swig_iface) $(top_builddir)/include/lal/$(swig_iface)
$(swig_config_header): Makefile $(CONFIG_HEADER)
$(AM_V_GEN)for file in $(CONFIG_HEADER); do \
case "$${file}" in \
*/config.h) \
echo "// $@: generated from $${file} by $(subdir)/Makefile" >$@; \
$(SED) -n -e 's/^#define */#define SWIGLAL_/p' "$${file}" >>$@;; \
*) ;; \
esac; \
done
$(swig_public_config_undef_header): Makefile $(CONFIG_HEADER)
$(AM_V_GEN)for file in $(CONFIG_HEADER); do \
case "$${file}" in \
*/config.h) ;; \
*) \
echo "// $@: generated from $${file} by $(subdir)/Makefile" >$@; \
$(SED) -n -e 's|^ *[/][*] *#undef *\([^ ]*\) *[*][/] *$$|#define \1 0|p' "$${file}" >> $@;; \
esac; \
done
swiglal_header_list.txt: force-swig-rule-execution
$(AM_V_at)headers=`find $(top_builddir)/include/lal -name '*.h' ! -name '*VCSInfoHeader.h'`; \
headers=`printf '%s\n' $${headers} | $(SED) -e 's|^.*/\([^/]*\)$$|\1|' | LC_ALL=C sort`; \
printf "%s\n" $${headers} >>$@.tmp; \
if test -f $@ && diff -s $@ $@.tmp >/dev/null 2>&1; then \
rm -f $@.tmp; \
else \
mv -f $@.tmp $@; \
fi
if AMDEP
@swig__depfile_include_pre@$(SWIG_DEPDIR)/swiglal.deps@swig__depfile_include_post@
swig_depfiles += $(SWIG_DEPDIR)/swiglal.deps
swig_preproc_flags += -MF $(SWIG_DEPDIR)/swiglal.deps.tmp
endif
$(swig_iface): Makefile swiglal_header_list.txt $(swig_public_config_undef_header) $(srcdir)/generate_swig_iface.py
$(AM_V_GEN)echo '// $@_preproc.i: generated by $(subdir)/Makefile' >$@_preproc.i; \
echo "%module swiglal_preproc;" >>$@_preproc.i; \
echo "%warnfilter(SWIGWARN_PARSE_REDUNDANT) __swiglal__;" >>$@_preproc.i; \
echo "%warnfilter(SWIGWARN_PARSE_REDUNDANT) __swiglal_clear__;" >>$@_preproc.i; \
echo "#define SWIGLAL(...) const char __swiglal__[] = #__VA_ARGS__" >>$@_preproc.i; \
echo "#define SWIGLAL_CLEAR(...) const char __swiglal_clear__[] = #__VA_ARGS__" >>$@_preproc.i; \
stddeffile=""; \
for flag in $(swig_flags); do \
case "$${flag}" in \
-I*) \
dir=`echo $${flag} | $(SED) -e 's|^-I||'`; \
stddeffile="$${dir}/lal/LALStddef.h"; \
if test -f "$${stddeffile}"; then \
break; \
fi; \
stddeffile=""; \
;; \
esac; \
done; \
if test "x$${stddeffile}" = x; then \
echo "ERROR: could not find LAL standard definitions header" >&2; \
exit 1; \
fi; \
echo "%import \"$${stddeffile}\"" >>$@_preproc.i; \
printf "%%include <lal/%s>\n" `cat swiglal_header_list.txt` >>$@_preproc.i; \
echo "%include \"$(swig_public_config_undef_header)\"" >>$@_preproc.i; \
if $(SWIG) $(swig_preproc_flags) -o $@_preproc.xml $@_preproc.i; then \
$(swig_deps_if)mv -f $(SWIG_DEPDIR)/swiglal.deps.tmp $(SWIG_DEPDIR)/swiglal.deps; \
else \
$(swig_deps_if)rm -f $(SWIG_DEPDIR)/swiglal.deps.tmp; \
rm -f $@; \
exit 1; \
fi; \
if $(PYTHON) $(srcdir)/generate_swig_iface.py '$(SWIG_VERSION)' '$(PACKAGE_NAME)' '$(SWIG_DEPENDENCIES)' '$(swig_function_prefixes)' $@_preproc.xml $@; then \
: ; \
else \
rm -f $@; \
exit 1; \
fi
clean-local: swig-clean-local
swig-clean-local:
-rm -rf swiglal*
endif # SWIG_BUILD
if SWIG_BUILD_OCTAVE
swig_octave_flags = -octave $(SWIG_OCTAVE_FLAGS) -outdir swiglal_octave/ $(swig_flags)
octexec_LTLIBRARIES = swiglal_octave.la
nodist_swiglal_octave_la_SOURCES = swiglal_@PACKAGE@_octave.cpp
swiglal_octave_la_SOURCES = SWIGTest.c
swiglal_octave_la_CPPFLAGS = $(SWIG_OCTAVE_CPPFLAGS_IOCTAVE) $(swig_cppflags) $(SWIG_OCTAVE_CPPFLAGS) $(LAL_SYSTEM_INCLUDES)
swiglal_octave_la_CXXFLAGS = $(SWIG_OCTAVE_CXXFLAGS)
swiglal_octave_la_LDFLAGS = $(LDADD) $(swig_ldflags) $(SWIG_OCTAVE_LDFLAGS)
swiglal_octave_la_LIBTOOLFLAGS = $(swig_libtoolflags)
if AMDEP
@swig__depfile_include_pre@$(SWIG_DEPDIR)/swiglal_octave.deps@swig__depfile_include_post@
swig_depfiles += $(SWIG_DEPDIR)/swiglal_octave.deps
swig_octave_flags += -MF $(SWIG_DEPDIR)/swiglal_octave.deps.tmp
endif
$(nodist_swiglal_octave_la_SOURCES): $(swig_iface) $(swig_config_header)
$(AM_V_GEN)$(MKDIR_P) swiglal_octave/ && \
if $(SWIG) $(swig_octave_flags) -o $@ $<; then \
$(swig_deps_if)mv -f $(SWIG_DEPDIR)/swiglal_octave.deps.tmp $(SWIG_DEPDIR)/swiglal_octave.deps; \
else \
$(swig_deps_if)rm -f $(SWIG_DEPDIR)/swiglal_octave.deps.tmp; \
exit 1; \
fi
all-local: swig-octave-all-local
swig-octave-all-local: $(octexec_LTLIBRARIES)
$(AM_V_at)$(MKDIR_P) $(top_builddir)/octave && \
cd $(top_builddir)/octave && \
rm -f $(PACKAGE).oct && \
$(LN_S) $(abs_top_builddir)/swig/$(SWIG_LTLIBDIR)/swiglal_octave$(SWIG_SOEXT) $(PACKAGE).oct
clean-local: swig-octave-clean-local
swig-octave-clean-local:
-cd $(top_builddir)/octave && \
rm -f $(PACKAGE).oct
install-exec-hook: swig-octave-install-hook
swig-octave-install-hook:
cd $(DESTDIR)$(octexecdir) && \
rm -f swiglal_octave.la $(PACKAGE).oct* && \
mv -f swiglal_octave$(SWIG_SOEXT) $(PACKAGE).oct
uninstall-hook: swig-octave-uninstall-hook
swig-octave-uninstall-hook:
cd $(DESTDIR)$(octexecdir) && \
rm -f $(PACKAGE).oct
test_scripts += SWIGTest$(PACKAGE_NAME)Octave.m
run-octave: swig-octave-all-local
$(AM_V_at)$(TESTS_ENVIRONMENT)$(test_script_compiler) $(OCTAVE)
debug-octave-test: swig-octave-all-local
$(AM_V_at)$(DEBUG_TESTS_ENVIRONMENT)$(test_script_compiler) $${DEBUGGER-gdb --args} $(OCTAVE) $${SCRIPT-./SWIGTest$(PACKAGE_NAME)Octave.m} $${SCRIPTARGS}
endif # SWIG_BUILD_OCTAVE
if SWIG_BUILD_PYTHON
swig_python_flags = -python $(SWIG_PYTHON_FLAGS) -outdir swiglal_python/ $(swig_flags)
pkgpyexec_LTLIBRARIES = swiglal_python.la
nodist_pkgpyexec_PYTHON = swiglal_python/$(PACKAGE).py
nodist_swiglal_python_la_SOURCES = swiglal_@PACKAGE@_python.c
swiglal_python_la_SOURCES = SWIGTest.c
swiglal_python_la_CPPFLAGS = $(swig_cppflags) $(SWIG_PYTHON_CPPFLAGS) $(LAL_SYSTEM_INCLUDES)
swiglal_python_la_CFLAGS = $(SWIG_PYTHON_CFLAGS)
swiglal_python_la_LDFLAGS = $(LDADD) $(swig_ldflags) $(SWIG_PYTHON_LDFLAGS) $(SWIG_PYTHON_FLAT_NAMESPACE_LDFLAG)
swiglal_python_la_LIBTOOLFLAGS = $(swig_libtoolflags)
if AMDEP
@swig__depfile_include_pre@$(SWIG_DEPDIR)/swiglal_python.deps@swig__depfile_include_post@
swig_depfiles += $(SWIG_DEPDIR)/swiglal_python.deps
swig_python_flags += -MF $(SWIG_DEPDIR)/swiglal_python.deps.tmp
endif
$(nodist_swiglal_python_la_SOURCES): $(swig_iface) $(swig_config_header)
$(AM_V_GEN)$(MKDIR_P) swiglal_python/ && \
if $(SWIG) $(swig_python_flags) -o $@ $<; then \
$(swig_deps_if)mv -f $(SWIG_DEPDIR)/swiglal_python.deps.tmp $(SWIG_DEPDIR)/swiglal_python.deps; \
else \
$(swig_deps_if)rm -f $(SWIG_DEPDIR)/swiglal_python.deps.tmp; \
exit 1; \
fi
$(nodist_pkgpyexec_PYTHON): $(nodist_swiglal_python_la_SOURCES)
all-local: swig-python-all-local
swig-python-all-local: $(pkgpyexec_LTLIBRARIES)
$(AM_V_at)$(MKDIR_P) $(top_builddir)/python/$(PACKAGE) && \
cd $(top_builddir)/python/$(PACKAGE) && \
rm -f _$(PACKAGE)$(SWIG_SOEXT) $(PACKAGE).py && \
$(LN_S) $(abs_top_builddir)/swig/$(SWIG_LTLIBDIR)/swiglal_python$(SWIG_SOEXT) _$(PACKAGE)$(SWIG_SOEXT) && \
if test -r $(abs_top_srcdir)/swig/$(nodist_pkgpyexec_PYTHON); then \
$(LN_S) $(abs_top_srcdir)/swig/$(nodist_pkgpyexec_PYTHON) $(PACKAGE).py; \
else \
$(LN_S) $(abs_top_builddir)/swig/$(nodist_pkgpyexec_PYTHON) $(PACKAGE).py; \
fi
clean-local: swig-python-clean-local
swig-python-clean-local:
-cd $(top_builddir)/python/$(PACKAGE) && \
rm -f _$(PACKAGE)$(SWIG_SOEXT) $(PACKAGE).py $(PACKAGE).pyc $(PACKAGE).pyo
install-exec-hook: swig-python-install-hook
swig-python-install-hook:
cd $(DESTDIR)$(pkgpyexecdir) && \
rm -f swiglal_python.la _$(PACKAGE)$(SWIG_SOEXT)* && \
mv -f swiglal_python$(SWIG_SOEXT) _$(PACKAGE)$(SWIG_SOEXT)
uninstall-hook: swig-python-uninstall-hook
swig-python-uninstall-hook:
cd $(DESTDIR)$(pkgpyexecdir) && \
rm -f _$(PACKAGE)$(SWIG_SOEXT)
test_scripts += SWIGTest$(PACKAGE_NAME)Python.py
run-python: swig-python-all-local
$(AM_V_at)$(TESTS_ENVIRONMENT)$(test_script_compiler) $(PYTHON)
debug-python-test: swig-python-all-local
$(AM_V_at)$(DEBUG_TESTS_ENVIRONMENT)$(test_script_compiler) $${DEBUGGER-gdb --args} $(PYTHON) $${SCRIPT-./SWIGTest$(PACKAGE_NAME)Python.py} $${SCRIPTARGS}
endif # SWIG_BUILD_PYTHON
tags-am:
@echo > swiglal_dummy.c && $(ETAGS) swiglal_dummy.c && rm -f swiglal_dummy.c
ctags-am:
@echo > swiglal_dummy.c && $(CTAGS) swiglal_dummy.c && rm -f swiglal_dummy.c
cscopelist-am:
@: