summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/lib/swig/Makefile.am
blob: d468b41a9d7ea244e3d0faaf49becaa57041f365 (plain)
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
#
# Copyright 2001,2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc.
# 
# This file is part of GNU Radio
# 
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
# 
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING.  If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
# 

include $(top_srcdir)/Makefile.common

# Install this stuff in the gr subdirectory of the python pkg dir.
# This usually ends up at:
#   ${prefix}/lib/python${python_version}/site-packages/gnuradio/gr

grgrpythondir = $(grpythondir)/gr
grgrlibdir    = $(grpyexecdir)/gr

AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) -I$(srcdir) \
	 $(WITH_INCLUDES)

EXTRA_DIST = gen-swig-bug-fix

LOCAL_IFILES =				\
	gnuradio.i			\
	shared_ptr.i			\
	sw_general.i			\
	sw_gengen.i			\
	sw_filter.i			\
	sw_io.i

ALL_IFILES =				\
	$(LOCAL_IFILES)

# ----------------------------------------------------------------
# We've split the previously monstrous gnuradio_swig_python into
# 5 smaller pieces.  This reduces compile time coupling and
# creates smaller pieces for the compiler to digest.
# prior to this change, on X86_64, g++'s resident set size was
# 650MB!

BUILT_SOURCES =				\
	gnuradio_swig_py_runtime.cc	\
	gnuradio_swig_py_runtime.py	\
	gnuradio_swig_py_runtime.h	\
	gnuradio_swig_py_general.cc	\
	gnuradio_swig_py_general.py	\
	gnuradio_swig_py_general.h	\
	gnuradio_swig_py_gengen.cc	\
	gnuradio_swig_py_gengen.py	\
	gnuradio_swig_py_gengen.h	\
	gnuradio_swig_py_filter.cc	\
	gnuradio_swig_py_filter.py	\
	gnuradio_swig_py_filter.h	\
	gnuradio_swig_py_io.cc		\
	gnuradio_swig_py_io.py		\
	gnuradio_swig_py_io.h		\
	gnuradio_swig_bug_workaround.h	

# ----------------------------------------------------------------
# We break this up into 5 libraries...

grgrlib_LTLIBRARIES = 				\
	_gnuradio_swig_py_runtime.la		\
	_gnuradio_swig_py_general.la		\
	_gnuradio_swig_py_gengen.la		\
	_gnuradio_swig_py_filter.la		\
	_gnuradio_swig_py_io.la			


grgrpython_PYTHON = 			\
	gnuradio_swig_python.py		\
	gnuradio_swig_py_runtime.py	\
	gnuradio_swig_py_general.py	\
	gnuradio_swig_py_gengen.py	\
	gnuradio_swig_py_filter.py	\
	gnuradio_swig_py_io.py		


# This results in the code being compiled with -O1 instead of -g -O2

_gnuradio_swig_py_runtime_la_CXXFLAGS = @swig_CXXFLAGS@
_gnuradio_swig_py_general_la_CXXFLAGS = @swig_CXXFLAGS@
_gnuradio_swig_py_gengen_la_CXXFLAGS  = @swig_CXXFLAGS@
_gnuradio_swig_py_filter_la_CXXFLAGS  = @swig_CXXFLAGS@
_gnuradio_swig_py_io_la_CXXFLAGS      = @swig_CXXFLAGS@


# ----------------------------------------------------------------
# Part 1: gnuradio.i -> gnuradio_swig_py_runtime
#
# We continue to call this gnuradio.i to avoid having to touch
# lots of code in other modules

_gnuradio_swig_py_runtime_la_SOURCES = 		\
	gnuradio_swig_py_runtime.cc		


_gnuradio_swig_py_runtime_la_LIBADD  = 		\
	$(GNURADIO_CORE_LA)			\
	$(PYTHON_LDFLAGS)			\
	-lstdc++

_gnuradio_swig_py_runtime_la_LDFLAGS = -module -avoid-version $(NO_UNDEFINED)


# KLUDGE: Force runtime include of gnuradio_swig_py_runtime.d dependency file.
# This is not guaranteed to be portable, but will probably work.
# If it works, we have accurate dependencies for our swig stuff, which is good.
@am__include@ @am__quote@./gnuradio_swig_py_runtime.d@am__quote@

gnuradio_swig_py_runtime.py gnuradio_swig_py_runtime.h: gnuradio_swig_py_runtime.cc

