Statistics
| Branch: | Tag: | Revision:

root / gnuradio-core / src / lib / swig / Makefile.am @ c8e09b54

History | View | Annotate | Download (4.4 kB)

1
#
2
# Copyright 2001,2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
3
# 
4
# This file is part of GNU Radio
5
# 
6
# GNU Radio is free software; you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation; either version 3, or (at your option)
9
# any later version.
10
# 
11
# GNU Radio is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
# GNU General Public License for more details.
15
# 
16
# You should have received a copy of the GNU General Public License
17
# along with GNU Radio; see the file COPYING.  If not, write to
18
# the Free Software Foundation, Inc., 51 Franklin Street,
19
# Boston, MA 02110-1301, USA.
20
# 
21
22
include $(top_srcdir)/Makefile.common
23
include $(top_srcdir)/Makefile.swig
24
25
BUILT_SOURCES = $(grinclude_HEADERS) $(swig_built_sources)
26
CLEANFILES = python/gnuradio*
27
if GUILE
28
CLEANFILES += guile/gnuradio*
29
endif
30
31
# ----------------------------------------------------------------
32
# We've split the previously monstrous gnuradio_swig_python into 6
33
# smaller pieces.  This reduces compile time coupling and creates
34
# smaller pieces for the compiler to digest.  prior to this change, on
35
# X86_64, g++'s resident set size was 650MB!
36
# ----------------------------------------------------------------
37
38
TOP_SWIG_IFILES =		\
39
	gnuradio_core_runtime.i	\
40
	gnuradio_core_general.i	\
41
	gnuradio_core_gengen.i	\
42
	gnuradio_core_filter.i	\
43
	gnuradio_core_io.i	\
44
	gnuradio_core_hier.i
45
46
47
# SWIG headers get installed in ${prefix}/include/gnuradio/swig
48
swiginclude_HEADERS =			\
49
	gnuradio.i			\
50
	gr_swig_block_magic.i		\
51
	gr_shared_ptr.i
52
53
54
if GUILE
55
# This is the top level guile file, which loads all the other scm files
56
# for gnuradio. This has to be installed top level to be found in the
57
# default search path.
58
grguile_DATA = gnuradio_swig.scm
59
endif
60
61
62
if PYTHON
63
AM_CPPFLAGS = -I$(srcdir) $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) \
64
	 $(WITH_INCLUDES)
65
66
EXTRA_DIST = gen-swig-bug-fix
67
68
# special install for this top-level Python script which includes all
69
# of the split Python libraries.
70
ourpythondir = $(grpythondir)/gr
71
ourpython_PYTHON = gnuradio_swig_python.py
72
73
# ----------------------------------------------------------------
74
# FIXME As of swig 1.3.31, this still seems to be required...
75
76
gnuradio_swig_bug_workaround.h : gnuradio_core_runtime.py $(srcdir)/gen-swig-bug-fix
77
	$(PYTHON) $(srcdir)/gen-swig-bug-fix python/gnuradio_core_runtime.cc $@
78
79
# C/C++ headers get installed in ${prefix}/include/gnuradio
80
grinclude_HEADERS = gnuradio_swig_bug_workaround.h
81
82
# Install so that they end up available as:
83
#   import gnuradio.gr
84
# This ends up at:
85
#   ${prefix}/lib/python${python_version}/site-packages/gnuradio/gr
86
gnuradio_core_runtime_pythondir_category = gnuradio/gr
87
gnuradio_core_general_pythondir_category = gnuradio/gr
88
gnuradio_core_gengen_pythondir_category  = gnuradio/gr
89
gnuradio_core_filter_pythondir_category  = gnuradio/gr
90
gnuradio_core_io_pythondir_category      = gnuradio/gr
91
gnuradio_core_hier_pythondir_category    = gnuradio/gr
92
93
# additional libraries for linking with each SWIG-generated library
94
gnuradio_core_runtime_la_swig_libadd = $(GNURADIO_CORE_LA)
95
gnuradio_core_general_la_swig_libadd = $(GNURADIO_CORE_LA)
96
gnuradio_core_gengen_la_swig_libadd  = $(GNURADIO_CORE_LA)
97
gnuradio_core_filter_la_swig_libadd  = $(GNURADIO_CORE_LA)
98
gnuradio_core_io_la_swig_libadd      = $(GNURADIO_CORE_LA)
99
gnuradio_core_hier_la_swig_libadd    = $(GNURADIO_CORE_LA)
100
101
# add some of the variables generated inside the Makefile.swig
102
103
# include the SWIG-generated .h files in the BUILT SOURCES, since they
104
# aren't by default when using Makefile.swig; order doesn't matter.
105
PYTHON_GEN = $(foreach HFILE,$(TOP_SWIG_IFILES), $(subst .i,.py,$(HFILE)))
106
#BUILT_SOURCES += $(foreach HFILE,$(PYTHON_GEN), $(subst gnuradio,python/gnuradio,$(HFILE)))
107
BUILT_SOURCES += $(PYTHON_GEN)
108
endif				# end of if python
109
110
if GUILE
111
GUILE_GEN = $(foreach HFILE,$(TOP_SWIG_IFILES), $(subst .i,.scm,$(HFILE)))
112
# BUILT_SOURCES += $(foreach HFILE,$(GUILE_GEN), $(subst gnuradio,guile/gnuradio,$(HFILE)))
113
BUILT_SOURCES += $(GUILE_GEN)
114
endif
115
116
# Do not distribute the output of SWIG
117
no_dist_files = $(swig_built_sources)
118
119
# Compile a .i to what guile needs. We use -o to set the output file name,
120
# or even with -outdir guile in SWIG_GUILE_ARGS, swig keeps putting a 
121
# gnuradio_core_*_wrap.cxx in the source directory.
122