summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/lib/swig/Makefile.am
blob: 77bd03083613b114ced315bcdff78ea07238f4ce (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
#
# Copyright 2001,2003,2004,2005 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 2, 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., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, 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


INCLUDES = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) -I$(srcdir)


EXTRA_DIST = gen-swig-bug-fix


LOCAL_IFILES =				\
	gnuradio.i			\
	shared_ptr.i					

ALL_IFILES =				\
	$(LOCAL_IFILES)			


BUILT_SOURCES =				\
	gnuradio_swig_python.cc		\
	gnuradio_swig_python.py		\
	gnuradio_swig_python.h		\
	gnuradio_swig_bug_workaround.h	

grgrpython_PYTHON = 			\
	gnuradio_swig_python.py		


SWIGPYTHONARGS = $(SWIGPYTHONFLAGS) $(INCLUDES)


# ----------------------------------------------------------------
# _gnuradio_swig_python contains all the glue that implements
# the gnuradio.gr python package

grgrlib_LTLIBRARIES = 					\
	_gnuradio_swig_python.la

_gnuradio_swig_python_la_SOURCES = 			\
	gnuradio_swig_python.cc		


_gnuradio_swig_python_la_LIBADD  = 			\
	$(top_builddir)/gnuradio-core/src/lib/libgnuradio-core.la	\
	$(PYTHON_LDFLAGS)				\
	-lstdc++

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


# KLUDGE: Force runtime include of gnuradio_swig_python.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_python.d@am__quote@

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

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


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

# 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_python.d