gnuradio_swig_py_runtime.cc : $(srcdir)/gnuradio.i
	if $(SWIG) $(STD_SWIG_PYTHON_ARGS) -MMD -MF gnuradio_swig_py_runtime.Td -module gnuradio_swig_py_runtime -o gnuradio_swig_py_runtime.cc $(srcdir)/gnuradio.i ;\
	then if test $(host_os) = mingw32; \
	     then sed 's,\\\\,/,g' <gnuradio_swig_py_runtime.Td >gnuradio_swig_py_runtime.d; rm -f gnuradio_swig_py_runtime.Td; \
	     else mv -f gnuradio_swig_py_runtime.Td gnuradio_swig_py_runtime.d; fi \
	else rm -f gnuradio_swig_py_runtime.Td; exit 1; fi 


# ----------------------------------------------------------------
# Part 2: sw_general.i -> gnuradio_swig_py_general
#

_gnuradio_swig_py_general_la_SOURCES = 		\
	gnuradio_swig_py_general.cc		


_gnuradio_swig_py_general_la_LIBADD  = 		\
	$(GNURADIO_CORE_LA)			\
	$(PYTHON_LDFLAGS)			\
	-lstdc++

_gnuradio_swig_py_general_la_LDFLAGS = -module -avoid-version $(NO_UNDEFINED)


# KLUDGE: Force general include of gnuradio_swig_py_general.d dependency file.
# This is not guaranteed to be portable, but will probably work.
# If it works, we have accurate dependencies for our swig stuff, which is good.
@am__include@ @am__quote@./gnuradio_swig_py_general.d@am__quote@

gnuradio_swig_py_general.py gnuradio_swig_py_general.h: gnuradio_swig_py_general.cc

gnuradio_swig_py_general.cc : $(srcdir)/sw_general.i
	if $(SWIG) $(STD_SWIG_PYTHON_ARGS) -MMD -MF gnuradio_swig_py_general.Td -module gnuradio_swig_py_general -o gnuradio_swig_py_general.cc $(srcdir)/sw_general.i ;\
	then if test $(host_os) = mingw32; \
	     then sed 's,\\\\,/,g' <gnuradio_swig_py_general.Td >gnuradio_swig_py_general.d; rm -f gnuradio_swig_py_general.Td; \
	     else mv -f gnuradio_swig_py_general.Td gnuradio_swig_py_general.d; fi \
	else rm -f gnuradio_swig_py_general.Td; exit 1; fi 


# ----------------------------------------------------------------
# Part 3: sw_gengen.i -> gnuradio_swig_py_gengen
#

_gnuradio_swig_py_gengen_la_SOURCES = 		\
	gnuradio_swig_py_gengen.cc		


_gnuradio_swig_py_gengen_la_LIBADD  = 		\
	$(GNURADIO_CORE_LA)			\
	$(PYTHON_LDFLAGS)			\
	-lstdc++

_gnuradio_swig_py_gengen_la_LDFLAGS = -module -avoid-version $(NO_UNDEFINED)


# KLUDGE: Force gengen include of gnuradio_swig_py_gengen.d dependency file.
# This is not guaranteed to be portable, but will probably work.
# If it works, we have accurate dependencies for our swig stuff, which is good.
@am__include@ @am__quote@./gnuradio_swig_py_gengen.d@am__quote@

gnuradio_swig_py_gengen.py gnuradio_swig_py_gengen.h: gnuradio_swig_py_gengen.cc

gnuradio_swig_py_gengen.cc : $(srcdir)/sw_gengen.i
	if $(SWIG) $(STD_SWIG_PYTHON_ARGS) -MMD -MF gnuradio_swig_py_gengen.Td -module gnuradio_swig_py_gengen -o gnuradio_swig_py_gengen.cc $(srcdir)/sw_gengen.i ;\
	then if test $(host_os) = mingw32; \
	     then sed 's,\\\\,/,g' <gnuradio_swig_py_gengen.Td >gnuradio_swig_py_gengen.d; rm -f gnuradio_swig_py_gengen.Td; \
	     else mv -f gnuradio_swig_py_gengen.Td gnuradio_swig_py_gengen.d; fi \
	else rm -f gnuradio_swig_py_gengen.Td; exit 1; fi 


# ----------------------------------------------------------------
# Part 4: sw_filter.i -> gnuradio_swig_py_filter
#

_gnuradio_swig_py_filter_la_SOURCES = 		\
	gnuradio_swig_py_filter.cc		


_gnuradio_swig_py_filter_la_LIBADD  = 		\
	$(GNURADIO_CORE_LA)			\
	$(PYTHON_LDFLAGS)			\
	-lstdc++

_gnuradio_swig_py_filter_la_LDFLAGS = -module -avoid-version $(NO_UNDEFINED)


# KLUDGE: Force filter include of gnuradio_swig_py_filter.d dependency file.
# This is not guaranteed to be portable, but will probably work.
# If it works, we have accurate dependencies for our swig stuff, which is good.
@am__include@ @am__quote@./gnuradio_swig_py_filter.d@am__quote@

gnuradio_swig_py_filter.py gnuradio_swig_py_filter.h: gnuradio_swig_py_filter.cc

gnuradio_swig_py_filter.cc : $(srcdir)/sw_filter.i
	if $(SWIG) $(STD_SWIG_PYTHON_ARGS) -MMD -MF gnuradio_swig_py_filter.Td -module gnuradio_swig_py_filter -o gnuradio_swig_py_filter.cc $(srcdir)/sw_filter.i ;\
	then if test $(host_os) = mingw32; \
	     then sed 's,\\\\,/,g' <gnuradio_swig_py_filter.Td >gnuradio_swig_py_filter.d; rm -f gnuradio_swig_py_filter.Td; \
	     else mv -f gnuradio_swig_py_filter.Td gnuradio_swig_py_filter.d; fi \
	else rm -f gnuradio_swig_py_filter.Td; exit 1; fi 


# ----------------------------------------------------------------
# Part 5: sw_io.i -> gnuradio_swig_py_io
#

_gnuradio_swig_py_io_la_SOURCES = 		\
	gnuradio_swig_py_io.cc		


_gnuradio_swig_py_io_la_LIBADD  = 		\
	$(GNURADIO_CORE_LA)			\
	$(PYTHON_LDFLAGS)			\
	-lstdc++

_gnuradio_swig_py_io_la_LDFLAGS = -module -avoid-version $(NO_UNDEFINED)


# KLUDGE: Force io include of gnuradio_swig_py_io.d dependency file.
# This is not guaranteed to be portable, but will probably work.
# If it works, we have accurate dependencies for our swig stuff, which is good.
@am__include@ @am__quote@./gnuradio_swig_py_io.d@am__quote@

gnuradio_swig_py_io.py gnuradio_swig_py_io.h: gnuradio_swig_py_io.cc

gnuradio_swig_py_io.cc : $(srcdir)/sw_io.i
	if $(SWIG) $(STD_SWIG_PYTHON_ARGS) -MMD -MF gnuradio_swig_py_io.Td -module gnuradio_swig_py_io -o gnuradio_swig_py_io.cc $(srcdir)/sw_io.i ;\
	then if test $(host_os) = mingw32; \
	     then sed 's,\\\\,/,g' <gnuradio_swig_py_io.Td >gnuradio_swig_py_io.d; rm -f gnuradio_swig_py_io.Td; \
	     else mv -f gnuradio_swig_py_io.Td gnuradio_swig_py_io.d; fi \
	else rm -f gnuradio_swig_py_io.Td; exit 1; fi 


# ----------------------------------------------------------------
# FIXME As of swig 1.3.31, this still seems to be required...

gnuradio_swig_bug_workaround.h : gnuradio_swig_py_runtime.cc $(srcdir)/gen-swig-bug-fix
	$(PYTHON) $(srcdir)/gen-swig-bug-fix gnuradio_swig_py_runtime.cc $@

# ----------------------------------------------------------------

# Don't distribute output of swig
dist-hook:
	@for file in $(BUILT_SOURCES); do echo $(RM) $(distdir)/$$file; done
	@for file in $(BUILT_SOURCES); do $(RM) $(distdir)/$$file; done


grinclude_HEADERS =				\
	gnuradio_swig_bug_workaround.h

swiginclude_HEADERS =				\
	$(LOCAL_IFILES)			

MOSTLYCLEANFILES = \
	$(BUILT_SOURCES) *~ *.pyc 

DISTCLEANFILES = 			\
	gnuradio_swig_py_runtime.d	\
	gnuradio_swig_py_general.d	\
	gnuradio_swig_py_gengen.d	\
	gnuradio_swig_py_filter.d	\
	gnuradio_swig_py_io.d