Merged r10554:10595 from michaelld/am_swig_4 into trunk. Major overhaul of SWIG...
authorjcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5>
Sat, 14 Mar 2009 02:28:41 +0000 (02:28 +0000)
committerjcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5>
Sat, 14 Mar 2009 02:28:41 +0000 (02:28 +0000)
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10596 221aa14e-8319-0410-a670-987f0aec2ac5

117 files changed:
Makefile.am
Makefile.common
Makefile.gen.gen
Makefile.par.gen [new file with mode: 0644]
Makefile.swig [new file with mode: 0644]
Makefile.swig.gen.t [new file with mode: 0644]
config/grc_gnuradio_core.m4
config/grc_gr_gcell.m4
gnuradio-core/src/lib/filter/Makefile.am
gnuradio-core/src/lib/general/Makefile.am
gnuradio-core/src/lib/gengen/Makefile.am
gnuradio-core/src/lib/runtime/Makefile.am
gnuradio-core/src/lib/swig/Makefile.am
gnuradio-core/src/lib/swig/Makefile.swig.gen [new file with mode: 0644]
gnuradio-core/src/lib/swig/gnuradio_swig_py_filter.i [new file with mode: 0644]
gnuradio-core/src/lib/swig/gnuradio_swig_py_general.i [new file with mode: 0644]
gnuradio-core/src/lib/swig/gnuradio_swig_py_gengen.i [new file with mode: 0644]
gnuradio-core/src/lib/swig/gnuradio_swig_py_io.i [new file with mode: 0644]
gnuradio-core/src/lib/swig/gnuradio_swig_py_runtime.i [new file with mode: 0644]
gnuradio-core/src/lib/swig/sw_filter.i [deleted file]
gnuradio-core/src/lib/swig/sw_general.i [deleted file]
gnuradio-core/src/lib/swig/sw_gengen.i [deleted file]
gnuradio-core/src/lib/swig/sw_io.i [deleted file]
gnuradio-core/src/lib/swig/sw_runtime.i [deleted file]
gnuradio-core/src/python/bin/Makefile.am
gnuradio-core/src/python/gnuradio/Makefile.am
gnuradio-core/src/python/gnuradio/blks2/Makefile.am
gnuradio-core/src/python/gnuradio/blks2impl/Makefile.am
gnuradio-core/src/python/gnuradio/gru/Makefile.am
gnuradio-core/src/python/gnuradio/gruimpl/Makefile.am
gnuradio-examples/c++/dial_tone/Makefile.am
gnuradio-examples/python/digital-bert/Makefile.am
gnuradio-examples/python/digital/Makefile.am
gnuradio-examples/python/network/Makefile.am
gr-atsc/src/lib/Makefile.am
gr-atsc/src/lib/Makefile.swig.gen [new file with mode: 0644]
gr-audio-alsa/src/Makefile.am
gr-audio-alsa/src/Makefile.swig.gen [new file with mode: 0644]
gr-audio-jack/src/Makefile.am
gr-audio-jack/src/Makefile.swig.gen [new file with mode: 0644]
gr-audio-oss/src/Makefile.am
gr-audio-oss/src/Makefile.swig.gen [new file with mode: 0644]
gr-audio-osx/src/Makefile.am
gr-audio-osx/src/Makefile.swig.gen [new file with mode: 0644]
gr-audio-portaudio/src/Makefile.am
gr-audio-portaudio/src/Makefile.swig.gen [new file with mode: 0644]
gr-audio-windows/src/Makefile.am
gr-audio-windows/src/Makefile.swig.gen [new file with mode: 0644]
gr-comedi/src/Makefile.am
gr-comedi/src/Makefile.swig.gen [new file with mode: 0644]
gr-cvsd-vocoder/src/lib/Makefile.am
gr-cvsd-vocoder/src/lib/Makefile.swig.gen [new file with mode: 0644]
gr-cvsd-vocoder/src/python/Makefile.am
gr-gcell/src/Makefile.am
gr-gcell/src/Makefile.swig.gen [new file with mode: 0644]
gr-gcell/src/examples/Makefile.am
gr-gpio/src/fpga/top/Makefile.am
gr-gpio/src/python/Makefile.am
gr-gsm-fr-vocoder/src/lib/Makefile.am
gr-gsm-fr-vocoder/src/lib/Makefile.swig.gen [new file with mode: 0644]
gr-howto-write-a-block/Makefile.am
gr-howto-write-a-block/Makefile.common
gr-howto-write-a-block/Makefile.swig [new file with mode: 0644]
gr-howto-write-a-block/Makefile.swig.gen.t [new file with mode: 0644]
gr-howto-write-a-block/config.guess
gr-howto-write-a-block/config.sub
gr-howto-write-a-block/config/gr_standalone.m4
gr-howto-write-a-block/config/lf_cc.m4
gr-howto-write-a-block/configure.ac
gr-howto-write-a-block/src/lib/Makefile.am
gr-howto-write-a-block/src/lib/Makefile.swig.gen [new file with mode: 0644]
gr-msdd6000/src/Makefile.am
gr-msdd6000/src/Makefile.swig.gen [new file with mode: 0644]
gr-pager/Makefile.am
gr-pager/src/Makefile.am
gr-pager/src/Makefile.swig.gen [new file with mode: 0644]
gr-pager/src/pager.i [deleted file]
gr-pager/src/pager_swig.i [new file with mode: 0644]
gr-qtgui/src/lib/Makefile.am
gr-qtgui/src/lib/Makefile.swig.gen [new file with mode: 0644]
gr-qtgui/src/python/Makefile.am
gr-radar-mono/src/fpga/lib/Makefile.am
gr-radar-mono/src/fpga/models/Makefile.am
gr-radar-mono/src/fpga/tb/Makefile.am
gr-radar-mono/src/fpga/top/Makefile.am
gr-radar-mono/src/python/Makefile.am
gr-radio-astronomy/src/lib/Makefile.am
gr-radio-astronomy/src/lib/Makefile.swig.gen [new file with mode: 0644]
gr-sounder/src/fpga/lib/Makefile.am
gr-sounder/src/fpga/tb/Makefile.am
gr-sounder/src/fpga/top/Makefile.am
gr-sounder/src/python/Makefile.am
gr-trellis/src/examples/Makefile.am
gr-trellis/src/lib/Makefile.am
gr-trellis/src/lib/Makefile.swig.gen [new file with mode: 0644]
gr-trellis/src/python/Makefile.am
gr-usrp/apps/Makefile.am
gr-usrp/src/Makefile.am
gr-usrp/src/Makefile.swig.gen [new file with mode: 0644]
gr-usrp/src/usrp.i [deleted file]
gr-usrp/src/usrp_swig.i [new file with mode: 0644]
gr-usrp2/src/Makefile.am
gr-usrp2/src/Makefile.swig.gen [new file with mode: 0644]
gr-utils/src/python/Makefile.am
gr-video-sdl/src/Makefile.am
gr-video-sdl/src/Makefile.swig.gen [new file with mode: 0644]
grc/freedesktop/Makefile.am
grc/src/platforms/base/Makefile.am
grc/src/platforms/python/Makefile.am
mblock/src/lib/Makefile.am
pmt/src/lib/Makefile.am
usrp/host/lib/inband/Makefile.am
usrp/host/lib/legacy/Makefile.am
usrp/host/swig/Makefile.am
usrp/host/swig/Makefile.swig.gen [new file with mode: 0644]
usrp/host/swig/prims.i [deleted file]
usrp/host/swig/usrp_prims.i [new file with mode: 0644]

index e9dde45f1b327b6abdf1d8a12e6c37454361342e..1711f707dc4fcd36496889f0d109d578f3772e85 100644 (file)
@@ -28,7 +28,11 @@ EXTRA_DIST = \
        configure \
        configure-cell-cross \
        config.h.in \
-       run_tests.sh.in
+       run_tests.sh.in \
+       Makefile.swig \
+       Makefile.swig.gen.t \
+       Makefile.par.gen \
+       Makefile.gen.gen
 
 SUBDIRS = @build_dirs@
 DIST_SUBDIRS = @build_dirs@ @skipped_dirs@ @with_dirs@
index 24ec75a37ad7d9513a738ab229aa1de48fcca420..b81433a32972d74e7164c1785869f38fbd12f84e 100644 (file)
@@ -59,21 +59,6 @@ STD_DEFINES_AND_INCLUDES = $(DEFINES) $(BOOST_CPPFLAGS) \
 WITH_INCLUDES = @with_INCLUDES@
 WITH_SWIG_INCLUDES = @with_SWIG_INCLUDES@
 
-# swig flags
-# -w511 turns off keyword argument warning
-# "-outdir $(builddir)" writes all generated output files to
-#   the local builddir (which should always be '.')
-SWIG_PYTHON_FLAGS = -fvirtual -python -modern -keyword \
-       -w511 -outdir .
-
-# standard swig flags used by most components
-STD_SWIG_PYTHON_ARGS = \
-       $(SWIG_PYTHON_FLAGS) \
-       $(STD_DEFINES_AND_INCLUDES) \
-       $(LOCAL_SWIG_DEFINES_AND_INCLUDES) \
-       $(WITH_SWIG_INCLUDES) \
-       $(WITH_INCLUDES)
-
 # How to link in the top-level omnithreads library from inside the tree
 OMNITHREAD_INCLUDES = @omnithread_INCLUDES@
 OMNITHREAD_LA = @omnithread_LA@
@@ -85,9 +70,6 @@ GNURADIO_INCLUDES = @gnuradio_core_INCLUDES@
 # How to link in GNU Radio core library from inside the tree
 GNURADIO_CORE_LA = @gnuradio_core_LA@
 
-# This is a dependency for many swig operations
-GNURADIO_I = @gnuradio_core_I@
-
 # How to link in the USRP library from inside the tree
 GRUEL_INCLUDES = @gruel_INCLUDES@
 GRUEL_LA = @gruel_LA@
@@ -132,3 +114,14 @@ exampledir = $(datadir)/gnuradio/examples
 # Base directory for documentation (docdir undefined in autoconf < 1.60)
 docdir ?= $(datadir)/doc/$(PACKAGE)
 gr_docdir = $(docdir)-$(VERSION)
+
+# Other common defines; use "+=" to add to these
+STAMPS =
+MOSTLYCLEANFILES = $(BUILT_SOURCES) $(STAMPS) *.pyc *.pyo *~ *.tmp *.loT
+
+# Don't distribute the files defined in the variable 'no_dist_files'
+dist-hook:
+       @for file in $(no_dist_files); do \
+               echo $(RM) $(distdir)/$$file; \
+               $(RM) $(distdir)/$$file; \
+       done;
index 1a67edf88d1a8214f5c4bfea5dfd28d5ebb6d0fc..a6df8b8f36e34f26bf29b1fac64ed37503b3834b 100644 (file)
 # Boston, MA 02110-1301, USA.
 # 
 
-STAMPS += $(DEPDIR)/sources-generate-*
-
-# Ensure parallel make does the right thing.
-# http://sources.redhat.com/automake/automake.html#Multiple-Outputs
-
-$(DEPDIR)/sources-generate-stamp: $(gen_sources_deps)
-       @rm -f $(DEPDIR)/sources-generate-tmp
-       @touch $(DEPDIR)/sources-generate-tmp
-       PYTHONPATH=$(top_srcdir)/gnuradio-core/src/python srcdir=$(srcdir) $(PYTHON) $(srcdir)/generate_all.py
-       @mv -f $(DEPDIR)/sources-generate-tmp $@
-
-$(gen_sources): $(DEPDIR)/sources-generate-stamp
-## Recover from the removal of $@
-       @if test -f $@; then :; else \
-               trap 'rm -rf $(DEPDIR)/sources-generate-*' 1 2 13 15; \
-               if mkdir $(DEPDIR)/sources-generate-lock 2>/dev/null; then \
-## This code is being executed by the first process.
-                       rm -f $(DEPDIR)/sources-generate-stamp; \
-                       $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/sources-generate-stamp; \
-                       rmdir $(DEPDIR)/sources-generate-lock; \
-               else \
-## This code is being executed by the follower processes.
-## Wait until the first process is done.
-                       while test -d $(DEPDIR)/sources-generate-lock; do sleep 1; done; \
-## Succeed if and only if the first process succeeded.
-                       test -f $(DEPDIR)/sources-generate-stamp; exit $$?; \
-               fi; \
-       fi;
-
 ## ----------------------------------------------------------------
 ## Special rule for regenerating the local Makefile.gen
+##
+## Define the variable 'makefile_gen_gen_command' to be the command
+## that creates $(srcdir)/Makefile.gen .  The rule below will check to
+## make sure that it can create the generated file, and if not exits
+## with an error -1.
+##
 
-STAMPS += $(DEPDIR)/generate-makefile-generate-*
+STAMPS += $(DEPDIR)/Makefile.gen-generate-generate-*
 
 generate-makefile $(srcdir)/Makefile.gen:
 ## parallel make protection; can't hurt
@@ -77,21 +54,17 @@ generate-makefile $(srcdir)/Makefile.gen:
                fi; \
                if test "$$do_recreate" == "1"; then \
                        echo "Regenerating $(srcdir)/Makefile.gen"; \
-                       PYTHONPATH=$(top_srcdir)/gnuradio-core/src/python srcdir=$(srcdir) do_makefile=1 do_sources=0 $(PYTHON) $(srcdir)/generate_all.py; \
+                       $(makefile_gen_gen_command); \
                else \
                        echo "Cannot recreate $(srcdir)/Makefile.gen because the directory or file is write-protected."; \
+                       exit -1; \
                fi; \
                mv -f $(DEPDIR)/Makefile.gen-generate-tmp $(DEPDIR)/Makefile.gen-generate-stamp; \
                rmdir $(DEPDIR)/Makefile.gen-generate-lock; \
        else \
 ## This code is being executed by the follower processes.
 ## Wait until the first process is done.
-               while test -d $(DEPDIR)/$@-generate-lock; do sleep 1; done; \
+               while test -d $(DEPDIR)/Makefile.gen-generate-lock; do sleep 1; done; \
 ## Succeed if and only if the first process succeeded.
-               test -f $(DEPDIR)/$@-generate-stamp; exit $$?; \
+               test -f $(DEPDIR)/Makefile.gen-generate-stamp; exit $$?; \
        fi;
-
-## ----------------------------------------------------------------
-
-MOSTLYCLEANFILES += $(STAMPS)
-
diff --git a/Makefile.par.gen b/Makefile.par.gen
new file mode 100644 (file)
index 0000000..22eb1a0
--- /dev/null
@@ -0,0 +1,77 @@
+# -*- Makefile -*-
+#
+# Copyright 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.
+# 
+
+STAMPS ?=
+EXTRA_DIST ?=
+MOSTLYCLEANFILES ?=
+
+## ----------------------------------------------------------------
+## Special rules for generating sources.  Include this file when there
+## are multiple targets ('gen_sources') being created using a single
+## command.  In this case, parallel build protection is required, and
+## is provided by this file using a reasonably generic ruleset.  For
+## more info, see:
+##
+## http://sources.redhat.com/automake/automake.html#Multiple-Outputs
+##
+## If a single source is being created, then normal rules can be used;
+## using this parallel protection will not hurt, but it also won't help.
+##
+## Define the variable 'par_gen_command' to be the command that
+## creates the sources 'gen_sources' from the dependency files
+## 'gen_sources_deps'.
+##
+
+## These STAMPS will be removed upon "make clean", but are otherwise
+## not used.
+
+STAMPS += $(DEPDIR)/stamp-sources-generate*
+
+## The following STAMP will be included in the archive, to show that
+## this these rules have been followed.
+
+EXTRA_DIST += stamp-sources-generate
+MOSTLYCLEANFILES += stamp-sources-generate
+
+stamp-sources-generate: $(gen_sources_deps)
+       @rm -f $(DEPDIR)/stamp-sources-generate-tmp
+       @touch $(DEPDIR)/stamp-sources-generate-tmp
+       $(par_gen_command)
+       @mv -f $(DEPDIR)/stamp-sources-generate-tmp $@
+
+$(gen_sources): stamp-sources-generate
+## Recover from the removal of $@
+       @if test -f $@; then :; else \
+               trap 'rm -rf $(DEPDIR)/stamp-sources-generate-*' 1 2 13 15; \
+               if mkdir $(DEPDIR)/stamp-sources-generate-lock 2>/dev/null; then \
+## This code is being executed by the first process.
+                       rm -f stamp-sources-generate; \
+                       $(MAKE) $(AM_MAKEFLAGS) stamp-sources-generate; \
+                       rmdir $(DEPDIR)/stamp-sources-generate-lock; \
+               else \
+## This code is being executed by the follower processes.
+## Wait until the first process is done.
+                       while test -d $(DEPDIR)/stamp-sources-generate-lock; do sleep 1; done; \
+## Succeed iff the first process succeeded.
+                       test -f stamp-sources-generate; exit $$?; \
+               fi; \
+       fi;
diff --git a/Makefile.swig b/Makefile.swig
new file mode 100644 (file)
index 0000000..9e14835
--- /dev/null
@@ -0,0 +1,117 @@
+# -*- Makefile -*-
+#
+# Copyright 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.
+# 
+
+## This makefile should be included using 
+##     include $(top_srcdir)/Makefile.swig
+## in Makefile.am's which require SWIG wrapping / compilation.
+## For just installing .i files, this Makefile is not required.
+
+## swig flags
+## -w511 turns off keyword argument warning
+## "-outdir $(builddir)" writes all generated output files to
+##   the local builddir (which should always be '.')
+##   In some older autotools, $(builddir) is not defined, so
+##   just use '.' instead.
+
+SWIG_PYTHON_FLAGS =    \
+       -fvirtual       \
+       -python         \
+       -modern         \
+       -keyword        \
+       -w511           \
+       -outdir .
+
+## standard swig flags used by most components
+
+STD_SWIG_PYTHON_ARGS =                         \
+       $(SWIG_PYTHON_FLAGS)                    \
+       $(STD_DEFINES_AND_INCLUDES)             \
+       $(WITH_SWIG_INCLUDES)                   \
+       $(WITH_INCLUDES)
+
+## standard SWIG LD flags for library creation
+
+STD_SWIG_LA_LD_FLAGS =         \
+       $(PYTHON_LDFLAGS)       \
+       -module                 \
+       -avoid-version          \
+       $(NO_UNDEFINED)
+
+## standard SWIG library additions for library creation
+
+STD_SWIG_LA_LIB_ADD =                  \
+       -lstdc++
+
+## standard SWIG CXXFLAGS
+## This allows for code to be compiled with "-O1" instead of "-g -O2"
+## for some systems, avoiding some optimization issues.
+
+STD_SWIG_CXX_FLAGS = @swig_CXXFLAGS@
+
+## SWIG suffix for automake to know about
+
+SUFFIXES = .i
+
+## Create $(srcdir)/Makefile.swig.gen, containing all of the rules
+## for running SWIG to generate or re-generate outputs.  SWIG file
+## names are to be defined in TOP_SWIG_IFILES, and must include the
+## full path to the file and full filename including extension.  This
+## Makefile addition will be made only if either it does not exist or
+## if the top-level template has been modified.
+
+generate-makefile-swig $(srcdir)/Makefile.swig.gen: $(top_srcdir)/Makefile.swig.gen.t
+## recreate $(srcdir)/Makefile.swig.gen only if ...
+       @do_recreate=0; \
+       if test -f $(srcdir)/Makefile.swig.gen; then \
+## the file exists and can be removed; or ...
+               if $(RM) $(srcdir)/Makefile.swig.gen 2>/dev/null; then \
+                       if touch $(srcdir)/Makefile.swig.gen 2>/dev/null; then \
+                               do_recreate=1; \
+                       fi; \
+               fi; \
+       else \
+## the file doesn't exist, but can be created (e.g., by touching it).
+               if touch $(srcdir)/Makefile.swig.gen 2>/dev/null; then \
+                       do_recreate=1; \
+               fi; \
+       fi; \
+       if test "$$do_recreate" == "1"; then \
+               echo "Regenerating $(srcdir)/Makefile.swig.gen"; \
+               for TFILE in $(TOP_SWIG_IFILES); do \
+## retrieve just the filename, without path or extension
+                       TNAME=`python -c "import os.path as op; (dN, fN) = op.split ('$$TFILE'); (fbN, fE) = op.splitext (fN); print fbN;"`; \
+## Replace the @-named strings in the template Makefile for SWIG.
+                       $(SED) -e 's|@NAME@|'$$TNAME'|g;' < $(top_srcdir)/Makefile.swig.gen.t >> $(srcdir)/Makefile.swig.gen; \
+                       echo "" >> $(srcdir)/Makefile.swig.gen; \
+               done; \
+       else \
+               echo "Cannot recreate $(srcdir)/Makefile.swig.gen because the directory or file is write-protected."; \
+               exit -1; \
+       fi;
+
+swig_built_sources =
+
+## include the built Makefile.swig.gen, always the one from the
+## srcdir; this must be included as the last item, because it depends
+## on variables defined above.
+
+include $(srcdir)/Makefile.swig.gen
diff --git a/Makefile.swig.gen.t b/Makefile.swig.gen.t
new file mode 100644 (file)
index 0000000..c15a817
--- /dev/null
@@ -0,0 +1,258 @@
+# -*- Makefile -*-
+#
+# Copyright 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.
+# 
+
+# Makefile.swig.gen for @NAME@.i
+
+## Default install locations for these files:
+##
+## Default location for the Python directory is:
+##  ${prefix}/lib/python${python_version}/site-packages/[category]/@NAME@
+## Default location for the Python exec directory is:
+##  ${exec_prefix}/lib/python${python_version}/site-packages/[category]/@NAME@
+##
+## The following can be overloaded to change the install location, but
+## this has to be done in the including Makefile.am -before-
+## Makefile.swig is included.
+
+@NAME@_pythondir_category ?= gnuradio/@NAME@
+@NAME@_pylibdir_category ?= $(@NAME@_pythondir_category)
+@NAME@_pythondir = $(pythondir)/$(@NAME@_pythondir_category)
+@NAME@_pylibdir = $(pyexecdir)/$(@NAME@_pylibdir_category)
+
+## SWIG headers are always installed into the same directory.
+
+@NAME@_swigincludedir = $(swigincludedir)
+
+## This is a template file for a "generated" Makefile addition (in
+## this case, "Makefile.swig.gen").  By including the top-level
+## Makefile.swig, this file will be used to generate the SWIG
+## dependencies.  Assign the variable TOP_SWIG_FILES to be the list of
+## SWIG .i files to generated wrappings for; there can be more than 1
+## so long as the names are unique (no sorting is done on the
+## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i
+## file will generate .cc, .py, and possibly .h files -- meaning that
+## all of these files will have the same base name (that provided for
+## the SWIG .i file).
+##
+## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the
+## right thing.  For more info, see <
+## http://sources.redhat.com/automake/automake.html#Multiple-Outputs >
+
+## Stamps used to ensure parallel make does the right thing.  These
+## are removed by "make clean", but otherwise unused except during the
+## parallel built.  These will not be included in a tarball, because
+## the SWIG-generated files will be removed from the distribution.
+
+STAMPS += $(DEPDIR)/@NAME@-generate-*
+
+## Other cleaned files: dependency files generated by SWIG or this Makefile
+
+MOSTLYCLEANFILES += $(DEPDIR)/*.S*
+
+## Add the .py and .cc files to the list of SWIG built sources.  The
+## .h file is sometimes built, but not always ... so that one has to
+## be added manually by the including Makefile.am .
+
+swig_built_sources += @NAME@.py @NAME@.cc
+
+## Various SWIG variables.  These can be overloaded in the including
+## Makefile.am by setting the variable value there, then including
+## Makefile.swig .
+
+@NAME@_swiginclude_HEADERS =           \
+       @NAME@.i                        \
+       $(@NAME@_swiginclude_headers)
+
+@NAME@_pylib_LTLIBRARIES =             \
+       _@NAME@.la
+
+_@NAME@_la_SOURCES =                   \
+       @NAME@.cc                       \
+       $(@NAME@_la_swig_sources)
+
+_@NAME@_la_LIBADD =                    \
+       $(STD_SWIG_LA_LIB_ADD)          \
+       $(@NAME@_la_swig_libadd)
+
+_@NAME@_la_LDFLAGS =                   \
+       $(STD_SWIG_LA_LD_FLAGS)         \
+       $(@NAME@_la_swig_ldflags)
+
+_@NAME@_la_CXXFLAGS =                  \
+       $(STD_SWIG_CXX_FLAGS)           \
+       $(@NAME@_la_swig_cxxflags)
+
+@NAME@_python_PYTHON =                 \
+       @NAME@.py                       \
+       $(@NAME@_python)
+
+## Entry rule for running SWIG
+
+@NAME@.h @NAME@.py @NAME@.cc: @NAME@.i
+## This rule will get called only when MAKE decides that one of the
+## targets needs to be created or re-created, because:
+##
+## * The .i file is newer than any or all of the generated files;
+##
+## * Any or all of the .cc, .h, or .py files does not exist and is
+##   needed (in the case this file is not needed, the rule for it is
+##   ignored); or
+##
+## * Some SWIG-based dependecy of the .cc file isn't met and hence the
+##   .cc file needs be be regenerated.  Explanation: Because MAKE
+##   knows how to handle dependencies for .cc files (regardless of
+##   their name or extension), then the .cc file is used as a target
+##   instead of the .i file -- but with the dependencies of the .i
+##   file.  It is this last reason why the line:
+##
+##             if test -f $@; then :; else
+##
+##   cannot be used in this case: If a .i file dependecy is not met,
+##   then the .cc file needs to be rebuilt.  But if the stamp is newer
+##   than the .cc file, and the .cc file exists, then in the original
+##   version (with the 'test' above) the internal MAKE call will not
+##   be issued and hence the .cc file will not be rebuilt.
+##
+## Once execution gets to here, it should always proceed no matter the
+## state of a stamp (as discussed in link above).  The
+## $(DEPDIR)/@NAME@-generate stuff is used to allow for parallel
+## builds to "do the right thing".  The stamp has no relationship with
+## either the target files or dependency file; it is used solely for
+## the protection of multiple builds during a given call to MAKE.
+##
+## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM
+## (15).  At a caught signal, the quoted command will be issued before
+## exiting.  In this case, remove any stamp, whether temporary of not.
+## The trap is valid until the process exits; the process includes all
+## commands appended via "\"s.
+##
+       trap 'rm -rf $(DEPDIR)/@NAME@-generate-*' 1 2 13 15; \
+##
+## Create a temporary directory, which acts as a lock.  The first
+## process to create the directory will succeed and issue the MAKE
+## command to do the actual work, while all subsequent processes will
+## fail -- leading them to wait for the first process to finish.
+##
+       if mkdir $(DEPDIR)/@NAME@-generate-lock 2>/dev/null; then \
+##
+## This code is being executed by the first process to succeed in
+## creating the directory lock.
+##
+## Remove the stamp associated with this filename.
+##
+               rm -f $(DEPDIR)/@NAME@-generate-stamp; \
+##
+## Tell MAKE to run the rule for creating this stamp.
+##
+               $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/@NAME@-generate-stamp WHAT=$<; \
+##
+## Now that the .cc, .h, and .py files have been (re)created from the
+## .i file, future checking of this rule during the same MAKE
+## execution will come back that the rule doesn't need to be executed
+## because none of the conditions mentioned at the start of this rule
+## will be positive.  Remove the the directory lock, which frees up
+## any waiting process(es) to continue.
+##
+               rmdir $(DEPDIR)/@NAME@-generate-lock; \
+       else \
+##
+## This code is being executed by any follower processes while the
+## directory lock is in place.
+##
+## Wait until the first process is done, testing once per second.
+##
+               while test -d $(DEPDIR)/@NAME@-generate-lock; do \
+                       sleep 1; \
+               done; \
+##
+## Succeed if and only if the first process succeeded; exit this
+## process returning the status of the generated stamp.
+##
+               test -f $(DEPDIR)/@NAME@-generate-stamp; \
+               exit $$?; \
+       fi;
+
+$(DEPDIR)/@NAME@-generate-stamp:
+## This rule will be called only by the first process issuing the
+## above rule to succeed in creating the lock directory, after
+## removing the actual stamp file in order to guarantee that MAKE will
+## execute this rule.
+##
+## Call SWIG to generate the various output files; special
+## post-processing on 'mingw32' host OS for the dependency file.
+##
+       if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(@NAME@_swig_args) \
+               -MD -MF $(DEPDIR)/@NAME@.Std \
+               -module @NAME@ -o @NAME@.cc $(WHAT); then \
+           if test $(host_os) = mingw32; then \
+               $(RM) $(DEPDIR)/@NAME@.Sd; \
+               $(SED) 's,\\\\,/,g' < $(DEPDIR)/@NAME@.Std \
+                       > $(DEPDIR)/@NAME@.Sd; \
+               $(RM) $(DEPDIR)/@NAME@.Std; \
+               $(MV) $(DEPDIR)/@NAME@.Sd $(DEPDIR)/@NAME@.Std; \
+           fi; \
+       else \
+           $(RM) $(DEPDIR)/@NAME@.S*; exit 1; \
+       fi;
+##
+## Mess with the SWIG output .Std dependency file, to create a
+## dependecy file valid for the input .i file: Basically, simulate the
+## dependency file created for libraries by GNU's libtool for C++,
+## where all of the dependencies for the target are first listed, then
+## each individual dependency is listed as a target with no further
+## dependencies.
+##
+## (1) remove the current dependency file
+##
+       $(RM) $(DEPDIR)/@NAME@.d
+##
+## (2) Copy the whole SWIG file:
+##
+       cp $(DEPDIR)/@NAME@.Std $(DEPDIR)/@NAME@.d
+##
+## (3) all a carriage return to the end of the dependency file.
+##
+       echo "" >> $(DEPDIR)/@NAME@.d
+##
+## (4) from the SWIG file, remove the first line (the target); remove
+##     trailing " \" and " " from each line.  Append ":" to each line,
+##     followed by 2 carriage returns, then append this to the end of
+##     the dependency file.
+##
+       $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/@NAME@.Std | \
+               awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/@NAME@.d
+##
+## (5) remove the SWIG-generated file
+##
+       $(RM) $(DEPDIR)/@NAME@.Std
+##
+## Create the stamp for this filename generation, to signal success in
+## executing this rule; allows other threads waiting on this process
+## to continue.
+##
+       touch $(DEPDIR)/@NAME@-generate-stamp
+
+# KLUDGE: Force runtime include of a SWIG 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@./$(DEPDIR)/@NAME@.d@am__quote@
index 43e6d55fe9449578c134b2cd247a5798fb898b6f..29e20c283472a50dc5a465b2d9510f42ae18b08d 100644 (file)
@@ -1,4 +1,4 @@
-dnl Copyright 2001,2002,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc.
+dnl Copyright 2001,2002,2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc.
 dnl 
 dnl This file is part of GNU Radio
 dnl 
@@ -65,19 +65,10 @@ AC_DEFUN([GRC_GNURADIO_CORE],[
 \$(FFTW3F_CFLAGS) \
 \$(GSL_CFLAGS)"
         gnuradio_core_LA="\${abs_top_builddir}/gnuradio-core/src/lib/libgnuradio-core.la"
-       gnuradio_core_I="\${abs_top_srcdir}/gnuradio-core/src/lib/swig/gnuradio.i"
+       dnl gnuradio_core_I="\${abs_top_srcdir}/gnuradio-core/src/lib/swig/gnuradio.i"
        gnuradio_core_LIBDIRPATH="\${abs_top_builddir}/gnuradio-core/src/lib:\${abs_top_builddir}/gnuradio-core/src/lib/.libs"
        gnuradio_core_SWIGDIRPATH="\${abs_top_builddir}/gnuradio-core/src/lib/swig:\${abs_top_builddir}/gnuradio-core/src/lib/swig/.libs:\${abs_top_srcdir}/gnuradio-core/src/lib/swig"
        gnuradio_core_PYDIRPATH="\${abs_top_srcdir}/gnuradio-core/src/python"
-
-        dnl kludge up initial swig dependency files
-        AC_CONFIG_COMMANDS([swig_deps], [
-            touch gnuradio-core/src/lib/swig/gnuradio_swig_py_runtime.d
-            touch gnuradio-core/src/lib/swig/gnuradio_swig_py_general.d
-            touch gnuradio-core/src/lib/swig/gnuradio_swig_py_gengen.d
-            touch gnuradio-core/src/lib/swig/gnuradio_swig_py_filter.d
-            touch gnuradio-core/src/lib/swig/gnuradio_swig_py_io.d
-        ])
     fi
 
     dnl other externally-required gnuradio-core variables
index 191afdc087e00bee9fb078c0e937644f11bc0868..476de364fa0315b5819718fc8963242678b5ee4f 100644 (file)
@@ -1,4 +1,4 @@
-dnl Copyright 2001,2002,2003,2004,2005,2006,2008 Free Software Foundation, Inc.
+dnl Copyright 2001,2002,2003,2004,2005,2006,2008,2009 Free Software Foundation, Inc.
 dnl 
 dnl This file is part of GNU Radio
 dnl 
@@ -31,12 +31,6 @@ AC_DEFUN([GRC_GR_GCELL],[
         gr-gcell/src/run_tests \
     ])
 
-    dnl kludge up initial swig dependency files
-    AC_CONFIG_COMMANDS([swig_gcell_deps], [
-        touch gr-gcell/src/gcell.d
-    ])
-
-
     GRC_BUILD_CONDITIONAL(gr-gcell,[
        dnl run_tests is created from run_tests.in.  Make it executable.
        AC_CONFIG_COMMANDS([run_tests_gcell], [chmod +x gr-gcell/src/run_tests])
index aaf7d41e0b185bd5b3d977bf7b4267c76ca7402d..b7fd0f58aac9f9c6436e7164101e36640c438094 100644 (file)
@@ -62,29 +62,13 @@ code_generator =                                    \
        gr_freq_xlating_fir_filter_XXX.h.t              \
        gr_freq_xlating_fir_filter_XXX.i.t
 
-# include the srcdir's Makefile.gen; doing this creates an implicit
-# dependency between $(srcdir)/Makefile.in and $(srcdir)/Makefile.gen.
-include $(srcdir)/Makefile.gen
-
 # Source built by Python into $(builddir)
-python_built_sources =         \
+BUILT_SOURCES =                        \
        $(GENERATED_H)          \
        $(GENERATED_I)          \
        $(GENERATED_CC)         \
        filter_generated.i
 
-BUILT_SOURCES = $(python_built_sources)
-
-# Required when including Makefile.gen.gen
-
-STAMPS =
-gen_sources = $(BUILT_SOURCES)
-gen_sources_deps = $(core_generator)
-MOSTLYCLEANFILES = $(BUILT_SOURCES) *.pyc
-
-# common way for generating sources from templates, using the above parameters
-include $(top_srcdir)/Makefile.gen.gen
-
 # ----------------------------------------------------------------
 # MD_CPU and MD_SUBCPU are set at configure time by way of 
 #   gnuradio/config/gr_set_md_cpu.m4.  
@@ -326,3 +310,20 @@ swiginclude_HEADERS =                      \
        gr_single_pole_iir_filter_ff.i  \
        gr_single_pole_iir_filter_cc.i  \
        $(GENERATED_I)
+
+# Do creation and inclusion of other Makefiles last
+
+# include the srcdir's Makefile.gen; doing this creates an implicit
+# dependency between $(srcdir)/Makefile.in and $(srcdir)/Makefile.gen.
+include $(srcdir)/Makefile.gen
+
+# common way for generating local Makefile.gen
+makefile_gen_gen_command = PYTHONPATH=$(top_srcdir)/gnuradio-core/src/python srcdir=$(srcdir) do_makefile=1 do_sources=0 $(PYTHON) $(srcdir)/generate_all.py
+include $(top_srcdir)/Makefile.gen.gen
+
+# common way for generating sources from templates when using
+# BUILT_SOURCES, using parallel build protection.
+gen_sources = $(BUILT_SOURCES)
+gen_sources_deps = $(core_generator)
+par_gen_command = PYTHONPATH=$(top_srcdir)/gnuradio-core/src/python srcdir=$(srcdir) $(PYTHON) $(srcdir)/generate_all.py
+include $(top_srcdir)/Makefile.par.gen
index 7d486092ac4ef737b04ef45a5a983b693f2d24d5..fa3ccd5a6c341f5eacc7c4960866a1b8754ee4a1 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2001,2002,2004,2006,2007,2008 Free Software Foundation, Inc.
+# Copyright 2001,2002,2004,2006,2007,2008,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -475,6 +475,3 @@ swiginclude_HEADERS =                       \
        gr_scrambler_bb.i               \
        gr_probe_mpsk_snr_c.i           \
        gr_probe_density_b.i
-
-
-CLEANFILES = $(BUILT_SOURCES) *.pyc
index e969eb90089def65fd59d4462a252b004d497555..13c821018b30ab74884bbb9cae81bbd801dc1b9e 100644 (file)
@@ -120,29 +120,13 @@ core_generator =                  \
        gr_moving_average_XX.h.t        \
        gr_moving_average_XX.i.t
 
-# include the srcdir's Makefile.gen; doing this creates an implicit
-# dependency between $(srcdir)/Makefile.in and $(srcdir)/Makefile.gen.
-include $(srcdir)/Makefile.gen
-
 # Source built by Python into $(builddir)
-python_built_sources =         \
+BUILT_SOURCES =                        \
        $(GENERATED_H)          \
        $(GENERATED_I)          \
        $(GENERATED_CC)         \
        gengen_generated.i
 
-BUILT_SOURCES = $(python_built_sources)
-
-# Required when including Makefile.gen.gen
-
-STAMPS =
-gen_sources = $(BUILT_SOURCES)
-gen_sources_deps = $(core_generator)
-MOSTLYCLEANFILES = $(BUILT_SOURCES) *.pyc
-
-# common way for generating sources from templates, using the above parameters
-include $(top_srcdir)/Makefile.gen.gen
-
 # ----------------------------------------------------------------
 
 EXTRA_DIST =                           \
@@ -151,20 +135,31 @@ EXTRA_DIST =                              \
 libgengen_la_SOURCES =                         \
        $(GENERATED_CC)                 
 
-#libgengen_qa_la_SOURCES =             
-
 grinclude_HEADERS =                    \
        $(GENERATED_H)                  \
        gr_endianness.h                 \
        gr_noise_type.h                 \
        gr_sig_source_waveform.h        
 
-noinst_HEADERS =                       
-
 swiginclude_HEADERS =                  \
        $(GENERATED_I)                  \
        gr_endianness.i                 \
        gengen.i                        \
        gengen_generated.i              
 
-CLEANFILES = $(BUILT_SOURCES) *.pyc
+# Do creation and inclusion of other Makefiles last
+
+# include the srcdir's Makefile.gen; doing this creates an implicit
+# dependency between $(srcdir)/Makefile.in and $(srcdir)/Makefile.gen.
+include $(srcdir)/Makefile.gen
+
+# common way for generating local Makefile.gen
+makefile_gen_gen_command = PYTHONPATH=$(top_srcdir)/gnuradio-core/src/python srcdir=$(srcdir) do_makefile=1 do_sources=0 $(PYTHON) $(srcdir)/generate_all.py
+include $(top_srcdir)/Makefile.gen.gen
+
+# common way for generating sources from templates when using
+# BUILT_SOURCES, using parallel build protection.
+gen_sources = $(BUILT_SOURCES)
+gen_sources_deps = $(core_generator)
+par_gen_command = PYTHONPATH=$(top_srcdir)/gnuradio-core/src/python srcdir=$(srcdir) $(PYTHON) $(srcdir)/generate_all.py
+include $(top_srcdir)/Makefile.par.gen
index cc8da49de4ecf0cd9a9b14712d7898a0cd5407de..af5e4980d68ec91813d9bc6ddde7f251b06fe81a 100644 (file)
@@ -154,5 +154,3 @@ swiginclude_HEADERS =                       \
        gr_sync_interpolator.i          \
        gr_top_block.i                  \
        runtime.i
-
-MOSTLYCLEANFILES = *~ *.loT
index 98c0321994362a3878f5bab9fff0c0dda0fe1ebd..734388d42a30e8906061e64254ad7e163e84c85e 100644 (file)
 
 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 =                         \
+# SWIG headers get installed in ${prefix}/include/gnuradio/swig
+swiginclude_HEADERS =                  \
        gnuradio.i                      \
        gr_swig_block_magic.i           \
-       gr_shared_ptr.i                 \
-       sw_general.i                    \
-       sw_gengen.i                     \
-       sw_filter.i                     \
-       sw_io.i                         \
-       sw_runtime.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: sw_runtime.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)/sw_runtime.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)/sw_runtime.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 
+       gr_shared_ptr.i
 
+# special install for this top-level Python script which includes all
+# of the split Python libraries.
+ourpythondir = $(grpythondir)/gr
+ourpython_PYTHON = gnuradio_swig_python.py
 
 # ----------------------------------------------------------------
 # FIXME As of swig 1.3.31, this still seems to be required...
@@ -263,26 +43,55 @@ gnuradio_swig_py_io.cc : $(srcdir)/sw_io.i
 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 $@
 
+# C/C++ headers get installed in ${prefix}/include/gnuradio
+grinclude_HEADERS =                    \
+       gnuradio_swig_bug_workaround.h
+
+# ----------------------------------------------------------------
+# 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!
 # ----------------------------------------------------------------
 
-# 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
+TOP_SWIG_IFILES =                      \
+       gnuradio_swig_py_runtime.i      \
+       gnuradio_swig_py_general.i      \
+       gnuradio_swig_py_gengen.i       \
+       gnuradio_swig_py_filter.i       \
+       gnuradio_swig_py_io.i
+
+# Install so that they end up available as:
+#   import gnuradio.gr
+# This ends up at:
+#   ${prefix}/lib/python${python_version}/site-packages/gnuradio/gr
+gnuradio_swig_py_runtime_pythondir_category = gnuradio/gr
+gnuradio_swig_py_general_pythondir_category = gnuradio/gr
+gnuradio_swig_py_gengen_pythondir_category  = gnuradio/gr
+gnuradio_swig_py_filter_pythondir_category  = gnuradio/gr
+gnuradio_swig_py_io_pythondir_category      = gnuradio/gr
 
+# additional libraries for linking with each SWIG-generated library
+gnuradio_swig_py_runtime_la_swig_libadd = $(GNURADIO_CORE_LA)
+gnuradio_swig_py_general_la_swig_libadd = $(GNURADIO_CORE_LA)
+gnuradio_swig_py_gengen_la_swig_libadd  = $(GNURADIO_CORE_LA)
+gnuradio_swig_py_filter_la_swig_libadd  = $(GNURADIO_CORE_LA)
+gnuradio_swig_py_io_la_swig_libadd      = $(GNURADIO_CORE_LA)
 
-grinclude_HEADERS =                            \
-       gnuradio_swig_bug_workaround.h
+include $(top_srcdir)/Makefile.swig
 
-swiginclude_HEADERS =                          \
-       $(LOCAL_IFILES)                 
+# add some of the variables generated inside the Makefile.swig
 
-MOSTLYCLEANFILES = \
-       $(BUILT_SOURCES) *~ *.pyc 
+# include the SWIG-generated .h files in the BUILT SOURCES, since they
+# aren't by default when using Makefile.swig; order doesn't matter.
+BUILT_SOURCES =                                \
+       gnuradio_swig_py_runtime.h      \
+       gnuradio_swig_py_general.h      \
+       gnuradio_swig_py_gengen.h       \
+       gnuradio_swig_py_filter.h       \
+       gnuradio_swig_py_io.h           \
+       $(grinclude_HEADERS)            \
+       $(swig_built_sources)
 
-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           
+# Do not distribute the output of SWIG
+no_dist_files = $(swig_built_sources)
diff --git a/gnuradio-core/src/lib/swig/Makefile.swig.gen b/gnuradio-core/src/lib/swig/Makefile.swig.gen
new file mode 100644 (file)
index 0000000..ebb98a0
--- /dev/null
@@ -0,0 +1,1295 @@
+# -*- Makefile -*-
+#
+# Copyright 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.
+# 
+
+# Makefile.swig.gen for gnuradio_swig_py_runtime.i
+
+## Default install locations for these files:
+##
+## Default location for the Python directory is:
+##  ${prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_swig_py_runtime
+## Default location for the Python exec directory is:
+##  ${exec_prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_swig_py_runtime
+##
+## The following can be overloaded to change the install location, but
+## this has to be done in the including Makefile.am -before-
+## Makefile.swig is included.
+
+gnuradio_swig_py_runtime_pythondir_category ?= gnuradio/gnuradio_swig_py_runtime
+gnuradio_swig_py_runtime_pylibdir_category ?= $(gnuradio_swig_py_runtime_pythondir_category)
+gnuradio_swig_py_runtime_pythondir = $(pythondir)/$(gnuradio_swig_py_runtime_pythondir_category)
+gnuradio_swig_py_runtime_pylibdir = $(pyexecdir)/$(gnuradio_swig_py_runtime_pylibdir_category)
+
+## SWIG headers are always installed into the same directory.
+
+gnuradio_swig_py_runtime_swigincludedir = $(swigincludedir)
+
+## This is a template file for a "generated" Makefile addition (in
+## this case, "Makefile.swig.gen").  By including the top-level
+## Makefile.swig, this file will be used to generate the SWIG
+## dependencies.  Assign the variable TOP_SWIG_FILES to be the list of
+## SWIG .i files to generated wrappings for; there can be more than 1
+## so long as the names are unique (no sorting is done on the
+## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i
+## file will generate .cc, .py, and possibly .h files -- meaning that
+## all of these files will have the same base name (that provided for
+## the SWIG .i file).
+##
+## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the
+## right thing.  For more info, see <
+## http://sources.redhat.com/automake/automake.html#Multiple-Outputs >
+
+## Stamps used to ensure parallel make does the right thing.  These
+## are removed by "make clean", but otherwise unused except during the
+## parallel built.  These will not be included in a tarball, because
+## the SWIG-generated files will be removed from the distribution.
+
+STAMPS += $(DEPDIR)/gnuradio_swig_py_runtime-generate-*
+
+## Other cleaned files: dependency files generated by SWIG or this Makefile
+
+MOSTLYCLEANFILES += $(DEPDIR)/*.S*
+
+## Add the .py and .cc files to the list of SWIG built sources.  The
+## .h file is sometimes built, but not always ... so that one has to
+## be added manually by the including Makefile.am .
+
+swig_built_sources += gnuradio_swig_py_runtime.py gnuradio_swig_py_runtime.cc
+
+## Various SWIG variables.  These can be overloaded in the including
+## Makefile.am by setting the variable value there, then including
+## Makefile.swig .
+
+gnuradio_swig_py_runtime_swiginclude_HEADERS =         \
+       gnuradio_swig_py_runtime.i                      \
+       $(gnuradio_swig_py_runtime_swiginclude_headers)
+
+gnuradio_swig_py_runtime_pylib_LTLIBRARIES =           \
+       _gnuradio_swig_py_runtime.la
+
+_gnuradio_swig_py_runtime_la_SOURCES =                         \
+       gnuradio_swig_py_runtime.cc                     \
+       $(gnuradio_swig_py_runtime_la_swig_sources)
+
+_gnuradio_swig_py_runtime_la_LIBADD =                  \
+       $(STD_SWIG_LA_LIB_ADD)          \
+       $(gnuradio_swig_py_runtime_la_swig_libadd)
+
+_gnuradio_swig_py_runtime_la_LDFLAGS =                 \
+       $(STD_SWIG_LA_LD_FLAGS)         \
+       $(gnuradio_swig_py_runtime_la_swig_ldflags)
+
+_gnuradio_swig_py_runtime_la_CXXFLAGS =                        \
+       $(STD_SWIG_CXX_FLAGS)           \
+       $(gnuradio_swig_py_runtime_la_swig_cxxflags)
+
+gnuradio_swig_py_runtime_python_PYTHON =                       \
+       gnuradio_swig_py_runtime.py                     \
+       $(gnuradio_swig_py_runtime_python)
+
+## Entry rule for running SWIG
+
+gnuradio_swig_py_runtime.h gnuradio_swig_py_runtime.py gnuradio_swig_py_runtime.cc: gnuradio_swig_py_runtime.i
+## This rule will get called only when MAKE decides that one of the
+## targets needs to be created or re-created, because:
+##
+## * The .i file is newer than any or all of the generated files;
+##
+## * Any or all of the .cc, .h, or .py files does not exist and is
+##   needed (in the case this file is not needed, the rule for it is
+##   ignored); or
+##
+## * Some SWIG-based dependecy of the .cc file isn't met and hence the
+##   .cc file needs be be regenerated.  Explanation: Because MAKE
+##   knows how to handle dependencies for .cc files (regardless of
+##   their name or extension), then the .cc file is used as a target
+##   instead of the .i file -- but with the dependencies of the .i
+##   file.  It is this last reason why the line:
+##
+##             if test -f $@; then :; else
+##
+##   cannot be used in this case: If a .i file dependecy is not met,
+##   then the .cc file needs to be rebuilt.  But if the stamp is newer
+##   than the .cc file, and the .cc file exists, then in the original
+##   version (with the 'test' above) the internal MAKE call will not
+##   be issued and hence the .cc file will not be rebuilt.
+##
+## Once execution gets to here, it should always proceed no matter the
+## state of a stamp (as discussed in link above).  The
+## $(DEPDIR)/gnuradio_swig_py_runtime-generate stuff is used to allow for parallel
+## builds to "do the right thing".  The stamp has no relationship with
+## either the target files or dependency file; it is used solely for
+## the protection of multiple builds during a given call to MAKE.
+##
+## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM
+## (15).  At a caught signal, the quoted command will be issued before
+## exiting.  In this case, remove any stamp, whether temporary of not.
+## The trap is valid until the process exits; the process includes all
+## commands appended via "\"s.
+##
+       trap 'rm -rf $(DEPDIR)/gnuradio_swig_py_runtime-generate-*' 1 2 13 15; \
+##
+## Create a temporary directory, which acts as a lock.  The first
+## process to create the directory will succeed and issue the MAKE
+## command to do the actual work, while all subsequent processes will
+## fail -- leading them to wait for the first process to finish.
+##
+       if mkdir $(DEPDIR)/gnuradio_swig_py_runtime-generate-lock 2>/dev/null; then \
+##
+## This code is being executed by the first process to succeed in
+## creating the directory lock.
+##
+## Remove the stamp associated with this filename.
+##
+               rm -f $(DEPDIR)/gnuradio_swig_py_runtime-generate-stamp; \
+##
+## Tell MAKE to run the rule for creating this stamp.
+##
+               $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_runtime-generate-stamp WHAT=$<; \
+##
+## Now that the .cc, .h, and .py files have been (re)created from the
+## .i file, future checking of this rule during the same MAKE
+## execution will come back that the rule doesn't need to be executed
+## because none of the conditions mentioned at the start of this rule
+## will be positive.  Remove the the directory lock, which frees up
+## any waiting process(es) to continue.
+##
+               rmdir $(DEPDIR)/gnuradio_swig_py_runtime-generate-lock; \
+       else \
+##
+## This code is being executed by any follower processes while the
+## directory lock is in place.
+##
+## Wait until the first process is done, testing once per second.
+##
+               while test -d $(DEPDIR)/gnuradio_swig_py_runtime-generate-lock; do \
+                       sleep 1; \
+               done; \
+##
+## Succeed if and only if the first process succeeded; exit this
+## process returning the status of the generated stamp.
+##
+               test -f $(DEPDIR)/gnuradio_swig_py_runtime-generate-stamp; \
+               exit $$?; \
+       fi;
+
+$(DEPDIR)/gnuradio_swig_py_runtime-generate-stamp:
+## This rule will be called only by the first process issuing the
+## above rule to succeed in creating the lock directory, after
+## removing the actual stamp file in order to guarantee that MAKE will
+## execute this rule.
+##
+## Call SWIG to generate the various output files; special
+## post-processing on 'mingw32' host OS for the dependency file.
+##
+       if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(gnuradio_swig_py_runtime_swig_args) \
+               -MD -MF $(DEPDIR)/gnuradio_swig_py_runtime.Std \
+               -module gnuradio_swig_py_runtime -o gnuradio_swig_py_runtime.cc $(WHAT); then \
+           if test $(host_os) = mingw32; then \
+               $(RM) $(DEPDIR)/gnuradio_swig_py_runtime.Sd; \
+               $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_runtime.Std \
+                       > $(DEPDIR)/gnuradio_swig_py_runtime.Sd; \
+               $(RM) $(DEPDIR)/gnuradio_swig_py_runtime.Std; \
+               $(MV) $(DEPDIR)/gnuradio_swig_py_runtime.Sd $(DEPDIR)/gnuradio_swig_py_runtime.Std; \
+           fi; \
+       else \
+           $(RM) $(DEPDIR)/gnuradio_swig_py_runtime.S*; exit 1; \
+       fi;
+##
+## Mess with the SWIG output .Std dependency file, to create a
+## dependecy file valid for the input .i file: Basically, simulate the
+## dependency file created for libraries by GNU's libtool for C++,
+## where all of the dependencies for the target are first listed, then
+## each individual dependency is listed as a target with no further
+## dependencies.
+##
+## (1) remove the current dependency file
+##
+       $(RM) $(DEPDIR)/gnuradio_swig_py_runtime.d
+##
+## (2) Copy the whole SWIG file:
+##
+       cp $(DEPDIR)/gnuradio_swig_py_runtime.Std $(DEPDIR)/gnuradio_swig_py_runtime.d
+##
+## (3) all a carriage return to the end of the dependency file.
+##
+       echo "" >> $(DEPDIR)/gnuradio_swig_py_runtime.d
+##
+## (4) from the SWIG file, remove the first line (the target); remove
+##     trailing " \" and " " from each line.  Append ":" to each line,
+##     followed by 2 carriage returns, then append this to the end of
+##     the dependency file.
+##
+       $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_runtime.Std | \
+               awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_runtime.d
+##
+## (5) remove the SWIG-generated file
+##
+       $(RM) $(DEPDIR)/gnuradio_swig_py_runtime.Std
+##
+## Create the stamp for this filename generation, to signal success in
+## executing this rule; allows other threads waiting on this process
+## to continue.
+##
+       touch $(DEPDIR)/gnuradio_swig_py_runtime-generate-stamp
+
+# KLUDGE: Force runtime include of a SWIG 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@./$(DEPDIR)/gnuradio_swig_py_runtime.d@am__quote@
+
+# -*- Makefile -*-
+#
+# Copyright 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.
+# 
+
+# Makefile.swig.gen for gnuradio_swig_py_general.i
+
+## Default install locations for these files:
+##
+## Default location for the Python directory is:
+##  ${prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_swig_py_general
+## Default location for the Python exec directory is:
+##  ${exec_prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_swig_py_general
+##
+## The following can be overloaded to change the install location, but
+## this has to be done in the including Makefile.am -before-
+## Makefile.swig is included.
+
+gnuradio_swig_py_general_pythondir_category ?= gnuradio/gnuradio_swig_py_general
+gnuradio_swig_py_general_pylibdir_category ?= $(gnuradio_swig_py_general_pythondir_category)
+gnuradio_swig_py_general_pythondir = $(pythondir)/$(gnuradio_swig_py_general_pythondir_category)
+gnuradio_swig_py_general_pylibdir = $(pyexecdir)/$(gnuradio_swig_py_general_pylibdir_category)
+
+## SWIG headers are always installed into the same directory.
+
+gnuradio_swig_py_general_swigincludedir = $(swigincludedir)
+
+## This is a template file for a "generated" Makefile addition (in
+## this case, "Makefile.swig.gen").  By including the top-level
+## Makefile.swig, this file will be used to generate the SWIG
+## dependencies.  Assign the variable TOP_SWIG_FILES to be the list of
+## SWIG .i files to generated wrappings for; there can be more than 1
+## so long as the names are unique (no sorting is done on the
+## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i
+## file will generate .cc, .py, and possibly .h files -- meaning that
+## all of these files will have the same base name (that provided for
+## the SWIG .i file).
+##
+## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the
+## right thing.  For more info, see <
+## http://sources.redhat.com/automake/automake.html#Multiple-Outputs >
+
+## Stamps used to ensure parallel make does the right thing.  These
+## are removed by "make clean", but otherwise unused except during the
+## parallel built.  These will not be included in a tarball, because
+## the SWIG-generated files will be removed from the distribution.
+
+STAMPS += $(DEPDIR)/gnuradio_swig_py_general-generate-*
+
+## Other cleaned files: dependency files generated by SWIG or this Makefile
+
+MOSTLYCLEANFILES += $(DEPDIR)/*.S*
+
+## Add the .py and .cc files to the list of SWIG built sources.  The
+## .h file is sometimes built, but not always ... so that one has to
+## be added manually by the including Makefile.am .
+
+swig_built_sources += gnuradio_swig_py_general.py gnuradio_swig_py_general.cc
+
+## Various SWIG variables.  These can be overloaded in the including
+## Makefile.am by setting the variable value there, then including
+## Makefile.swig .
+
+gnuradio_swig_py_general_swiginclude_HEADERS =         \
+       gnuradio_swig_py_general.i                      \
+       $(gnuradio_swig_py_general_swiginclude_headers)
+
+gnuradio_swig_py_general_pylib_LTLIBRARIES =           \
+       _gnuradio_swig_py_general.la
+
+_gnuradio_swig_py_general_la_SOURCES =                         \
+       gnuradio_swig_py_general.cc                     \
+       $(gnuradio_swig_py_general_la_swig_sources)
+
+_gnuradio_swig_py_general_la_LIBADD =                  \
+       $(STD_SWIG_LA_LIB_ADD)          \
+       $(gnuradio_swig_py_general_la_swig_libadd)
+
+_gnuradio_swig_py_general_la_LDFLAGS =                 \
+       $(STD_SWIG_LA_LD_FLAGS)         \
+       $(gnuradio_swig_py_general_la_swig_ldflags)
+
+_gnuradio_swig_py_general_la_CXXFLAGS =                        \
+       $(STD_SWIG_CXX_FLAGS)           \
+       $(gnuradio_swig_py_general_la_swig_cxxflags)
+
+gnuradio_swig_py_general_python_PYTHON =                       \
+       gnuradio_swig_py_general.py                     \
+       $(gnuradio_swig_py_general_python)
+
+## Entry rule for running SWIG
+
+gnuradio_swig_py_general.h gnuradio_swig_py_general.py gnuradio_swig_py_general.cc: gnuradio_swig_py_general.i
+## This rule will get called only when MAKE decides that one of the
+## targets needs to be created or re-created, because:
+##
+## * The .i file is newer than any or all of the generated files;
+##
+## * Any or all of the .cc, .h, or .py files does not exist and is
+##   needed (in the case this file is not needed, the rule for it is
+##   ignored); or
+##
+## * Some SWIG-based dependecy of the .cc file isn't met and hence the
+##   .cc file needs be be regenerated.  Explanation: Because MAKE
+##   knows how to handle dependencies for .cc files (regardless of
+##   their name or extension), then the .cc file is used as a target
+##   instead of the .i file -- but with the dependencies of the .i
+##   file.  It is this last reason why the line:
+##
+##             if test -f $@; then :; else
+##
+##   cannot be used in this case: If a .i file dependecy is not met,
+##   then the .cc file needs to be rebuilt.  But if the stamp is newer
+##   than the .cc file, and the .cc file exists, then in the original
+##   version (with the 'test' above) the internal MAKE call will not
+##   be issued and hence the .cc file will not be rebuilt.
+##
+## Once execution gets to here, it should always proceed no matter the
+## state of a stamp (as discussed in link above).  The
+## $(DEPDIR)/gnuradio_swig_py_general-generate stuff is used to allow for parallel
+## builds to "do the right thing".  The stamp has no relationship with
+## either the target files or dependency file; it is used solely for
+## the protection of multiple builds during a given call to MAKE.
+##
+## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM
+## (15).  At a caught signal, the quoted command will be issued before
+## exiting.  In this case, remove any stamp, whether temporary of not.
+## The trap is valid until the process exits; the process includes all
+## commands appended via "\"s.
+##
+       trap 'rm -rf $(DEPDIR)/gnuradio_swig_py_general-generate-*' 1 2 13 15; \
+##
+## Create a temporary directory, which acts as a lock.  The first
+## process to create the directory will succeed and issue the MAKE
+## command to do the actual work, while all subsequent processes will
+## fail -- leading them to wait for the first process to finish.
+##
+       if mkdir $(DEPDIR)/gnuradio_swig_py_general-generate-lock 2>/dev/null; then \
+##
+## This code is being executed by the first process to succeed in
+## creating the directory lock.
+##
+## Remove the stamp associated with this filename.
+##
+               rm -f $(DEPDIR)/gnuradio_swig_py_general-generate-stamp; \
+##
+## Tell MAKE to run the rule for creating this stamp.
+##
+               $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_general-generate-stamp WHAT=$<; \
+##
+## Now that the .cc, .h, and .py files have been (re)created from the
+## .i file, future checking of this rule during the same MAKE
+## execution will come back that the rule doesn't need to be executed
+## because none of the conditions mentioned at the start of this rule
+## will be positive.  Remove the the directory lock, which frees up
+## any waiting process(es) to continue.
+##
+               rmdir $(DEPDIR)/gnuradio_swig_py_general-generate-lock; \
+       else \
+##
+## This code is being executed by any follower processes while the
+## directory lock is in place.
+##
+## Wait until the first process is done, testing once per second.
+##
+               while test -d $(DEPDIR)/gnuradio_swig_py_general-generate-lock; do \
+                       sleep 1; \
+               done; \
+##
+## Succeed if and only if the first process succeeded; exit this
+## process returning the status of the generated stamp.
+##
+               test -f $(DEPDIR)/gnuradio_swig_py_general-generate-stamp; \
+               exit $$?; \
+       fi;
+
+$(DEPDIR)/gnuradio_swig_py_general-generate-stamp:
+## This rule will be called only by the first process issuing the
+## above rule to succeed in creating the lock directory, after
+## removing the actual stamp file in order to guarantee that MAKE will
+## execute this rule.
+##
+## Call SWIG to generate the various output files; special
+## post-processing on 'mingw32' host OS for the dependency file.
+##
+       if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(gnuradio_swig_py_general_swig_args) \
+               -MD -MF $(DEPDIR)/gnuradio_swig_py_general.Std \
+               -module gnuradio_swig_py_general -o gnuradio_swig_py_general.cc $(WHAT); then \
+           if test $(host_os) = mingw32; then \
+               $(RM) $(DEPDIR)/gnuradio_swig_py_general.Sd; \
+               $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_general.Std \
+                       > $(DEPDIR)/gnuradio_swig_py_general.Sd; \
+               $(RM) $(DEPDIR)/gnuradio_swig_py_general.Std; \
+               $(MV) $(DEPDIR)/gnuradio_swig_py_general.Sd $(DEPDIR)/gnuradio_swig_py_general.Std; \
+           fi; \
+       else \
+           $(RM) $(DEPDIR)/gnuradio_swig_py_general.S*; exit 1; \
+       fi;
+##
+## Mess with the SWIG output .Std dependency file, to create a
+## dependecy file valid for the input .i file: Basically, simulate the
+## dependency file created for libraries by GNU's libtool for C++,
+## where all of the dependencies for the target are first listed, then
+## each individual dependency is listed as a target with no further
+## dependencies.
+##
+## (1) remove the current dependency file
+##
+       $(RM) $(DEPDIR)/gnuradio_swig_py_general.d
+##
+## (2) Copy the whole SWIG file:
+##
+       cp $(DEPDIR)/gnuradio_swig_py_general.Std $(DEPDIR)/gnuradio_swig_py_general.d
+##
+## (3) all a carriage return to the end of the dependency file.
+##
+       echo "" >> $(DEPDIR)/gnuradio_swig_py_general.d
+##
+## (4) from the SWIG file, remove the first line (the target); remove
+##     trailing " \" and " " from each line.  Append ":" to each line,
+##     followed by 2 carriage returns, then append this to the end of
+##     the dependency file.
+##
+       $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_general.Std | \
+               awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_general.d
+##
+## (5) remove the SWIG-generated file
+##
+       $(RM) $(DEPDIR)/gnuradio_swig_py_general.Std
+##
+## Create the stamp for this filename generation, to signal success in
+## executing this rule; allows other threads waiting on this process
+## to continue.
+##
+       touch $(DEPDIR)/gnuradio_swig_py_general-generate-stamp
+
+# KLUDGE: Force runtime include of a SWIG 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@./$(DEPDIR)/gnuradio_swig_py_general.d@am__quote@
+
+# -*- Makefile -*-
+#
+# Copyright 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.
+# 
+
+# Makefile.swig.gen for gnuradio_swig_py_gengen.i
+
+## Default install locations for these files:
+##
+## Default location for the Python directory is:
+##  ${prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_swig_py_gengen
+## Default location for the Python exec directory is:
+##  ${exec_prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_swig_py_gengen
+##
+## The following can be overloaded to change the install location, but
+## this has to be done in the including Makefile.am -before-
+## Makefile.swig is included.
+
+gnuradio_swig_py_gengen_pythondir_category ?= gnuradio/gnuradio_swig_py_gengen
+gnuradio_swig_py_gengen_pylibdir_category ?= $(gnuradio_swig_py_gengen_pythondir_category)
+gnuradio_swig_py_gengen_pythondir = $(pythondir)/$(gnuradio_swig_py_gengen_pythondir_category)
+gnuradio_swig_py_gengen_pylibdir = $(pyexecdir)/$(gnuradio_swig_py_gengen_pylibdir_category)
+
+## SWIG headers are always installed into the same directory.
+
+gnuradio_swig_py_gengen_swigincludedir = $(swigincludedir)
+
+## This is a template file for a "generated" Makefile addition (in
+## this case, "Makefile.swig.gen").  By including the top-level
+## Makefile.swig, this file will be used to generate the SWIG
+## dependencies.  Assign the variable TOP_SWIG_FILES to be the list of
+## SWIG .i files to generated wrappings for; there can be more than 1
+## so long as the names are unique (no sorting is done on the
+## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i
+## file will generate .cc, .py, and possibly .h files -- meaning that
+## all of these files will have the same base name (that provided for
+## the SWIG .i file).
+##
+## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the
+## right thing.  For more info, see <
+## http://sources.redhat.com/automake/automake.html#Multiple-Outputs >
+
+## Stamps used to ensure parallel make does the right thing.  These
+## are removed by "make clean", but otherwise unused except during the
+## parallel built.  These will not be included in a tarball, because
+## the SWIG-generated files will be removed from the distribution.
+
+STAMPS += $(DEPDIR)/gnuradio_swig_py_gengen-generate-*
+
+## Other cleaned files: dependency files generated by SWIG or this Makefile
+
+MOSTLYCLEANFILES += $(DEPDIR)/*.S*
+
+## Add the .py and .cc files to the list of SWIG built sources.  The
+## .h file is sometimes built, but not always ... so that one has to
+## be added manually by the including Makefile.am .
+
+swig_built_sources += gnuradio_swig_py_gengen.py gnuradio_swig_py_gengen.cc
+
+## Various SWIG variables.  These can be overloaded in the including
+## Makefile.am by setting the variable value there, then including
+## Makefile.swig .
+
+gnuradio_swig_py_gengen_swiginclude_HEADERS =          \
+       gnuradio_swig_py_gengen.i                       \
+       $(gnuradio_swig_py_gengen_swiginclude_headers)
+
+gnuradio_swig_py_gengen_pylib_LTLIBRARIES =            \
+       _gnuradio_swig_py_gengen.la
+
+_gnuradio_swig_py_gengen_la_SOURCES =                  \
+       gnuradio_swig_py_gengen.cc                      \
+       $(gnuradio_swig_py_gengen_la_swig_sources)
+
+_gnuradio_swig_py_gengen_la_LIBADD =                   \
+       $(STD_SWIG_LA_LIB_ADD)          \
+       $(gnuradio_swig_py_gengen_la_swig_libadd)
+
+_gnuradio_swig_py_gengen_la_LDFLAGS =                  \
+       $(STD_SWIG_LA_LD_FLAGS)         \
+       $(gnuradio_swig_py_gengen_la_swig_ldflags)
+
+_gnuradio_swig_py_gengen_la_CXXFLAGS =                 \
+       $(STD_SWIG_CXX_FLAGS)           \
+       $(gnuradio_swig_py_gengen_la_swig_cxxflags)
+
+gnuradio_swig_py_gengen_python_PYTHON =                        \
+       gnuradio_swig_py_gengen.py                      \
+       $(gnuradio_swig_py_gengen_python)
+
+## Entry rule for running SWIG
+
+gnuradio_swig_py_gengen.h gnuradio_swig_py_gengen.py gnuradio_swig_py_gengen.cc: gnuradio_swig_py_gengen.i
+## This rule will get called only when MAKE decides that one of the
+## targets needs to be created or re-created, because:
+##
+## * The .i file is newer than any or all of the generated files;
+##
+## * Any or all of the .cc, .h, or .py files does not exist and is
+##   needed (in the case this file is not needed, the rule for it is
+##   ignored); or
+##
+## * Some SWIG-based dependecy of the .cc file isn't met and hence the
+##   .cc file needs be be regenerated.  Explanation: Because MAKE
+##   knows how to handle dependencies for .cc files (regardless of
+##   their name or extension), then the .cc file is used as a target
+##   instead of the .i file -- but with the dependencies of the .i
+##   file.  It is this last reason why the line:
+##
+##             if test -f $@; then :; else
+##
+##   cannot be used in this case: If a .i file dependecy is not met,
+##   then the .cc file needs to be rebuilt.  But if the stamp is newer
+##   than the .cc file, and the .cc file exists, then in the original
+##   version (with the 'test' above) the internal MAKE call will not
+##   be issued and hence the .cc file will not be rebuilt.
+##
+## Once execution gets to here, it should always proceed no matter the
+## state of a stamp (as discussed in link above).  The
+## $(DEPDIR)/gnuradio_swig_py_gengen-generate stuff is used to allow for parallel
+## builds to "do the right thing".  The stamp has no relationship with
+## either the target files or dependency file; it is used solely for
+## the protection of multiple builds during a given call to MAKE.
+##
+## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM
+## (15).  At a caught signal, the quoted command will be issued before
+## exiting.  In this case, remove any stamp, whether temporary of not.
+## The trap is valid until the process exits; the process includes all
+## commands appended via "\"s.
+##
+       trap 'rm -rf $(DEPDIR)/gnuradio_swig_py_gengen-generate-*' 1 2 13 15; \
+##
+## Create a temporary directory, which acts as a lock.  The first
+## process to create the directory will succeed and issue the MAKE
+## command to do the actual work, while all subsequent processes will
+## fail -- leading them to wait for the first process to finish.
+##
+       if mkdir $(DEPDIR)/gnuradio_swig_py_gengen-generate-lock 2>/dev/null; then \
+##
+## This code is being executed by the first process to succeed in
+## creating the directory lock.
+##
+## Remove the stamp associated with this filename.
+##
+               rm -f $(DEPDIR)/gnuradio_swig_py_gengen-generate-stamp; \
+##
+## Tell MAKE to run the rule for creating this stamp.
+##
+               $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_gengen-generate-stamp WHAT=$<; \
+##
+## Now that the .cc, .h, and .py files have been (re)created from the
+## .i file, future checking of this rule during the same MAKE
+## execution will come back that the rule doesn't need to be executed
+## because none of the conditions mentioned at the start of this rule
+## will be positive.  Remove the the directory lock, which frees up
+## any waiting process(es) to continue.
+##
+               rmdir $(DEPDIR)/gnuradio_swig_py_gengen-generate-lock; \
+       else \
+##
+## This code is being executed by any follower processes while the
+## directory lock is in place.
+##
+## Wait until the first process is done, testing once per second.
+##
+               while test -d $(DEPDIR)/gnuradio_swig_py_gengen-generate-lock; do \
+                       sleep 1; \
+               done; \
+##
+## Succeed if and only if the first process succeeded; exit this
+## process returning the status of the generated stamp.
+##
+               test -f $(DEPDIR)/gnuradio_swig_py_gengen-generate-stamp; \
+               exit $$?; \
+       fi;
+
+$(DEPDIR)/gnuradio_swig_py_gengen-generate-stamp:
+## This rule will be called only by the first process issuing the
+## above rule to succeed in creating the lock directory, after
+## removing the actual stamp file in order to guarantee that MAKE will
+## execute this rule.
+##
+## Call SWIG to generate the various output files; special
+## post-processing on 'mingw32' host OS for the dependency file.
+##
+       if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(gnuradio_swig_py_gengen_swig_args) \
+               -MD -MF $(DEPDIR)/gnuradio_swig_py_gengen.Std \
+               -module gnuradio_swig_py_gengen -o gnuradio_swig_py_gengen.cc $(WHAT); then \
+           if test $(host_os) = mingw32; then \
+               $(RM) $(DEPDIR)/gnuradio_swig_py_gengen.Sd; \
+               $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_gengen.Std \
+                       > $(DEPDIR)/gnuradio_swig_py_gengen.Sd; \
+               $(RM) $(DEPDIR)/gnuradio_swig_py_gengen.Std; \
+               $(MV) $(DEPDIR)/gnuradio_swig_py_gengen.Sd $(DEPDIR)/gnuradio_swig_py_gengen.Std; \
+           fi; \
+       else \
+           $(RM) $(DEPDIR)/gnuradio_swig_py_gengen.S*; exit 1; \
+       fi;
+##
+## Mess with the SWIG output .Std dependency file, to create a
+## dependecy file valid for the input .i file: Basically, simulate the
+## dependency file created for libraries by GNU's libtool for C++,
+## where all of the dependencies for the target are first listed, then
+## each individual dependency is listed as a target with no further
+## dependencies.
+##
+## (1) remove the current dependency file
+##
+       $(RM) $(DEPDIR)/gnuradio_swig_py_gengen.d
+##
+## (2) Copy the whole SWIG file:
+##
+       cp $(DEPDIR)/gnuradio_swig_py_gengen.Std $(DEPDIR)/gnuradio_swig_py_gengen.d
+##
+## (3) all a carriage return to the end of the dependency file.
+##
+       echo "" >> $(DEPDIR)/gnuradio_swig_py_gengen.d
+##
+## (4) from the SWIG file, remove the first line (the target); remove
+##     trailing " \" and " " from each line.  Append ":" to each line,
+##     followed by 2 carriage returns, then append this to the end of
+##     the dependency file.
+##
+       $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_gengen.Std | \
+               awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_gengen.d
+##
+## (5) remove the SWIG-generated file
+##
+       $(RM) $(DEPDIR)/gnuradio_swig_py_gengen.Std
+##
+## Create the stamp for this filename generation, to signal success in
+## executing this rule; allows other threads waiting on this process
+## to continue.
+##
+       touch $(DEPDIR)/gnuradio_swig_py_gengen-generate-stamp
+
+# KLUDGE: Force runtime include of a SWIG 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@./$(DEPDIR)/gnuradio_swig_py_gengen.d@am__quote@
+
+# -*- Makefile -*-
+#
+# Copyright 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.
+# 
+
+# Makefile.swig.gen for gnuradio_swig_py_filter.i
+
+## Default install locations for these files:
+##
+## Default location for the Python directory is:
+##  ${prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_swig_py_filter
+## Default location for the Python exec directory is:
+##  ${exec_prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_swig_py_filter
+##
+## The following can be overloaded to change the install location, but
+## this has to be done in the including Makefile.am -before-
+## Makefile.swig is included.
+
+gnuradio_swig_py_filter_pythondir_category ?= gnuradio/gnuradio_swig_py_filter
+gnuradio_swig_py_filter_pylibdir_category ?= $(gnuradio_swig_py_filter_pythondir_category)
+gnuradio_swig_py_filter_pythondir = $(pythondir)/$(gnuradio_swig_py_filter_pythondir_category)
+gnuradio_swig_py_filter_pylibdir = $(pyexecdir)/$(gnuradio_swig_py_filter_pylibdir_category)
+
+## SWIG headers are always installed into the same directory.
+
+gnuradio_swig_py_filter_swigincludedir = $(swigincludedir)
+
+## This is a template file for a "generated" Makefile addition (in
+## this case, "Makefile.swig.gen").  By including the top-level
+## Makefile.swig, this file will be used to generate the SWIG
+## dependencies.  Assign the variable TOP_SWIG_FILES to be the list of
+## SWIG .i files to generated wrappings for; there can be more than 1
+## so long as the names are unique (no sorting is done on the
+## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i
+## file will generate .cc, .py, and possibly .h files -- meaning that
+## all of these files will have the same base name (that provided for
+## the SWIG .i file).
+##
+## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the
+## right thing.  For more info, see <
+## http://sources.redhat.com/automake/automake.html#Multiple-Outputs >
+
+## Stamps used to ensure parallel make does the right thing.  These
+## are removed by "make clean", but otherwise unused except during the
+## parallel built.  These will not be included in a tarball, because
+## the SWIG-generated files will be removed from the distribution.
+
+STAMPS += $(DEPDIR)/gnuradio_swig_py_filter-generate-*
+
+## Other cleaned files: dependency files generated by SWIG or this Makefile
+
+MOSTLYCLEANFILES += $(DEPDIR)/*.S*
+
+## Add the .py and .cc files to the list of SWIG built sources.  The
+## .h file is sometimes built, but not always ... so that one has to
+## be added manually by the including Makefile.am .
+
+swig_built_sources += gnuradio_swig_py_filter.py gnuradio_swig_py_filter.cc
+
+## Various SWIG variables.  These can be overloaded in the including
+## Makefile.am by setting the variable value there, then including
+## Makefile.swig .
+
+gnuradio_swig_py_filter_swiginclude_HEADERS =          \
+       gnuradio_swig_py_filter.i                       \
+       $(gnuradio_swig_py_filter_swiginclude_headers)
+
+gnuradio_swig_py_filter_pylib_LTLIBRARIES =            \
+       _gnuradio_swig_py_filter.la
+
+_gnuradio_swig_py_filter_la_SOURCES =                  \
+       gnuradio_swig_py_filter.cc                      \
+       $(gnuradio_swig_py_filter_la_swig_sources)
+
+_gnuradio_swig_py_filter_la_LIBADD =                   \
+       $(STD_SWIG_LA_LIB_ADD)          \
+       $(gnuradio_swig_py_filter_la_swig_libadd)
+
+_gnuradio_swig_py_filter_la_LDFLAGS =                  \
+       $(STD_SWIG_LA_LD_FLAGS)         \
+       $(gnuradio_swig_py_filter_la_swig_ldflags)
+
+_gnuradio_swig_py_filter_la_CXXFLAGS =                 \
+       $(STD_SWIG_CXX_FLAGS)           \
+       $(gnuradio_swig_py_filter_la_swig_cxxflags)
+
+gnuradio_swig_py_filter_python_PYTHON =                        \
+       gnuradio_swig_py_filter.py                      \
+       $(gnuradio_swig_py_filter_python)
+
+## Entry rule for running SWIG
+
+gnuradio_swig_py_filter.h gnuradio_swig_py_filter.py gnuradio_swig_py_filter.cc: gnuradio_swig_py_filter.i
+## This rule will get called only when MAKE decides that one of the
+## targets needs to be created or re-created, because:
+##
+## * The .i file is newer than any or all of the generated files;
+##
+## * Any or all of the .cc, .h, or .py files does not exist and is
+##   needed (in the case this file is not needed, the rule for it is
+##   ignored); or
+##
+## * Some SWIG-based dependecy of the .cc file isn't met and hence the
+##   .cc file needs be be regenerated.  Explanation: Because MAKE
+##   knows how to handle dependencies for .cc files (regardless of
+##   their name or extension), then the .cc file is used as a target
+##   instead of the .i file -- but with the dependencies of the .i
+##   file.  It is this last reason why the line:
+##
+##             if test -f $@; then :; else
+##
+##   cannot be used in this case: If a .i file dependecy is not met,
+##   then the .cc file needs to be rebuilt.  But if the stamp is newer
+##   than the .cc file, and the .cc file exists, then in the original
+##   version (with the 'test' above) the internal MAKE call will not
+##   be issued and hence the .cc file will not be rebuilt.
+##
+## Once execution gets to here, it should always proceed no matter the
+## state of a stamp (as discussed in link above).  The
+## $(DEPDIR)/gnuradio_swig_py_filter-generate stuff is used to allow for parallel
+## builds to "do the right thing".  The stamp has no relationship with
+## either the target files or dependency file; it is used solely for
+## the protection of multiple builds during a given call to MAKE.
+##
+## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM
+## (15).  At a caught signal, the quoted command will be issued before
+## exiting.  In this case, remove any stamp, whether temporary of not.
+## The trap is valid until the process exits; the process includes all
+## commands appended via "\"s.
+##
+       trap 'rm -rf $(DEPDIR)/gnuradio_swig_py_filter-generate-*' 1 2 13 15; \
+##
+## Create a temporary directory, which acts as a lock.  The first
+## process to create the directory will succeed and issue the MAKE
+## command to do the actual work, while all subsequent processes will
+## fail -- leading them to wait for the first process to finish.
+##
+       if mkdir $(DEPDIR)/gnuradio_swig_py_filter-generate-lock 2>/dev/null; then \
+##
+## This code is being executed by the first process to succeed in
+## creating the directory lock.
+##
+## Remove the stamp associated with this filename.
+##
+               rm -f $(DEPDIR)/gnuradio_swig_py_filter-generate-stamp; \
+##
+## Tell MAKE to run the rule for creating this stamp.
+##
+               $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_filter-generate-stamp WHAT=$<; \
+##
+## Now that the .cc, .h, and .py files have been (re)created from the
+## .i file, future checking of this rule during the same MAKE
+## execution will come back that the rule doesn't need to be executed
+## because none of the conditions mentioned at the start of this rule
+## will be positive.  Remove the the directory lock, which frees up
+## any waiting process(es) to continue.
+##
+               rmdir $(DEPDIR)/gnuradio_swig_py_filter-generate-lock; \
+       else \
+##
+## This code is being executed by any follower processes while the
+## directory lock is in place.
+##
+## Wait until the first process is done, testing once per second.
+##
+               while test -d $(DEPDIR)/gnuradio_swig_py_filter-generate-lock; do \
+                       sleep 1; \
+               done; \
+##
+## Succeed if and only if the first process succeeded; exit this
+## process returning the status of the generated stamp.
+##
+               test -f $(DEPDIR)/gnuradio_swig_py_filter-generate-stamp; \
+               exit $$?; \
+       fi;
+
+$(DEPDIR)/gnuradio_swig_py_filter-generate-stamp:
+## This rule will be called only by the first process issuing the
+## above rule to succeed in creating the lock directory, after
+## removing the actual stamp file in order to guarantee that MAKE will
+## execute this rule.
+##
+## Call SWIG to generate the various output files; special
+## post-processing on 'mingw32' host OS for the dependency file.
+##
+       if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(gnuradio_swig_py_filter_swig_args) \
+               -MD -MF $(DEPDIR)/gnuradio_swig_py_filter.Std \
+               -module gnuradio_swig_py_filter -o gnuradio_swig_py_filter.cc $(WHAT); then \
+           if test $(host_os) = mingw32; then \
+               $(RM) $(DEPDIR)/gnuradio_swig_py_filter.Sd; \
+               $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_filter.Std \
+                       > $(DEPDIR)/gnuradio_swig_py_filter.Sd; \
+               $(RM) $(DEPDIR)/gnuradio_swig_py_filter.Std; \
+               $(MV) $(DEPDIR)/gnuradio_swig_py_filter.Sd $(DEPDIR)/gnuradio_swig_py_filter.Std; \
+           fi; \
+       else \
+           $(RM) $(DEPDIR)/gnuradio_swig_py_filter.S*; exit 1; \
+       fi;
+##
+## Mess with the SWIG output .Std dependency file, to create a
+## dependecy file valid for the input .i file: Basically, simulate the
+## dependency file created for libraries by GNU's libtool for C++,
+## where all of the dependencies for the target are first listed, then
+## each individual dependency is listed as a target with no further
+## dependencies.
+##
+## (1) remove the current dependency file
+##
+       $(RM) $(DEPDIR)/gnuradio_swig_py_filter.d
+##
+## (2) Copy the whole SWIG file:
+##
+       cp $(DEPDIR)/gnuradio_swig_py_filter.Std $(DEPDIR)/gnuradio_swig_py_filter.d
+##
+## (3) all a carriage return to the end of the dependency file.
+##
+       echo "" >> $(DEPDIR)/gnuradio_swig_py_filter.d
+##
+## (4) from the SWIG file, remove the first line (the target); remove
+##     trailing " \" and " " from each line.  Append ":" to each line,
+##     followed by 2 carriage returns, then append this to the end of
+##     the dependency file.
+##
+       $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_filter.Std | \
+               awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_filter.d
+##
+## (5) remove the SWIG-generated file
+##
+       $(RM) $(DEPDIR)/gnuradio_swig_py_filter.Std
+##
+## Create the stamp for this filename generation, to signal success in
+## executing this rule; allows other threads waiting on this process
+## to continue.
+##
+       touch $(DEPDIR)/gnuradio_swig_py_filter-generate-stamp
+
+# KLUDGE: Force runtime include of a SWIG 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@./$(DEPDIR)/gnuradio_swig_py_filter.d@am__quote@
+
+# -*- Makefile -*-
+#
+# Copyright 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.
+# 
+
+# Makefile.swig.gen for gnuradio_swig_py_io.i
+
+## Default install locations for these files:
+##
+## Default location for the Python directory is:
+##  ${prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_swig_py_io
+## Default location for the Python exec directory is:
+##  ${exec_prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_swig_py_io
+##
+## The following can be overloaded to change the install location, but
+## this has to be done in the including Makefile.am -before-
+## Makefile.swig is included.
+
+gnuradio_swig_py_io_pythondir_category ?= gnuradio/gnuradio_swig_py_io
+gnuradio_swig_py_io_pylibdir_category ?= $(gnuradio_swig_py_io_pythondir_category)
+gnuradio_swig_py_io_pythondir = $(pythondir)/$(gnuradio_swig_py_io_pythondir_category)
+gnuradio_swig_py_io_pylibdir = $(pyexecdir)/$(gnuradio_swig_py_io_pylibdir_category)
+
+## SWIG headers are always installed into the same directory.
+
+gnuradio_swig_py_io_swigincludedir = $(swigincludedir)
+
+## This is a template file for a "generated" Makefile addition (in
+## this case, "Makefile.swig.gen").  By including the top-level
+## Makefile.swig, this file will be used to generate the SWIG
+## dependencies.  Assign the variable TOP_SWIG_FILES to be the list of
+## SWIG .i files to generated wrappings for; there can be more than 1
+## so long as the names are unique (no sorting is done on the
+## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i
+## file will generate .cc, .py, and possibly .h files -- meaning that
+## all of these files will have the same base name (that provided for
+## the SWIG .i file).
+##
+## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the
+## right thing.  For more info, see <
+## http://sources.redhat.com/automake/automake.html#Multiple-Outputs >
+
+## Stamps used to ensure parallel make does the right thing.  These
+## are removed by "make clean", but otherwise unused except during the
+## parallel built.  These will not be included in a tarball, because
+## the SWIG-generated files will be removed from the distribution.
+
+STAMPS += $(DEPDIR)/gnuradio_swig_py_io-generate-*
+
+## Other cleaned files: dependency files generated by SWIG or this Makefile
+
+MOSTLYCLEANFILES += $(DEPDIR)/*.S*
+
+## Add the .py and .cc files to the list of SWIG built sources.  The
+## .h file is sometimes built, but not always ... so that one has to
+## be added manually by the including Makefile.am .
+
+swig_built_sources += gnuradio_swig_py_io.py gnuradio_swig_py_io.cc
+
+## Various SWIG variables.  These can be overloaded in the including
+## Makefile.am by setting the variable value there, then including
+## Makefile.swig .
+
+gnuradio_swig_py_io_swiginclude_HEADERS =              \
+       gnuradio_swig_py_io.i                   \
+       $(gnuradio_swig_py_io_swiginclude_headers)
+
+gnuradio_swig_py_io_pylib_LTLIBRARIES =                \
+       _gnuradio_swig_py_io.la
+
+_gnuradio_swig_py_io_la_SOURCES =                      \
+       gnuradio_swig_py_io.cc                  \
+       $(gnuradio_swig_py_io_la_swig_sources)
+
+_gnuradio_swig_py_io_la_LIBADD =                       \
+       $(STD_SWIG_LA_LIB_ADD)          \
+       $(gnuradio_swig_py_io_la_swig_libadd)
+
+_gnuradio_swig_py_io_la_LDFLAGS =                      \
+       $(STD_SWIG_LA_LD_FLAGS)         \
+       $(gnuradio_swig_py_io_la_swig_ldflags)
+
+_gnuradio_swig_py_io_la_CXXFLAGS =                     \
+       $(STD_SWIG_CXX_FLAGS)           \
+       $(gnuradio_swig_py_io_la_swig_cxxflags)
+
+gnuradio_swig_py_io_python_PYTHON =                    \
+       gnuradio_swig_py_io.py                  \
+       $(gnuradio_swig_py_io_python)
+
+## Entry rule for running SWIG
+
+gnuradio_swig_py_io.h gnuradio_swig_py_io.py gnuradio_swig_py_io.cc: gnuradio_swig_py_io.i
+## This rule will get called only when MAKE decides that one of the
+## targets needs to be created or re-created, because:
+##
+## * The .i file is newer than any or all of the generated files;
+##
+## * Any or all of the .cc, .h, or .py files does not exist and is
+##   needed (in the case this file is not needed, the rule for it is
+##   ignored); or
+##
+## * Some SWIG-based dependecy of the .cc file isn't met and hence the
+##   .cc file needs be be regenerated.  Explanation: Because MAKE
+##   knows how to handle dependencies for .cc files (regardless of
+##   their name or extension), then the .cc file is used as a target
+##   instead of the .i file -- but with the dependencies of the .i
+##   file.  It is this last reason why the line:
+##
+##             if test -f $@; then :; else
+##
+##   cannot be used in this case: If a .i file dependecy is not met,
+##   then the .cc file needs to be rebuilt.  But if the stamp is newer
+##   than the .cc file, and the .cc file exists, then in the original
+##   version (with the 'test' above) the internal MAKE call will not
+##   be issued and hence the .cc file will not be rebuilt.
+##
+## Once execution gets to here, it should always proceed no matter the
+## state of a stamp (as discussed in link above).  The
+## $(DEPDIR)/gnuradio_swig_py_io-generate stuff is used to allow for parallel
+## builds to "do the right thing".  The stamp has no relationship with
+## either the target files or dependency file; it is used solely for
+## the protection of multiple builds during a given call to MAKE.
+##
+## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM
+## (15).  At a caught signal, the quoted command will be issued before
+## exiting.  In this case, remove any stamp, whether temporary of not.
+## The trap is valid until the process exits; the process includes all
+## commands appended via "\"s.
+##
+       trap 'rm -rf $(DEPDIR)/gnuradio_swig_py_io-generate-*' 1 2 13 15; \
+##
+## Create a temporary directory, which acts as a lock.  The first
+## process to create the directory will succeed and issue the MAKE
+## command to do the actual work, while all subsequent processes will
+## fail -- leading them to wait for the first process to finish.
+##
+       if mkdir $(DEPDIR)/gnuradio_swig_py_io-generate-lock 2>/dev/null; then \
+##
+## This code is being executed by the first process to succeed in
+## creating the directory lock.
+##
+## Remove the stamp associated with this filename.
+##
+               rm -f $(DEPDIR)/gnuradio_swig_py_io-generate-stamp; \
+##
+## Tell MAKE to run the rule for creating this stamp.
+##
+               $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_io-generate-stamp WHAT=$<; \
+##
+## Now that the .cc, .h, and .py files have been (re)created from the
+## .i file, future checking of this rule during the same MAKE
+## execution will come back that the rule doesn't need to be executed
+## because none of the conditions mentioned at the start of this rule
+## will be positive.  Remove the the directory lock, which frees up
+## any waiting process(es) to continue.
+##
+               rmdir $(DEPDIR)/gnuradio_swig_py_io-generate-lock; \
+       else \
+##
+## This code is being executed by any follower processes while the
+## directory lock is in place.
+##
+## Wait until the first process is done, testing once per second.
+##
+               while test -d $(DEPDIR)/gnuradio_swig_py_io-generate-lock; do \
+                       sleep 1; \
+               done; \
+##
+## Succeed if and only if the first process succeeded; exit this
+## process returning the status of the generated stamp.
+##
+               test -f $(DEPDIR)/gnuradio_swig_py_io-generate-stamp; \
+               exit $$?; \
+       fi;
+
+$(DEPDIR)/gnuradio_swig_py_io-generate-stamp:
+## This rule will be called only by the first process issuing the
+## above rule to succeed in creating the lock directory, after
+## removing the actual stamp file in order to guarantee that MAKE will
+## execute this rule.
+##
+## Call SWIG to generate the various output files; special
+## post-processing on 'mingw32' host OS for the dependency file.
+##
+       if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(gnuradio_swig_py_io_swig_args) \
+               -MD -MF $(DEPDIR)/gnuradio_swig_py_io.Std \
+               -module gnuradio_swig_py_io -o gnuradio_swig_py_io.cc $(WHAT); then \
+           if test $(host_os) = mingw32; then \
+               $(RM) $(DEPDIR)/gnuradio_swig_py_io.Sd; \
+               $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_io.Std \
+                       > $(DEPDIR)/gnuradio_swig_py_io.Sd; \
+               $(RM) $(DEPDIR)/gnuradio_swig_py_io.Std; \
+               $(MV) $(DEPDIR)/gnuradio_swig_py_io.Sd $(DEPDIR)/gnuradio_swig_py_io.Std; \
+           fi; \
+       else \
+           $(RM) $(DEPDIR)/gnuradio_swig_py_io.S*; exit 1; \
+       fi;
+##
+## Mess with the SWIG output .Std dependency file, to create a
+## dependecy file valid for the input .i file: Basically, simulate the
+## dependency file created for libraries by GNU's libtool for C++,
+## where all of the dependencies for the target are first listed, then
+## each individual dependency is listed as a target with no further
+## dependencies.
+##
+## (1) remove the current dependency file
+##
+       $(RM) $(DEPDIR)/gnuradio_swig_py_io.d
+##
+## (2) Copy the whole SWIG file:
+##
+       cp $(DEPDIR)/gnuradio_swig_py_io.Std $(DEPDIR)/gnuradio_swig_py_io.d
+##
+## (3) all a carriage return to the end of the dependency file.
+##
+       echo "" >> $(DEPDIR)/gnuradio_swig_py_io.d
+##
+## (4) from the SWIG file, remove the first line (the target); remove
+##     trailing " \" and " " from each line.  Append ":" to each line,
+##     followed by 2 carriage returns, then append this to the end of
+##     the dependency file.
+##
+       $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_io.Std | \
+               awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_io.d
+##
+## (5) remove the SWIG-generated file
+##
+       $(RM) $(DEPDIR)/gnuradio_swig_py_io.Std
+##
+## Create the stamp for this filename generation, to signal success in
+## executing this rule; allows other threads waiting on this process
+## to continue.
+##
+       touch $(DEPDIR)/gnuradio_swig_py_io-generate-stamp
+
+# KLUDGE: Force runtime include of a SWIG 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@./$(DEPDIR)/gnuradio_swig_py_io.d@am__quote@
+
diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_py_filter.i b/gnuradio-core/src/lib/swig/gnuradio_swig_py_filter.i
new file mode 100644 (file)
index 0000000..6396a97
--- /dev/null
@@ -0,0 +1,30 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2006,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 this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef SWIGIMPORTED
+%module(directors="1") gnuradio_swig_py_filter
+#endif
+
+ //%feature("autodoc", "1");           // generate python docstrings
+
+%include "gnuradio.i"                          // the common stuff
+
+%include "filter.i"
diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_py_general.i b/gnuradio-core/src/lib/swig/gnuradio_swig_py_general.i
new file mode 100644 (file)
index 0000000..3ab1b05
--- /dev/null
@@ -0,0 +1,30 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2006,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 this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef SWIGIMPORTED
+%module(directors="1") gnuradio_swig_py_general
+#endif
+
+ //%feature("autodoc", "1");           // generate python docstrings
+
+%include "gnuradio.i"                          // the common stuff
+
+%include "general.i"
diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_py_gengen.i b/gnuradio-core/src/lib/swig/gnuradio_swig_py_gengen.i
new file mode 100644 (file)
index 0000000..95e85cf
--- /dev/null
@@ -0,0 +1,30 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2006,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 this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef SWIGIMPORTED
+%module(directors="1") gnuradio_swig_py_gengen
+#endif
+
+ //%feature("autodoc", "1");           // generate python docstrings
+
+%include "gnuradio.i"                          // the common stuff
+
+%include "gengen.i"
diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_py_io.i b/gnuradio-core/src/lib/swig/gnuradio_swig_py_io.i
new file mode 100644 (file)
index 0000000..9318f5d
--- /dev/null
@@ -0,0 +1,30 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2006,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 this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef SWIGIMPORTED
+%module(directors="1") gnuradio_swig_py_io
+#endif
+
+ //%feature("autodoc", "1");           // generate python docstrings
+
+%include "gnuradio.i"                          // the common stuff
+
+%include "io.i"
diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_py_runtime.i b/gnuradio-core/src/lib/swig/gnuradio_swig_py_runtime.i
new file mode 100644 (file)
index 0000000..8f444f9
--- /dev/null
@@ -0,0 +1,32 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 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.
+ */
+
+#ifndef SWIGIMPORTED
+%module(directors="1") gnuradio_swig_py_runtime
+#endif
+
+ //%feature("autodoc", "1");           // generate python docstrings
+
+#define SW_RUNTIME
+%include "gnuradio.i"                          // the common stuff
+
+%include "runtime.i"
diff --git a/gnuradio-core/src/lib/swig/sw_filter.i b/gnuradio-core/src/lib/swig/sw_filter.i
deleted file mode 100644 (file)
index 6396a97..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2006,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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef SWIGIMPORTED
-%module(directors="1") gnuradio_swig_py_filter
-#endif
-
- //%feature("autodoc", "1");           // generate python docstrings
-
-%include "gnuradio.i"                          // the common stuff
-
-%include "filter.i"
diff --git a/gnuradio-core/src/lib/swig/sw_general.i b/gnuradio-core/src/lib/swig/sw_general.i
deleted file mode 100644 (file)
index 3ab1b05..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2006,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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef SWIGIMPORTED
-%module(directors="1") gnuradio_swig_py_general
-#endif
-
- //%feature("autodoc", "1");           // generate python docstrings
-
-%include "gnuradio.i"                          // the common stuff
-
-%include "general.i"
diff --git a/gnuradio-core/src/lib/swig/sw_gengen.i b/gnuradio-core/src/lib/swig/sw_gengen.i
deleted file mode 100644 (file)
index 95e85cf..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2006,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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef SWIGIMPORTED
-%module(directors="1") gnuradio_swig_py_gengen
-#endif
-
- //%feature("autodoc", "1");           // generate python docstrings
-
-%include "gnuradio.i"                          // the common stuff
-
-%include "gengen.i"
diff --git a/gnuradio-core/src/lib/swig/sw_io.i b/gnuradio-core/src/lib/swig/sw_io.i
deleted file mode 100644 (file)
index 9318f5d..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2006,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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef SWIGIMPORTED
-%module(directors="1") gnuradio_swig_py_io
-#endif
-
- //%feature("autodoc", "1");           // generate python docstrings
-
-%include "gnuradio.i"                          // the common stuff
-
-%include "io.i"
diff --git a/gnuradio-core/src/lib/swig/sw_runtime.i b/gnuradio-core/src/lib/swig/sw_runtime.i
deleted file mode 100644 (file)
index 8f444f9..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 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.
- */
-
-#ifndef SWIGIMPORTED
-%module(directors="1") gnuradio_swig_py_runtime
-#endif
-
- //%feature("autodoc", "1");           // generate python docstrings
-
-#define SW_RUNTIME
-%include "gnuradio.i"                          // the common stuff
-
-%include "runtime.i"
index 5318777b057c476a2ad54825e8006422ad86fc50..0afd32767650dec932f3f0fd1e429146d96ce416 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2005 Free Software Foundation, Inc.
+# Copyright 2005,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -26,5 +26,3 @@ EXTRA_DIST = microtune.py
 
 noinst_SCRIPTS =               \
        microtune.py            
-
-CLEANFILES = *.pyc
index d01882151a482e1ea487fbafe21a07443e90d331..5cc0824b3aa5392ea96c48553cf836ff2d0ddc85 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2004,2007,2008 Free Software Foundation, Inc.
+# Copyright 2004,2007,2008,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -34,5 +34,3 @@ grpython_PYTHON =                     \
        gr_unittest.py                  \
        optfir.py                       \
        window.py
-
-CLEANFILES = *.pyc
index f79e3055b8e675b2744938840cdde90dfaacc21d..04b7c6500d823e2b9cb866be8999abce6f9c499d 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2005 Free Software Foundation, Inc.
+# Copyright 2005,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -28,8 +28,3 @@ grblks2pythondir = $(grpythondir)/blks2
 
 grblks2python_PYTHON =         \
        __init__.py             
-
-
-noinst_PYTHON =                
-
-CLEANFILES = *.pyc *.pyo
index 66540c77a5fef0a774718382bd5ded1ddb348639..09cd92fc39cca244baddf09682db3286bc3b6de5 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2005,2007 Free Software Foundation, Inc.
+# Copyright 2005,2007,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -60,8 +60,3 @@ grblkspython_PYTHON =         \
        wfm_rcv.py              \
        wfm_rcv_pll.py          \
        wfm_tx.py               
-
-
-noinst_PYTHON =                
-
-CLEANFILES = *.pyc *.pyo
index 361ab82a1e9da893fef069da1d83262717246b8a..9b311d81f83d556baa1f347e4b643afe185f09d2 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2005 Free Software Foundation, Inc.
+# Copyright 2005,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -28,8 +28,3 @@ grblkspythondir = $(grpythondir)/gru
 
 grblkspython_PYTHON =          \
        __init__.py             
-
-
-noinst_PYTHON =                
-
-CLEANFILES = *.pyc *.pyo
index b2ed7e64bec60a5e9bffac91af20cc3b4dd81450..314358a7f67278d1f510d350004320dd5e694708 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2005 Free Software Foundation, Inc.
+# Copyright 2005,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -37,5 +37,3 @@ grupython_PYTHON =                    \
        seq_with_cursor.py              \
        socket_stuff.py                 \
        daemon.py
-
-CLEANFILES = *.pyc
index 8acb54709a661fbabaa713ebb203e0c94b0adfc7..ea34beee865d8df781de72f3b6a18f17c7b85b95 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2006,2008 Free Software Foundation, Inc.
+# Copyright 2006,2008,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -42,5 +42,3 @@ dial_tone_SOURCES = \
 dial_tone_LDADD = \
     $(GNURADIO_CORE_LA) \
     $(GR_AUDIO_ALSA_LA)
-
-MOSTLYCLEANFILES = *~
index 4275af549237b0bd12c1bdb26904031af1700230..17b2de740a5ceebb50c9a592b7344d676e7cfdbd 100644 (file)
@@ -28,5 +28,3 @@ dist_ourdata_SCRIPTS =                \
        benchmark_tx.py         \
        receive_path.py         \
        transmit_path.py
-
-MOSTLYCLEANFILES = *.pyc *.pyo *~
index 2bc448165d5cf6832c663de83bb9af89802b03e7..f151c43292c1b4e2f4e621da2f559ffbc36d2af0 100644 (file)
@@ -41,5 +41,3 @@ dist_ourdata_SCRIPTS =                \
        transmit_path_lb.py     \
        tunnel.py               \
        tx_voice.py
-
-MOSTLYCLEANFILES = *.pyc *.pyo *~
index a5dddeec340bf3381c8aca5a6c351f5bbb37fb4f..77cacbfd2b35e1d40d280539097d5405b615c5ae 100644 (file)
@@ -30,5 +30,3 @@ dist_ourdata_SCRIPTS =                \
        dial_tone_source.py     \
        vector_sink.py          \
        vector_source.py
-
-MOSTLYCLEANFILES = *.pyc *~
index 21a25bc15540643e769b51048e1a6e397e11c38e..905eaa57e455328bb60fd6ae42e027fd806a5f77 100644 (file)
 
 include $(top_srcdir)/Makefile.common
 
-# Install this stuff so that it ends up as the gnuradio.atsc module
-# This usually ends up at:
-#   ${prefix}/lib/python${python_version}/site-packages/gnuradio
-
-ourpythondir = $(grpythondir)
-ourlibdir    = $(grpyexecdir)
-
 AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) \
        $(CPPUNIT_INCLUDES) $(WITH_INCLUDES)
 
@@ -37,17 +30,10 @@ EXTRA_DIST =                                        \
        qa_atsci_trellis_encoder_t1_input.dat   \
        qa_atsci_trellis_encoder_t1_output.dat  \
        qa_atsci_viterbi_decoder_t1_input.dat   \
-       qa_atsci_viterbi_decoder_t1_output.dat  
-
-
-BUILT_SOURCES =                                \
-       atsci_viterbi_mux.cc                    \
-       $(swig_built_sources)
-
+       qa_atsci_viterbi_decoder_t1_output.dat
 
 TESTS =                                                \
-       test_atsci                              
-
+       test_atsci
 
 # We build two libtool convenience libraries
 
@@ -60,7 +46,7 @@ noinst_LTLIBRARIES = libatsc.la libatsc-qa.la
 #      atsci_vsbtx_lp.cc                       \
 #
 
-libatsc_la_SOURCES =                           \
+libatsc_la_SOURCES =                   \
        atsc_derandomizer.cc                    \
        atsc_randomizer.cc                      \
        atsc_rs_decoder.cc                      \
@@ -102,6 +88,9 @@ libatsc_la_SOURCES =                                 \
        create_atsci_fs_correlator.cc           \
        plinfo.cc                               
 
+libatsc_la_LIBADD =                            \
+       $(GNURADIO_CORE_LA)
+
 libatsc_qa_la_SOURCES =                        \
        qa_atsci_basic_trellis_encoder.cc       \
        qa_atsci_data_interleaver.cc            \
@@ -118,6 +107,8 @@ libatsc_qa_la_SOURCES =                     \
        qa_atsci.cc                             \
        qa_interleaver_fifo.cc                  
 
+libatsc_qa_la_LIBADD =                         \
+       $(GNURADIO_CORE_LA)
 
 # These headers get installed in ${prefix}/include/gnuradio
 grinclude_HEADERS =                            \
@@ -186,14 +177,13 @@ grinclude_HEADERS =                               \
        qa_atsci_trellis_encoder.h              \
        qa_atsci_viterbi_decoder.h              \
        qa_convolutional_interleaver.h          \
-       qa_interleaver_fifo.h                   
+       qa_interleaver_fifo.h
 
 
 # programs we build but don't install
 # FIXME add test_atsc
 noinst_PROGRAMS =                              \
-       test_atsci                              
-
+       test_atsci
 
 atsci_viterbi_gen$(EXEEXT): $(srcdir)/atsci_viterbi_gen.cc
        $(CXX_FOR_BUILD) -O2 $(srcdir)/atsci_viterbi_gen.cc -o atsci_viterbi_gen$(EXEEXT)
@@ -201,75 +191,43 @@ atsci_viterbi_gen$(EXEEXT): $(srcdir)/atsci_viterbi_gen.cc
 atsci_viterbi_mux.cc: atsci_viterbi_gen$(EXEEXT) 
        ./atsci_viterbi_gen$(EXEEXT) -o atsci_viterbi_mux.cc
 
-
 test_atsci_SOURCES = test_atsci.cc
 test_atsci_LDADD   =           \
        libatsc-qa.la           \
        libatsc.la              \
-       $(GNURADIO_CORE_LA)     \
        $(CPPUNIT_LIBS)
 
 # ------------------------------------------------------------------------
-#  This is the swig-ish part of the Makefile.
-#  It builds the atsc module which we'll load into python
+#  Cleanup
 # ------------------------------------------------------------------------
 
-ALL_IFILES =                           \
-       $(LOCAL_IFILES)                 \
-       $(NON_LOCAL_IFILES)             
-
-NON_LOCAL_IFILES =                     \
-       $(GNURADIO_I)
-
-LOCAL_IFILES =                                 \
-       $(srcdir)/atsc.i                                
+CLEANFILES = atsci_viterbi_mux.cc atsci_viterbi_gen$(EXEEXT)
 
-# These files are built by SWIG.  The first is the C++ glue.
-# The second is the python wrapper that loads the _atsc shared library
-# and knows how to call our extensions.
-
-swig_built_sources =                   \
-       atsc.cc                         \
-       atsc.py                         
-
-# This gets atsc.py installed in the right place
-ourpython_PYTHON =                     \
-       atsc.py
-
-ourlib_LTLIBRARIES = _atsc.la
-
-# These are the source files that go into the shared library
-_atsc_la_SOURCES =                     \
-       atsc.cc                 
-
-# magic flags
-_atsc_la_LDFLAGS = $(NO_UNDEFINED) -module -avoid-version
-
-# link the library against some comon swig runtime code and the 
-# c++ standard library
-_atsc_la_LIBADD =                      \
-       $(GNURADIO_CORE_LA)             \
-       $(PYTHON_LDFLAGS)               \
-       libatsc.la                      \
-       -lstdc++                        
+# ------------------------------------------------------------------------
+#  This is the swig-ish part of the Makefile.
+#  It builds the atsc module which we'll load into python
+# ------------------------------------------------------------------------
 
-atsc.cc atsc.py: $(ALL_IFILES)
-       $(SWIG) $(STD_SWIG_PYTHON_ARGS) -module atsc \
-               -o atsc.cc $(LOCAL_IFILES)
+TOP_SWIG_IFILES =              \
+       atsc.i
 
-# These swig headers get installed in ${prefix}/include/gnuradio/swig
-swiginclude_HEADERS =                  \
-       $(LOCAL_IFILES)                 
+# Install so that they end up available as:
+#   import gnuradio
+# This ends up at:
+#   ${prefix}/lib/python${python_version}/site-packages/gnuradio
+atsc_pythondir_category =      \
+       gnuradio
 
-# 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
+# additional libraries for linking with the SWIG-generated library
+atsc_la_swig_libadd =          \
+       libatsc.la
 
-# ------------------------------------------------------------------------
-#  Cleanup
-# ------------------------------------------------------------------------
+include $(top_srcdir)/Makefile.swig
 
-CLEANFILES =      atsci_viterbi_mux.cc atsci_viterbi_gen
-MOSTLYCLEANFILES = $(BUILT_SOURCES) *.pyc
+# add some of the variables generated inside the Makefile.swig.gen
+BUILT_SOURCES =                                \
+       atsci_viterbi_mux.cc                    \
+       $(swig_built_sources)
 
+# Do not distribute the output of SWIG
+no_dist_files = $(swig_built_sources)
diff --git a/gr-atsc/src/lib/Makefile.swig.gen b/gr-atsc/src/lib/Makefile.swig.gen
new file mode 100644 (file)
index 0000000..e52d653
--- /dev/null
@@ -0,0 +1,259 @@
+# -*- Makefile -*-
+#
+# Copyright 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.
+# 
+
+# Makefile.swig.gen for atsc.i
+
+## Default install locations for these files:
+##
+## Default location for the Python directory is:
+##  ${prefix}/lib/python${python_version}/site-packages/[category]/atsc
+## Default location for the Python exec directory is:
+##  ${exec_prefix}/lib/python${python_version}/site-packages/[category]/atsc
+##
+## The following can be overloaded to change the install location, but
+## this has to be done in the including Makefile.am -before-
+## Makefile.swig is included.
+
+atsc_pythondir_category ?= gnuradio/atsc
+atsc_pylibdir_category ?= $(atsc_pythondir_category)
+atsc_pythondir = $(pythondir)/$(atsc_pythondir_category)
+atsc_pylibdir = $(pyexecdir)/$(atsc_pylibdir_category)
+
+## SWIG headers are always installed into the same directory.
+
+atsc_swigincludedir = $(swigincludedir)
+
+## This is a template file for a "generated" Makefile addition (in
+## this case, "Makefile.swig.gen").  By including the top-level
+## Makefile.swig, this file will be used to generate the SWIG
+## dependencies.  Assign the variable TOP_SWIG_FILES to be the list of
+## SWIG .i files to generated wrappings for; there can be more than 1
+## so long as the names are unique (no sorting is done on the
+## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i
+## file will generate .cc, .py, and possibly .h files -- meaning that
+## all of these files will have the same base name (that provided for
+## the SWIG .i file).
+##
+## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the
+## right thing.  For more info, see <
+## http://sources.redhat.com/automake/automake.html#Multiple-Outputs >
+
+## Stamps used to ensure parallel make does the right thing.  These
+## are removed by "make clean", but otherwise unused except during the
+## parallel built.  These will not be included in a tarball, because
+## the SWIG-generated files will be removed from the distribution.
+
+STAMPS += $(DEPDIR)/atsc-generate-*
+
+## Other cleaned files: dependency files generated by SWIG or this Makefile
+
+MOSTLYCLEANFILES += $(DEPDIR)/*.S*
+
+## Add the .py and .cc files to the list of SWIG built sources.  The
+## .h file is sometimes built, but not always ... so that one has to
+## be added manually by the including Makefile.am .
+
+swig_built_sources += atsc.py atsc.cc
+
+## Various SWIG variables.  These can be overloaded in the including
+## Makefile.am by setting the variable value there, then including
+## Makefile.swig .
+
+atsc_swiginclude_HEADERS =             \
+       atsc.i                  \
+       $(atsc_swiginclude_headers)
+
+atsc_pylib_LTLIBRARIES =               \
+       _atsc.la
+
+_atsc_la_SOURCES =                     \
+       atsc.cc                 \
+       $(atsc_la_swig_sources)
+
+_atsc_la_LIBADD =                      \
+       $(STD_SWIG_LA_LIB_ADD)          \
+       $(atsc_la_swig_libadd)
+
+_atsc_la_LDFLAGS =                     \
+       $(STD_SWIG_LA_LD_FLAGS)         \
+       $(atsc_la_swig_ldflags)
+
+_atsc_la_CXXFLAGS =                    \
+       $(STD_SWIG_CXX_FLAGS)           \
+       $(atsc_la_swig_cxxflags)
+
+atsc_python_PYTHON =                   \
+       atsc.py                 \
+       $(atsc_python)
+
+## Entry rule for running SWIG
+
+atsc.h atsc.py atsc.cc: atsc.i
+## This rule will get called only when MAKE decides that one of the
+## targets needs to be created or re-created, because:
+##
+## * The .i file is newer than any or all of the generated files;
+##
+## * Any or all of the .cc, .h, or .py files does not exist and is
+##   needed (in the case this file is not needed, the rule for it is
+##   ignored); or
+##
+## * Some SWIG-based dependecy of the .cc file isn't met and hence the
+##   .cc file needs be be regenerated.  Explanation: Because MAKE
+##   knows how to handle dependencies for .cc files (regardless of
+##   their name or extension), then the .cc file is used as a target
+##   instead of the .i file -- but with the dependencies of the .i
+##   file.  It is this last reason why the line:
+##
+##             if test -f $@; then :; else
+##
+##   cannot be used in this case: If a .i file dependecy is not met,
+##   then the .cc file needs to be rebuilt.  But if the stamp is newer
+##   than the .cc file, and the .cc file exists, then in the original
+##   version (with the 'test' above) the internal MAKE call will not
+##   be issued and hence the .cc file will not be rebuilt.
+##
+## Once execution gets to here, it should always proceed no matter the
+## state of a stamp (as discussed in link above).  The
+## $(DEPDIR)/atsc-generate stuff is used to allow for parallel
+## builds to "do the right thing".  The stamp has no relationship with
+## either the target files or dependency file; it is used solely for
+## the protection of multiple builds during a given call to MAKE.
+##
+## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM
+## (15).  At a caught signal, the quoted command will be issued before
+## exiting.  In this case, remove any stamp, whether temporary of not.
+## The trap is valid until the process exits; the process includes all
+## commands appended via "\"s.
+##
+       trap 'rm -rf $(DEPDIR)/atsc-generate-*' 1 2 13 15; \
+##
+## Create a temporary directory, which acts as a lock.  The first
+## process to create the directory will succeed and issue the MAKE
+## command to do the actual work, while all subsequent processes will
+## fail -- leading them to wait for the first process to finish.
+##
+       if mkdir $(DEPDIR)/atsc-generate-lock 2>/dev/null; then \
+##
+## This code is being executed by the first process to succeed in
+## creating the directory lock.
+##
+## Remove the stamp associated with this filename.
+##
+               rm -f $(DEPDIR)/atsc-generate-stamp; \
+##
+## Tell MAKE to run the rule for creating this stamp.
+##
+               $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/atsc-generate-stamp WHAT=$<; \
+##
+## Now that the .cc, .h, and .py files have been (re)created from the
+## .i file, future checking of this rule during the same MAKE
+## execution will come back that the rule doesn't need to be executed
+## because none of the conditions mentioned at the start of this rule
+## will be positive.  Remove the the directory lock, which frees up
+## any waiting process(es) to continue.
+##
+               rmdir $(DEPDIR)/atsc-generate-lock; \
+       else \
+##
+## This code is being executed by any follower processes while the
+## directory lock is in place.
+##
+## Wait until the first process is done, testing once per second.
+##
+               while test -d $(DEPDIR)/atsc-generate-lock; do \
+                       sleep 1; \
+               done; \
+##
+## Succeed if and only if the first process succeeded; exit this
+## process returning the status of the generated stamp.
+##
+               test -f $(DEPDIR)/atsc-generate-stamp; \
+               exit $$?; \
+       fi;
+
+$(DEPDIR)/atsc-generate-stamp:
+## This rule will be called only by the first process issuing the
+## above rule to succeed in creating the lock directory, after
+## removing the actual stamp file in order to guarantee that MAKE will
+## execute this rule.
+##
+## Call SWIG to generate the various output files; special
+## post-processing on 'mingw32' host OS for the dependency file.
+##
+       if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(atsc_swig_args) \
+               -MD -MF $(DEPDIR)/atsc.Std \
+               -module atsc -o atsc.cc $(WHAT); then \
+           if test $(host_os) = mingw32; then \
+               $(RM) $(DEPDIR)/atsc.Sd; \
+               $(SED) 's,\\\\,/,g' < $(DEPDIR)/atsc.Std \
+                       > $(DEPDIR)/atsc.Sd; \
+               $(RM) $(DEPDIR)/atsc.Std; \
+               $(MV) $(DEPDIR)/atsc.Sd $(DEPDIR)/atsc.Std; \
+           fi; \
+       else \
+           $(RM) $(DEPDIR)/atsc.S*; exit 1; \
+       fi;
+##
+## Mess with the SWIG output .Std dependency file, to create a
+## dependecy file valid for the input .i file: Basically, simulate the
+## dependency file created for libraries by GNU's libtool for C++,
+## where all of the dependencies for the target are first listed, then
+## each individual dependency is listed as a target with no further
+## dependencies.
+##
+## (1) remove the current dependency file
+##
+       $(RM) $(DEPDIR)/atsc.d
+##
+## (2) Copy the whole SWIG file:
+##
+       cp $(DEPDIR)/atsc.Std $(DEPDIR)/atsc.d
+##
+## (3) all a carriage return to the end of the dependency file.
+##
+       echo "" >> $(DEPDIR)/atsc.d
+##
+## (4) from the SWIG file, remove the first line (the target); remove
+##     trailing " \" and " " from each line.  Append ":" to each line,
+##     followed by 2 carriage returns, then append this to the end of
+##     the dependency file.
+##
+       $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/atsc.Std | \
+               awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/atsc.d
+##
+## (5) remove the SWIG-generated file
+##
+       $(RM) $(DEPDIR)/atsc.Std
+##
+## Create the stamp for this filename generation, to signal success in
+## executing this rule; allows other threads waiting on this process
+## to continue.
+##
+       touch $(DEPDIR)/atsc-generate-stamp
+
+# KLUDGE: Force runtime include of a SWIG 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@./$(DEPDIR)/atsc.d@am__quote@
+
index d7c787d56c0ad39f43c04b7c0e2ffdc56c868562..8230ab56999dee5c0173765c0e6042b8cdf25e6e 100644 (file)
 
 include $(top_srcdir)/Makefile.common
 
-# Install this stuff so that it ends up as the gnuradio.audio_alsa module
-# This usually ends up at:
-#   ${prefix}/lib/python${python_version}/site-packages/gnuradio
-
-ourpythondir = $(grpythondir)
-ourlibdir    = $(grpyexecdir)
-
 EXTRA_DIST = run_tests.in
 
 TESTS = run_tests
 
-LOCAL_IFILES =                                 \
-       $(srcdir)/audio_alsa.i                          
-
-NON_LOCAL_IFILES =                     \
-       $(GNURADIO_I)
+DISTCLEANFILES = run_tests
 
-ALL_IFILES =                           \
-       $(LOCAL_IFILES)                 \
-       $(NON_LOCAL_IFILES)             
+# C/C++ headers get installed in ${prefix}/include/gnuradio
+grinclude_HEADERS =                    \
+       audio_alsa_sink.h               \
+       audio_alsa_source.h
 
-BUILT_SOURCES =                        \
-       audio_alsa.cc                   \
-       audio_alsa.py                           
+noinst_HEADERS =                       \
+       gri_alsa.h
 
-ourpython_PYTHON =                     \
-       audio_alsa.py
+noinst_PYTHON =                        \
+       qa_alsa.py
 
 AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES)
 
-ourlib_LTLIBRARIES = _audio_alsa.la
+###################################
+# ALSA library, including OS interface, sink, and source
 
 lib_LTLIBRARIES = libgnuradio-audio-alsa.la
 
-_audio_alsa_la_SOURCES =               \
-       audio_alsa.cc
-
 libgnuradio_audio_alsa_la_SOURCES =    \
        audio_alsa_sink.cc              \
        audio_alsa_source.cc            \
        gri_alsa.cc
 
-grinclude_HEADERS =                    \
-       audio_alsa_sink.h               \
-       audio_alsa_source.h
-
-noinst_HEADERS =                       \
-       gri_alsa.h
-
-swiginclude_HEADERS =                  \
-       $(LOCAL_IFILES)
-
-_audio_alsa_la_LIBADD =                \
-       $(PYTHON_LDFLAGS)               \
-       $(GNURADIO_CORE_LA)             \
-       $(ALSA_LIBS)                    \
-       libgnuradio-audio-alsa.la       \
-       -lstdc++
-
 libgnuradio_audio_alsa_la_LIBADD =     \
+       $(GNURADIO_CORE_LA)             \
        $(ALSA_LIBS)
 
-_audio_alsa_la_LDFLAGS = $(NO_UNDEFINED) -module -avoid-version
+libgnuradio_audio_alsa_la_LDFLAGS =    \
+       $(NO_UNDEFINED)
 
-libgnuradio_audio_alsa_la_LDFLAGS = $(NO_UNDEFINED)
+###################################
+# SWIG Python interface and library
 
-_audio_alsa_la_CXXFLAGS = @swig_CXXFLAGS@
+TOP_SWIG_IFILES =                      \
+       audio_alsa.i
 
-audio_alsa.cc audio_alsa.py: $(ALL_IFILES)
-       $(SWIG) $(STD_SWIG_PYTHON_ARGS) -module audio_alsa \
-               -o audio_alsa.cc $(LOCAL_IFILES)
+# Install so that they end up available as:
+#   import gnuradio.audio_alsa
+# This ends up at:
+#   ${prefix}/lib/python${python_version}/site-packages/gnuradio
+audio_alsa_pythondir_category =                \
+       gnuradio
 
-noinst_PYTHON =                        \
-       qa_alsa.py                      
+# additional libraries for linking with the SWIG-generated library
+audio_alsa_la_swig_libadd =            \
+       libgnuradio-audio-alsa.la
+
+include $(top_srcdir)/Makefile.swig
 
-MOSTLYCLEANFILES = \
-       $(BUILT_SOURCES) *~ *.pyc
+# add some of the variables generated inside the Makefile.swig.gen
+BUILT_SOURCES = $(swig_built_sources)
 
-# 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
+# Do not distribute the output of SWIG
+no_dist_files = $(swig_built_sources)
diff --git a/gr-audio-alsa/src/Makefile.swig.gen b/gr-audio-alsa/src/Makefile.swig.gen
new file mode 100644 (file)
index 0000000..3a84a02
--- /dev/null
@@ -0,0 +1,259 @@
+# -*- Makefile -*-
+#
+# Copyright 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.
+# 
+
+# Makefile.swig.gen for audio_alsa.i
+
+## Default install locations for these files:
+##
+## Default location for the Python directory is:
+##  ${prefix}/lib/python${python_version}/site-packages/[category]/audio_alsa
+## Default location for the Python exec directory is:
+##  ${exec_prefix}/lib/python${python_version}/site-packages/[category]/audio_alsa
+##
+## The following can be overloaded to change the install location, but
+## this has to be done in the including Makefile.am -before-
+## Makefile.swig is included.
+
+audio_alsa_pythondir_category ?= gnuradio/audio_alsa
+audio_alsa_pylibdir_category ?= $(audio_alsa_pythondir_category)
+audio_alsa_pythondir = $(pythondir)/$(audio_alsa_pythondir_category)
+audio_alsa_pylibdir = $(pyexecdir)/$(audio_alsa_pylibdir_category)
+
+## SWIG headers are always installed into the same directory.
+
+audio_alsa_swigincludedir = $(swigincludedir)
+
+## This is a template file for a "generated" Makefile addition (in
+## this case, "Makefile.swig.gen").  By including the top-level
+## Makefile.swig, this file will be used to generate the SWIG
+## dependencies.  Assign the variable TOP_SWIG_FILES to be the list of
+## SWIG .i files to generated wrappings for; there can be more than 1
+## so long as the names are unique (no sorting is done on the
+## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i
+## file will generate .cc, .py, and possibly .h files -- meaning that
+## all of these files will have the same base name (that provided for
+## the SWIG .i file).
+##
+## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the
+## right thing.  For more info, see <
+## http://sources.redhat.com/automake/automake.html#Multiple-Outputs >
+
+## Stamps used to ensure parallel make does the right thing.  These
+## are removed by "make clean", but otherwise unused except during the
+## parallel built.  These will not be included in a tarball, because
+## the SWIG-generated files will be removed from the distribution.
+
+STAMPS += $(DEPDIR)/audio_alsa-generate-*
+
+## Other cleaned files: dependency files generated by SWIG or this Makefile
+
+MOSTLYCLEANFILES += $(DEPDIR)/*.S*
+
+## Add the .py and .cc files to the list of SWIG built sources.  The
+## .h file is sometimes built, but not always ... so that one has to
+## be added manually by the including Makefile.am .
+
+swig_built_sources += audio_alsa.py audio_alsa.cc
+
+## Various SWIG variables.  These can be overloaded in the including
+## Makefile.am by setting the variable value there, then including
+## Makefile.swig .
+
+audio_alsa_swiginclude_HEADERS =               \
+       audio_alsa.i                    \
+       $(audio_alsa_swiginclude_headers)
+
+audio_alsa_pylib_LTLIBRARIES =         \
+       _audio_alsa.la
+
+_audio_alsa_la_SOURCES =                       \
+       audio_alsa.cc                   \
+       $(audio_alsa_la_swig_sources)
+
+_audio_alsa_la_LIBADD =                        \
+       $(STD_SWIG_LA_LIB_ADD)          \
+       $(audio_alsa_la_swig_libadd)
+
+_audio_alsa_la_LDFLAGS =                       \
+       $(STD_SWIG_LA_LD_FLAGS)         \
+       $(audio_alsa_la_swig_ldflags)
+
+_audio_alsa_la_CXXFLAGS =                      \
+       $(STD_SWIG_CXX_FLAGS)           \
+       $(audio_alsa_la_swig_cxxflags)
+
+audio_alsa_python_PYTHON =                     \
+       audio_alsa.py                   \
+       $(audio_alsa_python)
+
+## Entry rule for running SWIG
+
+audio_alsa.h audio_alsa.py audio_alsa.cc: audio_alsa.i
+## This rule will get called only when MAKE decides that one of the
+## targets needs to be created or re-created, because:
+##
+## * The .i file is newer than any or all of the generated files;
+##
+## * Any or all of the .cc, .h, or .py files does not exist and is
+##   needed (in the case this file is not needed, the rule for it is
+##   ignored); or
+##
+## * Some SWIG-based dependecy of the .cc file isn't met and hence the
+##   .cc file needs be be regenerated.  Explanation: Because MAKE
+##   knows how to handle dependencies for .cc files (regardless of
+##   their name or extension), then the .cc file is used as a target
+##   instead of the .i file -- but with the dependencies of the .i
+##   file.  It is this last reason why the line:
+##
+##             if test -f $@; then :; else
+##
+##   cannot be used in this case: If a .i file dependecy is not met,
+##   then the .cc file needs to be rebuilt.  But if the stamp is newer
+##   than the .cc file, and the .cc file exists, then in the original
+##   version (with the 'test' above) the internal MAKE call will not
+##   be issued and hence the .cc file will not be rebuilt.
+##
+## Once execution gets to here, it should always proceed no matter the
+## state of a stamp (as discussed in link above).  The
+## $(DEPDIR)/audio_alsa-generate stuff is used to allow for parallel
+## builds to "do the right thing".  The stamp has no relationship with
+## either the target files or dependency file; it is used solely for
+## the protection of multiple builds during a given call to MAKE.
+##
+## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM
+## (15).  At a caught signal, the quoted command will be issued before
+## exiting.  In this case, remove any stamp, whether temporary of not.
+## The trap is valid until the process exits; the process includes all
+## commands appended via "\"s.
+##
+       trap 'rm -rf $(DEPDIR)/audio_alsa-generate-*' 1 2 13 15; \
+##
+## Create a temporary directory, which acts as a lock.  The first
+## process to create the directory will succeed and issue the MAKE
+## command to do the actual work, while all subsequent processes will
+## fail -- leading them to wait for the first process to finish.
+##
+       if mkdir $(DEPDIR)/audio_alsa-generate-lock 2>/dev/null; then \
+##
+## This code is being executed by the first process to succeed in
+## creating the directory lock.
+##
+## Remove the stamp associated with this filename.
+##
+               rm -f $(DEPDIR)/audio_alsa-generate-stamp; \
+##
+## Tell MAKE to run the rule for creating this stamp.
+##
+               $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/audio_alsa-generate-stamp WHAT=$<; \
+##
+## Now that the .cc, .h, and .py files have been (re)created from the
+## .i file, future checking of this rule during the same MAKE
+## execution will come back that the rule doesn't need to be executed
+## because none of the conditions mentioned at the start of this rule
+## will be positive.  Remove the the directory lock, which frees up
+## any waiting process(es) to continue.
+##
+               rmdir $(DEPDIR)/audio_alsa-generate-lock; \
+       else \
+##
+## This code is being executed by any follower processes while the
+## directory lock is in place.
+##
+## Wait until the first process is done, testing once per second.
+##
+               while test -d $(DEPDIR)/audio_alsa-generate-lock; do \
+                       sleep 1; \
+               done; \
+##
+## Succeed if and only if the first process succeeded; exit this
+## process returning the status of the generated stamp.
+##
+               test -f $(DEPDIR)/audio_alsa-generate-stamp; \
+               exit $$?; \
+       fi;
+
+$(DEPDIR)/audio_alsa-generate-stamp:
+## This rule will be called only by the first process issuing the
+## above rule to succeed in creating the lock directory, after
+## removing the actual stamp file in order to guarantee that MAKE will
+## execute this rule.
+##
+## Call SWIG to generate the various output files; special
+## post-processing on 'mingw32' host OS for the dependency file.
+##
+       if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(audio_alsa_swig_args) \
+               -MD -MF $(DEPDIR)/audio_alsa.Std \
+               -module audio_alsa -o audio_alsa.cc $(WHAT); then \
+           if test $(host_os) = mingw32; then \
+               $(RM) $(DEPDIR)/audio_alsa.Sd; \
+               $(SED) 's,\\\\,/,g' < $(DEPDIR)/audio_alsa.Std \
+                       > $(DEPDIR)/audio_alsa.Sd; \
+               $(RM) $(DEPDIR)/audio_alsa.Std; \
+               $(MV) $(DEPDIR)/audio_alsa.Sd $(DEPDIR)/audio_alsa.Std; \
+           fi; \
+       else \
+           $(RM) $(DEPDIR)/audio_alsa.S*; exit 1; \
+       fi;
+##
+## Mess with the SWIG output .Std dependency file, to create a
+## dependecy file valid for the input .i file: Basically, simulate the
+## dependency file created for libraries by GNU's libtool for C++,
+## where all of the dependencies for the target are first listed, then
+## each individual dependency is listed as a target with no further
+## dependencies.
+##
+## (1) remove the current dependency file
+##
+       $(RM) $(DEPDIR)/audio_alsa.d
+##
+## (2) Copy the whole SWIG file:
+##
+       cp $(DEPDIR)/audio_alsa.Std $(DEPDIR)/audio_alsa.d
+##
+## (3) all a carriage return to the end of the dependency file.
+##
+       echo "" >> $(DEPDIR)/audio_alsa.d
+##
+## (4) from the SWIG file, remove the first line (the target); remove
+##     trailing " \" and " " from each line.  Append ":" to each line,
+##     followed by 2 carriage returns, then append this to the end of
+##     the dependency file.
+##
+       $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/audio_alsa.Std | \
+               awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/audio_alsa.d
+##
+## (5) remove the SWIG-generated file
+##
+       $(RM) $(DEPDIR)/audio_alsa.Std
+##
+## Create the stamp for this filename generation, to signal success in
+## executing this rule; allows other threads waiting on this process
+## to continue.
+##
+       touch $(DEPDIR)/audio_alsa-generate-stamp
+
+# KLUDGE: Force runtime include of a SWIG 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@./$(DEPDIR)/audio_alsa.d@am__quote@
+
index 4ac3d1a432e4172f57d26adda52381db1df5e5ed..bd8694a26188709232858d04dbecd80e03b8d5bd 100644 (file)
 
 include $(top_srcdir)/Makefile.common
 
-# Install this stuff so that it ends up as the gnuradio.audio_jack module
-# This usually ends up at:
-#   ${prefix}/lib/python${python_version}/site-packages/gnuradio
-
-ourpythondir = $(grpythondir)
-ourlibdir    = $(grpyexecdir)
-
 EXTRA_DIST = run_tests.in
 
 TESTS = run_tests
 
-LOCAL_IFILES =                                 \
-       $(srcdir)/audio_jack.i                          
-
-NON_LOCAL_IFILES =                     \
-       $(GNURADIO_I)
-
-ALL_IFILES =                           \
-       $(LOCAL_IFILES)                 \
-       $(NON_LOCAL_IFILES)             
-
-BUILT_SOURCES =                        \
-       audio_jack.cc                   \
-       audio_jack.py                           
-
-ourpython_PYTHON =                     \
-       audio_jack.py
-
-AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES)
-
-ourlib_LTLIBRARIES = _audio_jack.la
-
-_audio_jack_la_SOURCES =               \
-       audio_jack.cc                   \
-       audio_jack_sink.cc              \
-       audio_jack_source.cc            \
-       gri_jack.cc
+DISTCLEANFILES = run_tests
 
+# C/C++ headers get installed in ${prefix}/include/gnuradio
 grinclude_HEADERS =                    \
        audio_jack_sink.h               \
        audio_jack_source.h
@@ -66,30 +35,39 @@ grinclude_HEADERS =                 \
 noinst_HEADERS =                       \
        gri_jack.h
 
-swiginclude_HEADERS =                  \
-       $(LOCAL_IFILES)
+noinst_PYTHON =                        \
+       qa_jack.py
 
-_audio_jack_la_LIBADD =                \
-       $(PYTHON_LDFLAGS)               \
-       $(GNURADIO_CORE_LA)             \
-       $(JACK_LIBS)                    \
-       -lstdc++
+AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES)
 
-_audio_jack_la_LDFLAGS = $(NO_UNDEFINED) -module -avoid-version
+###################################
+# SWIG Python interface and library
 
-_audio_jack_la_CXXFLAGS = @swig_CXXFLAGS@
+TOP_SWIG_IFILES =                      \
+       audio_jack.i
 
-audio_jack.cc audio_jack.py: $(ALL_IFILES)
-       $(SWIG) $(STD_SWIG_PYTHON_ARGS) -module audio_jack \
-               -o audio_jack.cc $(LOCAL_IFILES)
+# Install so that they end up available as:
+#   import gnuradio.audio_jack
+# This ends up at:
+#   ${prefix}/lib/python${python_version}/site-packages/gnuradio
+audio_jack_pythondir_category =                \
+       gnuradio
 
-noinst_PYTHON =                        \
-       qa_jack.py
+# additional sources for the SWIG-generated library
+audio_jack_la_swig_sources =           \
+       audio_jack_sink.cc              \
+       audio_jack_source.cc            \
+       gri_jack.cc
+
+# additional libraries for linking with the SWIG-generated library
+audio_jack_la_swig_libadd =            \
+       $(GNURADIO_CORE_LA)             \
+       $(JACK_LIBS)
+
+include $(top_srcdir)/Makefile.swig
 
-MOSTLYCLEANFILES = \
-       $(BUILT_SOURCES) *~ *.pyc
+# add some of the variables generated inside the Makefile.swig.gen
+BUILT_SOURCES = $(swig_built_sources)
 
-# 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
+# Do not distribute the output of SWIG
+no_dist_files = $(swig_built_sources)
diff --git a/gr-audio-jack/src/Makefile.swig.gen b/gr-audio-jack/src/Makefile.swig.gen
new file mode 100644 (file)
index 0000000..9b1f158
--- /dev/null
@@ -0,0 +1,259 @@
+# -*- Makefile -*-
+#
+# Copyright 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.
+# 
+
+# Makefile.swig.gen for audio_jack.i
+
+## Default install locations for these files:
+##
+## Default location for the Python directory is:
+##  ${prefix}/lib/python${python_version}/site-packages/[category]/audio_jack
+## Default location for the Python exec directory is:
+##  ${exec_prefix}/lib/python${python_version}/site-packages/[category]/audio_jack
+##
+## The following can be overloaded to change the install location, but
+## this has to be done in the including Makefile.am -before-
+## Makefile.swig is included.
+
+audio_jack_pythondir_category ?= gnuradio/audio_jack
+audio_jack_pylibdir_category ?= $(audio_jack_pythondir_category)
+audio_jack_pythondir = $(pythondir)/$(audio_jack_pythondir_category)
+audio_jack_pylibdir = $(pyexecdir)/$(audio_jack_pylibdir_category)
+
+## SWIG headers are always installed into the same directory.
+
+audio_jack_swigincludedir = $(swigincludedir)
+
+## This is a template file for a "generated" Makefile addition (in
+## this case, "Makefile.swig.gen").  By including the top-level
+## Makefile.swig, this file will be used to generate the SWIG
+## dependencies.  Assign the variable TOP_SWIG_FILES to be the list of
+## SWIG .i files to generated wrappings for; there can be more than 1
+## so long as the names are unique (no sorting is done on the
+## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i
+## file will generate .cc, .py, and possibly .h files -- meaning that
+## all of these files will have the same base name (that provided for
+## the SWIG .i file).
+##
+## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the
+## right thing.  For more info, see <
+## http://sources.redhat.com/automake/automake.html#Multiple-Outputs >
+
+## Stamps used to ensure parallel make does the right thing.  These
+## are removed by "make clean", but otherwise unused except during the
+## parallel built.  These will not be included in a tarball, because
+## the SWIG-generated files will be removed from the distribution.
+
+STAMPS += $(DEPDIR)/audio_jack-generate-*
+
+## Other cleaned files: dependency files generated by SWIG or this Makefile
+
+MOSTLYCLEANFILES += $(DEPDIR)/*.S*
+
+## Add the .py and .cc files to the list of SWIG built sources.  The
+## .h file is sometimes built, but not always ... so that one has to
+## be added manually by the including Makefile.am .
+
+swig_built_sources += audio_jack.py audio_jack.cc
+
+## Various SWIG variables.  These can be overloaded in the including
+## Makefile.am by setting the variable value there, then including
+## Makefile.swig .
+
+audio_jack_swiginclude_HEADERS =               \
+       audio_jack.i                    \
+       $(audio_jack_swiginclude_headers)
+
+audio_jack_pylib_LTLIBRARIES =         \
+       _audio_jack.la
+
+_audio_jack_la_SOURCES =                       \
+       audio_jack.cc                   \
+       $(audio_jack_la_swig_sources)
+
+_audio_jack_la_LIBADD =                        \
+       $(STD_SWIG_LA_LIB_ADD)          \
+       $(audio_jack_la_swig_libadd)
+
+_audio_jack_la_LDFLAGS =                       \
+       $(STD_SWIG_LA_LD_FLAGS)         \
+       $(audio_jack_la_swig_ldflags)
+
+_audio_jack_la_CXXFLAGS =                      \
+       $(STD_SWIG_CXX_FLAGS)           \
+       $(audio_jack_la_swig_cxxflags)
+
+audio_jack_python_PYTHON =                     \
+       audio_jack.py                   \
+       $(audio_jack_python)
+
+## Entry rule for running SWIG
+
+audio_jack.h audio_jack.py audio_jack.cc: audio_jack.i
+## This rule will get called only when MAKE decides that one of the
+## targets needs to be created or re-created, because:
+##
+## * The .i file is newer than any or all of the generated files;
+##
+## * Any or all of the .cc, .h, or .py files does not exist and is
+##   needed (in the case this file is not needed, the rule for it is
+##   ignored); or
+##
+## * Some SWIG-based dependecy of the .cc file isn't met and hence the
+##   .cc file needs be be regenerated.  Explanation: Because MAKE
+##   knows how to handle dependencies for .cc files (regardless of
+##   their name or extension), then the .cc file is used as a target
+##   instead of the .i file -- but with the dependencies of the .i
+##   file.  It is this last reason why the line:
+##
+##             if test -f $@; then :; else
+##
+##   cannot be used in this case: If a .i file dependecy is not met,
+##   then the .cc file needs to be rebuilt.  But if the stamp is newer
+##   than the .cc file, and the .cc file exists, then in the original
+##   version (with the 'test' above) the internal MAKE call will not
+##   be issued and hence the .cc file will not be rebuilt.
+##
+## Once execution gets to here, it should always proceed no matter the
+## state of a stamp (as discussed in link above).  The
+## $(DEPDIR)/audio_jack-generate stuff is used to allow for parallel
+## builds to "do the right thing".  The stamp has no relationship with
+## either the target files or dependency file; it is used solely for
+## the protection of multiple builds during a given call to MAKE.
+##
+## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM
+## (15).  At a caught signal, the quoted command will be issued before
+## exiting.  In this case, remove any stamp, whether temporary of not.
+## The trap is valid until the process exits; the process includes all
+## commands appended via "\"s.
+##
+       trap 'rm -rf $(DEPDIR)/audio_jack-generate-*' 1 2 13 15; \
+##
+## Create a temporary directory, which acts as a lock.  The first
+## process to create the directory will succeed and issue the MAKE
+## command to do the actual work, while all subsequent processes will
+## fail -- leading them to wait for the first process to finish.
+##
+       if mkdir $(DEPDIR)/audio_jack-generate-lock 2>/dev/null; then \
+##
+## This code is being executed by the first process to succeed in
+## creating the directory lock.
+##
+## Remove the stamp associated with this filename.
+##
+               rm -f $(DEPDIR)/audio_jack-generate-stamp; \
+##
+## Tell MAKE to run the rule for creating this stamp.
+##
+               $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/audio_jack-generate-stamp WHAT=$<; \
+##
+## Now that the .cc, .h, and .py files have been (re)created from the
+## .i file, future checking of this rule during the same MAKE
+## execution will come back that the rule doesn't need to be executed
+## because none of the conditions mentioned at the start of this rule
+## will be positive.  Remove the the directory lock, which frees up
+## any waiting process(es) to continue.
+##
+               rmdir $(DEPDIR)/audio_jack-generate-lock; \
+       else \
+##
+## This code is being executed by any follower processes while the
+## directory lock is in place.
+##
+## Wait until the first process is done, testing once per second.
+##
+               while test -d $(DEPDIR)/audio_jack-generate-lock; do \
+                       sleep 1; \
+               done; \
+##
+## Succeed if and only if the first process succeeded; exit this
+## process returning the status of the generated stamp.
+##
+               test -f $(DEPDIR)/audio_jack-generate-stamp; \
+               exit $$?; \
+       fi;
+
+$(DEPDIR)/audio_jack-generate-stamp:
+## This rule will be called only by the first process issuing the
+## above rule to succeed in creating the lock directory, after
+## removing the actual stamp file in order to guarantee that MAKE will
+## execute this rule.
+##
+## Call SWIG to generate the various output files; special
+## post-processing on 'mingw32' host OS for the dependency file.
+##
+       if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(audio_jack_swig_args) \
+               -MD -MF $(DEPDIR)/audio_jack.Std \
+               -module audio_jack -o audio_jack.cc $(WHAT); then \
+           if test $(host_os) = mingw32; then \
+               $(RM) $(DEPDIR)/audio_jack.Sd; \
+               $(SED) 's,\\\\,/,g' < $(DEPDIR)/audio_jack.Std \
+                       > $(DEPDIR)/audio_jack.Sd; \
+               $(RM) $(DEPDIR)/audio_jack.Std; \
+               $(MV) $(DEPDIR)/audio_jack.Sd $(DEPDIR)/audio_jack.Std; \
+           fi; \
+       else \
+           $(RM) $(DEPDIR)/audio_jack.S*; exit 1; \
+       fi;
+##
+## Mess with the SWIG output .Std dependency file, to create a
+## dependecy file valid for the input .i file: Basically, simulate the
+## dependency file created for libraries by GNU's libtool for C++,
+## where all of the dependencies for the target are first listed, then
+## each individual dependency is listed as a target with no further
+## dependencies.
+##
+## (1) remove the current dependency file
+##
+       $(RM) $(DEPDIR)/audio_jack.d
+##
+## (2) Copy the whole SWIG file:
+##
+       cp $(DEPDIR)/audio_jack.Std $(DEPDIR)/audio_jack.d
+##
+## (3) all a carriage return to the end of the dependency file.
+##
+       echo "" >> $(DEPDIR)/audio_jack.d
+##
+## (4) from the SWIG file, remove the first line (the target); remove
+##     trailing " \" and " " from each line.  Append ":" to each line,
+##     followed by 2 carriage returns, then append this to the end of
+##     the dependency file.
+##
+       $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/audio_jack.Std | \
+               awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/audio_jack.d
+##
+## (5) remove the SWIG-generated file
+##
+       $(RM) $(DEPDIR)/audio_jack.Std
+##
+## Create the stamp for this filename generation, to signal success in
+## executing this rule; allows other threads waiting on this process
+## to continue.
+##
+       touch $(DEPDIR)/audio_jack-generate-stamp
+
+# KLUDGE: Force runtime include of a SWIG 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@./$(DEPDIR)/audio_jack.d@am__quote@
+
index eb038a977ea0af5adb24ecc2e9cc21c4a6c76dfd..f83ba68ca98927a2714f28c73f9044dd300e8134 100644 (file)
 
 include $(top_srcdir)/Makefile.common
 
-# Install this stuff so that it ends up as the gnuradio.audio_oss module
-# This usually ends up at:
-#   ${prefix}/lib/python${python_version}/site-packages/gnuradio
-
-ourpythondir = $(grpythondir)
-ourlibdir    = $(grpyexecdir)
-
 EXTRA_DIST = run_tests.in
-TESTS = run_tests
 
-LOCAL_IFILES =                                 \
-       $(srcdir)/audio_oss.i
-
-NON_LOCAL_IFILES =                     \
-       $(GNURADIO_I)
+TESTS = run_tests
 
-ALL_IFILES =                           \
-       $(LOCAL_IFILES)                 \
-       $(NON_LOCAL_IFILES)             
+DISTCLEANFILES = run_tests
 
-BUILT_SOURCES =                        \
-       audio_oss.cc                    \
-       audio_oss.py                    
+# C/C++ headers get installed in ${prefix}/include/gnuradio
+grinclude_HEADERS =            \
+       audio_oss_sink.h        \
+       audio_oss_source.h
 
-ourpython_PYTHON =                     \
-       audio_oss.py
+noinst_PYTHON = qa_oss.py
 
 AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES)
 
-ourlib_LTLIBRARIES = _audio_oss.la
+###################################
+# SWIG Python interface and library
 
-_audio_oss_la_SOURCES =                \
-       audio_oss.cc                    \
-       audio_oss_sink.cc               \
-       audio_oss_source.cc
+TOP_SWIG_IFILES =              \
+       audio_oss.i
 
-grinclude_HEADERS =                    \
-       audio_oss_sink.h                \
-       audio_oss_source.h      
-
-swiginclude_HEADERS =                  \
-       $(LOCAL_IFILES)
-
-_audio_oss_la_LIBADD =                         \
-       $(PYTHON_LDFLAGS)               \
-       $(GNURADIO_CORE_LA)             \
-       $(OSS_LIBS)                     \
-       -lstdc++
-
-_audio_oss_la_LDFLAGS = $(NO_UNDEFINED) -module -avoid-version
-
-_audio_oss_la_CXXFLAGS = @swig_CXXFLAGS@
+# Install so that they end up available as:
+#   import gnuradio.audio_oss
+# This ends up at:
+#   ${prefix}/lib/python${python_version}/site-packages/gnuradio
+audio_oss_pythondir_category = \
+       gnuradio
 
-audio_oss.cc audio_oss.py: $(ALL_IFILES)
-       $(SWIG) $(STD_SWIG_PYTHON_ARGS) -module audio_oss \
-               -o audio_oss.cc $(LOCAL_IFILES)
+# additional sources for the SWIG-generated library
+audio_oss_la_swig_sources =    \
+       audio_oss_sink.cc       \
+       audio_oss_source.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
+# additional libraries for linking with the SWIG-generated library
+audio_oss_la_swig_libadd =     \
+       $(GNURADIO_CORE_LA)     \
+       $(OSS_LIBS)
 
-noinst_PYTHON = qa_oss.py
+include $(top_srcdir)/Makefile.swig
 
-MOSTLYCLEANFILES = \
-       $(BUILT_SOURCES) *~ *.pyc
+# add some of the variables generated inside the Makefile.swig.gen
+BUILT_SOURCES = $(swig_built_sources)
 
+# Do not distribute the output of SWIG
+no_dist_files = $(swig_built_sources)
diff --git a/gr-audio-oss/src/Makefile.swig.gen b/gr-audio-oss/src/Makefile.swig.gen
new file mode 100644 (file)
index 0000000..6fce10c
--- /dev/null
@@ -0,0 +1,259 @@
+# -*- Makefile -*-
+#
+# Copyright 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.
+# 
+
+# Makefile.swig.gen for audio_oss.i
+
+## Default install locations for these files:
+##
+## Default location for the Python directory is:
+##  ${prefix}/lib/python${python_version}/site-packages/[category]/audio_oss
+## Default location for the Python exec directory is:
+##  ${exec_prefix}/lib/python${python_version}/site-packages/[category]/audio_oss
+##
+## The following can be overloaded to change the install location, but
+## this has to be done in the including Makefile.am -before-
+## Makefile.swig is included.
+
+audio_oss_pythondir_category ?= gnuradio/audio_oss
+audio_oss_pylibdir_category ?= $(audio_oss_pythondir_category)
+audio_oss_pythondir = $(pythondir)/$(audio_oss_pythondir_category)
+audio_oss_pylibdir = $(pyexecdir)/$(audio_oss_pylibdir_category)
+
+## SWIG headers are always installed into the same directory.
+
+audio_oss_swigincludedir = $(swigincludedir)
+
+## This is a template file for a "generated" Makefile addition (in
+## this case, "Makefile.swig.gen").  By including the top-level
+## Makefile.swig, this file will be used to generate the SWIG
+## dependencies.  Assign the variable TOP_SWIG_FILES to be the list of
+## SWIG .i files to generated wrappings for; there can be more than 1
+## so long as the names are unique (no sorting is done on the
+## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i
+## file will generate .cc, .py, and possibly .h files -- meaning that
+## all of these files will have the same base name (that provided for
+## the SWIG .i file).
+##
+## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the
+## right thing.  For more info, see <
+## http://sources.redhat.com/automake/automake.html#Multiple-Outputs >
+
+## Stamps used to ensure parallel make does the right thing.  These
+## are removed by "make clean", but otherwise unused except during the
+## parallel built.  These will not be included in a tarball, because
+## the SWIG-generated files will be removed from the distribution.
+
+STAMPS += $(DEPDIR)/audio_oss-generate-*
+
+## Other cleaned files: dependency files generated by SWIG or this Makefile
+
+MOSTLYCLEANFILES += $(DEPDIR)/*.S*
+
+## Add the .py and .cc files to the list of SWIG built sources.  The
+## .h file is sometimes built, but not always ... so that one has to
+## be added manually by the including Makefile.am .
+
+swig_built_sources += audio_oss.py audio_oss.cc
+
+## Various SWIG variables.  These can be overloaded in the including
+## Makefile.am by setting the variable value there, then including
+## Makefile.swig .
+
+audio_oss_swiginclude_HEADERS =                \
+       audio_oss.i                     \
+       $(audio_oss_swiginclude_headers)
+
+audio_oss_pylib_LTLIBRARIES =          \
+       _audio_oss.la
+
+_audio_oss_la_SOURCES =                        \
+       audio_oss.cc                    \
+       $(audio_oss_la_swig_sources)
+
+_audio_oss_la_LIBADD =                 \
+       $(STD_SWIG_LA_LIB_ADD)          \
+       $(audio_oss_la_swig_libadd)
+
+_audio_oss_la_LDFLAGS =                        \
+       $(STD_SWIG_LA_LD_FLAGS)         \
+       $(audio_oss_la_swig_ldflags)
+
+_audio_oss_la_CXXFLAGS =                       \
+       $(STD_SWIG_CXX_FLAGS)           \
+       $(audio_oss_la_swig_cxxflags)
+
+audio_oss_python_PYTHON =                      \
+       audio_oss.py                    \
+       $(audio_oss_python)
+
+## Entry rule for running SWIG
+
+audio_oss.h audio_oss.py audio_oss.cc: audio_oss.i
+## This rule will get called only when MAKE decides that one of the
+## targets needs to be created or re-created, because:
+##
+## * The .i file is newer than any or all of the generated files;
+##
+## * Any or all of the .cc, .h, or .py files does not exist and is
+##   needed (in the case this file is not needed, the rule for it is
+##   ignored); or
+##
+## * Some SWIG-based dependecy of the .cc file isn't met and hence the
+##   .cc file needs be be regenerated.  Explanation: Because MAKE
+##   knows how to handle dependencies for .cc files (regardless of
+##   their name or extension), then the .cc file is used as a target
+##   instead of the .i file -- but with the dependencies of the .i
+##   file.  It is this last reason why the line:
+##
+##             if test -f $@; then :; else
+##
+##   cannot be used in this case: If a .i file dependecy is not met,
+##   then the .cc file needs to be rebuilt.  But if the stamp is newer
+##   than the .cc file, and the .cc file exists, then in the original
+##   version (with the 'test' above) the internal MAKE call will not
+##   be issued and hence the .cc file will not be rebuilt.
+##
+## Once execution gets to here, it should always proceed no matter the
+## state of a stamp (as discussed in link above).  The
+## $(DEPDIR)/audio_oss-generate stuff is used to allow for parallel
+## builds to "do the right thing".  The stamp has no relationship with
+## either the target files or dependency file; it is used solely for
+## the protection of multiple builds during a given call to MAKE.
+##
+## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM
+## (15).  At a caught signal, the quoted command will be issued before
+## exiting.  In this case, remove any stamp, whether temporary of not.
+## The trap is valid until the process exits; the process includes all
+## commands appended via "\"s.
+##
+       trap 'rm -rf $(DEPDIR)/audio_oss-generate-*' 1 2 13 15; \
+##
+## Create a temporary directory, which acts as a lock.  The first
+## process to create the directory will succeed and issue the MAKE
+## command to do the actual work, while all subsequent processes will
+## fail -- leading them to wait for the first process to finish.
+##
+       if mkdir $(DEPDIR)/audio_oss-generate-lock 2>/dev/null; then \
+##
+## This code is being executed by the first process to succeed in
+## creating the directory lock.
+##
+## Remove the stamp associated with this filename.
+##
+               rm -f $(DEPDIR)/audio_oss-generate-stamp; \
+##
+## Tell MAKE to run the rule for creating this stamp.
+##
+               $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/audio_oss-generate-stamp WHAT=$<; \
+##
+## Now that the .cc, .h, and .py files have been (re)created from the
+## .i file, future checking of this rule during the same MAKE
+## execution will come back that the rule doesn't need to be executed
+## because none of the conditions mentioned at the start of this rule
+## will be positive.  Remove the the directory lock, which frees up
+## any waiting process(es) to continue.
+##
+               rmdir $(DEPDIR)/audio_oss-generate-lock; \
+       else \
+##
+## This code is being executed by any follower processes while the
+## directory lock is in place.
+##
+## Wait until the first process is done, testing once per second.
+##
+               while test -d $(DEPDIR)/audio_oss-generate-lock; do \
+                       sleep 1; \
+               done; \
+##
+## Succeed if and only if the first process succeeded; exit this
+## process returning the status of the generated stamp.
+##
+               test -f $(DEPDIR)/audio_oss-generate-stamp; \
+               exit $$?; \
+       fi;
+
+$(DEPDIR)/audio_oss-generate-stamp:
+## This rule will be called only by the first process issuing the
+## above rule to succeed in creating the lock directory, after
+## removing the actual stamp file in order to guarantee that MAKE will
+## execute this rule.
+##
+## Call SWIG to generate the various output files; special
+## post-processing on 'mingw32' host OS for the dependency file.
+##
+       if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(audio_oss_swig_args) \
+               -MD -MF $(DEPDIR)/audio_oss.Std \
+               -module audio_oss -o audio_oss.cc $(WHAT); then \
+           if test $(host_os) = mingw32; then \
+               $(RM) $(DEPDIR)/audio_oss.Sd; \
+               $(SED) 's,\\\\,/,g' < $(DEPDIR)/audio_oss.Std \
+                       > $(DEPDIR)/audio_oss.Sd; \
+               $(RM) $(DEPDIR)/audio_oss.Std; \
+               $(MV) $(DEPDIR)/audio_oss.Sd $(DEPDIR)/audio_oss.Std; \
+           fi; \
+       else \
+           $(RM) $(DEPDIR)/audio_oss.S*; exit 1; \
+       fi;
+##
+## Mess with the SWIG output .Std dependency file, to create a
+## dependecy file valid for the input .i file: Basically, simulate the
+## dependency file created for libraries by GNU's libtool for C++,
+## where all of the dependencies for the target are first listed, then
+## each individual dependency is listed as a target with no further
+## dependencies.
+##
+## (1) remove the current dependency file
+##
+       $(RM) $(DEPDIR)/audio_oss.d
+##
+## (2) Copy the whole SWIG file:
+##
+       cp $(DEPDIR)/audio_oss.Std $(DEPDIR)/audio_oss.d
+##
+## (3) all a carriage return to the end of the dependency file.
+##
+       echo "" >> $(DEPDIR)/audio_oss.d
+##
+## (4) from the SWIG file, remove the first line (the target); remove
+##     trailing " \" and " " from each line.  Append ":" to each line,
+##     followed by 2 carriage returns, then append this to the end of
+##     the dependency file.
+##
+       $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/audio_oss.Std | \
+               awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/audio_oss.d
+##
+## (5) remove the SWIG-generated file
+##
+       $(RM) $(DEPDIR)/audio_oss.Std
+##
+## Create the stamp for this filename generation, to signal success in
+## executing this rule; allows other threads waiting on this process
+## to continue.
+##
+       touch $(DEPDIR)/audio_oss-generate-stamp
+
+# KLUDGE: Force runtime include of a SWIG 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@./$(DEPDIR)/audio_oss.d@am__quote@
+
index e70c9a41df6791158cb9d7606e036c344e08f468..a4e690963ad63a433d023e18798ca42f64acb90d 100644 (file)
 
 include $(top_srcdir)/Makefile.common
 
-# Install this stuff so that it ends up as the gnuradio.audio_osx module
-# This usually ends up at:
-#   ${prefix}/lib/python${python_version}/site-packages/gnuradio
-
-ourpythondir = $(grpythondir)
-ourlibdir    = $(grpyexecdir)
-
 EXTRA_DIST = run_tests.in
-TESTS = run_tests
 
-LOCAL_IFILES =                                 \
-       $(srcdir)/audio_osx.i                           
-
-NON_LOCAL_IFILES =                     \
-       $(GNURADIO_I)
-
-ALL_IFILES =                           \
-       $(LOCAL_IFILES)                 \
-       $(NON_LOCAL_IFILES)             
-
-BUILT_SOURCES =                        \
-       audio_osx.cc                    \
-       audio_osx.py                            
+TESTS = run_tests
 
-ourpython_PYTHON =                     \
-       audio_osx.py
+DISTCLEANFILES = run_tests
 
 AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES)
 
-ourlib_LTLIBRARIES = _audio_osx.la
-
-_audio_osx_la_SOURCES =                \
-       audio_osx.cc                    \
-       audio_osx_sink.cc               \
-       audio_osx_source.cc                     
+# C/C++ headers get installed in ${prefix}/include/gnuradio
+grinclude_HEADERS =                    \
+       audio_osx_sink.h                \
+       audio_osx_source.h
 
 noinst_HEADERS =                       \
        audio_osx.h                     \
        circular_buffer.h               \
        mld_threads.h
 
-grinclude_HEADERS =                    \
-       audio_osx_sink.h                \
-       audio_osx_source.h                      
+noinst_PYTHON =                                \
+       qa_osx.py                       \
+       test_audio_loop.py
 
-swiginclude_HEADERS =                  \
-       $(LOCAL_IFILES)
+###################################
+# SWIG Python interface and library
 
-_audio_osx_la_LIBADD =                         \
-       $(PYTHON_LDFLAGS)               \
-       $(GNURADIO_CORE_LA)             \
-       -lstdc++                                
+TOP_SWIG_IFILES =                      \
+       audio_osx.i
 
-_audio_osx_la_LDFLAGS = $(NO_UNDEFINED) -module -avoid-version -framework AudioUnit -framework CoreAudio -framework AudioToolbox
+# Install so that they end up available as:
+#   import gnuradio.audio_osx
+# This ends up at:
+#   ${prefix}/lib/python${python_version}/site-packages/gnuradio
+audio_osx_pythondir_category =         \
+       gnuradio
 
-_audio_osx_la_CXXFLAGS = @swig_CXXFLAGS@
+# additional sources for the SWIG-generated library
+audio_osx_la_swig_sources =            \
+       audio_osx_sink.cc               \
+       audio_osx_source.cc
 
-audio_osx.cc audio_osx.py: $(ALL_IFILES)
-       $(SWIG) $(STD_SWIG_PYTHON_ARGS) -module audio_osx \
-               -o audio_osx.cc $(LOCAL_IFILES)
+# additional libraries for linking with the SWIG-generated library
+audio_osx_la_swig_libadd =             \
+       $(GNURADIO_CORE_LA)
 
-noinst_PYTHON = qa_osx.py test_audio_loop.py
+# additional LD flags for linking the SWIG-generated library
+audio_osx_la_swig_ldflags =            \
+       -framework AudioUnit            \
+       -framework CoreAudio            \
+       -framework AudioToolbox
 
-MOSTLYCLEANFILES = $(BUILT_SOURCES) *~ *.pyc run_tests *.loT
+include $(top_srcdir)/Makefile.swig
 
-CONFIG_CLEAN_FILES = run_tests *.loT
+# add some of the variables generated inside the Makefile.swig.gen
+BUILT_SOURCES = $(swig_built_sources)
 
-# 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
+# Do not distribute the output of SWIG
+no_dist_files = $(swig_built_sources)
diff --git a/gr-audio-osx/src/Makefile.swig.gen b/gr-audio-osx/src/Makefile.swig.gen
new file mode 100644 (file)
index 0000000..b4fd713
--- /dev/null
@@ -0,0 +1,259 @@
+# -*- Makefile -*-
+#
+# Copyright 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.
+# 
+
+# Makefile.swig.gen for audio_osx.i
+
+## Default install locations for these files:
+##
+## Default location for the Python directory is:
+##  ${prefix}/lib/python${python_version}/site-packages/[category]/audio_osx
+## Default location for the Python exec directory is:
+##  ${exec_prefix}/lib/python${python_version}/site-packages/[category]/audio_osx
+##
+## The following can be overloaded to change the install location, but
+## this has to be done in the including Makefile.am -before-
+## Makefile.swig is included.
+
+audio_osx_pythondir_category ?= gnuradio/audio_osx
+audio_osx_pylibdir_category ?= $(audio_osx_pythondir_category)
+audio_osx_pythondir = $(pythondir)/$(audio_osx_pythondir_category)
+audio_osx_pylibdir = $(pyexecdir)/$(audio_osx_pylibdir_category)
+
+## SWIG headers are always installed into the same directory.
+
+audio_osx_swigincludedir = $(swigincludedir)
+
+## This is a template file for a "generated" Makefile addition (in
+## this case, "Makefile.swig.gen").  By including the top-level
+## Makefile.swig, this file will be used to generate the SWIG
+## dependencies.  Assign the variable TOP_SWIG_FILES to be the list of
+## SWIG .i files to generated wrappings for; there can be more than 1
+## so long as the names are unique (no sorting is done on the
+## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i
+## file will generate .cc, .py, and possibly .h files -- meaning that
+## all of these files will have the same base name (that provided for
+## the SWIG .i file).
+##
+## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the
+## right thing.  For more info, see <
+## http://sources.redhat.com/automake/automake.html#Multiple-Outputs >
+
+## Stamps used to ensure parallel make does the right thing.  These
+## are removed by "make clean", but otherwise unused except during the
+## parallel built.  These will not be included in a tarball, because
+## the SWIG-generated files will be removed from the distribution.
+
+STAMPS += $(DEPDIR)/audio_osx-generate-*
+
+## Other cleaned files: dependency files generated by SWIG or this Makefile
+
+MOSTLYCLEANFILES += $(DEPDIR)/*.S*
+
+## Add the .py and .cc files to the list of SWIG built sources.  The
+## .h file is sometimes built, but not always ... so that one has to
+## be added manually by the including Makefile.am .
+
+swig_built_sources += audio_osx.py audio_osx.cc
+
+## Various SWIG variables.  These can be overloaded in the including
+## Makefile.am by setting the variable value there, then including
+## Makefile.swig .
+
+audio_osx_swiginclude_HEADERS =                \
+       audio_osx.i                     \
+       $(audio_osx_swiginclude_headers)
+
+audio_osx_pylib_LTLIBRARIES =          \
+       _audio_osx.la
+
+_audio_osx_la_SOURCES =                        \
+       audio_osx.cc                    \
+       $(audio_osx_la_swig_sources)
+
+_audio_osx_la_LIBADD =                 \
+       $(STD_SWIG_LA_LIB_ADD)          \
+       $(audio_osx_la_swig_libadd)
+
+_audio_osx_la_LDFLAGS =                        \
+       $(STD_SWIG_LA_LD_FLAGS)         \
+       $(audio_osx_la_swig_ldflags)
+
+_audio_osx_la_CXXFLAGS =                       \
+       $(STD_SWIG_CXX_FLAGS)           \
+       $(audio_osx_la_swig_cxxflags)
+
+audio_osx_python_PYTHON =                      \
+       audio_osx.py                    \
+       $(audio_osx_python)
+
+## Entry rule for running SWIG
+
+audio_osx.h audio_osx.py audio_osx.cc: audio_osx.i
+## This rule will get called only when MAKE decides that one of the
+## targets needs to be created or re-created, because:
+##
+## * The .i file is newer than any or all of the generated files;
+##
+## * Any or all of the .cc, .h, or .py files does not exist and is
+##   needed (in the case this file is not needed, the rule for it is
+##   ignored); or
+##
+## * Some SWIG-based dependecy of the .cc file isn't met and hence the
+##   .cc file needs be be regenerated.  Explanation: Because MAKE
+##   knows how to handle dependencies for .cc files (regardless of
+##   their name or extension), then the .cc file is used as a target
+##   instead of the .i file -- but with the dependencies of the .i
+##   file.  It is this last reason why the line:
+##
+##             if test -f $@; then :; else
+##
+##   cannot be used in this case: If a .i file dependecy is not met,
+##   then the .cc file needs to be rebuilt.  But if the stamp is newer
+##   than the .cc file, and the .cc file exists, then in the original
+##   version (with the 'test' above) the internal MAKE call will not
+##   be issued and hence the .cc file will not be rebuilt.
+##
+## Once execution gets to here, it should always proceed no matter the
+## state of a stamp (as discussed in link above).  The
+## $(DEPDIR)/audio_osx-generate stuff is used to allow for parallel
+## builds to "do the right thing".  The stamp has no relationship with
+## either the target files or dependency file; it is used solely for
+## the protection of multiple builds during a given call to MAKE.
+##
+## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM
+## (15).  At a caught signal, the quoted command will be issued before
+## exiting.  In this case, remove any stamp, whether temporary of not.
+## The trap is valid until the process exits; the process includes all
+## commands appended via "\"s.
+##
+       trap 'rm -rf $(DEPDIR)/audio_osx-generate-*' 1 2 13 15; \
+##
+## Create a temporary directory, which acts as a lock.  The first
+## process to create the directory will succeed and issue the MAKE
+## command to do the actual work, while all subsequent processes will
+## fail -- leading them to wait for the first process to finish.
+##
+       if mkdir $(DEPDIR)/audio_osx-generate-lock 2>/dev/null; then \
+##
+## This code is being executed by the first process to succeed in
+## creating the directory lock.
+##
+## Remove the stamp associated with this filename.
+##
+               rm -f $(DEPDIR)/audio_osx-generate-stamp; \
+##
+## Tell MAKE to run the rule for creating this stamp.
+##
+               $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/audio_osx-generate-stamp WHAT=$<; \
+##
+## Now that the .cc, .h, and .py files have been (re)created from the
+## .i file, future checking of this rule during the same MAKE
+## execution will come back that the rule doesn't need to be executed
+## because none of the conditions mentioned at the start of this rule
+## will be positive.  Remove the the directory lock, which frees up
+## any waiting process(es) to continue.
+##
+               rmdir $(DEPDIR)/audio_osx-generate-lock; \
+       else \
+##
+## This code is being executed by any follower processes while the
+## directory lock is in place.
+##
+## Wait until the first process is done, testing once per second.
+##
+               while test -d $(DEPDIR)/audio_osx-generate-lock; do \
+                       sleep 1; \
+               done; \
+##
+## Succeed if and only if the first process succeeded; exit this
+## process returning the status of the generated stamp.
+##
+               test -f $(DEPDIR)/audio_osx-generate-stamp; \
+               exit $$?; \
+       fi;
+
+$(DEPDIR)/audio_osx-generate-stamp:
+## This rule will be called only by the first process issuing the
+## above rule to succeed in creating the lock directory, after
+## removing the actual stamp file in order to guarantee that MAKE will
+## execute this rule.
+##
+## Call SWIG to generate the various output files; special
+## post-processing on 'mingw32' host OS for the dependency file.
+##
+       if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(audio_osx_swig_args) \
+               -MD -MF $(DEPDIR)/audio_osx.Std \
+               -module audio_osx -o audio_osx.cc $(WHAT); then \
+           if test $(host_os) = mingw32; then \
+               $(RM) $(DEPDIR)/audio_osx.Sd; \
+               $(SED) 's,\\\\,/,g' < $(DEPDIR)/audio_osx.Std \
+                       > $(DEPDIR)/audio_osx.Sd; \
+               $(RM) $(DEPDIR)/audio_osx.Std; \
+               $(MV) $(DEPDIR)/audio_osx.Sd $(DEPDIR)/audio_osx.Std; \
+           fi; \
+       else \
+           $(RM) $(DEPDIR)/audio_osx.S*; exit 1; \
+       fi;
+##
+## Mess with the SWIG output .Std dependency file, to create a
+## dependecy file valid for the input .i file: Basically, simulate the
+## dependency file created for libraries by GNU's libtool for C++,
+## where all of the dependencies for the target are first listed, then
+## each individual dependency is listed as a target with no further
+## dependencies.
+##
+## (1) remove the current dependency file
+##
+       $(RM) $(DEPDIR)/audio_osx.d
+##
+## (2) Copy the whole SWIG file:
+##
+       cp $(DEPDIR)/audio_osx.Std $(DEPDIR)/audio_osx.d
+##
+## (3) all a carriage return to the end of the dependency file.
+##
+       echo "" >> $(DEPDIR)/audio_osx.d
+##
+## (4) from the SWIG file, remove the first line (the target); remove
+##     trailing " \" and " " from each line.  Append ":" to each line,
+##     followed by 2 carriage returns, then append this to the end of
+##     the dependency file.
+##
+       $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/audio_osx.Std | \
+               awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/audio_osx.d
+##
+## (5) remove the SWIG-generated file
+##
+       $(RM) $(DEPDIR)/audio_osx.Std
+##
+## Create the stamp for this filename generation, to signal success in
+## executing this rule; allows other threads waiting on this process
+## to continue.
+##
+       touch $(DEPDIR)/audio_osx-generate-stamp
+
+# KLUDGE: Force runtime include of a SWIG 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@./$(DEPDIR)/audio_osx.d@am__quote@
+
index 314ed72a8cc28a7dec54baef74eb734ae7d63bac..4b44807d8363c420bbd69236591cff36433723d6 100644 (file)
 
 include $(top_srcdir)/Makefile.common
 
-# Install this stuff so that it ends up as the gnuradio.audio_portaudio module
-# This usually ends up at:
-#   ${prefix}/lib/python${python_version}/site-packages/gnuradio
-
-ourpythondir = $(grpythondir)
-ourlibdir    = $(grpyexecdir)
-
 EXTRA_DIST = run_tests.in
 
 TESTS = run_tests
 
-LOCAL_IFILES =                                 \
-       $(srcdir)/audio_portaudio.i
-
-NON_LOCAL_IFILES =                     \
-       $(GNURADIO_I)
-
-ALL_IFILES =                           \
-       $(LOCAL_IFILES)                 \
-       $(NON_LOCAL_IFILES)             
-
-BUILT_SOURCES =                        \
-       audio_portaudio.cc              \
-       audio_portaudio.py                              
-
-ourpython_PYTHON =                     \
-       audio_portaudio.py
+DISTCLEANFILES = run_tests
 
 AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) \
        $(PORTAUDIO_CFLAGS) $(WITH_INCLUDES)
 
-ourlib_LTLIBRARIES = _audio_portaudio.la
-
-_audio_portaudio_la_SOURCES =          \
-       audio_portaudio.cc              \
-       audio_portaudio_sink.cc         \
-       audio_portaudio_source.cc       \
-       gri_portaudio.cc                        
-
+# C/C++ headers get installed in ${prefix}/include/gnuradio
 grinclude_HEADERS =                    \
        audio_portaudio_sink.h          \
        audio_portaudio_source.h                
@@ -67,30 +38,37 @@ grinclude_HEADERS =                 \
 noinst_HEADERS =                       \
        gri_portaudio.h
 
-swiginclude_HEADERS =                  \
-       $(LOCAL_IFILES)
+noinst_PYTHON =                        \
+       qa_portaudio.py
 
-_audio_portaudio_la_LIBADD =           \
-       $(PYTHON_LDFLAGS)               \
-       $(GNURADIO_CORE_LA)             \
-       $(PORTAUDIO_LIBS)               \
-       -lstdc++
+###################################
+# SWIG Python interface and library
 
-_audio_portaudio_la_LDFLAGS = $(NO_UNDEFINED) -module -avoid-version
+TOP_SWIG_IFILES =                      \
+       audio_portaudio.i
+
+# Install so that they end up available as:
+#   import gnuradio.audio_portaudio
+# This ends up at:
+#   ${prefix}/lib/python${python_version}/site-packages/gnuradio
+audio_portaudio_pythondir_category =   \
+       gnuradio
 
-_audio_portaudio_la_CXXFLAGS = @swig_CXXFLAGS@
+# additional sources for the SWIG-generated library
+audio_portaudio_la_swig_sources =      \
+       audio_portaudio_sink.cc         \
+       audio_portaudio_source.cc       \
+       gri_portaudio.cc
 
-audio_portaudio.cc audio_portaudio.py: $(ALL_IFILES) audio_portaudio_sink.h audio_portaudio_source.h
-       $(SWIG) $(STD_SWIG_PYTHON_ARGS) -module audio_portaudio \
-               -o audio_portaudio.cc $(LOCAL_IFILES)
+# additional libraries for linking with the SWIG-generated library
+audio_portaudio_la_swig_libadd =       \
+       $(GNURADIO_CORE_LA)             \
+       $(PORTAUDIO_LIBS)
 
-noinst_PYTHON =                        \
-       qa_portaudio.py
+include $(top_srcdir)/Makefile.swig
 
-MOSTLYCLEANFILES = \
-       $(BUILT_SOURCES) *~ *.pyc
+# add some of the variables generated inside the Makefile.swig.gen
+BUILT_SOURCES = $(swig_built_sources)
 
-# 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
+# Do not distribute the output of SWIG
+no_dist_files = $(swig_built_sources)
diff --git a/gr-audio-portaudio/src/Makefile.swig.gen b/gr-audio-portaudio/src/Makefile.swig.gen
new file mode 100644 (file)
index 0000000..368f2e3
--- /dev/null
@@ -0,0 +1,259 @@
+# -*- Makefile -*-
+#
+# Copyright 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.
+# 
+
+# Makefile.swig.gen for audio_portaudio.i
+
+## Default install locations for these files:
+##
+## Default location for the Python directory is:
+##  ${prefix}/lib/python${python_version}/site-packages/[category]/audio_portaudio
+## Default location for the Python exec directory is:
+##  ${exec_prefix}/lib/python${python_version}/site-packages/[category]/audio_portaudio
+##
+## The following can be overloaded to change the install location, but
+## this has to be done in the including Makefile.am -before-
+## Makefile.swig is included.
+
+audio_portaudio_pythondir_category ?= gnuradio/audio_portaudio
+audio_portaudio_pylibdir_category ?= $(audio_portaudio_pythondir_category)
+audio_portaudio_pythondir = $(pythondir)/$(audio_portaudio_pythondir_category)
+audio_portaudio_pylibdir = $(pyexecdir)/$(audio_portaudio_pylibdir_category)
+
+## SWIG headers are always installed into the same directory.
+
+audio_portaudio_swigincludedir = $(swigincludedir)
+
+## This is a template file for a "generated" Makefile addition (in
+## this case, "Makefile.swig.gen").  By including the top-level
+## Makefile.swig, this file will be used to generate the SWIG
+## dependencies.  Assign the variable TOP_SWIG_FILES to be the list of
+## SWIG .i files to generated wrappings for; there can be more than 1
+## so long as the names are unique (no sorting is done on the
+## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i
+## file will generate .cc, .py, and possibly .h files -- meaning that
+## all of these files will have the same base name (that provided for
+## the SWIG .i file).
+##
+## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the
+## right thing.  For more info, see <
+## http://sources.redhat.com/automake/automake.html#Multiple-Outputs >
+
+## Stamps used to ensure parallel make does the right thing.  These
+## are removed by "make clean", but otherwise unused except during the
+## parallel built.  These will not be included in a tarball, because
+## the SWIG-generated files will be removed from the distribution.
+
+STAMPS += $(DEPDIR)/audio_portaudio-generate-*
+
+## Other cleaned files: dependency files generated by SWIG or this Makefile
+
+MOSTLYCLEANFILES += $(DEPDIR)/*.S*
+
+## Add the .py and .cc files to the list of SWIG built sources.  The
+## .h file is sometimes built, but not always ... so that one has to
+## be added manually by the including Makefile.am .
+
+swig_built_sources += audio_portaudio.py audio_portaudio.cc
+
+## Various SWIG variables.  These can be overloaded in the including
+## Makefile.am by setting the variable value there, then including
+## Makefile.swig .
+
+audio_portaudio_swiginclude_HEADERS =          \
+       audio_portaudio.i                       \
+       $(audio_portaudio_swiginclude_headers)
+
+audio_portaudio_pylib_LTLIBRARIES =            \
+       _audio_portaudio.la
+
+_audio_portaudio_la_SOURCES =                  \
+       audio_portaudio.cc                      \
+       $(audio_portaudio_la_swig_sources)
+
+_audio_portaudio_la_LIBADD =                   \
+       $(STD_SWIG_LA_LIB_ADD)          \
+       $(audio_portaudio_la_swig_libadd)
+
+_audio_portaudio_la_LDFLAGS =                  \
+       $(STD_SWIG_LA_LD_FLAGS)         \
+       $(audio_portaudio_la_swig_ldflags)
+
+_audio_portaudio_la_CXXFLAGS =                 \
+       $(STD_SWIG_CXX_FLAGS)           \
+       $(audio_portaudio_la_swig_cxxflags)
+
+audio_portaudio_python_PYTHON =                        \
+       audio_portaudio.py                      \
+       $(audio_portaudio_python)
+
+## Entry rule for running SWIG
+
+audio_portaudio.h audio_portaudio.py audio_portaudio.cc: audio_portaudio.i
+## This rule will get called only when MAKE decides that one of the
+## targets needs to be created or re-created, because:
+##
+## * The .i file is newer than any or all of the generated files;
+##
+## * Any or all of the .cc, .h, or .py files does not exist and is
+##   needed (in the case this file is not needed, the rule for it is
+##   ignored); or
+##
+## * Some SWIG-based dependecy of the .cc file isn't met and hence the
+##   .cc file needs be be regenerated.  Explanation: Because MAKE
+##   knows how to handle dependencies for .cc files (regardless of
+##   their name or extension), then the .cc file is used as a target
+##   instead of the .i file -- but with the dependencies of the .i
+##   file.  It is this last reason why the line:
+##
+##             if test -f $@; then :; else
+##
+##   cannot be used in this case: If a .i file dependecy is not met,
+##   then the .cc file needs to be rebuilt.  But if the stamp is newer
+##   than the .cc file, and the .cc file exists, then in the original
+##   version (with the 'test' above) the internal MAKE call will not
+##   be issued and hence the .cc file will not be rebuilt.
+##
+## Once execution gets to here, it should always proceed no matter the
+## state of a stamp (as discussed in link above).  The
+## $(DEPDIR)/audio_portaudio-generate stuff is used to allow for parallel
+## builds to "do the right thing".  The stamp has no relationship with
+## either the target files or dependency file; it is used solely for
+## the protection of multiple builds during a given call to MAKE.
+##
+## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM
+## (15).  At a caught signal, the quoted command will be issued before
+## exiting.  In this case, remove any stamp, whether temporary of not.
+## The trap is valid until the process exits; the process includes all
+## commands appended via "\"s.
+##
+       trap 'rm -rf $(DEPDIR)/audio_portaudio-generate-*' 1 2 13 15; \
+##
+## Create a temporary directory, which acts as a lock.  The first
+## process to create the directory will succeed and issue the MAKE
+## command to do the actual work, while all subsequent processes will
+## fail -- leading them to wait for the first process to finish.
+##
+       if mkdir $(DEPDIR)/audio_portaudio-generate-lock 2>/dev/null; then \
+##
+## This code is being executed by the first process to succeed in
+## creating the directory lock.
+##
+## Remove the stamp associated with this filename.
+##
+               rm -f $(DEPDIR)/audio_portaudio-generate-stamp; \
+##
+## Tell MAKE to run the rule for creating this stamp.
+##
+               $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/audio_portaudio-generate-stamp WHAT=$<; \
+##
+## Now that the .cc, .h, and .py files have been (re)created from the
+## .i file, future checking of this rule during the same MAKE
+## execution will come back that the rule doesn't need to be executed
+## because none of the conditions mentioned at the start of this rule
+## will be positive.  Remove the the directory lock, which frees up
+## any waiting process(es) to continue.
+##
+               rmdir $(DEPDIR)/audio_portaudio-generate-lock; \
+       else \
+##
+## This code is being executed by any follower processes while the
+## directory lock is in place.
+##
+## Wait until the first process is done, testing once per second.
+##
+               while test -d $(DEPDIR)/audio_portaudio-generate-lock; do \
+                       sleep 1; \
+               done; \
+##
+## Succeed if and only if the first process succeeded; exit this
+## process returning the status of the generated stamp.
+##
+               test -f $(DEPDIR)/audio_portaudio-generate-stamp; \
+               exit $$?; \
+       fi;
+
+$(DEPDIR)/audio_portaudio-generate-stamp:
+## This rule will be called only by the first process issuing the
+## above rule to succeed in creating the lock directory, after
+## removing the actual stamp file in order to guarantee that MAKE will
+## execute this rule.
+##
+## Call SWIG to generate the various output files; special
+## post-processing on 'mingw32' host OS for the dependency file.
+##
+       if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(audio_portaudio_swig_args) \
+               -MD -MF $(DEPDIR)/audio_portaudio.Std \
+               -module audio_portaudio -o audio_portaudio.cc $(WHAT); then \
+           if test $(host_os) = mingw32; then \
+               $(RM) $(DEPDIR)/audio_portaudio.Sd; \
+               $(SED) 's,\\\\,/,g' < $(DEPDIR)/audio_portaudio.Std \
+                       > $(DEPDIR)/audio_portaudio.Sd; \
+               $(RM) $(DEPDIR)/audio_portaudio.Std; \
+               $(MV) $(DEPDIR)/audio_portaudio.Sd $(DEPDIR)/audio_portaudio.Std; \
+           fi; \
+       else \
+           $(RM) $(DEPDIR)/audio_portaudio.S*; exit 1; \
+       fi;
+##
+## Mess with the SWIG output .Std dependency file, to create a
+## dependecy file valid for the input .i file: Basically, simulate the
+## dependency file created for libraries by GNU's libtool for C++,
+## where all of the dependencies for the target are first listed, then
+## each individual dependency is listed as a target with no further
+## dependencies.
+##
+## (1) remove the current dependency file
+##
+       $(RM) $(DEPDIR)/audio_portaudio.d
+##
+## (2) Copy the whole SWIG file:
+##
+       cp $(DEPDIR)/audio_portaudio.Std $(DEPDIR)/audio_portaudio.d
+##
+## (3) all a carriage return to the end of the dependency file.
+##
+       echo "" >> $(DEPDIR)/audio_portaudio.d
+##
+## (4) from the SWIG file, remove the first line (the target); remove
+##     trailing " \" and " " from each line.  Append ":" to each line,
+##     followed by 2 carriage returns, then append this to the end of
+##     the dependency file.
+##
+       $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/audio_portaudio.Std | \
+               awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/audio_portaudio.d
+##
+## (5) remove the SWIG-generated file
+##
+       $(RM) $(DEPDIR)/audio_portaudio.Std
+##
+## Create the stamp for this filename generation, to signal success in
+## executing this rule; allows other threads waiting on this process
+## to continue.
+##
+       touch $(DEPDIR)/audio_portaudio-generate-stamp
+
+# KLUDGE: Force runtime include of a SWIG 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@./$(DEPDIR)/audio_portaudio.d@am__quote@
+
index 8618dd54999c00d70acc30430888b82e7e67146d..1a8ededa609dc3dfff6e0b00b13f28a5c77347ed 100644 (file)
 
 include $(top_srcdir)/Makefile.common
 
-# Install this stuff so that it ends up as the gnuradio.audio_windows module
-# This usually ends up at:
-#   ${prefix}/lib/python${python_version}/site-packages/gnuradio
-
-ourpythondir = $(grpythondir)
-ourlibdir    = $(grpyexecdir)
-
 EXTRA_DIST = run_tests.in
-TESTS = run_tests
-
-LOCAL_IFILES =                                 \
-       $(srcdir)/audio_windows.i                               
 
-NON_LOCAL_IFILES =                     \
-       $(GNURADIO_I)
-
-ALL_IFILES =                           \
-       $(LOCAL_IFILES)                 \
-       $(NON_LOCAL_IFILES)             
+TESTS = run_tests
 
-BUILT_SOURCES =                        \
-       audio_windows.cc                        \
-       audio_windows.py                                
+DISTCLEANFILES = run_tests
 
-ourpython_PYTHON =                     \
-       audio_windows.py
+noinst_PYTHON = qa_audio_windows.py
 
 AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES)
 
-ourlib_LTLIBRARIES = _audio_windows.la
-
-_audio_windows_la_SOURCES =            \
-       audio_windows.cc                        \
-       audio_windows_sink.cc           \
-       audio_windows_source.cc                 
-
-
+# C/C++ headers get installed in ${prefix}/include/gnuradio
 grinclude_HEADERS =                    \
        audio_windows_sink.h            \
-       audio_windows_source.h                  
+       audio_windows_source.h
 
-swiginclude_HEADERS =                  \
-       $(LOCAL_IFILES)
+###################################
+# SWIG Python interface and library
 
-_audio_windows_la_LIBADD =             \
-       $(PYTHON_LDFLAGS)               \
-       $(GNURADIO_CORE_LA)             \
-       $(WINAUDIO_LIBS)                \
-       -lstdc++                                
+TOP_SWIG_IFILES =                      \
+       audio_windows.i
 
-_audio_windows_la_LDFLAGS = -no-undefined -module -avoid-version \
-                            $(LIBGNURADIO_CORE_EXTRA_LDFLAGS)
+# Install so that they end up available as:
+#   import gnuradio.audio_windows
+# This ends up at:
+#   ${prefix}/lib/python${python_version}/site-packages/gnuradio
+audio_windows_pythondir_category =     \
+       gnuradio
 
-_audio_windows_la_CXXFLAGS = @swig_CXXFLAGS@
+# additional sources for the SWIG-generated library
+audio_windows_la_swig_sources =        \
+       audio_windows_sink.cc           \
+       audio_windows_source.cc         
+
+# additional libraries for linking with the SWIG-generated library
+audio_windows_la_swig_libadd =         \
+       $(GNURADIO_CORE_LA)             \
+       $(WINAUDIO_LIBS)
 
-audio_windows.cc audio_windows.py: $(ALL_IFILES)
-       $(SWIG) $(STD_SWIG_PYTHON_ARGS) -module audio_windows \
-               -o audio_windows.cc $(LOCAL_IFILES)
+# additional LD flags for linking the SWIG-generated library
+audio_windows_la_swig_ldflags =                \
+       $(LIBGNURADIO_CORE_EXTRA_LDFLAGS)
 
-noinst_PYTHON = qa_audio_windows.py
+include $(top_srcdir)/Makefile.swig
 
-MOSTLYCLEANFILES = \
-       $(BUILT_SOURCES) *~ *.pyc
+# add some of the variables generated inside the Makefile.swig.gen
+BUILT_SOURCES = $(swig_built_sources)
 
-# 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
+# Do not distribute the output of SWIG
+no_dist_files = $(swig_built_sources)
diff --git a/gr-audio-windows/src/Makefile.swig.gen b/gr-audio-windows/src/Makefile.swig.gen
new file mode 100644 (file)
index 0000000..61215b8
--- /dev/null
@@ -0,0 +1,259 @@
+# -*- Makefile -*-
+#
+# Copyright 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.
+# 
+
+# Makefile.swig.gen for audio_windows.i
+
+## Default install locations for these files:
+##
+## Default location for the Python directory is:
+##  ${prefix}/lib/python${python_version}/site-packages/[category]/audio_windows
+## Default location for the Python exec directory is:
+##  ${exec_prefix}/lib/python${python_version}/site-packages/[category]/audio_windows
+##
+## The following can be overloaded to change the install location, but
+## this has to be done in the including Makefile.am -before-
+## Makefile.swig is included.
+
+audio_windows_pythondir_category ?= gnuradio/audio_windows
+audio_windows_pylibdir_category ?= $(audio_windows_pythondir_category)
+audio_windows_pythondir = $(pythondir)/$(audio_windows_pythondir_category)
+audio_windows_pylibdir = $(pyexecdir)/$(audio_windows_pylibdir_category)
+
+## SWIG headers are always installed into the same directory.
+
+audio_windows_swigincludedir = $(swigincludedir)
+
+## This is a template file for a "generated" Makefile addition (in
+## this case, "Makefile.swig.gen").  By including the top-level
+## Makefile.swig, this file will be used to generate the SWIG
+## dependencies.  Assign the variable TOP_SWIG_FILES to be the list of
+## SWIG .i files to generated wrappings for; there can be more than 1
+## so long as the names are unique (no sorting is done on the
+## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i
+## file will generate .cc, .py, and possibly .h files -- meaning that
+## all of these files will have the same base name (that provided for
+## the SWIG .i file).
+##
+## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the
+## right thing.  For more info, see <
+## http://sources.redhat.com/automake/automake.html#Multiple-Outputs >
+
+## Stamps used to ensure parallel make does the right thing.  These
+## are removed by "make clean", but otherwise unused except during the
+## parallel built.  These will not be included in a tarball, because
+## the SWIG-generated files will be removed from the distribution.
+
+STAMPS += $(DEPDIR)/audio_windows-generate-*
+
+## Other cleaned files: dependency files generated by SWIG or this Makefile
+
+MOSTLYCLEANFILES += $(DEPDIR)/*.S*
+
+## Add the .py and .cc files to the list of SWIG built sources.  The
+## .h file is sometimes built, but not always ... so that one has to
+## be added manually by the including Makefile.am .
+
+swig_built_sources += audio_windows.py audio_windows.cc
+
+## Various SWIG variables.  These can be overloaded in the including
+## Makefile.am by setting the variable value there, then including
+## Makefile.swig .
+
+audio_windows_swiginclude_HEADERS =            \
+       audio_windows.i                 \
+       $(audio_windows_swiginclude_headers)
+
+audio_windows_pylib_LTLIBRARIES =              \
+       _audio_windows.la
+
+_audio_windows_la_SOURCES =                    \
+       audio_windows.cc                        \
+       $(audio_windows_la_swig_sources)
+
+_audio_windows_la_LIBADD =                     \
+       $(STD_SWIG_LA_LIB_ADD)          \
+       $(audio_windows_la_swig_libadd)
+
+_audio_windows_la_LDFLAGS =                    \
+       $(STD_SWIG_LA_LD_FLAGS)         \
+       $(audio_windows_la_swig_ldflags)
+
+_audio_windows_la_CXXFLAGS =                   \
+       $(STD_SWIG_CXX_FLAGS)           \
+       $(audio_windows_la_swig_cxxflags)
+
+audio_windows_python_PYTHON =                  \
+       audio_windows.py                        \
+       $(audio_windows_python)
+
+## Entry rule for running SWIG
+
+audio_windows.h audio_windows.py audio_windows.cc: audio_windows.i
+## This rule will get called only when MAKE decides that one of the
+## targets needs to be created or re-created, because:
+##
+## * The .i file is newer than any or all of the generated files;
+##
+## * Any or all of the .cc, .h, or .py files does not exist and is
+##   needed (in the case this file is not needed, the rule for it is
+##   ignored); or
+##
+## * Some SWIG-based dependecy of the .cc file isn't met and hence the
+##   .cc file needs be be regenerated.  Explanation: Because MAKE
+##   knows how to handle dependencies for .cc files (regardless of
+##   their name or extension), then the .cc file is used as a target
+##   instead of the .i file -- but with the dependencies of the .i
+##   file.  It is this last reason why the line:
+##
+##             if test -f $@; then :; else
+##
+##   cannot be used in this case: If a .i file dependecy is not met,
+##   then the .cc file needs to be rebuilt.  But if the stamp is newer
+##   than the .cc file, and the .cc file exists, then in the original
+##   version (with the 'test' above) the internal MAKE call will not
+##   be issued and hence the .cc file will not be rebuilt.
+##
+## Once execution gets to here, it should always proceed no matter the
+## state of a stamp (as discussed in link above).  The
+## $(DEPDIR)/audio_windows-generate stuff is used to allow for parallel
+## builds to "do the right thing".  The stamp has no relationship with
+## either the target files or dependency file; it is used solely for
+## the protection of multiple builds during a given call to MAKE.
+##
+## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM
+## (15).  At a caught signal, the quoted command will be issued before
+## exiting.  In this case, remove any stamp, whether temporary of not.
+## The trap is valid until the process exits; the process includes all
+## commands appended via "\"s.
+##
+       trap 'rm -rf $(DEPDIR)/audio_windows-generate-*' 1 2 13 15; \
+##
+## Create a temporary directory, which acts as a lock.  The first
+## process to create the directory will succeed and issue the MAKE
+## command to do the actual work, while all subsequent processes will
+## fail -- leading them to wait for the first process to finish.
+##
+       if mkdir $(DEPDIR)/audio_windows-generate-lock 2>/dev/null; then \
+##
+## This code is being executed by the first process to succeed in
+## creating the directory lock.
+##
+## Remove the stamp associated with this filename.
+##
+               rm -f $(DEPDIR)/audio_windows-generate-stamp; \
+##
+## Tell MAKE to run the rule for creating this stamp.
+##
+               $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/audio_windows-generate-stamp WHAT=$<; \
+##
+## Now that the .cc, .h, and .py files have been (re)created from the
+## .i file, future checking of this rule during the same MAKE
+## execution will come back that the rule doesn't need to be executed
+## because none of the conditions mentioned at the start of this rule
+## will be positive.  Remove the the directory lock, which frees up
+## any waiting process(es) to continue.
+##
+               rmdir $(DEPDIR)/audio_windows-generate-lock; \
+       else \
+##
+## This code is being executed by any follower processes while the
+## directory lock is in place.
+##
+## Wait until the first process is done, testing once per second.
+##
+               while test -d $(DEPDIR)/audio_windows-generate-lock; do \
+                       sleep 1; \
+               done; \
+##
+## Succeed if and only if the first process succeeded; exit this
+## process returning the status of the generated stamp.
+##
+               test -f $(DEPDIR)/audio_windows-generate-stamp; \
+               exit $$?; \
+       fi;
+
+$(DEPDIR)/audio_windows-generate-stamp:
+## This rule will be called only by the first process issuing the
+## above rule to succeed in creating the lock directory, after
+## removing the actual stamp file in order to guarantee that MAKE will
+## execute this rule.
+##
+## Call SWIG to generate the various output files; special
+## post-processing on 'mingw32' host OS for the dependency file.
+##
+       if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(audio_windows_swig_args) \
+               -MD -MF $(DEPDIR)/audio_windows.Std \
+               -module audio_windows -o audio_windows.cc $(WHAT); then \
+           if test $(host_os) = mingw32; then \
+               $(RM) $(DEPDIR)/audio_windows.Sd; \
+               $(SED) 's,\\\\,/,g' < $(DEPDIR)/audio_windows.Std \
+                       > $(DEPDIR)/audio_windows.Sd; \
+               $(RM) $(DEPDIR)/audio_windows.Std; \
+               $(MV) $(DEPDIR)/audio_windows.Sd $(DEPDIR)/audio_windows.Std; \
+           fi; \
+       else \
+           $(RM) $(DEPDIR)/audio_windows.S*; exit 1; \
+       fi;
+##
+## Mess with the SWIG output .Std dependency file, to create a
+## dependecy file valid for the input .i file: Basically, simulate the
+## dependency file created for libraries by GNU's libtool for C++,
+## where all of the dependencies for the target are first listed, then
+## each individual dependency is listed as a target with no further
+## dependencies.
+##
+## (1) remove the current dependency file
+##
+       $(RM) $(DEPDIR)/audio_windows.d
+##
+## (2) Copy the whole SWIG file:
+##
+       cp $(DEPDIR)/audio_windows.Std $(DEPDIR)/audio_windows.d
+##
+## (3) all a carriage return to the end of the dependency file.
+##
+       echo "" >> $(DEPDIR)/audio_windows.d
+##
+## (4) from the SWIG file, remove the first line (the target); remove
+##     trailing " \" and " " from each line.  Append ":" to each line,
+##     followed by 2 carriage returns, then append this to the end of
+##     the dependency file.
+##
+       $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/audio_windows.Std | \
+               awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/audio_windows.d
+##
+## (5) remove the SWIG-generated file
+##
+       $(RM) $(DEPDIR)/audio_windows.Std
+##
+## Create the stamp for this filename generation, to signal success in
+## executing this rule; allows other threads waiting on this process
+## to continue.
+##
+       touch $(DEPDIR)/audio_windows-generate-stamp
+
+# KLUDGE: Force runtime include of a SWIG 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@./$(DEPDIR)/audio_windows.d@am__quote@
+
index c276629e491fe45d23adfdb8665950fe324504df..bd26e695223eada8cd3c8df34bf5cbd179e30633 100644 (file)
 
 include $(top_srcdir)/Makefile.common
 
-# Install this stuff so that it ends up as the gnuradio.comedi module
-# This usually ends up at:
-#   ${prefix}/lib/python${python_version}/site-packages/gnuradio
-
-ourpythondir = $(grpythondir)
-ourlibdir    = $(grpyexecdir)
-
 EXTRA_DIST = run_tests.in
 
 TESTS = run_tests
 
-LOCAL_IFILES =                                 \
-       $(srcdir)/comedi.i                              
-
-NON_LOCAL_IFILES =                     \
-       $(GNURADIO_I)
-
-ALL_IFILES =                           \
-       $(LOCAL_IFILES)                 \
-       $(NON_LOCAL_IFILES)             
-
-BUILT_SOURCES =                        \
-       comedi.cc                       \
-       comedi.py                               
-
-ourpython_PYTHON =                     \
-       comedi.py
+DISTCLEANFILES = run_tests
 
 AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES)
 
-ourlib_LTLIBRARIES = _comedi.la
-
-_comedi_la_SOURCES =           \
-       comedi.cc               \
-       comedi_sink_s.cc        \
-       comedi_source_s.cc      \
-       gri_comedi.cc                   
-
+# C/C++ headers get installed in ${prefix}/include/gnuradio
 grinclude_HEADERS =            \
        comedi_sink_s.h         \
-       comedi_source_s.h               
+       comedi_source_s.h
 
-noinst_HEADERS =               \
-       gri_comedi.h                    
+noinst_HEADERS =               \
+       gri_comedi.h
 
+noinst_PYTHON =                        \
+       qa_comedi.py
 
-swiginclude_HEADERS =          \
-       $(LOCAL_IFILES)
-
-_comedi_la_LIBADD =            \
-       $(PYTHON_LDFLAGS)       \
-       $(GNURADIO_CORE_LA)     \
-       $(COMEDI_LIBS)          \
-       -lstdc++                                
+###################################
+# SWIG Python interface and library
 
-_comedi_la_LDFLAGS = $(NO_UNDEFINED) -module -avoid-version
+TOP_SWIG_IFILES =              \
+       comedi.i
 
-_comedi_la_CXXFLAGS = @swig_CXXFLAGS@
+# Install so that they end up available as:
+#   import gnuradio.comedi
+# This ends up at:
+#   ${prefix}/lib/python${python_version}/site-packages/gnuradio
+comedi_pythondir_category =    \
+       gnuradio
 
-comedi.cc comedi.py: $(ALL_IFILES)
-       $(SWIG) $(STD_SWIG_PYTHON_ARGS) -module comedi \
-               -o comedi.cc $(LOCAL_IFILES)
+# additional sources for the SWIG-generated library
+comedi_la_swig_sources =       \
+       comedi_sink_s.cc        \
+       comedi_source_s.cc      \
+       gri_comedi.cc
 
-noinst_PYTHON =                \
-       qa_comedi.py                    
+# additional libraries for linking with the SWIG-generated library
+comedi_la_swig_libadd =                \
+       $(GNURADIO_CORE_LA)     \
+       $(COMEDI_LIBS)
 
-# 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
+include $(top_srcdir)/Makefile.swig
 
-MOSTLYCLEANFILES = \
-       $(BUILT_SOURCES) *~ *.pyc
+# add some of the variables generated inside the Makefile.swig.gen
+BUILT_SOURCES = $(swig_built_sources)
 
+# Do not distribute the output of SWIG
+no_dist_files = $(swig_built_sources)
diff --git a/gr-comedi/src/Makefile.swig.gen b/gr-comedi/src/Makefile.swig.gen
new file mode 100644 (file)
index 0000000..dd2c235
--- /dev/null
@@ -0,0 +1,259 @@
+# -*- Makefile -*-
+#
+# Copyright 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.
+# 
+
+# Makefile.swig.gen for comedi.i
+
+## Default install locations for these files:
+##
+## Default location for the Python directory is:
+##  ${prefix}/lib/python${python_version}/site-packages/[category]/comedi
+## Default location for the Python exec directory is:
+##  ${exec_prefix}/lib/python${python_version}/site-packages/[category]/comedi
+##
+## The following can be overloaded to change the install location, but
+## this has to be done in the including Makefile.am -before-
+## Makefile.swig is included.
+
+comedi_pythondir_category ?= gnuradio/comedi
+comedi_pylibdir_category ?= $(comedi_pythondir_category)
+comedi_pythondir = $(pythondir)/$(comedi_pythondir_category)
+comedi_pylibdir = $(pyexecdir)/$(comedi_pylibdir_category)
+
+## SWIG headers are always installed into the same directory.
+
+comedi_swigincludedir = $(swigincludedir)
+
+## This is a template file for a "generated" Makefile addition (in
+## this case, "Makefile.swig.gen").  By including the top-level
+## Makefile.swig, this file will be used to generate the SWIG
+## dependencies.  Assign the variable TOP_SWIG_FILES to be the list of
+## SWIG .i files to generated wrappings for; there can be more than 1
+## so long as the names are unique (no sorting is done on the
+## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i
+## file will generate .cc, .py, and possibly .h files -- meaning that
+## all of these files will have the same base name (that provided for
+## the SWIG .i file).
+##
+## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the
+## right thing.  For more info, see <
+## http://sources.redhat.com/automake/automake.html#Multiple-Outputs >
+
+## Stamps used to ensure parallel make does the right thing.  These
+## are removed by "make clean", but otherwise unused except during the
+## parallel built.  These will not be included in a tarball, because
+## the SWIG-generated files will be removed from the distribution.
+
+STAMPS += $(DEPDIR)/comedi-generate-*
+
+## Other cleaned files: dependency files generated by SWIG or this Makefile
+
+MOSTLYCLEANFILES += $(DEPDIR)/*.S*
+
+## Add the .py and .cc files to the list of SWIG built sources.  The
+## .h file is sometimes built, but not always ... so that one has to
+## be added manually by the including Makefile.am .
+
+swig_built_sources += comedi.py comedi.cc
+
+## Various SWIG variables.  These can be overloaded in the including
+## Makefile.am by setting the variable value there, then including
+## Makefile.swig .
+
+comedi_swiginclude_HEADERS =           \
+       comedi.i                        \
+       $(comedi_swiginclude_headers)
+
+comedi_pylib_LTLIBRARIES =             \
+       _comedi.la
+
+_comedi_la_SOURCES =                   \
+       comedi.cc                       \
+       $(comedi_la_swig_sources)
+
+_comedi_la_LIBADD =                    \
+       $(STD_SWIG_LA_LIB_ADD)          \
+       $(comedi_la_swig_libadd)
+
+_comedi_la_LDFLAGS =                   \
+       $(STD_SWIG_LA_LD_FLAGS)         \
+       $(comedi_la_swig_ldflags)
+
+_comedi_la_CXXFLAGS =                  \
+       $(STD_SWIG_CXX_FLAGS)           \
+       $(comedi_la_swig_cxxflags)
+
+comedi_python_PYTHON =                 \
+       comedi.py                       \
+       $(comedi_python)
+
+## Entry rule for running SWIG
+
+comedi.h comedi.py comedi.cc: comedi.i
+## This rule will get called only when MAKE decides that one of the
+## targets needs to be created or re-created, because:
+##
+## * The .i file is newer than any or all of the generated files;
+##
+## * Any or all of the .cc, .h, or .py files does not exist and is
+##   needed (in the case this file is not needed, the rule for it is
+##   ignored); or
+##
+## * Some SWIG-based dependecy of the .cc file isn't met and hence the
+##   .cc file needs be be regenerated.  Explanation: Because MAKE
+##   knows how to handle dependencies for .cc files (regardless of
+##   their name or extension), then the .cc file is used as a target
+##   instead of the .i file -- but with the dependencies of the .i
+##   file.  It is this last reason why the line:
+##
+##             if test -f $@; then :; else
+##
+##   cannot be used in this case: If a .i file dependecy is not met,
+##   then the .cc file needs to be rebuilt.  But if the stamp is newer
+##   than the .cc file, and the .cc file exists, then in the original
+##   version (with the 'test' above) the internal MAKE call will not
+##   be issued and hence the .cc file will not be rebuilt.
+##
+## Once execution gets to here, it should always proceed no matter the
+## state of a stamp (as discussed in link above).  The
+## $(DEPDIR)/comedi-generate stuff is used to allow for parallel
+## builds to "do the right thing".  The stamp has no relationship with
+## either the target files or dependency file; it is used solely for
+## the protection of multiple builds during a given call to MAKE.
+##
+## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM
+## (15).  At a caught signal, the quoted command will be issued before
+## exiting.  In this case, remove any stamp, whether temporary of not.
+## The trap is valid until the process exits; the process includes all
+## commands appended via "\"s.
+##
+       trap 'rm -rf $(DEPDIR)/comedi-generate-*' 1 2 13 15; \
+##
+## Create a temporary directory, which acts as a lock.  The first
+## process to create the directory will succeed and issue the MAKE
+## command to do the actual work, while all subsequent processes will
+## fail -- leading them to wait for the first process to finish.
+##
+       if mkdir $(DEPDIR)/comedi-generate-lock 2>/dev/null; then \
+##
+## This code is being executed by the first process to succeed in
+## creating the directory lock.
+##
+## Remove the stamp associated with this filename.
+##
+               rm -f $(DEPDIR)/comedi-generate-stamp; \
+##
+## Tell MAKE to run the rule for creating this stamp.
+##
+               $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/comedi-generate-stamp WHAT=$<; \
+##
+## Now that the .cc, .h, and .py files have been (re)created from the
+## .i file, future checking of this rule during the same MAKE
+## execution will come back that the rule doesn't need to be executed
+## because none of the conditions mentioned at the start of this rule
+## will be positive.  Remove the the directory lock, which frees up
+## any waiting process(es) to continue.
+##
+               rmdir $(DEPDIR)/comedi-generate-lock; \
+       else \
+##
+## This code is being executed by any follower processes while the
+## directory lock is in place.
+##
+## Wait until the first process is done, testing once per second.
+##
+               while test -d $(DEPDIR)/comedi-generate-lock; do \
+                       sleep 1; \
+               done; \
+##
+## Succeed if and only if the first process succeeded; exit this
+## process returning the status of the generated stamp.
+##
+               test -f $(DEPDIR)/comedi-generate-stamp; \
+               exit $$?; \
+       fi;
+
+$(DEPDIR)/comedi-generate-stamp:
+## This rule will be called only by the first process issuing the
+## above rule to succeed in creating the lock directory, after
+## removing the actual stamp file in order to guarantee that MAKE will
+## execute this rule.
+##
+## Call SWIG to generate the various output files; special
+## post-processing on 'mingw32' host OS for the dependency file.
+##
+       if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(comedi_swig_args) \
+               -MD -MF $(DEPDIR)/comedi.Std \
+               -module comedi -o comedi.cc $(WHAT); then \
+           if test $(host_os) = mingw32; then \
+               $(RM) $(DEPDIR)/comedi.Sd; \
+               $(SED) 's,\\\\,/,g' < $(DEPDIR)/comedi.Std \
+                       > $(DEPDIR)/comedi.Sd; \
+               $(RM) $(DEPDIR)/comedi.Std; \
+               $(MV) $(DEPDIR)/comedi.Sd $(DEPDIR)/comedi.Std; \
+           fi; \
+       else \
+           $(RM) $(DEPDIR)/comedi.S*; exit 1; \
+       fi;
+##
+## Mess with the SWIG output .Std dependency file, to create a
+## dependecy file valid for the input .i file: Basically, simulate the
+## dependency file created for libraries by GNU's libtool for C++,
+## where all of the dependencies for the target are first listed, then
+## each individual dependency is listed as a target with no further
+## dependencies.
+##
+## (1) remove the current dependency file
+##
+       $(RM) $(DEPDIR)/comedi.d
+##
+## (2) Copy the whole SWIG file:
+##
+       cp $(DEPDIR)/comedi.Std $(DEPDIR)/comedi.d
+##
+## (3) all a carriage return to the end of the dependency file.
+##
+       echo "" >> $(DEPDIR)/comedi.d
+##
+## (4) from the SWIG file, remove the first line (the target); remove
+##     trailing " \" and " " from each line.  Append ":" to each line,
+##     followed by 2 carriage returns, then append this to the end of
+##     the dependency file.
+##
+       $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/comedi.Std | \
+               awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/comedi.d
+##
+## (5) remove the SWIG-generated file
+##
+       $(RM) $(DEPDIR)/comedi.Std
+##
+## Create the stamp for this filename generation, to signal success in
+## executing this rule; allows other threads waiting on this process
+## to continue.
+##
+       touch $(DEPDIR)/comedi-generate-stamp
+
+# KLUDGE: Force runtime include of a SWIG 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@./$(DEPDIR)/comedi.d@am__quote@
+
index 2306bc3b887655730db7df3c71026b11bc88001b..78a7c6400ecbacf95e8b003e47607eb92ae1602c 100644 (file)
 
 include $(top_srcdir)/Makefile.common
 
-# Install this stuff so that it ends up as the gnuradio.vocoder module
-# This usually ends up at:
-#   ${prefix}/lib/python${python_version}/site-packages/gnuradio/vocoder
-
-ourpythondir = $(grpythondir)/vocoder
-ourlibdir    = $(grpyexecdir)/vocoder
-
 AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES)
 
-ALL_IFILES =                           \
-       $(LOCAL_IFILES)                 \
-       $(NON_LOCAL_IFILES)             
-
-NON_LOCAL_IFILES =                     \
-       $(GNURADIO_I)
-
-LOCAL_IFILES =                                 \
-       $(srcdir)/cvsd_vocoder.i
-
-# These files are built by SWIG.  The first is the C++ glue.
-# The second is the python wrapper that loads the _howto shared library
-# and knows how to call our extensions.
+# These headers get installed in ${prefix}/include/gnuradio
+grinclude_HEADERS =                    \
+       cvsd_decode_bs.h                \
+       cvsd_encode_sb.h
 
-BUILT_SOURCES =                        \
-       cvsd_vocoder.cc         \
-       cvsd_vocoder.py                         
+###################################
+# SWIG Python interface and library
 
-# This gets cvsd_vocoder.py installed in the right place
-ourpython_PYTHON =                     \
-       cvsd_vocoder.py
+TOP_SWIG_IFILES =                      \
+       cvsd_vocoder.i
 
-ourlib_LTLIBRARIES = _cvsd_vocoder.la
+# Install so that they end up available as:
+#   import gnuradio.vocoder.cvsd_vocoder
+# This ends up at:
+#   ${prefix}/lib/python${python_version}/site-packages/gnuradio/vocoder
+cvsd_vocoder_pythondir_category =      \
+       gnuradio/vocoder
 
-# These are the source files that go into the shared library
-_cvsd_vocoder_la_SOURCES =             \
+# additional sources for the SWIG-generated library
+cvsd_vocoder_la_swig_sources =         \
        cvsd_decode_bs.cc               \
-       cvsd_encode_sb.cc               \
-       cvsd_vocoder.cc         
-
-
-# magic flags
-_cvsd_vocoder_la_LDFLAGS = $(NO_UNDEFINED) -module -avoid-version
-
-# link the library against the c++ standard library
-_cvsd_vocoder_la_LIBADD =      \
-       $(PYTHON_LDFLAGS)       \
-       $(GNURADIO_CORE_LA)     \
-       -lstdc++                        
-
-_cvsd_vocoder_la_CXXFLAGS = @swig_CXXFLAGS@
-
-cvsd_vocoder.cc cvsd_vocoder.py: $(ALL_IFILES)
-       $(SWIG) $(STD_SWIG_PYTHON_ARGS) -module cvsd_vocoder \
-               -o cvsd_vocoder.cc $(LOCAL_IFILES)
-
-# These headers get installed in ${prefix}/include/gnuradio
-grinclude_HEADERS =                    \
-       cvsd_decode_bs.h                \
-       cvsd_encode_sb.h                
-
-# These swig headers get installed in ${prefix}/include/gnuradio/swig
-swiginclude_HEADERS =                  \
-       $(LOCAL_IFILES)
+       cvsd_encode_sb.cc
 
+# additional libraries for linking with the SWIG-generated library
+cvsd_vocoder_la_swig_libadd =          \
+       $(GNURADIO_CORE_LA)
 
-MOSTLYCLEANFILES = $(BUILT_SOURCES) *.pyc
+include $(top_srcdir)/Makefile.swig
 
-# 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
+# add some of the variables generated inside the Makefile.swig.gen
+BUILT_SOURCES = $(swig_built_sources)
 
+# Do not distribute the output of SWIG
+no_dist_files = $(swig_built_sources)
diff --git a/gr-cvsd-vocoder/src/lib/Makefile.swig.gen b/gr-cvsd-vocoder/src/lib/Makefile.swig.gen
new file mode 100644 (file)
index 0000000..e192abc
--- /dev/null
@@ -0,0 +1,259 @@
+# -*- Makefile -*-
+#
+# Copyright 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.
+# 
+
+# Makefile.swig.gen for cvsd_vocoder.i
+
+## Default install locations for these files:
+##
+## Default location for the Python directory is:
+##  ${prefix}/lib/python${python_version}/site-packages/[category]/cvsd_vocoder
+## Default location for the Python exec directory is:
+##  ${exec_prefix}/lib/python${python_version}/site-packages/[category]/cvsd_vocoder
+##
+## The following can be overloaded to change the install location, but
+## this has to be done in the including Makefile.am -before-
+## Makefile.swig is included.
+
+cvsd_vocoder_pythondir_category ?= gnuradio/cvsd_vocoder
+cvsd_vocoder_pylibdir_category ?= $(cvsd_vocoder_pythondir_category)
+cvsd_vocoder_pythondir = $(pythondir)/$(cvsd_vocoder_pythondir_category)
+cvsd_vocoder_pylibdir = $(pyexecdir)/$(cvsd_vocoder_pylibdir_category)
+
+## SWIG headers are always installed into the same directory.
+
+cvsd_vocoder_swigincludedir = $(swigincludedir)
+
+## This is a template file for a "generated" Makefile addition (in
+## this case, "Makefile.swig.gen").  By including the top-level
+## Makefile.swig, this file will be used to generate the SWIG
+## dependencies.  Assign the variable TOP_SWIG_FILES to be the list of
+## SWIG .i files to generated wrappings for; there can be more than 1
+## so long as the names are unique (no sorting is done on the
+## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i
+## file will generate .cc, .py, and possibly .h files -- meaning that
+## all of these files will have the same base name (that provided for
+## the SWIG .i file).
+##
+## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the
+## right thing.  For more info, see <
+## http://sources.redhat.com/automake/automake.html#Multiple-Outputs >
+
+## Stamps used to ensure parallel make does the right thing.  These
+## are removed by "make clean", but otherwise unused except during the
+## parallel built.  These will not be included in a tarball, because
+## the SWIG-generated files will be removed from the distribution.
+
+STAMPS += $(DEPDIR)/cvsd_vocoder-generate-*
+
+## Other cleaned files: dependency files generated by SWIG or this Makefile
+
+MOSTLYCLEANFILES += $(DEPDIR)/*.S*
+
+## Add the .py and .cc files to the list of SWIG built sources.  The
+## .h file is sometimes built, but not always ... so that one has to
+## be added manually by the including Makefile.am .
+
+swig_built_sources += cvsd_vocoder.py cvsd_vocoder.cc
+
+## Various SWIG variables.  These can be overloaded in the including
+## Makefile.am by setting the variable value there, then including
+## Makefile.swig .
+
+cvsd_vocoder_swiginclude_HEADERS =             \
+       cvsd_vocoder.i                  \
+       $(cvsd_vocoder_swiginclude_headers)
+
+cvsd_vocoder_pylib_LTLIBRARIES =               \
+       _cvsd_vocoder.la
+
+_cvsd_vocoder_la_SOURCES =                     \
+       cvsd_vocoder.cc                 \
+       $(cvsd_vocoder_la_swig_sources)
+
+_cvsd_vocoder_la_LIBADD =                      \
+       $(STD_SWIG_LA_LIB_ADD)          \
+       $(cvsd_vocoder_la_swig_libadd)
+
+_cvsd_vocoder_la_LDFLAGS =                     \
+       $(STD_SWIG_LA_LD_FLAGS)         \
+       $(cvsd_vocoder_la_swig_ldflags)
+
+_cvsd_vocoder_la_CXXFLAGS =                    \
+       $(STD_SWIG_CXX_FLAGS)           \
+       $(cvsd_vocoder_la_swig_cxxflags)
+
+cvsd_vocoder_python_PYTHON =                   \
+       cvsd_vocoder.py                 \
+       $(cvsd_vocoder_python)
+
+## Entry rule for running SWIG
+
+cvsd_vocoder.h cvsd_vocoder.py cvsd_vocoder.cc: cvsd_vocoder.i
+## This rule will get called only when MAKE decides that one of the
+## targets needs to be created or re-created, because:
+##
+## * The .i file is newer than any or all of the generated files;
+##
+## * Any or all of the .cc, .h, or .py files does not exist and is
+##   needed (in the case this file is not needed, the rule for it is
+##   ignored); or
+##
+## * Some SWIG-based dependecy of the .cc file isn't met and hence the
+##   .cc file needs be be regenerated.  Explanation: Because MAKE
+##   knows how to handle dependencies for .cc files (regardless of
+##   their name or extension), then the .cc file is used as a target
+##   instead of the .i file -- but with the dependencies of the .i
+##   file.  It is this last reason why the line:
+##
+##             if test -f $@; then :; else
+##
+##   cannot be used in this case: If a .i file dependecy is not met,
+##   then the .cc file needs to be rebuilt.  But if the stamp is newer
+##   than the .cc file, and the .cc file exists, then in the original
+##   version (with the 'test' above) the internal MAKE call will not
+##   be issued and hence the .cc file will not be rebuilt.
+##
+## Once execution gets to here, it should always proceed no matter the
+## state of a stamp (as discussed in link above).  The
+## $(DEPDIR)/cvsd_vocoder-generate stuff is used to allow for parallel
+## builds to "do the right thing".  The stamp has no relationship with
+## either the target files or dependency file; it is used solely for
+## the protection of multiple builds during a given call to MAKE.
+##
+## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM
+## (15).  At a caught signal, the quoted command will be issued before
+## exiting.  In this case, remove any stamp, whether temporary of not.
+## The trap is valid until the process exits; the process includes all
+## commands appended via "\"s.
+##
+       trap 'rm -rf $(DEPDIR)/cvsd_vocoder-generate-*' 1 2 13 15; \
+##
+## Create a temporary directory, which acts as a lock.  The first
+## process to create the directory will succeed and issue the MAKE
+## command to do the actual work, while all subsequent processes will
+## fail -- leading them to wait for the first process to finish.
+##
+       if mkdir $(DEPDIR)/cvsd_vocoder-generate-lock 2>/dev/null; then \
+##
+## This code is being executed by the first process to succeed in
+## creating the directory lock.
+##
+## Remove the stamp associated with this filename.
+##
+               rm -f $(DEPDIR)/cvsd_vocoder-generate-stamp; \
+##
+## Tell MAKE to run the rule for creating this stamp.
+##
+               $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/cvsd_vocoder-generate-stamp WHAT=$<; \
+##
+## Now that the .cc, .h, and .py files have been (re)created from the
+## .i file, future checking of this rule during the same MAKE
+## execution will come back that the rule doesn't need to be executed
+## because none of the conditions mentioned at the start of this rule
+## will be positive.  Remove the the directory lock, which frees up
+## any waiting process(es) to continue.
+##
+               rmdir $(DEPDIR)/cvsd_vocoder-generate-lock; \
+       else \
+##
+## This code is being executed by any follower processes while the
+## directory lock is in place.
+##
+## Wait until the first process is done, testing once per second.
+##
+               while test -d $(DEPDIR)/cvsd_vocoder-generate-lock; do \
+                       sleep 1; \
+               done; \
+##
+## Succeed if and only if the first process succeeded; exit this
+## process returning the status of the generated stamp.
+##
+               test -f $(DEPDIR)/cvsd_vocoder-generate-stamp; \
+               exit $$?; \
+       fi;
+
+$(DEPDIR)/cvsd_vocoder-generate-stamp:
+## This rule will be called only by the first process issuing the
+## above rule to succeed in creating the lock directory, after
+## removing the actual stamp file in order to guarantee that MAKE will
+## execute this rule.
+##
+## Call SWIG to generate the various output files; special
+## post-processing on 'mingw32' host OS for the dependency file.
+##
+       if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(cvsd_vocoder_swig_args) \
+               -MD -MF $(DEPDIR)/cvsd_vocoder.Std \
+               -module cvsd_vocoder -o cvsd_vocoder.cc $(WHAT); then \
+           if test $(host_os) = mingw32; then \
+               $(RM) $(DEPDIR)/cvsd_vocoder.Sd; \
+               $(SED) 's,\\\\,/,g' < $(DEPDIR)/cvsd_vocoder.Std \
+                       > $(DEPDIR)/cvsd_vocoder.Sd; \
+               $(RM) $(DEPDIR)/cvsd_vocoder.Std; \
+               $(MV) $(DEPDIR)/cvsd_vocoder.Sd $(DEPDIR)/cvsd_vocoder.Std; \
+           fi; \
+       else \
+           $(RM) $(DEPDIR)/cvsd_vocoder.S*; exit 1; \
+       fi;
+##
+## Mess with the SWIG output .Std dependency file, to create a
+## dependecy file valid for the input .i file: Basically, simulate the
+## dependency file created for libraries by GNU's libtool for C++,
+## where all of the dependencies for the target are first listed, then
+## each individual dependency is listed as a target with no further
+## dependencies.
+##
+## (1) remove the current dependency file
+##
+       $(RM) $(DEPDIR)/cvsd_vocoder.d
+##
+## (2) Copy the whole SWIG file:
+##
+       cp $(DEPDIR)/cvsd_vocoder.Std $(DEPDIR)/cvsd_vocoder.d
+##
+## (3) all a carriage return to the end of the dependency file.
+##
+       echo "" >> $(DEPDIR)/cvsd_vocoder.d
+##
+## (4) from the SWIG file, remove the first line (the target); remove
+##     trailing " \" and " " from each line.  Append ":" to each line,
+##     followed by 2 carriage returns, then append this to the end of
+##     the dependency file.
+##
+       $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/cvsd_vocoder.Std | \
+               awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/cvsd_vocoder.d
+##
+## (5) remove the SWIG-generated file
+##
+       $(RM) $(DEPDIR)/cvsd_vocoder.Std
+##
+## Create the stamp for this filename generation, to signal success in
+## executing this rule; allows other threads waiting on this process
+## to continue.
+##
+       touch $(DEPDIR)/cvsd_vocoder-generate-stamp
+
+# KLUDGE: Force runtime include of a SWIG 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@./$(DEPDIR)/cvsd_vocoder.d@am__quote@
+
index e22ad3235dd84e454b28ffcf0c7418d9b125df3d..801dc8fbb399684340f9801c40bd34260e46fbbc 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2004 Free Software Foundation, Inc.
+# Copyright 2004,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -36,5 +36,3 @@ grblkspython_PYTHON =         \
 noinst_PYTHON =                        \
        encdec.py                       \
        qa_cvsd_vocoder.py              
-
-CLEANFILES = *.pyc *.pyo
index 4ed607c55dd5f07b317a1afe33e78a253e63ee42..83dc30f45789a9710515da88affbe4fd80b055b1 100644 (file)
@@ -23,20 +23,20 @@ include $(top_srcdir)/Makefile.common
 SUBDIRS = . examples
 
 EXTRA_DIST = run_tests.in
-TESTS = run_tests
-
-
-# Install the python portion so that it ends up as the gnuradio.gcell module
-#   ${prefix}/lib/python${python_version}/site-packages/gnuradio
 
-ourpythondir = $(grpythondir)
-ourlibdir    = $(grpyexecdir)
+TESTS = run_tests
 
 AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(GCELL_INCLUDES) \
        $(PYTHON_CPPFLAGS) $(WITH_INCLUDES)
 
-# Special swig arguments
-LOCAL_SWIG_DEFINES_AND_INCLUDES = $(GCELL_INCLUDES)
+# ----------------------------------------------------------------
+
+noinst_PYTHON =  \
+       qa_fft.py
+
+DISTCLEANFILES = \
+       gcell.d \
+       run_tests
 
 # ----------------------------------------------------------------
 #                        The C++ blocks
@@ -48,6 +48,7 @@ lib_LTLIBRARIES = libgr_gcell.la
 libgr_gcell_la_SOURCES = \
        gcell_fft_vcc.cc
 
+# C/C++ headers get installed in ${prefix}/include/gnuradio
 grinclude_HEADERS = \
        gcell_fft_vcc.h
 
@@ -57,80 +58,37 @@ libgr_gcell_la_LIBADD = \
 
 libgr_gcell_la_LDFLAGS = $(NO_UNDEFINED)
 
-
 # ----------------------------------------------------------------
 #                         SWIG stuff
 # ----------------------------------------------------------------
 
-# the library for the swig interface
-ourlib_LTLIBRARIES = _gcell.la
-
-LOCAL_IFILES = \
-       $(srcdir)/gc_job_manager.i \
-       $(srcdir)/gcell.i \
-       $(srcdir)/gcell_fft_vcc.i
-
-NON_LOCAL_IFILES = \
-       $(GNURADIO_I)
-
-ALL_IFILES = \
-       $(LOCAL_IFILES) \
-       $(NON_LOCAL_IFILES)
+TOP_SWIG_IFILES =              \
+       gcell.i
 
-swig_built_sources = \
-       gcell.cc \
-       gcell.py
-
-ourpython_PYTHON = \
-       gcell.py
-
-_gcell_la_SOURCES = \
-       gcell.cc
-
-_gcell_la_LIBADD = \
-       $(PYTHON_LDFLAGS) \
-       libgr_gcell.la \
-       -lstdc++
-
-_gcell_la_LDFLAGS = $(NO_UNDEFINED) -module -avoid-version
-
-_gcell_la_CXXFLAGS = @swig_CXXFLAGS@
-
-swiginclude_HEADERS = \
-       $(LOCAL_IFILES)
-
-#gcell.cc gcell.py: $(ALL_IFILES)
-#      $(SWIG) $(STD_SWIG_PYTHON_ARGS) -module gcell \
-#              -o gcell.cc $(LOCAL_IFILES)
-
-# KLUDGE: Force runtime include of gcell.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@./gcell.d@am__quote@
+# Install so that they end up available as:
+#   import gnuradio.gcell
+# This ends up at:
+#   ${prefix}/lib/python${python_version}/site-packages/gnuradio
+gcell_pythondir_category =     \
+       gnuradio
 
-gcell.py gcell.h: gcell.cc
+# additional arguments to the SWIG command
+gcell_swig_args =              \
+       $(GCELL_INCLUDES)
 
-gcell.cc : $(srcdir)/gcell.i $(GNURADIO_I)
-       if $(SWIG) $(STD_SWIG_PYTHON_ARGS) -MMD -MF gcell.Td -module gcell \
-               -o gcell.cc $(srcdir)/gcell.i ;\
-       then if test $(host_os) = mingw32; \
-            then sed 's,\\\\,/,g' <gcell.Td >gcell.d; rm -f gcell.Td; \
-            else mv -f gcell.Td gcell.d; fi \
-       else rm -f gcell.Td; exit 1; fi 
+# additional libraries for linking with the SWIG-generated library
+gcell_la_swig_libadd =         \
+       libgr_gcell.la
 
+# additional SWIG files to be installed
+gcell_swiginclude_headers =    \
+       gc_job_manager.i        \
+       gcell_fft_vcc.i
 
-noinst_PYTHON =  \
-       qa_fft.py
+include $(top_srcdir)/Makefile.swig
 
-# ----------------------------------------------------------------
+# add some of the variables generated inside the Makefile.swig.gen
+BUILT_SOURCES = $(swig_built_sources)
 
-MOSTLYCLEANFILES =  \
-       $(swig_built_sources) *~ *.pyc
-
-# Don't distribute output of swig
-dist-hook:
-       @for file in $(swig_built_sources); do echo $(RM) $(distdir)/$$file; done
-       @for file in $(swig_built_sources); do $(RM) $(distdir)/$$file; done
-
-DISTCLEANFILES = \
-       gcell.d
+# Do not distribute the output of SWIG
+no_dist_files = $(swig_built_sources)
diff --git a/gr-gcell/src/Makefile.swig.gen b/gr-gcell/src/Makefile.swig.gen
new file mode 100644 (file)
index 0000000..75353c3
--- /dev/null
@@ -0,0 +1,259 @@
+# -*- Makefile -*-
+#
+# Copyright 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.
+# 
+
+# Makefile.swig.gen for gcell.i
+
+## Default install locations for these files:
+##
+## Default location for the Python directory is:
+##  ${prefix}/lib/python${python_version}/site-packages/[category]/gcell
+## Default location for the Python exec directory is:
+##  ${exec_prefix}/lib/python${python_version}/site-packages/[category]/gcell
+##
+## The following can be overloaded to change the install location, but
+## this has to be done in the including Makefile.am -before-
+## Makefile.swig is included.
+
+gcell_pythondir_category ?= gnuradio/gcell
+gcell_pylibdir_category ?= $(gcell_pythondir_category)
+gcell_pythondir = $(pythondir)/$(gcell_pythondir_category)
+gcell_pylibdir = $(pyexecdir)/$(gcell_pylibdir_category)
+
+## SWIG headers are always installed into the same directory.
+
+gcell_swigincludedir = $(swigincludedir)
+
+## This is a template file for a "generated" Makefile addition (in
+## this case, "Makefile.swig.gen").  By including the top-level
+## Makefile.swig, this file will be used to generate the SWIG
+## dependencies.  Assign the variable TOP_SWIG_FILES to be the list of
+## SWIG .i files to generated wrappings for; there can be more than 1
+## so long as the names are unique (no sorting is done on the
+## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i
+## file will generate .cc, .py, and possibly .h files -- meaning that
+## all of these files will have the same base name (that provided for
+## the SWIG .i file).
+##
+## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the
+## right thing.  For more info, see <
+## http://sources.redhat.com/automake/automake.html#Multiple-Outputs >
+
+## Stamps used to ensure parallel make does the right thing.  These
+## are removed by "make clean", but otherwise unused except during the
+## parallel built.  These will not be included in a tarball, because
+## the SWIG-generated files will be removed from the distribution.
+
+STAMPS += $(DEPDIR)/gcell-generate-*
+
+## Other cleaned files: dependency files generated by SWIG or this Makefile
+
+MOSTLYCLEANFILES += $(DEPDIR)/*.S*
+
+## Add the .py and .cc files to the list of SWIG built sources.  The
+## .h file is sometimes built, but not always ... so that one has to
+## be added manually by the including Makefile.am .
+
+swig_built_sources += gcell.py gcell.cc
+
+## Various SWIG variables.  These can be overloaded in the including
+## Makefile.am by setting the variable value there, then including
+## Makefile.swig .
+
+gcell_swiginclude_HEADERS =            \
+       gcell.i                 \
+       $(gcell_swiginclude_headers)
+
+gcell_pylib_LTLIBRARIES =              \
+       _gcell.la
+
+_gcell_la_SOURCES =                    \
+       gcell.cc                        \
+       $(gcell_la_swig_sources)
+
+_gcell_la_LIBADD =                     \
+       $(STD_SWIG_LA_LIB_ADD)          \
+       $(gcell_la_swig_libadd)
+
+_gcell_la_LDFLAGS =                    \
+       $(STD_SWIG_LA_LD_FLAGS)         \
+       $(gcell_la_swig_ldflags)
+
+_gcell_la_CXXFLAGS =                   \
+       $(STD_SWIG_CXX_FLAGS)           \
+       $(gcell_la_swig_cxxflags)
+
+gcell_python_PYTHON =                  \
+       gcell.py                        \
+       $(gcell_python)
+
+## Entry rule for running SWIG
+
+gcell.h gcell.py gcell.cc: gcell.i
+## This rule will get called only when MAKE decides that one of the
+## targets needs to be created or re-created, because:
+##
+## * The .i file is newer than any or all of the generated files;
+##
+## * Any or all of the .cc, .h, or .py files does not exist and is
+##   needed (in the case this file is not needed, the rule for it is
+##   ignored); or
+##
+## * Some SWIG-based dependecy of the .cc file isn't met and hence the
+##   .cc file needs be be regenerated.  Explanation: Because MAKE
+##   knows how to handle dependencies for .cc files (regardless of
+##   their name or extension), then the .cc file is used as a target
+##   instead of the .i file -- but with the dependencies of the .i
+##   file.  It is this last reason why the line:
+##
+##             if test -f $@; then :; else
+##
+##   cannot be used in this case: If a .i file dependecy is not met,
+##   then the .cc file needs to be rebuilt.  But if the stamp is newer
+##   than the .cc file, and the .cc file exists, then in the original
+##   version (with the 'test' above) the internal MAKE call will not
+##   be issued and hence the .cc file will not be rebuilt.
+##
+## Once execution gets to here, it should always proceed no matter the
+## state of a stamp (as discussed in link above).  The
+## $(DEPDIR)/gcell-generate stuff is used to allow for parallel
+## builds to "do the right thing".  The stamp has no relationship with
+## either the target files or dependency file; it is used solely for
+## the protection of multiple builds during a given call to MAKE.
+##
+## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM
+## (15).  At a caught signal, the quoted command will be issued before
+## exiting.  In this case, remove any stamp, whether temporary of not.
+## The trap is valid until the process exits; the process includes all
+## commands appended via "\"s.
+##
+       trap 'rm -rf $(DEPDIR)/gcell-generate-*' 1 2 13 15; \
+##
+## Create a temporary directory, which acts as a lock.  The first
+## process to create the directory will succeed and issue the MAKE
+## command to do the actual work, while all subsequent processes will
+## fail -- leading them to wait for the first process to finish.
+##
+       if mkdir $(DEPDIR)/gcell-generate-lock 2>/dev/null; then \
+##
+## This code is being executed by the first process to succeed in
+## creating the directory lock.
+##
+## Remove the stamp associated with this filename.
+##
+               rm -f $(DEPDIR)/gcell-generate-stamp; \
+##
+## Tell MAKE to run the rule for creating this stamp.
+##
+               $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gcell-generate-stamp WHAT=$<; \
+##
+## Now that the .cc, .h, and .py files have been (re)created from the
+## .i file, future checking of this rule during the same MAKE
+## execution will come back that the rule doesn't need to be executed
+## because none of the conditions mentioned at the start of this rule
+## will be positive.  Remove the the directory lock, which frees up
+## any waiting process(es) to continue.
+##
+               rmdir $(DEPDIR)/gcell-generate-lock; \
+       else \
+##
+## This code is being executed by any follower processes while the
+## directory lock is in place.
+##
+## Wait until the first process is done, testing once per second.
+##
+               while test -d $(DEPDIR)/gcell-generate-lock; do \
+                       sleep 1; \
+               done; \
+##
+## Succeed if and only if the first process succeeded; exit this
+## process returning the status of the generated stamp.
+##
+               test -f $(DEPDIR)/gcell-generate-stamp; \
+               exit $$?; \
+       fi;
+
+$(DEPDIR)/gcell-generate-stamp:
+## This rule will be called only by the first process issuing the
+## above rule to succeed in creating the lock directory, after
+## removing the actual stamp file in order to guarantee that MAKE will
+## execute this rule.
+##
+## Call SWIG to generate the various output files; special
+## post-processing on 'mingw32' host OS for the dependency file.
+##
+       if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(gcell_swig_args) \
+               -MD -MF $(DEPDIR)/gcell.Std \
+               -module gcell -o gcell.cc $(WHAT); then \
+           if test $(host_os) = mingw32; then \
+               $(RM) $(DEPDIR)/gcell.Sd; \
+               $(SED) 's,\\\\,/,g' < $(DEPDIR)/gcell.Std \
+                       > $(DEPDIR)/gcell.Sd; \
+               $(RM) $(DEPDIR)/gcell.Std; \
+               $(MV) $(DEPDIR)/gcell.Sd $(DEPDIR)/gcell.Std; \
+           fi; \
+       else \
+           $(RM) $(DEPDIR)/gcell.S*; exit 1; \
+       fi;
+##
+## Mess with the SWIG output .Std dependency file, to create a
+## dependecy file valid for the input .i file: Basically, simulate the
+## dependency file created for libraries by GNU's libtool for C++,
+## where all of the dependencies for the target are first listed, then
+## each individual dependency is listed as a target with no further
+## dependencies.
+##
+## (1) remove the current dependency file
+##
+       $(RM) $(DEPDIR)/gcell.d
+##
+## (2) Copy the whole SWIG file:
+##
+       cp $(DEPDIR)/gcell.Std $(DEPDIR)/gcell.d
+##
+## (3) all a carriage return to the end of the dependency file.
+##
+       echo "" >> $(DEPDIR)/gcell.d
+##
+## (4) from the SWIG file, remove the first line (the target); remove
+##     trailing " \" and " " from each line.  Append ":" to each line,
+##     followed by 2 carriage returns, then append this to the end of
+##     the dependency file.
+##
+       $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gcell.Std | \
+               awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gcell.d
+##
+## (5) remove the SWIG-generated file
+##
+       $(RM) $(DEPDIR)/gcell.Std
+##
+## Create the stamp for this filename generation, to signal success in
+## executing this rule; allows other threads waiting on this process
+## to continue.
+##
+       touch $(DEPDIR)/gcell-generate-stamp
+
+# KLUDGE: Force runtime include of a SWIG 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@./$(DEPDIR)/gcell.d@am__quote@
+
index dc5aa3074d9638ca3b690a1be73656ef7553987b..bdea961ea9a19909eccdb52d48912f8926be093a 100644 (file)
@@ -26,5 +26,3 @@ include $(top_srcdir)/Makefile.common
 #dist_ourdata_DATA = README
 
 #dist_ourdata_SCRIPTS = fsm_utils.py
-
-MOSTLYCLEANFILES = *.pyc
index 8cf8f40bdb86f445f383b065ec53877d749924a4..c4b4e1fd7034f7f942f3e90952868810b4e9d659 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2008 Free Software Foundation, Inc.
+# Copyright 2008,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -30,7 +30,7 @@ EXTRA_DIST = \
        usrp_gpio.qsf \
        usrp_gpio.v
 
-MOSTLYCLEANFILES     \
+MOSTLYCLEANFILES +=    \
        db/*            \
        *.rpt           \
        *.summary       \
@@ -38,5 +38,4 @@ MOSTLYCLEANFILES =    \
        *.smsg          \
        *.done          \
        *.pin           \
-       *.sof           \
-       *~
+       *.sof
index ee5bdaadd895718aaa4c7c8391771ab154b9dfb7..427047cdf6ffb08ecd66853a5e3bf8b26b70f00a 100644 (file)
@@ -35,5 +35,3 @@ dist_bin_SCRIPTS =                    \
     gpio_rx_sfile.py                   \
     gpio_usrp_siggen.py                \
     gpio_usrp_fft.py
-
-MOSTLYCLEANFILES = *.pyo *.pyc *~
index 82646adb799135905aff82d5ceeed9600c8fa58d..0cf0fb0788fe67653f15cf72e89ea1fae324d6ad 100644 (file)
@@ -23,75 +23,39 @@ include $(top_srcdir)/Makefile.common
 
 SUBDIRS = gsm .
 
-# Install this stuff so that it ends up as the gnuradio.vocoder module
-# This usually ends up at:
-#   ${prefix}/lib/python${python_version}/site-packages/gnuradio/vocoder
-
-ourpythondir = $(grpythondir)/vocoder
-ourlibdir    = $(grpyexecdir)/vocoder
-
 AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES)
 
-ALL_IFILES =                           \
-       $(LOCAL_IFILES)                 \
-       $(NON_LOCAL_IFILES)             
-
-NON_LOCAL_IFILES =                     \
-       $(GNURADIO_I)
-
-LOCAL_IFILES =                                 \
-       $(srcdir)/gsm_full_rate.i
-
-# These files are built by SWIG.  The first is the C++ glue.
-# The second is the python wrapper that loads the _howto shared library
-# and knows how to call our extensions.
+# C/C++ headers get installed in ${prefix}/include/gnuradio
+grinclude_HEADERS =                    \
+       gsm_fr_decode_ps.h              \
+       gsm_fr_encode_sp.h
 
-BUILT_SOURCES =                        \
-       gsm_full_rate.cc                \
-       gsm_full_rate.py                                
+# SWIG interface and library
 
-# This gets gsm_full_rate.py installed in the right place
-ourpython_PYTHON =                     \
-       gsm_full_rate.py
+TOP_SWIG_IFILES =                      \
+       gsm_full_rate.i
 
-ourlib_LTLIBRARIES = _gsm_full_rate.la
+# Install so that they end up available as:
+#   import gnuradio.vocoder.gsm_full_rate
+# This ends up at:
+#   ${prefix}/lib/python${python_version}/site-packages/gnuradio/vocoder
+gsm_full_rate_pythondir_category =     \
+       gnuradio/vocoder
 
-# These are the source files that go into the shared library
-_gsm_full_rate_la_SOURCES =            \
+# additional sources for the SWIG-generated library
+gsm_full_rate_la_swig_sources =        \
        gsm_fr_decode_ps.cc             \
-       gsm_fr_encode_sp.cc             \
-       gsm_full_rate.cc                
-
-
-# magic flags
-_gsm_full_rate_la_LDFLAGS = $(NO_UNDEFINED) -module -avoid-version
-
-# link the library against the gsm library and the
-# c++ standard library
-_gsm_full_rate_la_LIBADD =     \
-       gsm/libgsm.la           \
-       $(PYTHON_LDFLAGS)       \
-       $(GNURADIO_CORE_LA)     \
-       -lstdc++                        
-
-gsm_full_rate.cc gsm_full_rate.py: $(ALL_IFILES)
-       $(SWIG) $(STD_SWIG_PYTHON_ARGS) -module gsm_full_rate \
-               -o gsm_full_rate.cc $(LOCAL_IFILES)
-
-# These headers get installed in ${prefix}/include/gnuradio
-grinclude_HEADERS =                    \
-       gsm_fr_decode_ps.h              \
-       gsm_fr_encode_sp.h              
-
-# These swig headers get installed in ${prefix}/include/gnuradio/swig
-swiginclude_HEADERS =                  \
-       $(LOCAL_IFILES)
+       gsm_fr_encode_sp.cc
 
+# additional libraries for linking with the SWIG-generated library
+gsm_full_rate_la_swig_libadd =         \
+       $(GNURADIO_CORE_LA)             \
+       gsm/libgsm.la
 
-MOSTLYCLEANFILES = $(BUILT_SOURCES) *.pyc
+include $(top_srcdir)/Makefile.swig
 
-# 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
+# add some of the variables generated inside the Makefile.swig.gen
+BUILT_SOURCES = $(swig_built_sources)
 
+# Do not distribute the output of SWIG
+no_dist_files = $(swig_built_sources)
diff --git a/gr-gsm-fr-vocoder/src/lib/Makefile.swig.gen b/gr-gsm-fr-vocoder/src/lib/Makefile.swig.gen
new file mode 100644 (file)
index 0000000..5446f34
--- /dev/null
@@ -0,0 +1,259 @@
+# -*- Makefile -*-
+#
+# Copyright 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.
+# 
+
+# Makefile.swig.gen for gsm_full_rate.i
+
+## Default install locations for these files:
+##
+## Default location for the Python directory is:
+##  ${prefix}/lib/python${python_version}/site-packages/[category]/gsm_full_rate
+## Default location for the Python exec directory is:
+##  ${exec_prefix}/lib/python${python_version}/site-packages/[category]/gsm_full_rate
+##
+## The following can be overloaded to change the install location, but
+## this has to be done in the including Makefile.am -before-
+## Makefile.swig is included.
+
+gsm_full_rate_pythondir_category ?= gnuradio/gsm_full_rate
+gsm_full_rate_pylibdir_category ?= $(gsm_full_rate_pythondir_category)
+gsm_full_rate_pythondir = $(pythondir)/$(gsm_full_rate_pythondir_category)
+gsm_full_rate_pylibdir = $(pyexecdir)/$(gsm_full_rate_pylibdir_category)
+
+## SWIG headers are always installed into the same directory.
+
+gsm_full_rate_swigincludedir = $(swigincludedir)
+
+## This is a template file for a "generated" Makefile addition (in
+## this case, "Makefile.swig.gen").  By including the top-level
+## Makefile.swig, this file will be used to generate the SWIG
+## dependencies.  Assign the variable TOP_SWIG_FILES to be the list of
+## SWIG .i files to generated wrappings for; there can be more than 1
+## so long as the names are unique (no sorting is done on the
+## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i
+## file will generate .cc, .py, and possibly .h files -- meaning that
+## all of these files will have the same base name (that provided for
+## the SWIG .i file).
+##
+## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the
+## right thing.  For more info, see <
+## http://sources.redhat.com/automake/automake.html#Multiple-Outputs >
+
+## Stamps used to ensure parallel make does the right thing.  These
+## are removed by "make clean", but otherwise unused except during the
+## parallel built.  These will not be included in a tarball, because
+## the SWIG-generated files will be removed from the distribution.
+
+STAMPS += $(DEPDIR)/gsm_full_rate-generate-*
+
+## Other cleaned files: dependency files generated by SWIG or this Makefile
+
+MOSTLYCLEANFILES += $(DEPDIR)/*.S*
+
+## Add the .py and .cc files to the list of SWIG built sources.  The
+## .h file is sometimes built, but not always ... so that one has to
+## be added manually by the including Makefile.am .
+
+swig_built_sources += gsm_full_rate.py gsm_full_rate.cc
+
+## Various SWIG variables.  These can be overloaded in the including
+## Makefile.am by setting the variable value there, then including
+## Makefile.swig .
+
+gsm_full_rate_swiginclude_HEADERS =            \
+       gsm_full_rate.i                 \
+       $(gsm_full_rate_swiginclude_headers)
+
+gsm_full_rate_pylib_LTLIBRARIES =              \
+       _gsm_full_rate.la
+
+_gsm_full_rate_la_SOURCES =                    \
+       gsm_full_rate.cc                        \
+       $(gsm_full_rate_la_swig_sources)
+
+_gsm_full_rate_la_LIBADD =                     \
+       $(STD_SWIG_LA_LIB_ADD)          \
+       $(gsm_full_rate_la_swig_libadd)
+
+_gsm_full_rate_la_LDFLAGS =                    \
+       $(STD_SWIG_LA_LD_FLAGS)         \
+       $(gsm_full_rate_la_swig_ldflags)
+
+_gsm_full_rate_la_CXXFLAGS =                   \
+       $(STD_SWIG_CXX_FLAGS)           \
+       $(gsm_full_rate_la_swig_cxxflags)
+
+gsm_full_rate_python_PYTHON =                  \
+       gsm_full_rate.py                        \
+       $(gsm_full_rate_python)
+
+## Entry rule for running SWIG
+
+gsm_full_rate.h gsm_full_rate.py gsm_full_rate.cc: gsm_full_rate.i
+## This rule will get called only when MAKE decides that one of the
+## targets needs to be created or re-created, because:
+##
+## * The .i file is newer than any or all of the generated files;
+##
+## * Any or all of the .cc, .h, or .py files does not exist and is
+##   needed (in the case this file is not needed, the rule for it is
+##   ignored); or
+##
+## * Some SWIG-based dependecy of the .cc file isn't met and hence the
+##   .cc file needs be be regenerated.  Explanation: Because MAKE
+##   knows how to handle dependencies for .cc files (regardless of
+##   their name or extension), then the .cc file is used as a target
+##   instead of the .i file -- but with the dependencies of the .i
+##   file.  It is this last reason why the line:
+##
+##             if test -f $@; then :; else
+##
+##   cannot be used in this case: If a .i file dependecy is not met,
+##   then the .cc file needs to be rebuilt.  But if the stamp is newer
+##   than the .cc file, and the .cc file exists, then in the original
+##   version (with the 'test' above) the internal MAKE call will not
+##   be issued and hence the .cc file will not be rebuilt.
+##
+## Once execution gets to here, it should always proceed no matter the
+## state of a stamp (as discussed in link above).  The
+## $(DEPDIR)/gsm_full_rate-generate stuff is used to allow for parallel
+## builds to "do the right thing".  The stamp has no relationship with
+## either the target files or dependency file; it is used solely for
+## the protection of multiple builds during a given call to MAKE.
+##
+## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM
+## (15).  At a caught signal, the quoted command will be issued before
+## exiting.  In this case, remove any stamp, whether temporary of not.
+## The trap is valid until the process exits; the process includes all
+## commands appended via "\"s.
+##
+       trap 'rm -rf $(DEPDIR)/gsm_full_rate-generate-*' 1 2 13 15; \
+##
+## Create a temporary directory, which acts as a lock.  The first
+## process to create the directory will succeed and issue the MAKE
+## command to do the actual work, while all subsequent processes will
+## fail -- leading them to wait for the first process to finish.
+##
+       if mkdir $(DEPDIR)/gsm_full_rate-generate-lock 2>/dev/null; then \
+##
+## This code is being executed by the first process to succeed in
+## creating the directory lock.
+##
+## Remove the stamp associated with this filename.
+##
+               rm -f $(DEPDIR)/gsm_full_rate-generate-stamp; \
+##
+## Tell MAKE to run the rule for creating this stamp.
+##
+               $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gsm_full_rate-generate-stamp WHAT=$<; \
+##
+## Now that the .cc, .h, and .py files have been (re)created from the
+## .i file, future checking of this rule during the same MAKE
+## execution will come back that the rule doesn't need to be executed
+## because none of the conditions mentioned at the start of this rule
+## will be positive.  Remove the the directory lock, which frees up
+## any waiting process(es) to continue.
+##
+               rmdir $(DEPDIR)/gsm_full_rate-generate-lock; \
+       else \
+##
+## This code is being executed by any follower processes while the
+## directory lock is in place.
+##
+## Wait until the first process is done, testing once per second.
+##
+               while test -d $(DEPDIR)/gsm_full_rate-generate-lock; do \
+                       sleep 1; \
+               done; \
+##
+## Succeed if and only if the first process succeeded; exit this
+## process returning the status of the generated stamp.
+##
+               test -f $(DEPDIR)/gsm_full_rate-generate-stamp; \
+               exit $$?; \
+       fi;
+
+$(DEPDIR)/gsm_full_rate-generate-stamp:
+## This rule will be called only by the first process issuing the
+## above rule to succeed in creating the lock directory, after
+## removing the actual stamp file in order to guarantee that MAKE will
+## execute this rule.
+##
+## Call SWIG to generate the various output files; special
+## post-processing on 'mingw32' host OS for the dependency file.
+##
+       if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(gsm_full_rate_swig_args) \
+               -MD -MF $(DEPDIR)/gsm_full_rate.Std \
+               -module gsm_full_rate -o gsm_full_rate.cc $(WHAT); then \
+           if test $(host_os) = mingw32; then \
+               $(RM) $(DEPDIR)/gsm_full_rate.Sd; \
+               $(SED) 's,\\\\,/,g' < $(DEPDIR)/gsm_full_rate.Std \
+                       > $(DEPDIR)/gsm_full_rate.Sd; \
+               $(RM) $(DEPDIR)/gsm_full_rate.Std; \
+               $(MV) $(DEPDIR)/gsm_full_rate.Sd $(DEPDIR)/gsm_full_rate.Std; \
+           fi; \
+       else \
+           $(RM) $(DEPDIR)/gsm_full_rate.S*; exit 1; \
+       fi;
+##
+## Mess with the SWIG output .Std dependency file, to create a
+## dependecy file valid for the input .i file: Basically, simulate the
+## dependency file created for libraries by GNU's libtool for C++,
+## where all of the dependencies for the target are first listed, then
+## each individual dependency is listed as a target with no further
+## dependencies.
+##
+## (1) remove the current dependency file
+##
+       $(RM) $(DEPDIR)/gsm_full_rate.d
+##
+## (2) Copy the whole SWIG file:
+##
+       cp $(DEPDIR)/gsm_full_rate.Std $(DEPDIR)/gsm_full_rate.d
+##
+## (3) all a carriage return to the end of the dependency file.
+##
+       echo "" >> $(DEPDIR)/gsm_full_rate.d
+##
+## (4) from the SWIG file, remove the first line (the target); remove
+##     trailing " \" and " " from each line.  Append ":" to each line,
+##     followed by 2 carriage returns, then append this to the end of
+##     the dependency file.
+##
+       $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gsm_full_rate.Std | \
+               awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gsm_full_rate.d
+##
+## (5) remove the SWIG-generated file
+##
+       $(RM) $(DEPDIR)/gsm_full_rate.Std
+##
+## Create the stamp for this filename generation, to signal success in
+## executing this rule; allows other threads waiting on this process
+## to continue.
+##
+       touch $(DEPDIR)/gsm_full_rate-generate-stamp
+
+# KLUDGE: Force runtime include of a SWIG 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@./$(DEPDIR)/gsm_full_rate.d@am__quote@
+
index a230be80e00a1c3303998240c5316784bed236c7..56307aada053766671445349e8256bbd2c8620d6 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2004,2008 Free Software Foundation, Inc.
+# Copyright 2004,2008,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -23,7 +23,9 @@ ACLOCAL_AMFLAGS = -I config
 
 include $(top_srcdir)/Makefile.common
 
-EXTRA_DIST = bootstrap configure config.h.in
+EXTRA_DIST = bootstrap configure config.h.in \
+       Makefile.swig Makefile.swig.gen.t
+
 SUBDIRS = config src
 DIST_SUBDIRS = config src doc
 
index 6b62f25f84884799088f0e68621c2176cf869d09..4b808112511afb5f5c6a50e63496e1c27c303780 100644 (file)
@@ -1,6 +1,6 @@
 # -*- Makefile -*-
 #
-# Copyright 2004,2006 Free Software Foundation, Inc.
+# Copyright 2004,2006,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
 # Boston, MA 02110-1301, USA.
 # 
 
+# these flags are used when compiling non-SWIG-wrapper files
+# when going in to non-SWIG libraries
+AM_CXXFLAGS = @autoconf_default_CXXFLAGS@
+
+# these flags are used when compiling any CXX file
+AM_CPPFLAGS = \
+       $(STD_DEFINES_AND_INCLUDES) \
+       $(PYTHON_CPPFLAGS) \
+       $(CPPUNIT_INCLUDES) \
+       $(GNURADIO_CORE_CPPFLAGS)
+
+# these are used by both SWIG and CXX
+STD_DEFINES_AND_INCLUDES = \
+       $(DEFINES) \
+       -I$(GNURADIO_CORE_INCLUDEDIR) \
+       -I$(GNURADIO_CORE_INCLUDEDIR)/swig
+
 # includes
-grincludedir   = $(includedir)/gnuradio
+grincludedir = $(includedir)/gnuradio
 
 # swig includes 
 swigincludedir = $(grincludedir)/swig
@@ -33,11 +50,18 @@ swigincludedir = $(grincludedir)/swig
 grpythondir = $(pythondir)/gnuradio
 grpyexecdir = $(pyexecdir)/gnuradio
 
-# swig flags
-SWIGPYTHONFLAGS = -fvirtual -python -modern
-SWIGGRFLAGS = -I$(GNURADIO_CORE_INCLUDEDIR)/swig -I$(GNURADIO_CORE_INCLUDEDIR)
-
 # Don't assume that make predefines $(RM), because BSD make does
 # not. We define it now in configure.ac using AM_PATH_PROG, but now
 # here have to add a -f to be like GNU make.
 RM=$(RM_PROG) -f
+
+# Other common defines; use "+=" to add to these
+STAMPS =
+MOSTLYCLEANFILES = $(BUILT_SOURCES) $(STAMPS) *.pyc *.pyo *~ *.tmp *.loT
+
+# Don't distribute the files defined in the variable 'no_dist_files'
+dist-hook:
+       @for file in $(no_dist_files); do \
+               echo $(RM) $(distdir)/$$file; \
+               $(RM) $(distdir)/$$file; \
+       done;
diff --git a/gr-howto-write-a-block/Makefile.swig b/gr-howto-write-a-block/Makefile.swig
new file mode 100644 (file)
index 0000000..9e14835
--- /dev/null
@@ -0,0 +1,117 @@
+# -*- Makefile -*-
+#
+# Copyright 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.
+# 
+
+## This makefile should be included using 
+##     include $(top_srcdir)/Makefile.swig
+## in Makefile.am's which require SWIG wrapping / compilation.
+## For just installing .i files, this Makefile is not required.
+
+## swig flags
+## -w511 turns off keyword argument warning
+## "-outdir $(builddir)" writes all generated output files to
+##   the local builddir (which should always be '.')
+##   In some older autotools, $(builddir) is not defined, so
+##   just use '.' instead.
+
+SWIG_PYTHON_FLAGS =    \
+       -fvirtual       \
+       -python         \
+       -modern         \
+       -keyword        \
+       -w511           \
+       -outdir .
+
+## standard swig flags used by most components
+
+STD_SWIG_PYTHON_ARGS =                         \
+       $(SWIG_PYTHON_FLAGS)                    \
+       $(STD_DEFINES_AND_INCLUDES)             \
+       $(WITH_SWIG_INCLUDES)                   \
+       $(WITH_INCLUDES)
+
+## standard SWIG LD flags for library creation
+
+STD_SWIG_LA_LD_FLAGS =         \
+       $(PYTHON_LDFLAGS)       \
+       -module                 \
+       -avoid-version          \
+       $(NO_UNDEFINED)
+
+## standard SWIG library additions for library creation
+
+STD_SWIG_LA_LIB_ADD =                  \
+       -lstdc++
+
+## standard SWIG CXXFLAGS
+## This allows for code to be compiled with "-O1" instead of "-g -O2"
+## for some systems, avoiding some optimization issues.
+
+STD_SWIG_CXX_FLAGS = @swig_CXXFLAGS@
+
+## SWIG suffix for automake to know about
+
+SUFFIXES = .i
+
+## Create $(srcdir)/Makefile.swig.gen, containing all of the rules
+## for running SWIG to generate or re-generate outputs.  SWIG file
+## names are to be defined in TOP_SWIG_IFILES, and must include the
+## full path to the file and full filename including extension.  This
+## Makefile addition will be made only if either it does not exist or
+## if the top-level template has been modified.
+
+generate-makefile-swig $(srcdir)/Makefile.swig.gen: $(top_srcdir)/Makefile.swig.gen.t
+## recreate $(srcdir)/Makefile.swig.gen only if ...
+       @do_recreate=0; \
+       if test -f $(srcdir)/Makefile.swig.gen; then \
+## the file exists and can be removed; or ...
+               if $(RM) $(srcdir)/Makefile.swig.gen 2>/dev/null; then \
+                       if touch $(srcdir)/Makefile.swig.gen 2>/dev/null; then \
+                               do_recreate=1; \
+                       fi; \
+               fi; \
+       else \
+## the file doesn't exist, but can be created (e.g., by touching it).
+               if touch $(srcdir)/Makefile.swig.gen 2>/dev/null; then \
+                       do_recreate=1; \
+               fi; \
+       fi; \
+       if test "$$do_recreate" == "1"; then \
+               echo "Regenerating $(srcdir)/Makefile.swig.gen"; \
+               for TFILE in $(TOP_SWIG_IFILES); do \
+## retrieve just the filename, without path or extension
+                       TNAME=`python -c "import os.path as op; (dN, fN) = op.split ('$$TFILE'); (fbN, fE) = op.splitext (fN); print fbN;"`; \
+## Replace the @-named strings in the template Makefile for SWIG.
+                       $(SED) -e 's|@NAME@|'$$TNAME'|g;' < $(top_srcdir)/Makefile.swig.gen.t >> $(srcdir)/Makefile.swig.gen; \
+                       echo "" >> $(srcdir)/Makefile.swig.gen; \
+               done; \
+       else \
+               echo "Cannot recreate $(srcdir)/Makefile.swig.gen because the directory or file is write-protected."; \
+               exit -1; \
+       fi;
+
+swig_built_sources =
+
+## include the built Makefile.swig.gen, always the one from the
+## srcdir; this must be included as the last item, because it depends
+## on variables defined above.
+
+include $(srcdir)/Makefile.swig.gen
diff --git a/gr-howto-write-a-block/Makefile.swig.gen.t b/gr-howto-write-a-block/Makefile.swig.gen.t
new file mode 100644 (file)
index 0000000..c15a817
--- /dev/null
@@ -0,0 +1,258 @@
+# -*- Makefile -*-
+#
+# Copyright 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.
+# 
+
+# Makefile.swig.gen for @NAME@.i
+
+## Default install locations for these files:
+##
+## Default location for the Python directory is:
+##  ${prefix}/lib/python${python_version}/site-packages/[category]/@NAME@
+## Default location for the Python exec directory is:
+##  ${exec_prefix}/lib/python${python_version}/site-packages/[category]/@NAME@
+##
+## The following can be overloaded to change the install location, but
+## this has to be done in the including Makefile.am -before-
+## Makefile.swig is included.
+
+@NAME@_pythondir_category ?= gnuradio/@NAME@
+@NAME@_pylibdir_category ?= $(@NAME@_pythondir_category)
+@NAME@_pythondir = $(pythondir)/$(@NAME@_pythondir_category)
+@NAME@_pylibdir = $(pyexecdir)/$(@NAME@_pylibdir_category)
+
+## SWIG headers are always installed into the same directory.
+
+@NAME@_swigincludedir = $(swigincludedir)
+
+## This is a template file for a "generated" Makefile addition (in
+## this case, "Makefile.swig.gen").  By including the top-level
+## Makefile.swig, this file will be used to generate the SWIG
+## dependencies.  Assign the variable TOP_SWIG_FILES to be the list of
+## SWIG .i files to generated wrappings for; there can be more than 1
+## so long as the names are unique (no sorting is done on the
+## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i
+## file will generate .cc, .py, and possibly .h files -- meaning that
+## all of these files will have the same base name (that provided for
+## the SWIG .i file).
+##
+## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the
+## right thing.  For more info, see <
+## http://sources.redhat.com/automake/automake.html#Multiple-Outputs >
+
+## Stamps used to ensure parallel make does the right thing.  These
+## are removed by "make clean", but otherwise unused except during the
+## parallel built.  These will not be included in a tarball, because
+## the SWIG-generated files will be removed from the distribution.
+
+STAMPS += $(DEPDIR)/@NAME@-generate-*
+
+## Other cleaned files: dependency files generated by SWIG or this Makefile
+
+MOSTLYCLEANFILES += $(DEPDIR)/*.S*
+
+## Add the .py and .cc files to the list of SWIG built sources.  The
+## .h file is sometimes built, but not always ... so that one has to
+## be added manually by the including Makefile.am .
+
+swig_built_sources += @NAME@.py @NAME@.cc
+
+## Various SWIG variables.  These can be overloaded in the including
+## Makefile.am by setting the variable value there, then including
+## Makefile.swig .
+
+@NAME@_swiginclude_HEADERS =           \
+       @NAME@.i                        \
+       $(@NAME@_swiginclude_headers)
+
+@NAME@_pylib_LTLIBRARIES =             \
+       _@NAME@.la
+
+_@NAME@_la_SOURCES =                   \
+       @NAME@.cc                       \
+       $(@NAME@_la_swig_sources)
+
+_@NAME@_la_LIBADD =                    \
+       $(STD_SWIG_LA_LIB_ADD)          \
+       $(@NAME@_la_swig_libadd)
+
+_@NAME@_la_LDFLAGS =                   \
+       $(STD_SWIG_LA_LD_FLAGS)         \
+       $(@NAME@_la_swig_ldflags)
+
+_@NAME@_la_CXXFLAGS =                  \
+       $(STD_SWIG_CXX_FLAGS)           \
+       $(@NAME@_la_swig_cxxflags)
+
+@NAME@_python_PYTHON =                 \
+       @NAME@.py                       \
+       $(@NAME@_python)
+
+## Entry rule for running SWIG
+
+@NAME@.h @NAME@.py @NAME@.cc: @NAME@.i
+## This rule will get called only when MAKE decides that one of the
+## targets needs to be created or re-created, because:
+##
+## * The .i file is newer than any or all of the generated files;
+##
+## * Any or all of the .cc, .h, or .py files does not exist and is
+##   needed (in the case this file is not needed, the rule for it is
+##   ignored); or
+##
+## * Some SWIG-based dependecy of the .cc file isn't met and hence the
+##   .cc file needs be be regenerated.  Explanation: Because MAKE
+##   knows how to handle dependencies for .cc files (regardless of
+##   their name or extension), then the .cc file is used as a target
+##   instead of the .i file -- but with the dependencies of the .i
+##   file.  It is this last reason why the line:
+##
+##             if test -f $@; then :; else
+##
+##   cannot be used in this case: If a .i file dependecy is not met,
+##   then the .cc file needs to be rebuilt.  But if the stamp is newer
+##   than the .cc file, and the .cc file exists, then in the original
+##   version (with the 'test' above) the internal MAKE call will not
+##   be issued and hence the .cc file will not be rebuilt.
+##
+## Once execution gets to here, it should always proceed no matter the
+## state of a stamp (as discussed in link above).  The
+## $(DEPDIR)/@NAME@-generate stuff is used to allow for parallel
+## builds to "do the right thing".  The stamp has no relationship with
+## either the target files or dependency file; it is used solely for
+## the protection of multiple builds during a given call to MAKE.
+##
+## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM
+## (15).  At a caught signal, the quoted command will be issued before
+## exiting.  In this case, remove any stamp, whether temporary of not.
+## The trap is valid until the process exits; the process includes all
+## commands appended via "\"s.
+##
+       trap 'rm -rf $(DEPDIR)/@NAME@-generate-*' 1 2 13 15; \
+##
+## Create a temporary directory, which acts as a lock.  The first
+## process to create the directory will succeed and issue the MAKE
+## command to do the actual work, while all subsequent processes will
+## fail -- leading them to wait for the first process to finish.
+##
+       if mkdir $(DEPDIR)/@NAME@-generate-lock 2>/dev/null; then \
+##
+## This code is being executed by the first process to succeed in
+## creating the directory lock.
+##
+## Remove the stamp associated with this filename.
+##
+               rm -f $(DEPDIR)/@NAME@-generate-stamp; \
+##
+## Tell MAKE to run the rule for creating this stamp.
+##
+               $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/@NAME@-generate-stamp WHAT=$<; \
+##
+## Now that the .cc, .h, and .py files have been (re)created from the
+## .i file, future checking of this rule during the same MAKE
+## execution will come back that the rule doesn't need to be executed
+## because none of the conditions mentioned at the start of this rule
+## will be positive.  Remove the the directory lock, which frees up
+## any waiting process(es) to continue.
+##
+               rmdir $(DEPDIR)/@NAME@-generate-lock; \
+       else \
+##
+## This code is being executed by any follower processes while the
+## directory lock is in place.
+##
+## Wait until the first process is done, testing once per second.
+##
+               while test -d $(DEPDIR)/@NAME@-generate-lock; do \
+                       sleep 1; \
+               done; \
+##
+## Succeed if and only if the first process succeeded; exit this
+## process returning the status of the generated stamp.
+##
+               test -f $(DEPDIR)/@NAME@-generate-stamp; \
+               exit $$?; \
+       fi;
+
+$(DEPDIR)/@NAME@-generate-stamp:
+## This rule will be called only by the first process issuing the
+## above rule to succeed in creating the lock directory, after
+## removing the actual stamp file in order to guarantee that MAKE will
+## execute this rule.
+##
+## Call SWIG to generate the various output files; special
+## post-processing on 'mingw32' host OS for the dependency file.
+##
+       if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(@NAME@_swig_args) \
+               -MD -MF $(DEPDIR)/@NAME@.Std \
+               -module @NAME@ -o @NAME@.cc $(WHAT); then \
+           if test $(host_os) = mingw32; then \
+               $(RM) $(DEPDIR)/@NAME@.Sd; \
+               $(SED) 's,\\\\,/,g' < $(DEPDIR)/@NAME@.Std \
+                       > $(DEPDIR)/@NAME@.Sd; \
+               $(RM) $(DEPDIR)/@NAME@.Std; \
+               $(MV) $(DEPDIR)/@NAME@.Sd $(DEPDIR)/@NAME@.Std; \
+           fi; \
+       else \
+           $(RM) $(DEPDIR)/@NAME@.S*; exit 1; \
+       fi;
+##
+## Mess with the SWIG output .Std dependency file, to create a
+## dependecy file valid for the input .i file: Basically, simulate the
+## dependency file created for libraries by GNU's libtool for C++,
+## where all of the dependencies for the target are first listed, then
+## each individual dependency is listed as a target with no further
+## dependencies.
+##
+## (1) remove the current dependency file
+##
+       $(RM) $(DEPDIR)/@NAME@.d
+##
+## (2) Copy the whole SWIG file:
+##
+       cp $(DEPDIR)/@NAME@.Std $(DEPDIR)/@NAME@.d
+##
+## (3) all a carriage return to the end of the dependency file.
+##
+       echo "" >> $(DEPDIR)/@NAME@.d
+##
+## (4) from the SWIG file, remove the first line (the target); remove
+##     trailing " \" and " " from each line.  Append ":" to each line,
+##     followed by 2 carriage returns, then append this to the end of
+##     the dependency file.
+##
+       $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/@NAME@.Std | \
+               awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/@NAME@.d
+##
+## (5) remove the SWIG-generated file
+##
+       $(RM) $(DEPDIR)/@NAME@.Std
+##
+## Create the stamp for this filename generation, to signal success in
+## executing this rule; allows other threads waiting on this process
+## to continue.
+##
+       touch $(DEPDIR)/@NAME@-generate-stamp
+
+# KLUDGE: Force runtime include of a SWIG 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@./$(DEPDIR)/@NAME@.d@am__quote@
index 0f0fe712ae6d6e0cfa6d50da3b1812ef530de814..f32079abda668e5fc8f8de6f226e7b26384e8a03 100644 (file)
@@ -1,10 +1,10 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
-#   Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+#   Free Software Foundation, Inc.
 
-timestamp='2007-03-06'
+timestamp='2008-01-23'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -56,8 +56,8 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -330,7 +330,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
        echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
        exit ;;
-    i86pc:SunOS:5.*:*)
+    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
        echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
        exit ;;
     sun4*:SunOS:6*:*)
@@ -532,7 +532,7 @@ EOF
                echo rs6000-ibm-aix3.2
        fi
        exit ;;
-    *:AIX:*:[45])
+    *:AIX:*:[456])
        IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
        if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
                IBM_ARCH=rs6000
@@ -793,12 +793,15 @@ EOF
        exit ;;
     *:Interix*:[3456]*)
        case ${UNAME_MACHINE} in
-           x86) 
+           x86)
                echo i586-pc-interix${UNAME_RELEASE}
                exit ;;
            EM64T | authenticamd)
                echo x86_64-unknown-interix${UNAME_RELEASE}
                exit ;;
+           IA64)
+               echo ia64-unknown-interix${UNAME_RELEASE}
+               exit ;;
        esac ;;
     [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
        echo i${UNAME_MACHINE}-pc-mks
@@ -833,7 +836,14 @@ EOF
        echo ${UNAME_MACHINE}-pc-minix
        exit ;;
     arm*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-gnu
+       eval $set_cc_for_build
+       if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+           | grep -q __ARM_EABI__
+       then
+           echo ${UNAME_MACHINE}-unknown-linux-gnu
+       else
+           echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+       fi
        exit ;;
     avr32*:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-gnu
@@ -954,8 +964,8 @@ EOF
     x86_64:Linux:*:*)
        echo x86_64-unknown-linux-gnu
        exit ;;
-    xtensa:Linux:*:*)
-       echo xtensa-unknown-linux-gnu
+    xtensa*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit ;;
     i*86:Linux:*:*)
        # The BFD linker knows what the default object file format is, so
@@ -1474,9 +1484,9 @@ This script, last modified $timestamp, has failed to recognize
 the operating system you are using. It is advised that you
 download the most up to date version of the config scripts from
 
-  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
 and
-  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
 
 If the version you run ($0) is already up to date, please
 send the following data and any information you think might be
index 5defff65a6e4cd091921d9bcab0ab286092ec39e..6759825a5b7fcf64476b4398dc0e30b3090b925c 100644 (file)
@@ -1,10 +1,10 @@
 #! /bin/sh
 # Configuration validation subroutine script.
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
-#   Inc.
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+#   Free Software Foundation, Inc.
 
-timestamp='2007-01-18'
+timestamp='2008-01-16'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -72,8 +72,8 @@ Report bugs and patches to <config-patches@gnu.org>."
 version="\
 GNU config.sub ($timestamp)
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -369,10 +369,14 @@ case $basic_machine in
        | v850-* | v850e-* | vax-* \
        | we32k-* \
        | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
-       | xstormy16-* | xtensa-* \
+       | xstormy16-* | xtensa*-* \
        | ymp-* \
        | z8k-*)
                ;;
+       # Recognize the basic CPU types without company name, with glob match.
+       xtensa*)
+               basic_machine=$basic_machine-unknown
+               ;;
        # Recognize the various machine names and aliases which stand
        # for a CPU type and a company and sometimes even an OS.
        386bsd)
@@ -443,6 +447,14 @@ case $basic_machine in
                basic_machine=ns32k-sequent
                os=-dynix
                ;;
+       blackfin)
+               basic_machine=bfin-unknown
+               os=-linux
+               ;;
+       blackfin-*)
+               basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
        c90)
                basic_machine=c90-cray
                os=-unicos
@@ -475,8 +487,8 @@ case $basic_machine in
                basic_machine=craynv-cray
                os=-unicosmp
                ;;
-       cr16c)
-               basic_machine=cr16c-unknown
+       cr16)
+               basic_machine=cr16-unknown
                os=-elf
                ;;
        crds | unos)
@@ -668,6 +680,14 @@ case $basic_machine in
                basic_machine=m68k-isi
                os=-sysv
                ;;
+       m68knommu)
+               basic_machine=m68k-unknown
+               os=-linux
+               ;;
+       m68knommu-*)
+               basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
        m88k-omron*)
                basic_machine=m88k-omron
                ;;
@@ -683,6 +703,10 @@ case $basic_machine in
                basic_machine=i386-pc
                os=-mingw32
                ;;
+       mingw32ce)
+               basic_machine=arm-unknown
+               os=-mingw32ce
+               ;;
        miniframe)
                basic_machine=m68000-convergent
                ;;
@@ -809,6 +833,14 @@ case $basic_machine in
                basic_machine=i860-intel
                os=-osf
                ;;
+       parisc)
+               basic_machine=hppa-unknown
+               os=-linux
+               ;;
+       parisc-*)
+               basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
        pbd)
                basic_machine=sparc-tti
                ;;
@@ -1017,6 +1049,10 @@ case $basic_machine in
                basic_machine=tic6x-unknown
                os=-coff
                ;;
+       tile*)
+               basic_machine=tile-unknown
+               os=-linux-gnu
+               ;;
        tx39)
                basic_machine=mipstx39-unknown
                ;;
index a00d502db7463ca14f2395071fa5a55602b06122..44d9235f45fd5925a5d7e0ba98de356e232206c4 100644 (file)
@@ -1,5 +1,5 @@
 dnl
-dnl Copyright 2008 Free Software Foundation, Inc.
+dnl Copyright 2008,2009 Free Software Foundation, Inc.
 dnl 
 dnl This file is part of GNU Radio
 dnl 
@@ -37,10 +37,41 @@ m4_define([GR_STANDALONE],
 
   AM_INIT_AUTOMAKE
 
+  dnl Remember if the user explicity set CXXFLAGS
+  if test -n "${CXXFLAGS}"; then
+    user_set_cxxflags=yes
+  fi
+
   LF_CONFIGURE_CC
   LF_CONFIGURE_CXX
   GR_LIB64             dnl check for lib64 suffix after choosing compilers
 
+  dnl The three macros above are known to override CXXFLAGS if the user
+  dnl didn't specify them.  Though I'm sure somebody thought this was
+  dnl a good idea, it makes it hard to use other than -g -O2 when compiling
+  dnl selected files.  Thus we "undo" the damage here...
+  dnl 
+  dnl If the user specified CXXFLAGS, we use them.  Otherwise when compiling
+  dnl the output of swig use use -O1 if we're using g++.
+  dnl See Makefile.common for the rest of the magic.
+  if test "$user_set_cxxflags" != yes; then
+    autoconf_default_CXXFLAGS="$CXXFLAGS"
+    if test "$GXX" = yes; then
+      case "$host_cpu" in
+       powerpc*)
+          dnl "-O1" is broken on the PPC for some reason
+          dnl (at least as of g++ 4.1.1)
+          swig_CXXFLAGS="-g1 -O2 -Wno-strict-aliasing -Wno-parentheses"
+       ;;
+       *) 
+       swig_CXXFLAGS="-g -O1 -Wno-strict-aliasing -Wno-parentheses"
+       ;;
+      esac
+    fi
+  fi
+  AC_SUBST(autoconf_default_CXXFLAGS)
+  AC_SUBST(swig_CXXFLAGS)
+
   dnl add ${prefix}/lib${gr_libdir_suffix}/pkgconfig to the head of the PKG_CONFIG_PATH
   if test x${PKG_CONFIG_PATH} = x; then
       PKG_CONFIG_PATH=${prefix}/lib${gr_libdir_suffix}/pkgconfig
@@ -67,13 +98,6 @@ m4_define([GR_STANDALONE],
   GR_NO_UNDEFINED      dnl do we need the -no-undefined linker flag
   GR_SCRIPTING         dnl Locate python, SWIG, etc
 
-  dnl Set the c++ compiler that we use for the build system when cross compiling
-  if test "x$CXX_FOR_BUILD" = x
-  then
-    CXX_FOR_BUILD=${CXX}
-  fi
-  AC_SUBST(CXX_FOR_BUILD)
-
   dnl Checks for header files.
   AC_HEADER_STDC
 
index b9d1c9c08d4587bdde11f3a78fcd6075af3091eb..b75e1a4c54f1e0a485911e368ec3456c6f45812e 100644 (file)
@@ -36,7 +36,6 @@ AC_DEFUN([LF_CONFIGURE_CC],[
   AC_REQUIRE([AC_PROG_CPP])dnl
   AC_REQUIRE([AC_AIX])dnl
   AC_REQUIRE([AC_ISC_POSIX])dnl
-  AC_REQUIRE([AC_MINIX])dnl
   AC_REQUIRE([AC_HEADER_STDC])dnl
 ])
 
index c1a7c77feb18274fcb00d128a0ec7aa2c74e6bc0..da456e03cd283fb2ef821c5098ae37b72971771b 100644 (file)
@@ -59,10 +59,6 @@ dnl AX_BOOST_TEST_EXEC_MONITOR
 dnl AX_BOOST_UNIT_TEST_FRAMEWORK
 dnl AX_BOOST_WSERIALIZATION
 
-
-STD_DEFINES_AND_INCLUDES="$GNURADIO_CORE_CFLAGS"
-AC_SUBST(STD_DEFINES_AND_INCLUDES)
 AC_CONFIG_FILES([\
          Makefile \
          config/Makefile \
index c6fe7ca441de438497ef731ea2ec1007a8aace2a..5b6d5136a58d66df00a26a7e7a1fded121e50a58 100644 (file)
 
 include $(top_srcdir)/Makefile.common
 
-# Install this stuff so that it ends up as the gnuradio.howto module
-# This usually ends up at:
-#   ${prefix}/lib/python${python_version}/site-packages/gnuradio
-
-ourpythondir = $(grpythondir)
-ourlibdir    = $(grpyexecdir)
-
-AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS)
-
-SWIG_PYTHON_ARGS = $(SWIG_PYTHON_FLAGS) $(SWIGGRFLAGS)
-
-ALL_IFILES =                           \
-       $(LOCAL_IFILES)                 \
-       $(NON_LOCAL_IFILES)             
+# C/C++ headers get installed in ${prefix}/include/gnuradio
+grinclude_HEADERS =            \
+       howto_square_ff.h       \
+       howto_square2_ff.h
 
-NON_LOCAL_IFILES =                     \
-       $(GNURADIO_CORE_INCLUDEDIR)/swig/gnuradio.i
+###################################
+# SWIG Python interface and library
 
+TOP_SWIG_IFILES =              \
+       howto.i
 
-LOCAL_IFILES =                                 \
-       $(srcdir)/howto.i                               
-
-# These files are built by SWIG.  The first is the C++ glue.
-# The second is the python wrapper that loads the _howto shared library
-# and knows how to call our extensions.
-
-BUILT_SOURCES =                        \
-       howto.cc                        \
-       howto.py                                
-
-# This gets howto.py installed in the right place
-ourpython_PYTHON =                     \
-       howto.py
-
-ourlib_LTLIBRARIES = _howto.la
+# Install so that they end up available as:
+#   import gnuradio.howto
+# This ends up at:
+#   ${prefix}/lib/python${python_version}/site-packages/gnuradio
+howto_pythondir_category =     \
+       gnuradio
 
-# These are the source files that go into the shared library
-_howto_la_SOURCES =                    \
-       howto.cc                        \
-       howto_square_ff.cc              \
-       howto_square2_ff.cc             
+# additional arguments to the SWIG command
+#howto_la_swig_args =          \
+#      -g
 
-# magic flags
-_howto_la_LDFLAGS = $(NO_UNDEFINED) -module -avoid-version
+# additional sources for the SWIG-generated library
+howto_la_swig_sources =        \
+       howto_square_ff.cc      \
+       howto_square2_ff.cc
 
-# link the library against some comon swig runtime code and the 
-# c++ standard library
-_howto_la_LIBADD =                     \
-       $(PYTHON_LDFLAGS)               \
-       -lstdc++                        
+# additional arguments to the SWIG command
+#howto_la_swig_args =          \
+#      $(SWIG_PYTHON_ARGS)
 
-howto.cc howto.py: $(ALL_IFILES)
-       $(SWIG) $(STD_SWIG_PYTHON_ARGS) -module howto \
-               -o howto.cc $(LOCAL_IFILES)
+# additional libraries for linking with the SWIG-generated library
+#howto_la_swig_libadd =                \
+#      libm.dylib
 
-# These headers get installed in ${prefix}/include/gnuradio
-grinclude_HEADERS =                    \
-       howto_square_ff.h               \
-       howto_square2_ff.h              
+# additional LD flags for linking the SWIG-generated library
+#howto_la_swig_ldflags =       \
+#      -L/opt/local/bin
 
+# additional Python files to be installed along with the SWIG-generated one
+#howto_python =                        \
+#      __init__.py
 
-# These swig headers get installed in ${prefix}/include/gnuradio/swig
-swiginclude_HEADERS =                  \
-       $(LOCAL_IFILES)
+# additional SWIG files to be installed
+#howto_swiginclude_headers =   \
+#      nothing.i
 
+include $(top_srcdir)/Makefile.swig
 
-MOSTLYCLEANFILES = $(BUILT_SOURCES) *.pyc
+# add some of the variables generated inside the Makefile.swig.gen
+BUILT_SOURCES = $(swig_built_sources)
 
-# 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
+# Do not distribute the output of SWIG
+no_dist_files = $(swig_built_sources)
diff --git a/gr-howto-write-a-block/src/lib/Makefile.swig.gen b/gr-howto-write-a-block/src/lib/Makefile.swig.gen
new file mode 100644 (file)
index 0000000..f76cc63
--- /dev/null
@@ -0,0 +1,259 @@
+# -*- Makefile -*-
+#
+# Copyright 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.
+# 
+
+# Makefile.swig.gen for howto.i
+
+## Default install locations for these files:
+##
+## Default location for the Python directory is:
+##  ${prefix}/lib/python${python_version}/site-packages/[category]/howto
+## Default location for the Python exec directory is:
+##  ${exec_prefix}/lib/python${python_version}/site-packages/[category]/howto
+##
+## The following can be overloaded to change the install location, but
+## this has to be done in the including Makefile.am -before-
+## Makefile.swig is included.
+
+howto_pythondir_category ?= gnuradio/howto
+howto_pylibdir_category ?= $(howto_pythondir_category)
+howto_pythondir = $(pythondir)/$(howto_pythondir_category)
+howto_pylibdir = $(pyexecdir)/$(howto_pylibdir_category)
+
+## SWIG headers are always installed into the same directory.
+
+howto_swigincludedir = $(swigincludedir)
+
+## This is a template file for a "generated" Makefile addition (in
+## this case, "Makefile.swig.gen").  By including the top-level
+## Makefile.swig, this file will be used to generate the SWIG
+## dependencies.  Assign the variable TOP_SWIG_FILES to be the list of
+## SWIG .i files to generated wrappings for; there can be more than 1
+## so long as the names are unique (no sorting is done on the
+## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i
+## file will generate .cc, .py, and possibly .h files -- meaning that
+## all of these files will have the same base name (that provided for
+## the SWIG .i file).
+##
+## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the
+## right thing.  For more info, see <
+## http://sources.redhat.com/automake/automake.html#Multiple-Outputs >
+
+## Stamps used to ensure parallel make does the right thing.  These
+## are removed by "make clean", but otherwise unused except during the
+## parallel built.  These will not be included in a tarball, because
+## the SWIG-generated files will be removed from the distribution.
+
+STAMPS += $(DEPDIR)/howto-generate-*
+
+## Other cleaned files: dependency files generated by SWIG or this Makefile
+
+MOSTLYCLEANFILES += $(DEPDIR)/*.S*
+
+## Add the .py and .cc files to the list of SWIG built sources.  The
+## .h file is sometimes built, but not always ... so that one has to
+## be added manually by the including Makefile.am .
+
+swig_built_sources += howto.py howto.cc
+
+## Various SWIG variables.  These can be overloaded in the including
+## Makefile.am by setting the variable value there, then including
+## Makefile.swig .
+
+howto_swiginclude_HEADERS =            \
+       howto.i                 \
+       $(howto_swiginclude_headers)
+
+howto_pylib_LTLIBRARIES =              \
+       _howto.la
+
+_howto_la_SOURCES =                    \
+       howto.cc                        \
+       $(howto_la_swig_sources)
+
+_howto_la_LIBADD =                     \
+       $(STD_SWIG_LA_LIB_ADD)          \
+       $(howto_la_swig_libadd)
+
+_howto_la_LDFLAGS =                    \
+       $(STD_SWIG_LA_LD_FLAGS)         \
+       $(howto_la_swig_ldflags)
+
+_howto_la_CXXFLAGS =                   \
+       $(STD_SWIG_CXX_FLAGS)           \
+       $(howto_la_swig_cxxflags)
+
+howto_python_PYTHON =                  \
+       howto.py                        \
+       $(howto_python)
+
+## Entry rule for running SWIG
+
+howto.h howto.py howto.cc: howto.i
+## This rule will get called only when MAKE decides that one of the
+## targets needs to be created or re-created, because:
+##
+## * The .i file is newer than any or all of the generated files;
+##
+## * Any or all of the .cc, .h, or .py files does not exist and is
+##   needed (in the case this file is not needed, the rule for it is
+##   ignored); or
+##
+## * Some SWIG-based dependecy of the .cc file isn't met and hence the
+##   .cc file needs be be regenerated.  Explanation: Because MAKE
+##   knows how to handle dependencies for .cc files (regardless of
+##   their name or extension), then the .cc file is used as a target
+##   instead of the .i file -- but with the dependencies of the .i
+##   file.  It is this last reason why the line:
+##
+##             if test -f $@; then :; else
+##
+##   cannot be used in this case: If a .i file dependecy is not met,
+##   then the .cc file needs to be rebuilt.  But if the stamp is newer
+##   than the .cc file, and the .cc file exists, then in the original
+##   version (with the 'test' above) the internal MAKE call will not
+##   be issued and hence the .cc file will not be rebuilt.
+##
+## Once execution gets to here, it should always proceed no matter the
+## state of a stamp (as discussed in link above).  The
+## $(DEPDIR)/howto-generate stuff is used to allow for parallel
+## builds to "do the right thing".  The stamp has no relationship with
+## either the target files or dependency file; it is used solely for
+## the protection of multiple builds during a given call to MAKE.
+##
+## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM
+## (15).  At a caught signal, the quoted command will be issued before
+## exiting.  In this case, remove any stamp, whether temporary of not.
+## The trap is valid until the process exits; the process includes all
+## commands appended via "\"s.
+##
+       trap 'rm -rf $(DEPDIR)/howto-generate-*' 1 2 13 15; \
+##
+## Create a temporary directory, which acts as a lock.  The first
+## process to create the directory will succeed and issue the MAKE
+## command to do the actual work, while all subsequent processes will
+## fail -- leading them to wait for the first process to finish.
+##
+       if mkdir $(DEPDIR)/howto-generate-lock 2>/dev/null; then \
+##
+## This code is being executed by the first process to succeed in
+## creating the directory lock.
+##
+## Remove the stamp associated with this filename.
+##
+               rm -f $(DEPDIR)/howto-generate-stamp; \
+##
+## Tell MAKE to run the rule for creating this stamp.
+##
+               $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/howto-generate-stamp WHAT=$<; \
+##
+## Now that the .cc, .h, and .py files have been (re)created from the
+## .i file, future checking of this rule during the same MAKE
+## execution will come back that the rule doesn't need to be executed
+## because none of the conditions mentioned at the start of this rule
+## will be positive.  Remove the the directory lock, which frees up
+## any waiting process(es) to continue.
+##
+               rmdir $(DEPDIR)/howto-generate-lock; \
+       else \
+##
+## This code is being executed by any follower processes while the
+## directory lock is in place.
+##
+## Wait until the first process is done, testing once per second.
+##
+               while test -d $(DEPDIR)/howto-generate-lock; do \
+                       sleep 1; \
+               done; \
+##
+## Succeed if and only if the first process succeeded; exit this
+## process returning the status of the generated stamp.
+##
+               test -f $(DEPDIR)/howto-generate-stamp; \
+               exit $$?; \
+       fi;
+
+$(DEPDIR)/howto-generate-stamp:
+## This rule will be called only by the first process issuing the
+## above rule to succeed in creating the lock directory, after
+## removing the actual stamp file in order to guarantee that MAKE will
+## execute this rule.
+##
+## Call SWIG to generate the various output files; special
+## post-processing on 'mingw32' host OS for the dependency file.
+##
+       if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(howto_swig_args) \
+               -MD -MF $(DEPDIR)/howto.Std \
+               -module howto -o howto.cc $(WHAT); then \
+           if test $(host_os) = mingw32; then \
+               $(RM) $(DEPDIR)/howto.Sd; \
+               $(SED) 's,\\\\,/,g' < $(DEPDIR)/howto.Std \
+                       > $(DEPDIR)/howto.Sd; \
+               $(RM) $(DEPDIR)/howto.Std; \
+               $(MV) $(DEPDIR)/howto.Sd $(DEPDIR)/howto.Std; \
+           fi; \
+       else \
+           $(RM) $(DEPDIR)/howto.S*; exit 1; \
+       fi;
+##
+## Mess with the SWIG output .Std dependency file, to create a
+## dependecy file valid for the input .i file: Basically, simulate the
+## dependency file created for libraries by GNU's libtool for C++,
+## where all of the dependencies for the target are first listed, then
+## each individual dependency is listed as a target with no further
+## dependencies.
+##
+## (1) remove the current dependency file
+##
+       $(RM) $(DEPDIR)/howto.d
+##
+## (2) Copy the whole SWIG file:
+##
+       cp $(DEPDIR)/howto.Std $(DEPDIR)/howto.d
+##
+## (3) all a carriage return to the end of the dependency file.
+##
+       echo "" >> $(DEPDIR)/howto.d
+##
+## (4) from the SWIG file, remove the first line (the target); remove
+##     trailing " \" and " " from each line.  Append ":" to each line,
+##     followed by 2 carriage returns, then append this to the end of
+##     the dependency file.
+##
+       $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/howto.Std | \
+               awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/howto.d
+##
+## (5) remove the SWIG-generated file
+##
+       $(RM) $(DEPDIR)/howto.Std
+##
+## Create the stamp for this filename generation, to signal success in
+## executing this rule; allows other threads waiting on this process
+## to continue.
+##
+       touch $(DEPDIR)/howto-generate-stamp
+
+# KLUDGE: Force runtime include of a SWIG 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@./$(DEPDIR)/howto.d@am__quote@
+
index 2d0899ca06a61795aa8918ff211c69c6af0a8259..b2bf22ab9f10173a713896d0009709b7520a47ce 100644 (file)
 
 include $(top_srcdir)/Makefile.common
 
-# Install this stuff so that it ends up as the gnuradio.howto module
-# This usually ends up at:
-#   ${prefix}/lib/python${python_version}/site-packages/gnuradio
-
-ourpythondir = $(grpythondir)
-ourlibdir    = $(grpyexecdir)
-
-
-#EXTRA_DIST = run_tests.in
-
-#TESTS = run_tests
-
-
-#INCLUDES = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS)
-
 AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) \
        $(WITH_INCLUDES)
 
-NON_LOCAL_IFILES =                     \
-       $(GNURADIO_I)
-
-LOCAL_IFILES =                                 \
-       $(srcdir)/msdd.i
-
-ALL_IFILES =                           \
-       $(LOCAL_IFILES)                 \
-       $(NON_LOCAL_IFILES)             
-
-
-# These files are built by SWIG.  The first is the C++ glue.
-# The second is the python wrapper that loads the _howto shared library
-# and knows how to call our extensions.
+# C/C++ headers get installed in ${prefix}/include/gnuradio
+grinclude_HEADERS =                    \
+       msdd_source_simple.h            \
+       msdd_buffer_copy_behaviors.h    \
+       msdd6000.h
 
-BUILT_SOURCES =                        \
-       msdd.cc                 \
-       msdd.py                         
+#################################
+# SWIG interface and library
 
-# This gets howto.py installed in the right place
-ourpython_PYTHON =                     \
-       msdd.py
+TOP_SWIG_IFILES =                      \
+       msdd.i
 
-ourlib_LTLIBRARIES = _msdd.la
+# Install so that they end up available as:
+#   import gnuradio.msdd
+# This ends up at:
+#   ${prefix}/lib/python${python_version}/site-packages/gnuradio
+msdd_pythondir_category =              \
+       gnuradio
 
-# These are the source files that go into the shared library
-_msdd_la_SOURCES =                     \
-       msdd.cc                 \
-       msdd_source_simple.cc   \
+# additional sources for the SWIG-generated library
+msdd_la_swig_sources =                 \
+       msdd_source_simple.cc           \
        msdd6000.cc
 
-# magic flag
-_msdd_la_LDFLAGS = $(NO_UNDEFINED) -module -avoid-version 
-#-lfftw3 -lfftw3f -lfann 
-
-# link the library against some comon swig runtime code and the 
-# c++ standard library
-_msdd_la_LIBADD =                      \
-       $(GNURADIO_CORE_LA)             \
-       $(PYTHON_LDFLAGS)               \
-       -lstdc++
-
-
-msdd.cc msdd.py: $(ALL_IFILES) 
-       $(SWIG) $(STD_SWIG_PYTHON_ARGS) -module msdd \
-               -o msdd.cc $(LOCAL_IFILES)
-
-# These headers get installed in ${prefix}/include/gnuradio
-grinclude_HEADERS =                    \
-       msdd_source_simple.h                    \
-       msdd_buffer_copy_behaviors.h \
-       msdd6000.h
-
-
-# These swig headers get installed in ${prefix}/include/gnuradio/swig
-swiginclude_HEADERS =                  \
-       $(LOCAL_IFILES)
+# additional libraries for linking with the SWIG-generated library
+msdd_la_swig_libadd =                  \
+       $(GNURADIO_CORE_LA)
 
+include $(top_srcdir)/Makefile.swig
 
-MOSTLYCLEANFILES = $(BUILT_SOURCES) *.pyc
+# add some of the variables generated inside the Makefile.swig.gen
+BUILT_SOURCES = $(swig_built_sources)
 
-# 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
+# Do not distribute the output of SWIG
+no_dist_files = $(swig_built_sources)
diff --git a/gr-msdd6000/src/Makefile.swig.gen b/gr-msdd6000/src/Makefile.swig.gen
new file mode 100644 (file)
index 0000000..5c29202
--- /dev/null
@@ -0,0 +1,259 @@
+# -*- Makefile -*-
+#
+# Copyright 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.
+# 
+
+# Makefile.swig.gen for msdd.i
+
+## Default install locations for these files:
+##
+## Default location for the Python directory is:
+##  ${prefix}/lib/python${python_version}/site-packages/[category]/msdd
+## Default location for the Python exec directory is:
+##  ${exec_prefix}/lib/python${python_version}/site-packages/[category]/msdd
+##
+## The following can be overloaded to change the install location, but
+## this has to be done in the including Makefile.am -before-
+## Makefile.swig is included.
+
+msdd_pythondir_category ?= gnuradio/msdd
+msdd_pylibdir_category ?= $(msdd_pythondir_category)
+msdd_pythondir = $(pythondir)/$(msdd_pythondir_category)
+msdd_pylibdir = $(pyexecdir)/$(msdd_pylibdir_category)
+
+## SWIG headers are always installed into the same directory.
+
+msdd_swigincludedir = $(swigincludedir)
+
+## This is a template file for a "generated" Makefile addition (in
+## this case, "Makefile.swig.gen").  By including the top-level
+## Makefile.swig, this file will be used to generate the SWIG
+## dependencies.  Assign the variable TOP_SWIG_FILES to be the list of
+## SWIG .i files to generated wrappings for; there can be more than 1
+## so long as the names are unique (no sorting is done on the
+## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i
+## file will generate .cc, .py, and possibly .h files -- meaning that
+## all of these files will have the same base name (that provided for
+## the SWIG .i file).
+##
+## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the
+## right thing.  For more info, see <
+## http://sources.redhat.com/automake/automake.html#Multiple-Outputs >
+
+## Stamps used to ensure parallel make does the right thing.  These
+## are removed by "make clean", but otherwise unused except during the
+## parallel built.  These will not be included in a tarball, because
+## the SWIG-generated files will be removed from the distribution.
+
+STAMPS += $(DEPDIR)/msdd-generate-*
+
+## Other cleaned files: dependency files generated by SWIG or this Makefile
+
+MOSTLYCLEANFILES += $(DEPDIR)/*.S*
+
+## Add the .py and .cc files to the list of SWIG built sources.  The
+## .h file is sometimes built, but not always ... so that one has to
+## be added manually by the including Makefile.am .
+
+swig_built_sources += msdd.py msdd.cc
+
+## Various SWIG variables.  These can be overloaded in the including
+## Makefile.am by setting the variable value there, then including
+## Makefile.swig .
+
+msdd_swiginclude_HEADERS =             \
+       msdd.i                  \
+       $(msdd_swiginclude_headers)
+
+msdd_pylib_LTLIBRARIES =               \
+       _msdd.la
+
+_msdd_la_SOURCES =                     \
+       msdd.cc                 \
+       $(msdd_la_swig_sources)
+
+_msdd_la_LIBADD =                      \
+       $(STD_SWIG_LA_LIB_ADD)          \
+       $(msdd_la_swig_libadd)
+
+_msdd_la_LDFLAGS =                     \
+       $(STD_SWIG_LA_LD_FLAGS)         \
+       $(msdd_la_swig_ldflags)
+
+_msdd_la_CXXFLAGS =                    \
+       $(STD_SWIG_CXX_FLAGS)           \
+       $(msdd_la_swig_cxxflags)
+
+msdd_python_PYTHON =                   \
+       msdd.py                 \
+       $(msdd_python)
+
+## Entry rule for running SWIG
+
+msdd.h msdd.py msdd.cc: msdd.i
+## This rule will get called only when MAKE decides that one of the
+## targets needs to be created or re-created, because:
+##
+## * The .i file is newer than any or all of the generated files;
+##
+## * Any or all of the .cc, .h, or .py files does not exist and is
+##   needed (in the case this file is not needed, the rule for it is
+##   ignored); or
+##
+## * Some SWIG-based dependecy of the .cc file isn't met and hence the
+##   .cc file needs be be regenerated.  Explanation: Because MAKE
+##   knows how to handle dependencies for .cc files (regardless of
+##   their name or extension), then the .cc file is used as a target
+##   instead of the .i file -- but with the dependencies of the .i
+##   file.  It is this last reason why the line:
+##
+##             if test -f $@; then :; else
+##
+##   cannot be used in this case: If a .i file dependecy is not met,
+##   then the .cc file needs to be rebuilt.  But if the stamp is newer
+##   than the .cc file, and the .cc file exists, then in the original
+##   version (with the 'test' above) the internal MAKE call will not
+##   be issued and hence the .cc file will not be rebuilt.
+##
+## Once execution gets to here, it should always proceed no matter the
+## state of a stamp (as discussed in link above).  The
+## $(DEPDIR)/msdd-generate stuff is used to allow for parallel
+## builds to "do the right thing".  The stamp has no relationship with
+## either the target files or dependency file; it is used solely for
+## the protection of multiple builds during a given call to MAKE.
+##
+## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM
+## (15).  At a caught signal, the quoted command will be issued before
+## exiting.  In this case, remove any stamp, whether temporary of not.
+## The trap is valid until the process exits; the process includes all
+## commands appended via "\"s.
+##
+       trap 'rm -rf $(DEPDIR)/msdd-generate-*' 1 2 13 15; \
+##
+## Create a temporary directory, which acts as a lock.  The first
+## process to create the directory will succeed and issue the MAKE
+## command to do the actual work, while all subsequent processes will
+## fail -- leading them to wait for the first process to finish.
+##
+       if mkdir $(DEPDIR)/msdd-generate-lock 2>/dev/null; then \
+##
+## This code is being executed by the first process to succeed in
+## creating the directory lock.
+##
+## Remove the stamp associated with this filename.
+##
+               rm -f $(DEPDIR)/msdd-generate-stamp; \
+##
+## Tell MAKE to run the rule for creating this stamp.
+##
+               $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/msdd-generate-stamp WHAT=$<; \
+##
+## Now that the .cc, .h, and .py files have been (re)created from the
+## .i file, future checking of this rule during the same MAKE
+## execution will come back that the rule doesn't need to be executed
+## because none of the conditions mentioned at the start of this rule
+## will be positive.  Remove the the directory lock, which frees up
+## any waiting process(es) to continue.
+##
+               rmdir $(DEPDIR)/msdd-generate-lock; \
+       else \
+##
+## This code is being executed by any follower processes while the
+## directory lock is in place.
+##
+## Wait until the first process is done, testing once per second.
+##
+               while test -d $(DEPDIR)/msdd-generate-lock; do \
+                       sleep 1; \
+               done; \
+##
+## Succeed if and only if the first process succeeded; exit this
+## process returning the status of the generated stamp.
+##
+               test -f $(DEPDIR)/msdd-generate-stamp; \
+               exit $$?; \
+       fi;
+
+$(DEPDIR)/msdd-generate-stamp:
+## This rule will be called only by the first process issuing the
+## above rule to succeed in creating the lock directory, after
+## removing the actual stamp file in order to guarantee that MAKE will
+## execute this rule.
+##
+## Call SWIG to generate the various output files; special
+## post-processing on 'mingw32' host OS for the dependency file.
+##
+       if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(msdd_swig_args) \
+               -MD -MF $(DEPDIR)/msdd.Std \
+               -module msdd -o msdd.cc $(WHAT); then \
+           if test $(host_os) = mingw32; then \
+               $(RM) $(DEPDIR)/msdd.Sd; \
+               $(SED) 's,\\\\,/,g' < $(DEPDIR)/msdd.Std \
+                       > $(DEPDIR)/msdd.Sd; \
+               $(RM) $(DEPDIR)/msdd.Std; \
+               $(MV) $(DEPDIR)/msdd.Sd $(DEPDIR)/msdd.Std; \
+           fi; \
+       else \
+           $(RM) $(DEPDIR)/msdd.S*; exit 1; \
+       fi;
+##
+## Mess with the SWIG output .Std dependency file, to create a
+## dependecy file valid for the input .i file: Basically, simulate the
+## dependency file created for libraries by GNU's libtool for C++,
+## where all of the dependencies for the target are first listed, then
+## each individual dependency is listed as a target with no further
+## dependencies.
+##
+## (1) remove the current dependency file
+##
+       $(RM) $(DEPDIR)/msdd.d
+##
+## (2) Copy the whole SWIG file:
+##
+       cp $(DEPDIR)/msdd.Std $(DEPDIR)/msdd.d
+##
+## (3) all a carriage return to the end of the dependency file.
+##
+       echo "" >> $(DEPDIR)/msdd.d
+##
+## (4) from the SWIG file, remove the first line (the target); remove
+##     trailing " \" and " " from each line.  Append ":" to each line,
+##     followed by 2 carriage returns, then append this to the end of
+##     the dependency file.
+##
+       $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/msdd.Std | \
+               awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/msdd.d
+##
+## (5) remove the SWIG-generated file
+##
+       $(RM) $(DEPDIR)/msdd.Std
+##
+## Create the stamp for this filename generation, to signal success in
+## executing this rule; allows other threads waiting on this process
+## to continue.
+##
+       touch $(DEPDIR)/msdd-generate-stamp
+
+# KLUDGE: Force runtime include of a SWIG 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@./$(DEPDIR)/msdd.d@am__quote@
+
index e4f76c5413878fec048408bcd5266e5c3e9565d8..7297661a1f524189b84999ae986ac7e035fcce48 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2006 Free Software Foundation, Inc.
+# Copyright 2006,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -22,5 +22,3 @@
 include $(top_srcdir)/Makefile.common
 
 SUBDIRS = src
-
-MOSTLYCLEANFILES = *~ *.tmp
\ No newline at end of file
index 7f6f5c128229f473efbd817962de706e2efe0c8e..b12f7b8ff9eb488629fdbb9f8201396644c77f3a 100644 (file)
 
 include $(top_srcdir)/Makefile.common
 
-EXTRA_DIST = \
-    run_tests.in
+EXTRA_DIST = run_tests.in
 
-TESTS = \
-    run_tests
+TESTS = run_tests
 
-dist_bin_SCRIPTS = \
-    usrp_flex.py \
-    usrp_flex_all.py \
-    usrp_flex_band.py
-
-noinst_PYTHON = \
-    qa_pager.py
-
-# Install this stuff so that it ends up as the gnuradio.pgr module
-# This usually ends up at:
-#   ${prefix}/lib/python${python_version}/site-packages/gnuradio/pager
-
-ourpythondir = $(grpythondir)/pager
-ourlibdir    = $(grpyexecdir)/pager
+DISTCLEANFILES = run_tests
 
 AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES)
 
-ALL_IFILES = \
-    $(LOCAL_IFILES) \
-    $(NON_LOCAL_IFILES)        \
-    $(srcdir)/pager_flex_frame.i
-
-NON_LOCAL_IFILES = \
-    $(GNURADIO_I)
-
-LOCAL_IFILES = \
-    $(srcdir)/pager.i
-
-# These files are built by SWIG.  The first is the C++ glue.
-# The second is the python wrapper that loads the _howto shared library
-# and knows how to call our extensions.
-
-BUILT_SOURCES = \
-    pager_swig.cc \
-    pager_swig.py                              
-
-# This gets imported Python objects installed in the right place
-ourpython_PYTHON = \
-    __init__.py \
-    pager_swig.py \
-    pager_utils.py \
-    flex_demod.py
-
-ourlib_LTLIBRARIES = _pager_swig.la
-
-# These are the source files that go into the shared library
-_pager_swig_la_SOURCES = \
-    pager_swig.cc \
-    pager_flex_frame.cc \
-    pager_slicer_fb.cc \
-    pager_flex_sync.cc \
-    pager_flex_deinterleave.cc \
-    pager_flex_parse.cc \
-    pageri_bch3221.cc \
-    pageri_flex_modes.cc \
-    pageri_util.cc
-    # Additional source modules here
-
-# magic flags
-_pager_swig_la_LDFLAGS = $(NO_UNDEFINED) -module -avoid-version
-
-# link the library against the c++ standard library
-_pager_swig_la_LIBADD = \
-    $(PYTHON_LDFLAGS) \
-    $(GNURADIO_CORE_LA) \
-    -lstdc++                   
-
-pager_swig.cc pager_swig.py: $(ALL_IFILES)
-       $(SWIG) $(STD_SWIG_PYTHON_ARGS) -module pager_swig \
-               -o pager_swig.cc $(LOCAL_IFILES)
+dist_bin_SCRIPTS = \
+       usrp_flex.py \
+       usrp_flex_all.py \
+       usrp_flex_band.py
+
+noinst_PYTHON = \
+       qa_pager.py
 
 # These headers get installed in ${prefix}/include/gnuradio
 grinclude_HEADERS = \
-    pager_slicer_fb.h \
-    pager_flex_sync.h \
-    pager_flex_deinterleave.h \
-    pager_flex_parse.h \
-    pager_flex_frame.h \
-    pageri_bch3221.h \
-    pageri_flex_modes.h \
-    pageri_util.h
-    # Additional header files here
-
-# These swig headers get installed in ${prefix}/include/gnuradio/swig
-swiginclude_HEADERS = \
-    $(LOCAL_IFILES) \
-    pager_flex_frame.i
-
-MOSTLYCLEANFILES = $(BUILT_SOURCES) *.pyc *~ *.tmp
-
-# 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
+       pager_slicer_fb.h \
+       pager_flex_sync.h \
+       pager_flex_deinterleave.h \
+       pager_flex_parse.h \
+       pager_flex_frame.h \
+       pageri_bch3221.h \
+       pageri_flex_modes.h \
+       pageri_util.h
+
+##############################
+# SWIG interface and library
+
+TOP_SWIG_IFILES = \
+       pager_swig.i
+
+# Install so that they end up available as:
+#   import gnuradio.pager
+# This ends up at:
+#   ${prefix}/lib/python${python_version}/site-packages/gnuradio/pager
+pager_swig_pythondir_category = \
+       gnuradio/pager
+
+# additional sources for the SWIG-generated library
+pager_swig_la_swig_sources = \
+       pager_flex_frame.cc \
+       pager_slicer_fb.cc \
+       pager_flex_sync.cc \
+       pager_flex_deinterleave.cc \
+       pager_flex_parse.cc \
+       pageri_bch3221.cc \
+       pageri_flex_modes.cc \
+       pageri_util.cc
+
+# additional libraries for linking with the SWIG-generated library
+pager_swig_la_swig_libadd = \
+       $(GNURADIO_CORE_LA)
+
+# additional Python files to be installed along with the SWIG-generated one
+pager_swig_python = \
+       __init__.py \
+       pager_utils.py \
+       flex_demod.py
+
+# additional SWIG files to be installed
+pager_swig_swiginclude_headers = \
+       pager_flex_frame.i
+
+include $(top_srcdir)/Makefile.swig
+
+# add some of the variables generated inside the Makefile.swig.gen
+BUILT_SOURCES = $(swig_built_sources)
+
+# Do not distribute the output of SWIG
+no_dist_files = $(swig_built_sources)
diff --git a/gr-pager/src/Makefile.swig.gen b/gr-pager/src/Makefile.swig.gen
new file mode 100644 (file)
index 0000000..5cfbc66
--- /dev/null
@@ -0,0 +1,259 @@
+# -*- Makefile -*-
+#
+# Copyright 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.
+# 
+
+# Makefile.swig.gen for pager_swig.i
+
+## Default install locations for these files:
+##
+## Default location for the Python directory is:
+##  ${prefix}/lib/python${python_version}/site-packages/[category]/pager_swig
+## Default location for the Python exec directory is:
+##  ${exec_prefix}/lib/python${python_version}/site-packages/[category]/pager_swig
+##
+## The following can be overloaded to change the install location, but
+## this has to be done in the including Makefile.am -before-
+## Makefile.swig is included.
+
+pager_swig_pythondir_category ?= gnuradio/pager_swig
+pager_swig_pylibdir_category ?= $(pager_swig_pythondir_category)
+pager_swig_pythondir = $(pythondir)/$(pager_swig_pythondir_category)
+pager_swig_pylibdir = $(pyexecdir)/$(pager_swig_pylibdir_category)
+
+## SWIG headers are always installed into the same directory.
+
+pager_swig_swigincludedir = $(swigincludedir)
+
+## This is a template file for a "generated" Makefile addition (in
+## this case, "Makefile.swig.gen").  By including the top-level
+## Makefile.swig, this file will be used to generate the SWIG
+## dependencies.  Assign the variable TOP_SWIG_FILES to be the list of
+## SWIG .i files to generated wrappings for; there can be more than 1
+## so long as the names are unique (no sorting is done on the
+## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i
+## file will generate .cc, .py, and possibly .h files -- meaning that
+## all of these files will have the same base name (that provided for
+## the SWIG .i file).
+##
+## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the
+## right thing.  For more info, see <
+## http://sources.redhat.com/automake/automake.html#Multiple-Outputs >
+
+## Stamps used to ensure parallel make does the right thing.  These
+## are removed by "make clean", but otherwise unused except during the
+## parallel built.  These will not be included in a tarball, because
+## the SWIG-generated files will be removed from the distribution.
+
+STAMPS += $(DEPDIR)/pager_swig-generate-*
+
+## Other cleaned files: dependency files generated by SWIG or this Makefile
+
+MOSTLYCLEANFILES += $(DEPDIR)/*.S*
+
+## Add the .py and .cc files to the list of SWIG built sources.  The
+## .h file is sometimes built, but not always ... so that one has to
+## be added manually by the including Makefile.am .
+
+swig_built_sources += pager_swig.py pager_swig.cc
+
+## Various SWIG variables.  These can be overloaded in the including
+## Makefile.am by setting the variable value there, then including
+## Makefile.swig .
+
+pager_swig_swiginclude_HEADERS =               \
+       pager_swig.i                    \
+       $(pager_swig_swiginclude_headers)
+
+pager_swig_pylib_LTLIBRARIES =         \
+       _pager_swig.la
+
+_pager_swig_la_SOURCES =                       \
+       pager_swig.cc                   \
+       $(pager_swig_la_swig_sources)
+
+_pager_swig_la_LIBADD =                        \
+       $(STD_SWIG_LA_LIB_ADD)          \
+       $(pager_swig_la_swig_libadd)
+
+_pager_swig_la_LDFLAGS =                       \
+       $(STD_SWIG_LA_LD_FLAGS)         \
+       $(pager_swig_la_swig_ldflags)
+
+_pager_swig_la_CXXFLAGS =                      \
+       $(STD_SWIG_CXX_FLAGS)           \
+       $(pager_swig_la_swig_cxxflags)
+
+pager_swig_python_PYTHON =                     \
+       pager_swig.py                   \
+       $(pager_swig_python)
+
+## Entry rule for running SWIG
+
+pager_swig.h pager_swig.py pager_swig.cc: pager_swig.i
+## This rule will get called only when MAKE decides that one of the
+## targets needs to be created or re-created, because:
+##
+## * The .i file is newer than any or all of the generated files;
+##
+## * Any or all of the .cc, .h, or .py files does not exist and is
+##   needed (in the case this file is not needed, the rule for it is
+##   ignored); or
+##
+## * Some SWIG-based dependecy of the .cc file isn't met and hence the
+##   .cc file needs be be regenerated.  Explanation: Because MAKE
+##   knows how to handle dependencies for .cc files (regardless of
+##   their name or extension), then the .cc file is used as a target
+##   instead of the .i file -- but with the dependencies of the .i
+##   file.  It is this last reason why the line:
+##
+##             if test -f $@; then :; else
+##
+##   cannot be used in this case: If a .i file dependecy is not met,
+##   then the .cc file needs to be rebuilt.  But if the stamp is newer
+##   than the .cc file, and the .cc file exists, then in the original
+##   version (with the 'test' above) the internal MAKE call will not
+##   be issued and hence the .cc file will not be rebuilt.
+##
+## Once execution gets to here, it should always proceed no matter the
+## state of a stamp (as discussed in link above).  The
+## $(DEPDIR)/pager_swig-generate stuff is used to allow for parallel
+## builds to "do the right thing".  The stamp has no relationship with
+## either the target files or dependency file; it is used solely for
+## the protection of multiple builds during a given call to MAKE.
+##
+## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM
+## (15).  At a caught signal, the quoted command will be issued before
+## exiting.  In this case, remove any stamp, whether temporary of not.
+## The trap is valid until the process exits; the process includes all
+## commands appended via "\"s.
+##
+       trap 'rm -rf $(DEPDIR)/pager_swig-generate-*' 1 2 13 15; \
+##
+## Create a temporary directory, which acts as a lock.  The first
+## process to create the directory will succeed and issue the MAKE
+## command to do the actual work, while all subsequent processes will
+## fail -- leading them to wait for the first process to finish.
+##
+       if mkdir $(DEPDIR)/pager_swig-generate-lock 2>/dev/null; then \
+##
+## This code is being executed by the first process to succeed in
+## creating the directory lock.
+##
+## Remove the stamp associated with this filename.
+##
+               rm -f $(DEPDIR)/pager_swig-generate-stamp; \
+##
+## Tell MAKE to run the rule for creating this stamp.
+##
+               $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/pager_swig-generate-stamp WHAT=$<; \
+##
+## Now that the .cc, .h, and .py files have been (re)created from the
+## .i file, future checking of this rule during the same MAKE
+## execution will come back that the rule doesn't need to be executed
+## because none of the conditions mentioned at the start of this rule
+## will be positive.  Remove the the directory lock, which frees up
+## any waiting process(es) to continue.
+##
+               rmdir $(DEPDIR)/pager_swig-generate-lock; \
+       else \
+##
+## This code is being executed by any follower processes while the
+## directory lock is in place.
+##
+## Wait until the first process is done, testing once per second.
+##
+               while test -d $(DEPDIR)/pager_swig-generate-lock; do \
+                       sleep 1; \
+               done; \
+##
+## Succeed if and only if the first process succeeded; exit this
+## process returning the status of the generated stamp.
+##
+               test -f $(DEPDIR)/pager_swig-generate-stamp; \
+               exit $$?; \
+       fi;
+
+$(DEPDIR)/pager_swig-generate-stamp:
+## This rule will be called only by the first process issuing the
+## above rule to succeed in creating the lock directory, after
+## removing the actual stamp file in order to guarantee that MAKE will
+## execute this rule.
+##
+## Call SWIG to generate the various output files; special
+## post-processing on 'mingw32' host OS for the dependency file.
+##
+       if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(pager_swig_swig_args) \
+               -MD -MF $(DEPDIR)/pager_swig.Std \
+               -module pager_swig -o pager_swig.cc $(WHAT); then \
+           if test $(host_os) = mingw32; then \
+               $(RM) $(DEPDIR)/pager_swig.Sd; \
+               $(SED) 's,\\\\,/,g' < $(DEPDIR)/pager_swig.Std \
+                       > $(DEPDIR)/pager_swig.Sd; \
+               $(RM) $(DEPDIR)/pager_swig.Std; \
+               $(MV) $(DEPDIR)/pager_swig.Sd $(DEPDIR)/pager_swig.Std; \
+           fi; \
+       else \
+           $(RM) $(DEPDIR)/pager_swig.S*; exit 1; \
+       fi;
+##
+## Mess with the SWIG output .Std dependency file, to create a
+## dependecy file valid for the input .i file: Basically, simulate the
+## dependency file created for libraries by GNU's libtool for C++,
+## where all of the dependencies for the target are first listed, then
+## each individual dependency is listed as a target with no further
+## dependencies.
+##
+## (1) remove the current dependency file
+##
+       $(RM) $(DEPDIR)/pager_swig.d
+##
+## (2) Copy the whole SWIG file:
+##
+       cp $(DEPDIR)/pager_swig.Std $(DEPDIR)/pager_swig.d
+##
+## (3) all a carriage return to the end of the dependency file.
+##
+       echo "" >> $(DEPDIR)/pager_swig.d
+##
+## (4) from the SWIG file, remove the first line (the target); remove
+##     trailing " \" and " " from each line.  Append ":" to each line,
+##     followed by 2 carriage returns, then append this to the end of
+##     the dependency file.
+##
+       $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/pager_swig.Std | \
+               awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/pager_swig.d
+##
+## (5) remove the SWIG-generated file
+##
+       $(RM) $(DEPDIR)/pager_swig.Std
+##
+## Create the stamp for this filename generation, to signal success in
+## executing this rule; allows other threads waiting on this process
+## to continue.
+##
+       touch $(DEPDIR)/pager_swig-generate-stamp
+
+# KLUDGE: Force runtime include of a SWIG 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@./$(DEPDIR)/pager_swig.d@am__quote@
+
diff --git a/gr-pager/src/pager.i b/gr-pager/src/pager.i
deleted file mode 100644 (file)
index aeb576d..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2005,2006,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 "gnuradio.i"
-
-%{
-#include "pager_flex_frame.h"
-#include "pager_slicer_fb.h"
-#include "pager_flex_sync.h"
-#include "pager_flex_deinterleave.h"
-#include "pager_flex_parse.h"
-%}
-
-%include "pager_flex_frame.i"
-
-// ----------------------------------------------------------------
-
-GR_SWIG_BLOCK_MAGIC(pager,slicer_fb);
-
-pager_slicer_fb_sptr pager_make_slicer_fb(float alpha);
-
-class pager_slicer_fb : public gr_sync_block
-{
-private:
-    pager_slicer_fb(float alpha);
-
-public:
-    float dc_offset() const { return d_avg; }
-};
-
-// ----------------------------------------------------------------
-
-GR_SWIG_BLOCK_MAGIC(pager,flex_sync);
-
-pager_flex_sync_sptr pager_make_flex_sync();
-
-class pager_flex_sync : public gr_block
-{
-private:
-    pager_flex_sync();
-
-public:
-};
-
-// ----------------------------------------------------------------
-
-GR_SWIG_BLOCK_MAGIC(pager,flex_deinterleave);
-
-pager_flex_deinterleave_sptr pager_make_flex_deinterleave();
-
-class pager_flex_deinterleave : public gr_sync_decimator
-{
-private:
-    pager_flex_deinterleave();
-
-public:
-};
-
-// ----------------------------------------------------------------
-
-GR_SWIG_BLOCK_MAGIC(pager,flex_parse);
-
-pager_flex_parse_sptr pager_make_flex_parse(gr_msg_queue_sptr queue, float freq);
-
-class pager_flex_parse : public gr_block
-{
-private:
-    pager_flex_parse(gr_msg_queue_sptr queue, float freq);
-
-public:
-};
diff --git a/gr-pager/src/pager_swig.i b/gr-pager/src/pager_swig.i
new file mode 100644 (file)
index 0000000..aeb576d
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2005,2006,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 "gnuradio.i"
+
+%{
+#include "pager_flex_frame.h"
+#include "pager_slicer_fb.h"
+#include "pager_flex_sync.h"
+#include "pager_flex_deinterleave.h"
+#include "pager_flex_parse.h"
+%}
+
+%include "pager_flex_frame.i"
+
+// ----------------------------------------------------------------
+
+GR_SWIG_BLOCK_MAGIC(pager,slicer_fb);
+
+pager_slicer_fb_sptr pager_make_slicer_fb(float alpha);
+
+class pager_slicer_fb : public gr_sync_block
+{
+private:
+    pager_slicer_fb(float alpha);
+
+public:
+    float dc_offset() const { return d_avg; }
+};
+
+// ----------------------------------------------------------------
+
+GR_SWIG_BLOCK_MAGIC(pager,flex_sync);
+
+pager_flex_sync_sptr pager_make_flex_sync();
+
+class pager_flex_sync : public gr_block
+{
+private:
+    pager_flex_sync();
+
+public:
+};
+
+// ----------------------------------------------------------------
+
+GR_SWIG_BLOCK_MAGIC(pager,flex_deinterleave);
+
+pager_flex_deinterleave_sptr pager_make_flex_deinterleave();
+
+class pager_flex_deinterleave : public gr_sync_decimator
+{
+private:
+    pager_flex_deinterleave();
+
+public:
+};
+
+// ----------------------------------------------------------------
+
+GR_SWIG_BLOCK_MAGIC(pager,flex_parse);
+
+pager_flex_parse_sptr pager_make_flex_parse(gr_msg_queue_sptr queue, float freq);
+
+class pager_flex_parse : public gr_block
+{
+private:
+    pager_flex_parse(gr_msg_queue_sptr queue, float freq);
+
+public:
+};
index 034eff0533036122efe7354cd45597ea9d9d8cbe..eee58990d890955cb1820e3c8a6cd1869ccc170e 100644 (file)
 
 include $(top_srcdir)/Makefile.common
 
-# Install this stuff so that it ends up as the gnuradio.qtgui module
-# This usually ends up at:
-#   ${prefix}/lib/python${python_version}/site-packages/gnuradio/qtgui
-
-ourpythondir = $(grpythondir)/qtgui
-ourlibdir    = $(grpyexecdir)/qtgui
-
 AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) \
               $(QT_INCLUDES) -I. $(WITH_INCLUDES)
 
-ALL_IFILES =                           \
-       $(LOCAL_IFILES)                 \
-       $(NON_LOCAL_IFILES)             
-
-NON_LOCAL_IFILES =                     \
-       $(GNURADIO_I)
-
-LOCAL_IFILES =                                 \
-       $(srcdir)/qtgui.i
-
-# These files are built by SWIG.  The first is the C++ glue.
-# The second is the python wrapper that loads the shared library
-# and knows how to call our extensions.
-
 # Only include these files in the build if qtgui passes configure checks
 # This is mostly to help make distcheck pass
 if BUILD_QT
@@ -60,18 +39,6 @@ endif
 
 EXTRA_DIST = spectrumdisplayform.ui
 
-BUILT_SOURCES =                                \
-       qtgui.cc                                \
-       qtgui.py                                \
-       $(QMAKE_SOURCES)
-
-# This gets qtgui.py installed in the right place
-ourpython_PYTHON =                     \
-       qtgui.py
-
-# Build the library for Python module to link against
-ourlib_LTLIBRARIES = _qtgui.la
-
 # Build the normal library for C++ apps to link against
 lib_LTLIBRARIES = libqtgui.la
 
@@ -91,10 +58,6 @@ libqtgui_la_SOURCES =        \
        qtgui_sink_c.cc                         \
        qtgui_sink_f.cc
 
-_qtgui_la_SOURCES =                    \
-       $(libqtgui_la_SOURCES)          \
-       qtgui.cc
-
 # These headers get installed in ${prefix}/include/gnuradio
 grinclude_HEADERS =                    \
        FrequencyDisplayPlot.h          \
@@ -127,34 +90,36 @@ else
 endif
 
 # magic flags
-_qtgui_la_LDFLAGS = $(NO_UNDEFINED) -module -avoid-version
 libqtgui_la_LDFLAGS = $(NO_UNDEFINED) -version-info 0:0:0
 
-# link the library against the c++ standard library
-_qtgui_la_LIBADD =             \
-       $(PYTHON_LDFLAGS)       \
+libqtgui_la_LIBADD =           \
        $(GNURADIO_CORE_LA)     \
        -lstdc++                \
        $(QT_LIBS)
 
+##############################
+# SWIG interface and library
 
-libqtgui_la_LIBADD =           \
-       $(GNURADIO_CORE_LA)     \
-       -lstdc++                \
-       $(QT_LIBS)
+TOP_SWIG_IFILES =              \
+       qtgui.i
 
-qtgui.cc qtgui.py: $(ALL_IFILES)
-       $(SWIG) $(STD_SWIG_PYTHON_ARGS) -module qtgui \
-               -o qtgui.cc $(LOCAL_IFILES)
+# Install so that they end up available as:
+#   import gnuradio.qtgui
+# This ends up at:
+#   ${prefix}/lib/python${python_version}/site-packages/gnuradio
+qtgui_pythondir_category =     \
+       gnuradio
 
-# These swig headers get installed in ${prefix}/include/gnuradio/swig
-swiginclude_HEADERS =                  \
-       $(LOCAL_IFILES)
+# additional libraries for linking with the SWIG-generated library
+qtgui_la_swig_libadd =         \
+       libqtgui.la
 
+include $(top_srcdir)/Makefile.swig
 
-MOSTLYCLEANFILES = $(BUILT_SOURCES) *.pyc
+# add some of the variables generated inside the Makefile.swig.gen
+BUILT_SOURCES =                \
+       $(QMAKE_SOURCES)        \
+       $(swig_built_sources)
 
-# 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
+# Do not distribute the output of SWIG
+no_dist_files = $(swig_built_sources)
diff --git a/gr-qtgui/src/lib/Makefile.swig.gen b/gr-qtgui/src/lib/Makefile.swig.gen
new file mode 100644 (file)
index 0000000..f40f0d8
--- /dev/null
@@ -0,0 +1,259 @@
+# -*- Makefile -*-
+#
+# Copyright 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.
+# 
+
+# Makefile.swig.gen for qtgui.i
+
+## Default install locations for these files:
+##
+## Default location for the Python directory is:
+##  ${prefix}/lib/python${python_version}/site-packages/[category]/qtgui
+## Default location for the Python exec directory is:
+##  ${exec_prefix}/lib/python${python_version}/site-packages/[category]/qtgui
+##
+## The following can be overloaded to change the install location, but
+## this has to be done in the including Makefile.am -before-
+## Makefile.swig is included.
+
+qtgui_pythondir_category ?= gnuradio/qtgui
+qtgui_pylibdir_category ?= $(qtgui_pythondir_category)
+qtgui_pythondir = $(pythondir)/$(qtgui_pythondir_category)
+qtgui_pylibdir = $(pyexecdir)/$(qtgui_pylibdir_category)
+
+## SWIG headers are always installed into the same directory.
+
+qtgui_swigincludedir = $(swigincludedir)
+
+## This is a template file for a "generated" Makefile addition (in
+## this case, "Makefile.swig.gen").  By including the top-level
+## Makefile.swig, this file will be used to generate the SWIG
+## dependencies.  Assign the variable TOP_SWIG_FILES to be the list of
+## SWIG .i files to generated wrappings for; there can be more than 1
+## so long as the names are unique (no sorting is done on the
+## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i
+## file will generate .cc, .py, and possibly .h files -- meaning that
+## all of these files will have the same base name (that provided for
+## the SWIG .i file).
+##
+## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the
+## right thing.  For more info, see <
+## http://sources.redhat.com/automake/automake.html#Multiple-Outputs >
+
+## Stamps used to ensure parallel make does the right thing.  These
+## are removed by "make clean", but otherwise unused except during the
+## parallel built.  These will not be included in a tarball, because
+## the SWIG-generated files will be removed from the distribution.
+
+STAMPS += $(DEPDIR)/qtgui-generate-*
+
+## Other cleaned files: dependency files generated by SWIG or this Makefile
+
+MOSTLYCLEANFILES += $(DEPDIR)/*.S*
+
+## Add the .py and .cc files to the list of SWIG built sources.  The
+## .h file is sometimes built, but not always ... so that one has to
+## be added manually by the including Makefile.am .
+
+swig_built_sources += qtgui.py qtgui.cc
+
+## Various SWIG variables.  These can be overloaded in the including
+## Makefile.am by setting the variable value there, then including
+## Makefile.swig .
+
+qtgui_swiginclude_HEADERS =            \
+       qtgui.i                 \
+       $(qtgui_swiginclude_headers)
+
+qtgui_pylib_LTLIBRARIES =              \
+       _qtgui.la
+
+_qtgui_la_SOURCES =                    \
+       qtgui.cc                        \
+       $(qtgui_la_swig_sources)
+
+_qtgui_la_LIBADD =                     \
+       $(STD_SWIG_LA_LIB_ADD)          \
+       $(qtgui_la_swig_libadd)
+
+_qtgui_la_LDFLAGS =                    \
+       $(STD_SWIG_LA_LD_FLAGS)         \
+       $(qtgui_la_swig_ldflags)
+
+_qtgui_la_CXXFLAGS =                   \
+       $(STD_SWIG_CXX_FLAGS)           \
+       $(qtgui_la_swig_cxxflags)
+
+qtgui_python_PYTHON =                  \
+       qtgui.py                        \
+       $(qtgui_python)
+
+## Entry rule for running SWIG
+
+qtgui.h qtgui.py qtgui.cc: qtgui.i
+## This rule will get called only when MAKE decides that one of the
+## targets needs to be created or re-created, because:
+##
+## * The .i file is newer than any or all of the generated files;
+##
+## * Any or all of the .cc, .h, or .py files does not exist and is
+##   needed (in the case this file is not needed, the rule for it is
+##   ignored); or
+##
+## * Some SWIG-based dependecy of the .cc file isn't met and hence the
+##   .cc file needs be be regenerated.  Explanation: Because MAKE
+##   knows how to handle dependencies for .cc files (regardless of
+##   their name or extension), then the .cc file is used as a target
+##   instead of the .i file -- but with the dependencies of the .i
+##   file.  It is this last reason why the line:
+##
+##             if test -f $@; then :; else
+##
+##   cannot be used in this case: If a .i file dependecy is not met,
+##   then the .cc file needs to be rebuilt.  But if the stamp is newer
+##   than the .cc file, and the .cc file exists, then in the original
+##   version (with the 'test' above) the internal MAKE call will not
+##   be issued and hence the .cc file will not be rebuilt.
+##
+## Once execution gets to here, it should always proceed no matter the
+## state of a stamp (as discussed in link above).  The
+## $(DEPDIR)/qtgui-generate stuff is used to allow for parallel
+## builds to "do the right thing".  The stamp has no relationship with
+## either the target files or dependency file; it is used solely for
+## the protection of multiple builds during a given call to MAKE.
+##
+## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM
+## (15).  At a caught signal, the quoted command will be issued before
+## exiting.  In this case, remove any stamp, whether temporary of not.
+## The trap is valid until the process exits; the process includes all
+## commands appended via "\"s.
+##
+       trap 'rm -rf $(DEPDIR)/qtgui-generate-*' 1 2 13 15; \
+##
+## Create a temporary directory, which acts as a lock.  The first
+## process to create the directory will succeed and issue the MAKE
+## command to do the actual work, while all subsequent processes will
+## fail -- leading them to wait for the first process to finish.
+##
+       if mkdir $(DEPDIR)/qtgui-generate-lock 2>/dev/null; then \
+##
+## This code is being executed by the first process to succeed in
+## creating the directory lock.
+##
+## Remove the stamp associated with this filename.
+##
+               rm -f $(DEPDIR)/qtgui-generate-stamp; \
+##
+## Tell MAKE to run the rule for creating this stamp.
+##
+               $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/qtgui-generate-stamp WHAT=$<; \
+##
+## Now that the .cc, .h, and .py files have been (re)created from the
+## .i file, future checking of this rule during the same MAKE
+## execution will come back that the rule doesn't need to be executed
+## because none of the conditions mentioned at the start of this rule
+## will be positive.  Remove the the directory lock, which frees up
+## any waiting process(es) to continue.
+##
+               rmdir $(DEPDIR)/qtgui-generate-lock; \
+       else \
+##
+## This code is being executed by any follower processes while the
+## directory lock is in place.
+##
+## Wait until the first process is done, testing once per second.
+##
+               while test -d $(DEPDIR)/qtgui-generate-lock; do \
+                       sleep 1; \
+               done; \
+##
+## Succeed if and only if the first process succeeded; exit this
+## process returning the status of the generated stamp.
+##
+               test -f $(DEPDIR)/qtgui-generate-stamp; \
+               exit $$?; \
+       fi;
+
+$(DEPDIR)/qtgui-generate-stamp:
+## This rule will be called only by the first process issuing the
+## above rule to succeed in creating the lock directory, after
+## removing the actual stamp file in order to guarantee that MAKE will
+## execute this rule.
+##
+## Call SWIG to generate the various output files; special
+## post-processing on 'mingw32' host OS for the dependency file.
+##
+       if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(qtgui_swig_args) \
+               -MD -MF $(DEPDIR)/qtgui.Std \
+               -module qtgui -o qtgui.cc $(WHAT); then \
+           if test $(host_os) = mingw32; then \
+               $(RM) $(DEPDIR)/qtgui.Sd; \
+               $(SED) 's,\\\\,/,g' < $(DEPDIR)/qtgui.Std \
+                       > $(DEPDIR)/qtgui.Sd; \
+               $(RM) $(DEPDIR)/qtgui.Std; \
+               $(MV) $(DEPDIR)/qtgui.Sd $(DEPDIR)/qtgui.Std; \
+           fi; \
+       else \
+           $(RM) $(DEPDIR)/qtgui.S*; exit 1; \
+       fi;
+##
+## Mess with the SWIG output .Std dependency file, to create a
+## dependecy file valid for the input .i file: Basically, simulate the
+## dependency file created for libraries by GNU's libtool for C++,
+## where all of the dependencies for the target are first listed, then
+## each individual dependency is listed as a target with no further
+## dependencies.
+##
+## (1) remove the current dependency file
+##
+       $(RM) $(DEPDIR)/qtgui.d
+##
+## (2) Copy the whole SWIG file:
+##
+       cp $(DEPDIR)/qtgui.Std $(DEPDIR)/qtgui.d
+##
+## (3) all a carriage return to the end of the dependency file.
+##
+       echo "" >> $(DEPDIR)/qtgui.d
+##
+## (4) from the SWIG file, remove the first line (the target); remove
+##     trailing " \" and " " from each line.  Append ":" to each line,
+##     followed by 2 carriage returns, then append this to the end of
+##     the dependency file.
+##
+       $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/qtgui.Std | \
+               awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/qtgui.d
+##
+## (5) remove the SWIG-generated file
+##
+       $(RM) $(DEPDIR)/qtgui.Std
+##
+## Create the stamp for this filename generation, to signal success in
+## executing this rule; allows other threads waiting on this process
+## to continue.
+##
+       touch $(DEPDIR)/qtgui-generate-stamp
+
+# KLUDGE: Force runtime include of a SWIG 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@./$(DEPDIR)/qtgui.d@am__quote@
+
index ce862c2b74201598271fe949041bad61f2919451..ad57873444f3c3ba566c2704e26755fe7a684f49 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2004 Free Software Foundation, Inc.
+# Copyright 2004,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -29,5 +29,3 @@ qtguipythondir = $(grpythondir)/qtgui
 
 qtguipython_PYTHON =                   \
        __init__.py
-
-CLEANFILES = *.pyc *.pyo
index 2c5205382a3757e47a8e867c1f623b8df0fdd59d..a48e4f87f4f61ce11eb712e79c426202e91afe9c 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2007 Free Software Foundation, Inc.
+# Copyright 2007,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -31,4 +31,4 @@ EXTRA_DIST =                  \
                fifo32_2k.v     \
                cordic_nco.v
 
-MOSTLYCLEANFILES = *~ *.bak
+MOSTLYCLEANFILES += *.bak
index 1d51f485fac43660c3a4442d3390e4af4052bb7c..ca59fe78f90cfc0394244f37416dfea370186770 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2007 Free Software Foundation, Inc.
+# Copyright 2007,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -23,5 +23,3 @@ include $(top_srcdir)/Makefile.common
 
 EXTRA_DIST = \
        fifo_1clk.v
-
-MOSTLYCLEANFILES = *~
index 44394db1929a31e6d647bec779c3bb9f14b4958c..1bff8795f2e8b15942bbed15bf1238ae7abca7b9 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2007 Free Software Foundation, Inc.
+# Copyright 2007,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -27,4 +27,4 @@ EXTRA_DIST = \
        radar_tb.sh \
        radar_tb_wave.sh
 
-MOSTLYCLEANFILES = *~ *.vcd *.out* radar_tb
+MOSTLYCLEANFILES += *.vcd *.out* radar_tb
index 606aa6c445bbb844865e8bd2e550dbfb8a0e444f..f51f3def3ce230a26cf4fd539cc87360ce56fac7 100644 (file)
@@ -37,7 +37,7 @@ EXTRA_DIST = \
        usrp_radar_mono.qsf \
        usrp_radar_mono.v
 
-MOSTLYCLEANFILES     \
+MOSTLYCLEANFILES +=    \
        db/*            \
        *.rpt           \
        *.summary       \
@@ -45,5 +45,4 @@ MOSTLYCLEANFILES =    \
        *.smsg          \
        *.done          \
        *.pin           \
-       *.sof           \
-       *~
+       *.sof
index 366e8176432969b5e1153c13dc2515683d461303..8a44b681022048f43072c91b7476d9f984b8b15f 100644 (file)
@@ -29,5 +29,3 @@ dist_bin_SCRIPTS =    \
 
 dist_ourpython_PYTHON =        \
        radar_mono.py
-
-MOSTLYCLEANFILES = *~ *.pyc *.pyo
index bfd1928b44f7484ae3c49b5306819d3307595b78..33a8a859ab6e438a01f88d69713996dc16c639ef 100644 (file)
 
 include $(top_srcdir)/Makefile.common
 
-# Install this stuff so that it ends up as the gnuradio.ra module
-# This usually ends up at:
-#   ${prefix}/lib/python${python_version}/site-packages/gnuradio
-
-ourpythondir = $(grpythondir)
-ourlibdir    = $(grpyexecdir)
-
 AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES)
 
-ALL_IFILES =                           \
-       $(LOCAL_IFILES)                 \
-       $(NON_LOCAL_IFILES)             
-
-NON_LOCAL_IFILES =                     \
-       $(GNURADIO_I)
-
-LOCAL_IFILES =                                 \
-       $(srcdir)/ra.i                          
-
-# These files are built by SWIG.  The first is the C++ glue.
-# The second is the python wrapper that loads the _howto shared library
-# and knows how to call our extensions.
-
-BUILT_SOURCES =                \
-       ra.cc                   \
-       ra.py                           
-
-# This gets ra.py installed in the right place
-ourpython_PYTHON =                     \
-       ra.py
+TOP_SWIG_IFILES =              \
+       ra.i
 
-ourlib_LTLIBRARIES = _ra.la
-
-# These are the source files that go into the shared library
-_ra_la_SOURCES =               \
-       ra.cc                   
-
-# magic flags
-_ra_la_LDFLAGS = $(NO_UNDEFINED) -module -avoid-version
-
-# link the library against some comon swig runtime code and the 
-# c++ standard library
-_ra_la_LIBADD =                \
-       $(PYTHON_LDFLAGS)       \
-       $(GNURADIO_CORE_LA)     \
-       -lstdc++                        
-
-ra.cc ra.py: $(ALL_IFILES)
-       $(SWIG) $(STD_SWIG_PYTHON_ARGS) -module ra -o ra.cc $(LOCAL_IFILES)
-
-# These headers get installed in ${prefix}/include/gnuradio
-grinclude_HEADERS =
-
-# These swig headers get installed in ${prefix}/include/gnuradio/swig
-swiginclude_HEADERS =                  \
-       $(LOCAL_IFILES)
+# Install so that they end up available as:
+#   import gnuradio.ra
+# This ends up at:
+#   ${prefix}/lib/python${python_version}/site-packages/gnuradio
+ra_pythondir_category =                \
+       gnuradio
 
+include $(top_srcdir)/Makefile.swig
 
-MOSTLYCLEANFILES = $(BUILT_SOURCES) *.pyc
+# add some of the variables generated inside the Makefile.swig.gen
+BUILT_SOURCES = $(swig_built_sources)
 
-# 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
+# Do not distribute the output of SWIG
+no_dist_files = $(swig_built_sources)
diff --git a/gr-radio-astronomy/src/lib/Makefile.swig.gen b/gr-radio-astronomy/src/lib/Makefile.swig.gen
new file mode 100644 (file)
index 0000000..26f2373
--- /dev/null
@@ -0,0 +1,259 @@
+# -*- Makefile -*-
+#
+# Copyright 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.
+# 
+
+# Makefile.swig.gen for ra.i
+
+## Default install locations for these files:
+##
+## Default location for the Python directory is:
+##  ${prefix}/lib/python${python_version}/site-packages/[category]/ra
+## Default location for the Python exec directory is:
+##  ${exec_prefix}/lib/python${python_version}/site-packages/[category]/ra
+##
+## The following can be overloaded to change the install location, but
+## this has to be done in the including Makefile.am -before-
+## Makefile.swig is included.
+
+ra_pythondir_category ?= gnuradio/ra
+ra_pylibdir_category ?= $(ra_pythondir_category)
+ra_pythondir = $(pythondir)/$(ra_pythondir_category)
+ra_pylibdir = $(pyexecdir)/$(ra_pylibdir_category)
+
+## SWIG headers are always installed into the same directory.
+
+ra_swigincludedir = $(swigincludedir)
+
+## This is a template file for a "generated" Makefile addition (in
+## this case, "Makefile.swig.gen").  By including the top-level
+## Makefile.swig, this file will be used to generate the SWIG
+## dependencies.  Assign the variable TOP_SWIG_FILES to be the list of
+## SWIG .i files to generated wrappings for; there can be more than 1
+## so long as the names are unique (no sorting is done on the
+## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i
+## file will generate .cc, .py, and possibly .h files -- meaning that
+## all of these files will have the same base name (that provided for
+## the SWIG .i file).
+##
+## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the
+## right thing.  For more info, see <
+## http://sources.redhat.com/automake/automake.html#Multiple-Outputs >
+
+## Stamps used to ensure parallel make does the right thing.  These
+## are removed by "make clean", but otherwise unused except during the
+## parallel built.  These will not be included in a tarball, because
+## the SWIG-generated files will be removed from the distribution.
+
+STAMPS += $(DEPDIR)/ra-generate-*
+
+## Other cleaned files: dependency files generated by SWIG or this Makefile
+
+MOSTLYCLEANFILES += $(DEPDIR)/*.S*
+
+## Add the .py and .cc files to the list of SWIG built sources.  The
+## .h file is sometimes built, but not always ... so that one has to
+## be added manually by the including Makefile.am .
+
+swig_built_sources += ra.py ra.cc
+
+## Various SWIG variables.  These can be overloaded in the including
+## Makefile.am by setting the variable value there, then including
+## Makefile.swig .
+
+ra_swiginclude_HEADERS =               \
+       ra.i                    \
+       $(ra_swiginclude_headers)
+
+ra_pylib_LTLIBRARIES =         \
+       _ra.la
+
+_ra_la_SOURCES =                       \
+       ra.cc                   \
+       $(ra_la_swig_sources)
+
+_ra_la_LIBADD =                        \
+       $(STD_SWIG_LA_LIB_ADD)          \
+       $(ra_la_swig_libadd)
+
+_ra_la_LDFLAGS =                       \
+       $(STD_SWIG_LA_LD_FLAGS)         \
+       $(ra_la_swig_ldflags)
+
+_ra_la_CXXFLAGS =                      \
+       $(STD_SWIG_CXX_FLAGS)           \
+       $(ra_la_swig_cxxflags)
+
+ra_python_PYTHON =                     \
+       ra.py                   \
+       $(ra_python)
+
+## Entry rule for running SWIG
+
+ra.h ra.py ra.cc: ra.i
+## This rule will get called only when MAKE decides that one of the
+## targets needs to be created or re-created, because:
+##
+## * The .i file is newer than any or all of the generated files;
+##
+## * Any or all of the .cc, .h, or .py files does not exist and is
+##   needed (in the case this file is not needed, the rule for it is
+##   ignored); or
+##
+## * Some SWIG-based dependecy of the .cc file isn't met and hence the
+##   .cc file needs be be regenerated.  Explanation: Because MAKE
+##   knows how to handle dependencies for .cc files (regardless of
+##   their name or extension), then the .cc file is used as a target
+##   instead of the .i file -- but with the dependencies of the .i
+##   file.  It is this last reason why the line:
+##
+##             if test -f $@; then :; else
+##
+##   cannot be used in this case: If a .i file dependecy is not met,
+##   then the .cc file needs to be rebuilt.  But if the stamp is newer
+##   than the .cc file, and the .cc file exists, then in the original
+##   version (with the 'test' above) the internal MAKE call will not
+##   be issued and hence the .cc file will not be rebuilt.
+##
+## Once execution gets to here, it should always proceed no matter the
+## state of a stamp (as discussed in link above).  The
+## $(DEPDIR)/ra-generate stuff is used to allow for parallel
+## builds to "do the right thing".  The stamp has no relationship with
+## either the target files or dependency file; it is used solely for
+## the protection of multiple builds during a given call to MAKE.
+##
+## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM
+## (15).  At a caught signal, the quoted command will be issued before
+## exiting.  In this case, remove any stamp, whether temporary of not.
+## The trap is valid until the process exits; the process includes all
+## commands appended via "\"s.
+##
+       trap 'rm -rf $(DEPDIR)/ra-generate-*' 1 2 13 15; \
+##
+## Create a temporary directory, which acts as a lock.  The first
+## process to create the directory will succeed and issue the MAKE
+## command to do the actual work, while all subsequent processes will
+## fail -- leading them to wait for the first process to finish.
+##
+       if mkdir $(DEPDIR)/ra-generate-lock 2>/dev/null; then \
+##
+## This code is being executed by the first process to succeed in
+## creating the directory lock.
+##
+## Remove the stamp associated with this filename.
+##
+               rm -f $(DEPDIR)/ra-generate-stamp; \
+##
+## Tell MAKE to run the rule for creating this stamp.
+##
+               $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/ra-generate-stamp WHAT=$<; \
+##
+## Now that the .cc, .h, and .py files have been (re)created from the
+## .i file, future checking of this rule during the same MAKE
+## execution will come back that the rule doesn't need to be executed
+## because none of the conditions mentioned at the start of this rule
+## will be positive.  Remove the the directory lock, which frees up
+## any waiting process(es) to continue.
+##
+               rmdir $(DEPDIR)/ra-generate-lock; \
+       else \
+##
+## This code is being executed by any follower processes while the
+## directory lock is in place.
+##
+## Wait until the first process is done, testing once per second.
+##
+               while test -d $(DEPDIR)/ra-generate-lock; do \
+                       sleep 1; \
+               done; \
+##
+## Succeed if and only if the first process succeeded; exit this
+## process returning the status of the generated stamp.
+##
+               test -f $(DEPDIR)/ra-generate-stamp; \
+               exit $$?; \
+       fi;
+
+$(DEPDIR)/ra-generate-stamp:
+## This rule will be called only by the first process issuing the
+## above rule to succeed in creating the lock directory, after
+## removing the actual stamp file in order to guarantee that MAKE will
+## execute this rule.
+##
+## Call SWIG to generate the various output files; special
+## post-processing on 'mingw32' host OS for the dependency file.
+##
+       if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(ra_swig_args) \
+               -MD -MF $(DEPDIR)/ra.Std \
+               -module ra -o ra.cc $(WHAT); then \
+           if test $(host_os) = mingw32; then \
+               $(RM) $(DEPDIR)/ra.Sd; \
+               $(SED) 's,\\\\,/,g' < $(DEPDIR)/ra.Std \
+                       > $(DEPDIR)/ra.Sd; \
+               $(RM) $(DEPDIR)/ra.Std; \
+               $(MV) $(DEPDIR)/ra.Sd $(DEPDIR)/ra.Std; \
+           fi; \
+       else \
+           $(RM) $(DEPDIR)/ra.S*; exit 1; \
+       fi;
+##
+## Mess with the SWIG output .Std dependency file, to create a
+## dependecy file valid for the input .i file: Basically, simulate the
+## dependency file created for libraries by GNU's libtool for C++,
+## where all of the dependencies for the target are first listed, then
+## each individual dependency is listed as a target with no further
+## dependencies.
+##
+## (1) remove the current dependency file
+##
+       $(RM) $(DEPDIR)/ra.d
+##
+## (2) Copy the whole SWIG file:
+##
+       cp $(DEPDIR)/ra.Std $(DEPDIR)/ra.d
+##
+## (3) all a carriage return to the end of the dependency file.
+##
+       echo "" >> $(DEPDIR)/ra.d
+##
+## (4) from the SWIG file, remove the first line (the target); remove
+##     trailing " \" and " " from each line.  Append ":" to each line,
+##     followed by 2 carriage returns, then append this to the end of
+##     the dependency file.
+##
+       $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/ra.Std | \
+               awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/ra.d
+##
+## (5) remove the SWIG-generated file
+##
+       $(RM) $(DEPDIR)/ra.Std
+##
+## Create the stamp for this filename generation, to signal success in
+## executing this rule; allows other threads waiting on this process
+## to continue.
+##
+       touch $(DEPDIR)/ra-generate-stamp
+
+# KLUDGE: Force runtime include of a SWIG 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@./$(DEPDIR)/ra.d@am__quote@
+
index 0dfb19b22fb26ca18a5a2dc158e685b7a873043e..3aae96371ec587e2c8d6fe4aacae5493674a00f3 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2007 Free Software Foundation, Inc.
+# Copyright 2007,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -28,5 +28,3 @@ EXTRA_DIST = \
        sounder_ctrl.v \
        sounder_rx.v \
        sounder_tx.v
-
-MOSTLYCLEANFILES = *~
\ No newline at end of file
index e873fa59c0dcd850d55ded0fe4b4d1ba83bc6964..ec15f28d6eea1f72ccdca7dabcb721b39ca21535 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2007 Free Software Foundation, Inc.
+# Copyright 2007,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -27,4 +27,4 @@ EXTRA_DIST = \
        sounder_tb.sh \
        sounder_tb_wave.sh
 
-MOSTLYCLEANFILES = *~ *.vcd *.out* sounder_tb
\ No newline at end of file
+MOSTLYCLEANFILES += *.vcd *.out* sounder_tb
index 33e8c860d41f97950be828aaf3f66e14a1b891ed..63e07dc5b772baed26bef9ec79ddef85a14cf871 100644 (file)
@@ -37,7 +37,7 @@ EXTRA_DIST =                  \
        usrp_sounder.psf        \
        usrp_sounder.qpf
 
-MOSTLYCLEANFILES     \
+MOSTLYCLEANFILES +=    \
        db/*            \
        *.rpt           \
        *.summary       \
@@ -45,5 +45,4 @@ MOSTLYCLEANFILES =    \
        *.smsg          \
        *.done          \
        *.pin           \
-       *.sof           \
-       *~
+       *.sof
index cec948473846240124c5f6724b592f3a0870113a..546a9d6459c7d3c58ded7e6511ca0e2e7118bcd9 100644 (file)
@@ -38,5 +38,3 @@ dist_bin_SCRIPTS =            \
 
 ourpython_PYTHON =     \
        sounder.py
-
-MOSTLYCLEANFILES = *~ *.pyc *.pyo
\ No newline at end of file
index c8ba44f9c6818fc8efe9b1c8857e80b160358cae..8fb727acd244202fd9504f0bf160deda812f90b7 100644 (file)
@@ -43,5 +43,3 @@ dist_ourdata_SCRIPTS =                        \
        test_turbo_equalization.py      \
        test_turbo_equalization1.py     \
        test_turbo_equalization2.py
-
-MOSTLYCLEANFILES = *.pyc
index ea43a37f70a51a35ab4f2c322cc1d953dcf00f76..2e7591e4b9bc76e87136ea009e1d0033f81e3ffd 100644 (file)
 
 include $(top_srcdir)/Makefile.common
 
-# Install this stuff so that it ends up as the gnuradio.trellis module
-# This usually ends up at:
-#   ${prefix}/lib/python${python_version}/site-packages/gnuradio
-
-ourpythondir = $(grpythondir)
-ourlibdir    = $(grpyexecdir)
-
 AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES)
 
 # ----------------------------------------------------------------
@@ -42,17 +35,13 @@ core_generator =                            \
        trellis_metrics_X.cc.t                  \
        trellis_metrics_X.h.t                   \
        trellis_metrics_X.i.t                   \
-       trellis_viterbi_combined_XX.cc.t                \
+       trellis_viterbi_combined_XX.cc.t        \
        trellis_viterbi_combined_XX.h.t         \
        trellis_viterbi_combined_XX.i.t         \
        trellis_viterbi_X.cc.t                  \
        trellis_viterbi_X.h.t                   \
        trellis_viterbi_X.i.t
 
-# include the srcdir's Makefile.gen; doing this creates an implicit
-# dependency between $(srcdir)/Makefile.in and $(srcdir)/Makefile.gen.
-include $(srcdir)/Makefile.gen
-
 # Source built by Python into $(builddir)
 python_built_sources =         \
        $(GENERATED_H)          \
@@ -60,76 +49,9 @@ python_built_sources =               \
        $(GENERATED_CC)         \
        trellis_generated.i
 
-# Required when including Makefile.gen.gen
-
-STAMPS =
-gen_sources = $(python_built_sources)
-gen_sources_deps = $(core_generator)
-MOSTLYCLEANFILES = $(BUILT_SOURCES) *.pyc
-
-# common way for generating sources from templates, using the above parameters
-include $(top_srcdir)/Makefile.gen.gen
-
-# These files are built by SWIG.  The first is the C++ glue.
-# The second is the python wrapper that loads the _trellis shared library
-# and knows how to call our extensions.
-
-swig_built_sources =           \
-       trellis.cc              \
-       trellis.py                              
-
-BUILT_SOURCES =                        \
-       $(python_built_sources) \
-       $(swig_built_sources)
-
-ALL_IFILES =                   \
-       $(LOCAL_IFILES)         \
-       $(NON_LOCAL_IFILES)     
-
-NON_LOCAL_IFILES =             \
-       $(GNURADIO_I)   
-
-LOCAL_IFILES =                         \
-       $(srcdir)/trellis.i                     
-
 EXTRA_DIST =                   \
        $(core_generator)
 
-# This gets trellis.py installed in the right place
-ourpython_PYTHON =             \
-       trellis.py
-
-ourlib_LTLIBRARIES = _trellis.la
-
-# These are the source files that go into the shared library
-_trellis_la_SOURCES =                  \
-       trellis.cc                      \
-        fsm.cc                         \
-        quicksort_index.cc             \
-        base.cc                                \
-        interleaver.cc                 \
-        trellis_calc_metric.cc         \
-        trellis_permutation.cc         \
-       trellis_siso_f.cc               \
-       trellis_siso_combined_f.cc      \
-       $(GENERATED_CC)                 
-
-# magic flags
-_trellis_la_LDFLAGS = $(NO_UNDEFINED) -module -avoid-version
-
-# link the library against some comon swig runtime code and the 
-# c++ standard library
-_trellis_la_LIBADD =                   \
-       $(PYTHON_LDFLAGS)               \
-       $(GNURADIO_CORE_LA)             \
-       -lstdc++
-
-_trellis_la_CXXFLAGS = @swig_CXXFLAGS@
-
-trellis.cc trellis.py: $(ALL_IFILES) $(grinclude_HEADERS)
-       $(SWIG) $(STD_SWIG_PYTHON_ARGS) -module trellis \
-               -o trellis.cc $(LOCAL_IFILES)
-
 # These headers get installed in ${prefix}/include/gnuradio
 grinclude_HEADERS =                    \
         fsm.h                          \
@@ -144,9 +66,37 @@ grinclude_HEADERS =                 \
        trellis_siso_combined_f.h       \
        $(GENERATED_H)
 
-# These swig headers get installed in ${prefix}/include/gnuradio/swig
-swiginclude_HEADERS =                  \
-       $(LOCAL_IFILES)                 \
+#################################
+# SWIG interface and library
+
+TOP_SWIG_IFILES =                      \
+       trellis.i
+
+# Install so that they end up available as:
+#   import gnuradio.trellis
+# This ends up at:
+#   ${prefix}/lib/python${python_version}/site-packages/gnuradio
+trellis_pythondir_category =           \
+       gnuradio
+
+# additional sources for the SWIG-generated library
+trellis_la_swig_sources =              \
+        fsm.cc                         \
+        quicksort_index.cc             \
+        base.cc                                \
+        interleaver.cc                 \
+        trellis_calc_metric.cc         \
+        trellis_permutation.cc         \
+       trellis_siso_f.cc               \
+       trellis_siso_combined_f.cc      \
+       $(GENERATED_CC)
+
+# additional libraries for linking with the SWIG-generated library
+trellis_la_swig_libadd =               \
+       $(GNURADIO_CORE_LA)
+
+# additional SWIG files to be installed
+trellis_swiginclude_headers =          \
        $(GENERATED_I)                  \
        fsm.i                           \
        interleaver.i                   \
@@ -155,7 +105,29 @@ swiginclude_HEADERS =                      \
        trellis_siso_combined_f.i       \
        trellis_generated.i
 
-# Don't distribute output of swig
-dist-hook:
-       @for file in $(swig_built_sources); do echo $(RM) $(distdir)/$$file; done
-       @for file in $(swig_built_sources); do $(RM) $(distdir)/$$file; done
+# Do creation and inclusion of other Makefiles last
+
+# include the srcdir's Makefile.gen; doing this creates an implicit
+# dependency between $(srcdir)/Makefile.in and $(srcdir)/Makefile.gen.
+include $(srcdir)/Makefile.gen
+
+# common way for generating local Makefile.gen
+makefile_gen_gen_command = PYTHONPATH=$(top_srcdir)/gnuradio-core/src/python srcdir=$(srcdir) do_makefile=1 do_sources=0 $(PYTHON) $(srcdir)/generate_all.py
+include $(top_srcdir)/Makefile.gen.gen
+
+# common way for generating sources from templates when using
+# BUILT_SOURCES, using parallel build protection.
+gen_sources = $(python_built_sources)
+gen_sources_deps = $(core_generator)
+par_gen_command = PYTHONPATH=$(top_srcdir)/gnuradio-core/src/python srcdir=$(srcdir) $(PYTHON) $(srcdir)/generate_all.py
+include $(top_srcdir)/Makefile.par.gen
+
+include $(top_srcdir)/Makefile.swig
+
+# add some of the variables generated inside the Makefile.swig.gen
+BUILT_SOURCES =                                \
+       $(python_built_sources)         \
+       $(swig_built_sources)
+
+# Do not distribute the output of SWIG
+no_dist_files = $(swig_built_sources)
diff --git a/gr-trellis/src/lib/Makefile.swig.gen b/gr-trellis/src/lib/Makefile.swig.gen
new file mode 100644 (file)
index 0000000..1a9656b
--- /dev/null
@@ -0,0 +1,259 @@
+# -*- Makefile -*-
+#
+# Copyright 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.
+# 
+
+# Makefile.swig.gen for trellis.i
+
+## Default install locations for these files:
+##
+## Default location for the Python directory is:
+##  ${prefix}/lib/python${python_version}/site-packages/[category]/trellis
+## Default location for the Python exec directory is:
+##  ${exec_prefix}/lib/python${python_version}/site-packages/[category]/trellis
+##
+## The following can be overloaded to change the install location, but
+## this has to be done in the including Makefile.am -before-
+## Makefile.swig is included.
+
+trellis_pythondir_category ?= gnuradio/trellis
+trellis_pylibdir_category ?= $(trellis_pythondir_category)
+trellis_pythondir = $(pythondir)/$(trellis_pythondir_category)
+trellis_pylibdir = $(pyexecdir)/$(trellis_pylibdir_category)
+
+## SWIG headers are always installed into the same directory.
+
+trellis_swigincludedir = $(swigincludedir)
+
+## This is a template file for a "generated" Makefile addition (in
+## this case, "Makefile.swig.gen").  By including the top-level
+## Makefile.swig, this file will be used to generate the SWIG
+## dependencies.  Assign the variable TOP_SWIG_FILES to be the list of
+## SWIG .i files to generated wrappings for; there can be more than 1
+## so long as the names are unique (no sorting is done on the
+## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i
+## file will generate .cc, .py, and possibly .h files -- meaning that
+## all of these files will have the same base name (that provided for
+## the SWIG .i file).
+##
+## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the
+## right thing.  For more info, see <
+## http://sources.redhat.com/automake/automake.html#Multiple-Outputs >
+
+## Stamps used to ensure parallel make does the right thing.  These
+## are removed by "make clean", but otherwise unused except during the
+## parallel built.  These will not be included in a tarball, because
+## the SWIG-generated files will be removed from the distribution.
+
+STAMPS += $(DEPDIR)/trellis-generate-*
+
+## Other cleaned files: dependency files generated by SWIG or this Makefile
+
+MOSTLYCLEANFILES += $(DEPDIR)/*.S*
+
+## Add the .py and .cc files to the list of SWIG built sources.  The
+## .h file is sometimes built, but not always ... so that one has to
+## be added manually by the including Makefile.am .
+
+swig_built_sources += trellis.py trellis.cc
+
+## Various SWIG variables.  These can be overloaded in the including
+## Makefile.am by setting the variable value there, then including
+## Makefile.swig .
+
+trellis_swiginclude_HEADERS =          \
+       trellis.i                       \
+       $(trellis_swiginclude_headers)
+
+trellis_pylib_LTLIBRARIES =            \
+       _trellis.la
+
+_trellis_la_SOURCES =                  \
+       trellis.cc                      \
+       $(trellis_la_swig_sources)
+
+_trellis_la_LIBADD =                   \
+       $(STD_SWIG_LA_LIB_ADD)          \
+       $(trellis_la_swig_libadd)
+
+_trellis_la_LDFLAGS =                  \
+       $(STD_SWIG_LA_LD_FLAGS)         \
+       $(trellis_la_swig_ldflags)
+
+_trellis_la_CXXFLAGS =                 \
+       $(STD_SWIG_CXX_FLAGS)           \
+       $(trellis_la_swig_cxxflags)
+
+trellis_python_PYTHON =                        \
+       trellis.py                      \
+       $(trellis_python)
+
+## Entry rule for running SWIG
+
+trellis.h trellis.py trellis.cc: trellis.i
+## This rule will get called only when MAKE decides that one of the
+## targets needs to be created or re-created, because:
+##
+## * The .i file is newer than any or all of the generated files;
+##
+## * Any or all of the .cc, .h, or .py files does not exist and is
+##   needed (in the case this file is not needed, the rule for it is
+##   ignored); or
+##
+## * Some SWIG-based dependecy of the .cc file isn't met and hence the
+##   .cc file needs be be regenerated.  Explanation: Because MAKE
+##   knows how to handle dependencies for .cc files (regardless of
+##   their name or extension), then the .cc file is used as a target
+##   instead of the .i file -- but with the dependencies of the .i
+##   file.  It is this last reason why the line:
+##
+##             if test -f $@; then :; else
+##
+##   cannot be used in this case: If a .i file dependecy is not met,
+##   then the .cc file needs to be rebuilt.  But if the stamp is newer
+##   than the .cc file, and the .cc file exists, then in the original
+##   version (with the 'test' above) the internal MAKE call will not
+##   be issued and hence the .cc file will not be rebuilt.
+##
+## Once execution gets to here, it should always proceed no matter the
+## state of a stamp (as discussed in link above).  The
+## $(DEPDIR)/trellis-generate stuff is used to allow for parallel
+## builds to "do the right thing".  The stamp has no relationship with
+## either the target files or dependency file; it is used solely for
+## the protection of multiple builds during a given call to MAKE.
+##
+## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM
+## (15).  At a caught signal, the quoted command will be issued before
+## exiting.  In this case, remove any stamp, whether temporary of not.
+## The trap is valid until the process exits; the process includes all
+## commands appended via "\"s.
+##
+       trap 'rm -rf $(DEPDIR)/trellis-generate-*' 1 2 13 15; \
+##
+## Create a temporary directory, which acts as a lock.  The first
+## process to create the directory will succeed and issue the MAKE
+## command to do the actual work, while all subsequent processes will
+## fail -- leading them to wait for the first process to finish.
+##
+       if mkdir $(DEPDIR)/trellis-generate-lock 2>/dev/null; then \
+##
+## This code is being executed by the first process to succeed in
+## creating the directory lock.
+##
+## Remove the stamp associated with this filename.
+##
+               rm -f $(DEPDIR)/trellis-generate-stamp; \
+##
+## Tell MAKE to run the rule for creating this stamp.
+##
+               $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/trellis-generate-stamp WHAT=$<; \
+##
+## Now that the .cc, .h, and .py files have been (re)created from the
+## .i file, future checking of this rule during the same MAKE
+## execution will come back that the rule doesn't need to be executed
+## because none of the conditions mentioned at the start of this rule
+## will be positive.  Remove the the directory lock, which frees up
+## any waiting process(es) to continue.
+##
+               rmdir $(DEPDIR)/trellis-generate-lock; \
+       else \
+##
+## This code is being executed by any follower processes while the
+## directory lock is in place.
+##
+## Wait until the first process is done, testing once per second.
+##
+               while test -d $(DEPDIR)/trellis-generate-lock; do \
+                       sleep 1; \
+               done; \
+##
+## Succeed if and only if the first process succeeded; exit this
+## process returning the status of the generated stamp.
+##
+               test -f $(DEPDIR)/trellis-generate-stamp; \
+               exit $$?; \
+       fi;
+
+$(DEPDIR)/trellis-generate-stamp:
+## This rule will be called only by the first process issuing the
+## above rule to succeed in creating the lock directory, after
+## removing the actual stamp file in order to guarantee that MAKE will
+## execute this rule.
+##
+## Call SWIG to generate the various output files; special
+## post-processing on 'mingw32' host OS for the dependency file.
+##
+       if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(trellis_swig_args) \
+               -MD -MF $(DEPDIR)/trellis.Std \
+               -module trellis -o trellis.cc $(WHAT); then \
+           if test $(host_os) = mingw32; then \
+               $(RM) $(DEPDIR)/trellis.Sd; \
+               $(SED) 's,\\\\,/,g' < $(DEPDIR)/trellis.Std \
+                       > $(DEPDIR)/trellis.Sd; \
+               $(RM) $(DEPDIR)/trellis.Std; \
+               $(MV) $(DEPDIR)/trellis.Sd $(DEPDIR)/trellis.Std; \
+           fi; \
+       else \
+           $(RM) $(DEPDIR)/trellis.S*; exit 1; \
+       fi;
+##
+## Mess with the SWIG output .Std dependency file, to create a
+## dependecy file valid for the input .i file: Basically, simulate the
+## dependency file created for libraries by GNU's libtool for C++,
+## where all of the dependencies for the target are first listed, then
+## each individual dependency is listed as a target with no further
+## dependencies.
+##
+## (1) remove the current dependency file
+##
+       $(RM) $(DEPDIR)/trellis.d
+##
+## (2) Copy the whole SWIG file:
+##
+       cp $(DEPDIR)/trellis.Std $(DEPDIR)/trellis.d
+##
+## (3) all a carriage return to the end of the dependency file.
+##
+       echo "" >> $(DEPDIR)/trellis.d
+##
+## (4) from the SWIG file, remove the first line (the target); remove
+##     trailing " \" and " " from each line.  Append ":" to each line,
+##     followed by 2 carriage returns, then append this to the end of
+##     the dependency file.
+##
+       $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/trellis.Std | \
+               awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/trellis.d
+##
+## (5) remove the SWIG-generated file
+##
+       $(RM) $(DEPDIR)/trellis.Std
+##
+## Create the stamp for this filename generation, to signal success in
+## executing this rule; allows other threads waiting on this process
+## to continue.
+##
+       touch $(DEPDIR)/trellis-generate-stamp
+
+# KLUDGE: Force runtime include of a SWIG 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@./$(DEPDIR)/trellis.d@am__quote@
+
index 37b8f1a03b9ca2358f39152ac50fc2063921f165..76ec9d0c17021ff25a3fa19a3319b4372c463353 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2004 Free Software Foundation, Inc.
+# Copyright 2004,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -31,5 +31,3 @@ TESTS =                               \
 
 noinst_PYTHON =                        \
        qa_trellis.py                   
-
-MOSTLYCLEANFILES = *.pyc
index f28fac8d402e3289a322aca3d180d9df26abe83a..824a48974779ef3f3f3cfabda9fb371b38c6886b 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2008 Free Software Foundation, Inc.
+# Copyright 2008,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -51,5 +51,3 @@ usrp_rx_cfile_SOURCES =       \
 
 usrp_siggen_SOURCES =  \
     usrp_siggen.cc
-
-MOSTLYCLEANFILES = *~
index 7b897ea082029745dfd2d6d66534858b897faee2..9b8737d715666b43b5487cee19c12e6673fb61f3 100644 (file)
 
 include $(top_srcdir)/Makefile.common
 
+# ----------------------------------------------------------------
+# Misc. build/installation activities
+
+EXTRA_DIST = run_tests.in
+
+TESTS = run_tests
+
+DISTCLEANFILES = run_tests
+
+noinst_PYTHON =        qa_usrp.py
+
 # ----------------------------------------------------------------
 # The straight C++ library
 
@@ -58,76 +69,45 @@ grinclude_HEADERS = \
        usrp_source_s.h
 
 # ----------------------------------------------------------------
-# The SWIG library and Python modules
-#
-# Install this stuff so that it ends up as the gnuradio.usrp module
-# This usually ends up at:
-#   ${prefix}/lib/python${python_version}/site-packages/gnuradio/usrp
-
-ourpythondir = $(grpythondir)/usrp
-ourlibdir    = $(grpyexecdir)/usrp
-
-BUILT_SOURCES = \
-       usrp_swig.cc \
-       usrp_swig.py            
+# The SWIG library
 
-LOCAL_IFILES = \
-       $(srcdir)/usrp.i \
-       $(srcdir)/usrp_base.i \
-       $(srcdir)/usrp_source_base.i \
-       $(srcdir)/usrp_source_c.i \
-       $(srcdir)/usrp_source_s.i \
-       $(srcdir)/usrp_sink_base.i \
-       $(srcdir)/usrp_sink_c.i \
-       $(srcdir)/usrp_sink_s.i \
-       $(srcdir)/usrp_standard.i
+TOP_SWIG_IFILES =              \
+       usrp_swig.i
 
-NON_LOCAL_IFILES = \
-       $(GNURADIO_I)
-
-ALL_IFILES = \
-       $(LOCAL_IFILES) \
-       $(NON_LOCAL_IFILES)             
-
-ourlib_LTLIBRARIES = \
-       _usrp_swig.la
-
-ourlib_PYTHON = \
-       __init__.py \
-       usrp_swig.py
+# Install so that they end up available as:
+#   import gnuradio.usrp
+# This ends up at:
+#   ${prefix}/lib/python${python_version}/site-packages/gnuradio/usrp
+usrp_swig_pythondir_category =         \
+       gnuradio/usrp
 
-_usrp_swig_la_SOURCES =        \
-       usrp_swig.cc                    
+# additional arguments to the SWIG command
+usrp_swig_swig_args =          \
+       $(USRP_INCLUDES)
 
-_usrp_swig_la_LIBADD = \
-       $(PYTHON_LDFLAGS) \
+# additional libraries for linking with the SWIG-generated library
+usrp_swig_la_swig_libadd =     \
        libgnuradio-usrp.la
 
-_usrp_swig_la_LDFLAGS = $(NO_UNDEFINED) -module -avoid-version
-
-_usrp_swig_la_CXXFLAGS = @swig_CXXFLAGS@
-
-# Special swig arguments
-LOCAL_SWIG_DEFINES_AND_INCLUDES = $(USRP_INCLUDES)
+# additional Python files to be installed along with the SWIG-generated one
+usrp_swig_python =             \
+       __init__.py
 
-usrp_swig.cc usrp_swig.py: $(ALL_IFILES)
-       $(SWIG) $(STD_SWIG_PYTHON_ARGS) -module usrp_swig \
-               -o usrp_swig.cc $(srcdir)/usrp.i
+# additional SWIG files to be installed
+usrp_swig_swiginclude_headers =        \
+       usrp_base.i             \
+       usrp_source_base.i      \
+       usrp_source_c.i         \
+       usrp_source_s.i         \
+       usrp_sink_base.i        \
+       usrp_sink_c.i           \
+       usrp_sink_s.i           \
+       usrp_standard.i
 
-noinst_PYTHON =        \
-       qa_usrp.py                      
+include $(top_srcdir)/Makefile.swig
 
-swiginclude_HEADERS = \
-       $(LOCAL_IFILES)
+# add some of the variables generated inside the Makefile.swig.gen
+BUILT_SOURCES = $(swig_built_sources)
 
-# 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
-
-# ----------------------------------------------------------------
-# Misc. build/installation activities
-
-MOSTLYCLEANFILES = $(BUILT_SOURCES) *~ *.pyc
-EXTRA_DIST = run_tests.in
-TESTS = run_tests
+# Do not distribute the output of SWIG
+no_dist_files = $(swig_built_sources)
diff --git a/gr-usrp/src/Makefile.swig.gen b/gr-usrp/src/Makefile.swig.gen
new file mode 100644 (file)
index 0000000..9884b3d
--- /dev/null
@@ -0,0 +1,259 @@
+# -*- Makefile -*-
+#
+# Copyright 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.
+# 
+
+# Makefile.swig.gen for usrp_swig.i
+
+## Default install locations for these files:
+##
+## Default location for the Python directory is:
+##  ${prefix}/lib/python${python_version}/site-packages/[category]/usrp_swig
+## Default location for the Python exec directory is:
+##  ${exec_prefix}/lib/python${python_version}/site-packages/[category]/usrp_swig
+##
+## The following can be overloaded to change the install location, but
+## this has to be done in the including Makefile.am -before-
+## Makefile.swig is included.
+
+usrp_swig_pythondir_category ?= gnuradio/usrp_swig
+usrp_swig_pylibdir_category ?= $(usrp_swig_pythondir_category)
+usrp_swig_pythondir = $(pythondir)/$(usrp_swig_pythondir_category)
+usrp_swig_pylibdir = $(pyexecdir)/$(usrp_swig_pylibdir_category)
+
+## SWIG headers are always installed into the same directory.
+
+usrp_swig_swigincludedir = $(swigincludedir)
+
+## This is a template file for a "generated" Makefile addition (in
+## this case, "Makefile.swig.gen").  By including the top-level
+## Makefile.swig, this file will be used to generate the SWIG
+## dependencies.  Assign the variable TOP_SWIG_FILES to be the list of
+## SWIG .i files to generated wrappings for; there can be more than 1
+## so long as the names are unique (no sorting is done on the
+## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i
+## file will generate .cc, .py, and possibly .h files -- meaning that
+## all of these files will have the same base name (that provided for
+## the SWIG .i file).
+##
+## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the
+## right thing.  For more info, see <
+## http://sources.redhat.com/automake/automake.html#Multiple-Outputs >
+
+## Stamps used to ensure parallel make does the right thing.  These
+## are removed by "make clean", but otherwise unused except during the
+## parallel built.  These will not be included in a tarball, because
+## the SWIG-generated files will be removed from the distribution.
+
+STAMPS += $(DEPDIR)/usrp_swig-generate-*
+
+## Other cleaned files: dependency files generated by SWIG or this Makefile
+
+MOSTLYCLEANFILES += $(DEPDIR)/*.S*
+
+## Add the .py and .cc files to the list of SWIG built sources.  The
+## .h file is sometimes built, but not always ... so that one has to
+## be added manually by the including Makefile.am .
+
+swig_built_sources += usrp_swig.py usrp_swig.cc
+
+## Various SWIG variables.  These can be overloaded in the including
+## Makefile.am by setting the variable value there, then including
+## Makefile.swig .
+
+usrp_swig_swiginclude_HEADERS =                \
+       usrp_swig.i                     \
+       $(usrp_swig_swiginclude_headers)
+
+usrp_swig_pylib_LTLIBRARIES =          \
+       _usrp_swig.la
+
+_usrp_swig_la_SOURCES =                        \
+       usrp_swig.cc                    \
+       $(usrp_swig_la_swig_sources)
+
+_usrp_swig_la_LIBADD =                 \
+       $(STD_SWIG_LA_LIB_ADD)          \
+       $(usrp_swig_la_swig_libadd)
+
+_usrp_swig_la_LDFLAGS =                        \
+       $(STD_SWIG_LA_LD_FLAGS)         \
+       $(usrp_swig_la_swig_ldflags)
+
+_usrp_swig_la_CXXFLAGS =                       \
+       $(STD_SWIG_CXX_FLAGS)           \
+       $(usrp_swig_la_swig_cxxflags)
+
+usrp_swig_python_PYTHON =                      \
+       usrp_swig.py                    \
+       $(usrp_swig_python)
+
+## Entry rule for running SWIG
+
+usrp_swig.h usrp_swig.py usrp_swig.cc: usrp_swig.i
+## This rule will get called only when MAKE decides that one of the
+## targets needs to be created or re-created, because:
+##
+## * The .i file is newer than any or all of the generated files;
+##
+## * Any or all of the .cc, .h, or .py files does not exist and is
+##   needed (in the case this file is not needed, the rule for it is
+##   ignored); or
+##
+## * Some SWIG-based dependecy of the .cc file isn't met and hence the
+##   .cc file needs be be regenerated.  Explanation: Because MAKE
+##   knows how to handle dependencies for .cc files (regardless of
+##   their name or extension), then the .cc file is used as a target
+##   instead of the .i file -- but with the dependencies of the .i
+##   file.  It is this last reason why the line:
+##
+##             if test -f $@; then :; else
+##
+##   cannot be used in this case: If a .i file dependecy is not met,
+##   then the .cc file needs to be rebuilt.  But if the stamp is newer
+##   than the .cc file, and the .cc file exists, then in the original
+##   version (with the 'test' above) the internal MAKE call will not
+##   be issued and hence the .cc file will not be rebuilt.
+##
+## Once execution gets to here, it should always proceed no matter the
+## state of a stamp (as discussed in link above).  The
+## $(DEPDIR)/usrp_swig-generate stuff is used to allow for parallel
+## builds to "do the right thing".  The stamp has no relationship with
+## either the target files or dependency file; it is used solely for
+## the protection of multiple builds during a given call to MAKE.
+##
+## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM
+## (15).  At a caught signal, the quoted command will be issued before
+## exiting.  In this case, remove any stamp, whether temporary of not.
+## The trap is valid until the process exits; the process includes all
+## commands appended via "\"s.
+##
+       trap 'rm -rf $(DEPDIR)/usrp_swig-generate-*' 1 2 13 15; \
+##
+## Create a temporary directory, which acts as a lock.  The first
+## process to create the directory will succeed and issue the MAKE
+## command to do the actual work, while all subsequent processes will
+## fail -- leading them to wait for the first process to finish.
+##
+       if mkdir $(DEPDIR)/usrp_swig-generate-lock 2>/dev/null; then \
+##
+## This code is being executed by the first process to succeed in
+## creating the directory lock.
+##
+## Remove the stamp associated with this filename.
+##
+               rm -f $(DEPDIR)/usrp_swig-generate-stamp; \
+##
+## Tell MAKE to run the rule for creating this stamp.
+##
+               $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/usrp_swig-generate-stamp WHAT=$<; \
+##
+## Now that the .cc, .h, and .py files have been (re)created from the
+## .i file, future checking of this rule during the same MAKE
+## execution will come back that the rule doesn't need to be executed
+## because none of the conditions mentioned at the start of this rule
+## will be positive.  Remove the the directory lock, which frees up
+## any waiting process(es) to continue.
+##
+               rmdir $(DEPDIR)/usrp_swig-generate-lock; \
+       else \
+##
+## This code is being executed by any follower processes while the
+## directory lock is in place.
+##
+## Wait until the first process is done, testing once per second.
+##
+               while test -d $(DEPDIR)/usrp_swig-generate-lock; do \
+                       sleep 1; \
+               done; \
+##
+## Succeed if and only if the first process succeeded; exit this
+## process returning the status of the generated stamp.
+##
+               test -f $(DEPDIR)/usrp_swig-generate-stamp; \
+               exit $$?; \
+       fi;
+
+$(DEPDIR)/usrp_swig-generate-stamp:
+## This rule will be called only by the first process issuing the
+## above rule to succeed in creating the lock directory, after
+## removing the actual stamp file in order to guarantee that MAKE will
+## execute this rule.
+##
+## Call SWIG to generate the various output files; special
+## post-processing on 'mingw32' host OS for the dependency file.
+##
+       if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(usrp_swig_swig_args) \
+               -MD -MF $(DEPDIR)/usrp_swig.Std \
+               -module usrp_swig -o usrp_swig.cc $(WHAT); then \
+           if test $(host_os) = mingw32; then \
+               $(RM) $(DEPDIR)/usrp_swig.Sd; \
+               $(SED) 's,\\\\,/,g' < $(DEPDIR)/usrp_swig.Std \
+                       > $(DEPDIR)/usrp_swig.Sd; \
+               $(RM) $(DEPDIR)/usrp_swig.Std; \
+               $(MV) $(DEPDIR)/usrp_swig.Sd $(DEPDIR)/usrp_swig.Std; \
+           fi; \
+       else \
+           $(RM) $(DEPDIR)/usrp_swig.S*; exit 1; \
+       fi;
+##
+## Mess with the SWIG output .Std dependency file, to create a
+## dependecy file valid for the input .i file: Basically, simulate the
+## dependency file created for libraries by GNU's libtool for C++,
+## where all of the dependencies for the target are first listed, then
+## each individual dependency is listed as a target with no further
+## dependencies.
+##
+## (1) remove the current dependency file
+##
+       $(RM) $(DEPDIR)/usrp_swig.d
+##
+## (2) Copy the whole SWIG file:
+##
+       cp $(DEPDIR)/usrp_swig.Std $(DEPDIR)/usrp_swig.d
+##
+## (3) all a carriage return to the end of the dependency file.
+##
+       echo "" >> $(DEPDIR)/usrp_swig.d
+##
+## (4) from the SWIG file, remove the first line (the target); remove
+##     trailing " \" and " " from each line.  Append ":" to each line,
+##     followed by 2 carriage returns, then append this to the end of
+##     the dependency file.
+##
+       $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/usrp_swig.Std | \
+               awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/usrp_swig.d
+##
+## (5) remove the SWIG-generated file
+##
+       $(RM) $(DEPDIR)/usrp_swig.Std
+##
+## Create the stamp for this filename generation, to signal success in
+## executing this rule; allows other threads waiting on this process
+## to continue.
+##
+       touch $(DEPDIR)/usrp_swig-generate-stamp
+
+# KLUDGE: Force runtime include of a SWIG 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@./$(DEPDIR)/usrp_swig.d@am__quote@
+
diff --git a/gr-usrp/src/usrp.i b/gr-usrp/src/usrp.i
deleted file mode 100644 (file)
index f584198..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 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 "gnuradio.i"  // the common stuff
-
-%{
-#include <vector>
-%}
-
-%include <usrp_subdev_spec.h>
-%include <db_base.i>
-%include <fpga_regs_common.h>
-%include <fpga_regs_standard.h>
-%include "usrp_standard.i"
-%include "usrp_base.i"
-%include "usrp_source_base.i"
-%include "usrp_source_c.i"
-%include "usrp_source_s.i"
-%include "usrp_sink_base.i"
-%include "usrp_sink_c.i"
-%include "usrp_sink_s.i"
-
-//---Allow a more Pythonic interface
-%pythoncode %{
-
-# Allow subdev_spec to be tuple
-def __selected_subdev(self, subdev_spec):
-  ss = usrp_subdev_spec(subdev_spec[0], subdev_spec[1])
-  return self._real_selected_subdev(ss)
-
-# Allow subdev_spec to be tuple
-def __determine_tx_mux_value(self, subdev_spec, subdev_spec_=None):
-    ss = usrp_subdev_spec(subdev_spec[0], subdev_spec[1])
-    if subdev_spec_ is None: return self._real_determine_tx_mux_value(ss)
-    ss_ = usrp_subdev_spec(subdev_spec_[0], subdev_spec_[1])
-    return self._real_determine_tx_mux_value(ss, ss_)
-
-# Allow subdev_spec to be tuple
-def __determine_rx_mux_value(self, subdev_spec, subdev_spec_=None):
-    ss = usrp_subdev_spec(subdev_spec[0], subdev_spec[1])
-    if subdev_spec_ is None: return self._real_determine_rx_mux_value(ss)
-    ss_ = usrp_subdev_spec(subdev_spec_[0], subdev_spec_[1])
-    return self._real_determine_rx_mux_value(ss, ss_)
-
-# Allow subdev_spec to be tuple
-def __pick_subdev(self, candidates=[]):
-    ss = self._real_pick_subdev(candidates)
-    return (ss.side, ss.subdev)
-
-# Allow subdev_spec to be tuple
-def __pick_tx_subdevice(self):
-    ss = self._real_pick_tx_subdevice()
-    return (ss.side, ss.subdev)
-
-# Allow subdev_spec to be tuple
-def __pick_rx_subdevice(self):
-    ss = self._real_pick_rx_subdevice()
-    return (ss.side, ss.subdev)
-
-# Make return tune_result or None on failure
-def __tune(self, chan, db, target_freq):
-    tr = usrp_tune_result()
-    r = self._real_tune(chan, db, target_freq, tr)
-    if r:
-        return tr
-    else:
-        return None
-
-# Allow to be called as a free function
-def tune(u, chan, subdev, target_freq):
-    return u.tune(chan, subdev, target_freq)
-
-# Allow to be called as free function
-def determine_tx_mux_value(u, subdev_spec, subdev_spec_=None):
-    return u.determine_tx_mux_value(subdev_spec, subdev_spec_)
-
-# Allow to be called as free function
-def determine_rx_mux_value(u, subdev_spec, subdev_spec_=None):
-    return u.determine_rx_mux_value(subdev_spec, subdev_spec_)
-
-# Allow to be called as free function
-def selected_subdev(u, subdev_spec):
-    return u.selected_subdev(subdev_spec)
-
-# Allow to be called as free function
-def pick_subdev(u, candidates=[]):
-    return u.pick_subdev(candidates);
-
-# Allow to be called as free function
-def pick_tx_subdevice(u):
-    return u.pick_tx_subdevice();
-
-# Allow to be called as free function
-def pick_rx_subdevice(u):
-    return u.pick_rx_subdevice();
-
-# Jam into Python objects
-usrp_sink_c_sptr.determine_tx_mux_value   = __determine_tx_mux_value
-usrp_sink_s_sptr.determine_tx_mux_value   = __determine_tx_mux_value
-
-usrp_source_c_sptr.determine_rx_mux_value = __determine_rx_mux_value
-usrp_source_s_sptr.determine_rx_mux_value = __determine_rx_mux_value
-
-usrp_sink_c_sptr.selected_subdev          = __selected_subdev
-usrp_sink_s_sptr.selected_subdev          = __selected_subdev
-usrp_source_c_sptr.selected_subdev        = __selected_subdev
-usrp_source_s_sptr.selected_subdev        = __selected_subdev
-
-usrp_sink_c_sptr.tune                     = __tune
-usrp_sink_s_sptr.tune                     = __tune
-usrp_source_c_sptr.tune                   = __tune
-usrp_source_s_sptr.tune                   = __tune
-
-usrp_sink_c_sptr.pick_subdev              = __pick_subdev
-usrp_sink_s_sptr.pick_subdev              = __pick_subdev
-usrp_source_c_sptr.pick_subdev            = __pick_subdev
-usrp_source_s_sptr.pick_subdev            = __pick_subdev
-
-usrp_sink_c_sptr.pick_tx_subdevice        = __pick_tx_subdevice
-usrp_sink_s_sptr.pick_tx_subdevice        = __pick_tx_subdevice
-usrp_source_c_sptr.pick_rx_subdevice      = __pick_rx_subdevice
-usrp_source_s_sptr.pick_rx_subdevice      = __pick_rx_subdevice
-
-%}
diff --git a/gr-usrp/src/usrp_swig.i b/gr-usrp/src/usrp_swig.i
new file mode 100644 (file)
index 0000000..f584198
--- /dev/null
@@ -0,0 +1,143 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 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 "gnuradio.i"  // the common stuff
+
+%{
+#include <vector>
+%}
+
+%include <usrp_subdev_spec.h>
+%include <db_base.i>
+%include <fpga_regs_common.h>
+%include <fpga_regs_standard.h>
+%include "usrp_standard.i"
+%include "usrp_base.i"
+%include "usrp_source_base.i"
+%include "usrp_source_c.i"
+%include "usrp_source_s.i"
+%include "usrp_sink_base.i"
+%include "usrp_sink_c.i"
+%include "usrp_sink_s.i"
+
+//---Allow a more Pythonic interface
+%pythoncode %{
+
+# Allow subdev_spec to be tuple
+def __selected_subdev(self, subdev_spec):
+  ss = usrp_subdev_spec(subdev_spec[0], subdev_spec[1])
+  return self._real_selected_subdev(ss)
+
+# Allow subdev_spec to be tuple
+def __determine_tx_mux_value(self, subdev_spec, subdev_spec_=None):
+    ss = usrp_subdev_spec(subdev_spec[0], subdev_spec[1])
+    if subdev_spec_ is None: return self._real_determine_tx_mux_value(ss)
+    ss_ = usrp_subdev_spec(subdev_spec_[0], subdev_spec_[1])
+    return self._real_determine_tx_mux_value(ss, ss_)
+
+# Allow subdev_spec to be tuple
+def __determine_rx_mux_value(self, subdev_spec, subdev_spec_=None):
+    ss = usrp_subdev_spec(subdev_spec[0], subdev_spec[1])
+    if subdev_spec_ is None: return self._real_determine_rx_mux_value(ss)
+    ss_ = usrp_subdev_spec(subdev_spec_[0], subdev_spec_[1])
+    return self._real_determine_rx_mux_value(ss, ss_)
+
+# Allow subdev_spec to be tuple
+def __pick_subdev(self, candidates=[]):
+    ss = self._real_pick_subdev(candidates)
+    return (ss.side, ss.subdev)
+
+# Allow subdev_spec to be tuple
+def __pick_tx_subdevice(self):
+    ss = self._real_pick_tx_subdevice()
+    return (ss.side, ss.subdev)
+
+# Allow subdev_spec to be tuple
+def __pick_rx_subdevice(self):
+    ss = self._real_pick_rx_subdevice()
+    return (ss.side, ss.subdev)
+
+# Make return tune_result or None on failure
+def __tune(self, chan, db, target_freq):
+    tr = usrp_tune_result()
+    r = self._real_tune(chan, db, target_freq, tr)
+    if r:
+        return tr
+    else:
+        return None
+
+# Allow to be called as a free function
+def tune(u, chan, subdev, target_freq):
+    return u.tune(chan, subdev, target_freq)
+
+# Allow to be called as free function
+def determine_tx_mux_value(u, subdev_spec, subdev_spec_=None):
+    return u.determine_tx_mux_value(subdev_spec, subdev_spec_)
+
+# Allow to be called as free function
+def determine_rx_mux_value(u, subdev_spec, subdev_spec_=None):
+    return u.determine_rx_mux_value(subdev_spec, subdev_spec_)
+
+# Allow to be called as free function
+def selected_subdev(u, subdev_spec):
+    return u.selected_subdev(subdev_spec)
+
+# Allow to be called as free function
+def pick_subdev(u, candidates=[]):
+    return u.pick_subdev(candidates);
+
+# Allow to be called as free function
+def pick_tx_subdevice(u):
+    return u.pick_tx_subdevice();
+
+# Allow to be called as free function
+def pick_rx_subdevice(u):
+    return u.pick_rx_subdevice();
+
+# Jam into Python objects
+usrp_sink_c_sptr.determine_tx_mux_value   = __determine_tx_mux_value
+usrp_sink_s_sptr.determine_tx_mux_value   = __determine_tx_mux_value
+
+usrp_source_c_sptr.determine_rx_mux_value = __determine_rx_mux_value
+usrp_source_s_sptr.determine_rx_mux_value = __determine_rx_mux_value
+
+usrp_sink_c_sptr.selected_subdev          = __selected_subdev
+usrp_sink_s_sptr.selected_subdev          = __selected_subdev
+usrp_source_c_sptr.selected_subdev        = __selected_subdev
+usrp_source_s_sptr.selected_subdev        = __selected_subdev
+
+usrp_sink_c_sptr.tune                     = __tune
+usrp_sink_s_sptr.tune                     = __tune
+usrp_source_c_sptr.tune                   = __tune
+usrp_source_s_sptr.tune                   = __tune
+
+usrp_sink_c_sptr.pick_subdev              = __pick_subdev
+usrp_sink_s_sptr.pick_subdev              = __pick_subdev
+usrp_source_c_sptr.pick_subdev            = __pick_subdev
+usrp_source_s_sptr.pick_subdev            = __pick_subdev
+
+usrp_sink_c_sptr.pick_tx_subdevice        = __pick_tx_subdevice
+usrp_sink_s_sptr.pick_tx_subdevice        = __pick_tx_subdevice
+usrp_source_c_sptr.pick_rx_subdevice      = __pick_rx_subdevice
+usrp_source_s_sptr.pick_rx_subdevice      = __pick_rx_subdevice
+
+%}
index 90796ceae9103e3742ee1f98bcc599e7ed008d19..bd9034f1ad51c0a8a664a2258ea0733bdf8f29e8 100644 (file)
 
 include $(top_srcdir)/Makefile.common
 
+# ----------------------------------------------------------------------
+# Local Python files, not installed
+#
+# qa_usrp2.py
+# ----------------------------------------------------------------------
+
+noinst_PYTHON = qa_usrp2.py
+
+# ----------------------------------------------------------------------
+# Miscellaneous build operations
+# ----------------------------------------------------------------------
+
+EXTRA_DIST = run_tests.in
+TESTS = run_tests
+DISTCLEANFILES = run_tests
+
 # ----------------------------------------------------------------------
 # C++ block API interface librar(ies)
 #
@@ -70,64 +86,28 @@ noinst_HEADERS = \
 # _usrp2.so
 # ----------------------------------------------------------------------
 
-# Python installation locations
-ourpythondir = $(grpythondir)
-ourlibdir    = $(grpyexecdir)
-
-# SWIG interface files
-LOCAL_IFILES = $(srcdir)/usrp2.i
-NON_LOCAL_IFILES = $(GNURADIO_I)
-ALL_IFILES = $(LOCAL_IFILES) $(NON_LOCAL_IFILES)               
-
-# Install the SWIG interface files
-swiginclude_HEADERS = $(LOCAL_IFILES)
+TOP_SWIG_IFILES =              \
+       usrp2.i
 
-# Generated by SWIG wrapper generator
-BUILT_SOURCES = usrp2.cc usrp2.py                      
+# Install so that they end up available as:
+#   import gnuradio.usrp2
+# This ends up at:
+#   ${prefix}/lib/python${python_version}/site-packages/gnuradio
+usrp2_pythondir_category =     \
+       gnuradio
 
-# Install the SWIG python output
-ourpython_PYTHON = usrp2.py
+# additional arguments to the SWIG command
+usrp2_swig_args =              \
+       $(USRP2_INCLUDES)
 
-# Special swig arguments
-LOCAL_SWIG_DEFINES_AND_INCLUDES = $(USRP2_INCLUDES)
+# additional libraries for linking with the SWIG-generated library
+usrp2_la_swig_libadd =         \
+       libgr-usrp2.la
 
-# Invoke SWIG wrapper generator
-usrp2.cc usrp2.py: $(ALL_IFILES)
-       $(SWIG) $(STD_SWIG_PYTHON_ARGS) -module usrp2 \
-               -o usrp2.cc $(LOCAL_IFILES)
+include $(top_srcdir)/Makefile.swig
 
-# Create the Python shared library
-ourlib_LTLIBRARIES = _usrp2.la
-_usrp2_la_SOURCES = usrp2.cc
-_usrp2_la_CXXFLAGS = @swig_CXXFLAGS@
-_usrp2_la_LDFLAGS = $(swig_CXXFLAGS) $(NO_UNDEFINED) -module -avoid-version
+# add some of the variables generated inside the Makefile.swig.gen
+BUILT_SOURCES = $(swig_built_sources)
 
-# Link the library as needed
-_usrp2_la_LIBADD = \
-       $(PYTHON_LDFLAGS) \
-       libgr-usrp2.la \
-       $(GNURADIO_CORE_LA) \
-       $(USRP2_LIBS) \
-       -lstdc++
-
-# 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
-
-# ----------------------------------------------------------------------
-# Local Python files, not installed
-#
-# qa_usrp2.py
-# ----------------------------------------------------------------------
-
-noinst_PYTHON = qa_usrp2.py                    
-
-
-# ----------------------------------------------------------------------
-# Miscellaneous build operations
-# ----------------------------------------------------------------------
-
-EXTRA_DIST = run_tests.in
-TESTS = run_tests
-MOSTLYCLEANFILES = $(BUILT_SOURCES) *.pyc
+# Do not distribute the output of SWIG
+no_dist_files = $(swig_built_sources)
diff --git a/gr-usrp2/src/Makefile.swig.gen b/gr-usrp2/src/Makefile.swig.gen
new file mode 100644 (file)
index 0000000..24d9f17
--- /dev/null
@@ -0,0 +1,259 @@
+# -*- Makefile -*-
+#
+# Copyright 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.
+# 
+
+# Makefile.swig.gen for usrp2.i
+
+## Default install locations for these files:
+##
+## Default location for the Python directory is:
+##  ${prefix}/lib/python${python_version}/site-packages/[category]/usrp2
+## Default location for the Python exec directory is:
+##  ${exec_prefix}/lib/python${python_version}/site-packages/[category]/usrp2
+##
+## The following can be overloaded to change the install location, but
+## this has to be done in the including Makefile.am -before-
+## Makefile.swig is included.
+
+usrp2_pythondir_category ?= gnuradio/usrp2
+usrp2_pylibdir_category ?= $(usrp2_pythondir_category)
+usrp2_pythondir = $(pythondir)/$(usrp2_pythondir_category)
+usrp2_pylibdir = $(pyexecdir)/$(usrp2_pylibdir_category)
+
+## SWIG headers are always installed into the same directory.
+
+usrp2_swigincludedir = $(swigincludedir)
+
+## This is a template file for a "generated" Makefile addition (in
+## this case, "Makefile.swig.gen").  By including the top-level
+## Makefile.swig, this file will be used to generate the SWIG
+## dependencies.  Assign the variable TOP_SWIG_FILES to be the list of
+## SWIG .i files to generated wrappings for; there can be more than 1
+## so long as the names are unique (no sorting is done on the
+## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i
+## file will generate .cc, .py, and possibly .h files -- meaning that
+## all of these files will have the same base name (that provided for
+## the SWIG .i file).
+##
+## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the
+## right thing.  For more info, see <
+## http://sources.redhat.com/automake/automake.html#Multiple-Outputs >
+
+## Stamps used to ensure parallel make does the right thing.  These
+## are removed by "make clean", but otherwise unused except during the
+## parallel built.  These will not be included in a tarball, because
+## the SWIG-generated files will be removed from the distribution.
+
+STAMPS += $(DEPDIR)/usrp2-generate-*
+
+## Other cleaned files: dependency files generated by SWIG or this Makefile
+
+MOSTLYCLEANFILES += $(DEPDIR)/*.S*
+
+## Add the .py and .cc files to the list of SWIG built sources.  The
+## .h file is sometimes built, but not always ... so that one has to
+## be added manually by the including Makefile.am .
+
+swig_built_sources += usrp2.py usrp2.cc
+
+## Various SWIG variables.  These can be overloaded in the including
+## Makefile.am by setting the variable value there, then including
+## Makefile.swig .
+
+usrp2_swiginclude_HEADERS =            \
+       usrp2.i                 \
+       $(usrp2_swiginclude_headers)
+
+usrp2_pylib_LTLIBRARIES =              \
+       _usrp2.la
+
+_usrp2_la_SOURCES =                    \
+       usrp2.cc                        \
+       $(usrp2_la_swig_sources)
+
+_usrp2_la_LIBADD =                     \
+       $(STD_SWIG_LA_LIB_ADD)          \
+       $(usrp2_la_swig_libadd)
+
+_usrp2_la_LDFLAGS =                    \
+       $(STD_SWIG_LA_LD_FLAGS)         \
+       $(usrp2_la_swig_ldflags)
+
+_usrp2_la_CXXFLAGS =                   \
+       $(STD_SWIG_CXX_FLAGS)           \
+       $(usrp2_la_swig_cxxflags)
+
+usrp2_python_PYTHON =                  \
+       usrp2.py                        \
+       $(usrp2_python)
+
+## Entry rule for running SWIG
+
+usrp2.h usrp2.py usrp2.cc: usrp2.i
+## This rule will get called only when MAKE decides that one of the
+## targets needs to be created or re-created, because:
+##
+## * The .i file is newer than any or all of the generated files;
+##
+## * Any or all of the .cc, .h, or .py files does not exist and is
+##   needed (in the case this file is not needed, the rule for it is
+##   ignored); or
+##
+## * Some SWIG-based dependecy of the .cc file isn't met and hence the
+##   .cc file needs be be regenerated.  Explanation: Because MAKE
+##   knows how to handle dependencies for .cc files (regardless of
+##   their name or extension), then the .cc file is used as a target
+##   instead of the .i file -- but with the dependencies of the .i
+##   file.  It is this last reason why the line:
+##
+##             if test -f $@; then :; else
+##
+##   cannot be used in this case: If a .i file dependecy is not met,
+##   then the .cc file needs to be rebuilt.  But if the stamp is newer
+##   than the .cc file, and the .cc file exists, then in the original
+##   version (with the 'test' above) the internal MAKE call will not
+##   be issued and hence the .cc file will not be rebuilt.
+##
+## Once execution gets to here, it should always proceed no matter the
+## state of a stamp (as discussed in link above).  The
+## $(DEPDIR)/usrp2-generate stuff is used to allow for parallel
+## builds to "do the right thing".  The stamp has no relationship with
+## either the target files or dependency file; it is used solely for
+## the protection of multiple builds during a given call to MAKE.
+##
+## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM
+## (15).  At a caught signal, the quoted command will be issued before
+## exiting.  In this case, remove any stamp, whether temporary of not.
+## The trap is valid until the process exits; the process includes all
+## commands appended via "\"s.
+##
+       trap 'rm -rf $(DEPDIR)/usrp2-generate-*' 1 2 13 15; \
+##
+## Create a temporary directory, which acts as a lock.  The first
+## process to create the directory will succeed and issue the MAKE
+## command to do the actual work, while all subsequent processes will
+## fail -- leading them to wait for the first process to finish.
+##
+       if mkdir $(DEPDIR)/usrp2-generate-lock 2>/dev/null; then \
+##
+## This code is being executed by the first process to succeed in
+## creating the directory lock.
+##
+## Remove the stamp associated with this filename.
+##
+               rm -f $(DEPDIR)/usrp2-generate-stamp; \
+##
+## Tell MAKE to run the rule for creating this stamp.
+##
+               $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/usrp2-generate-stamp WHAT=$<; \
+##
+## Now that the .cc, .h, and .py files have been (re)created from the
+## .i file, future checking of this rule during the same MAKE
+## execution will come back that the rule doesn't need to be executed
+## because none of the conditions mentioned at the start of this rule
+## will be positive.  Remove the the directory lock, which frees up
+## any waiting process(es) to continue.
+##
+               rmdir $(DEPDIR)/usrp2-generate-lock; \
+       else \
+##
+## This code is being executed by any follower processes while the
+## directory lock is in place.
+##
+## Wait until the first process is done, testing once per second.
+##
+               while test -d $(DEPDIR)/usrp2-generate-lock; do \
+                       sleep 1; \
+               done; \
+##
+## Succeed if and only if the first process succeeded; exit this
+## process returning the status of the generated stamp.
+##
+               test -f $(DEPDIR)/usrp2-generate-stamp; \
+               exit $$?; \
+       fi;
+
+$(DEPDIR)/usrp2-generate-stamp:
+## This rule will be called only by the first process issuing the
+## above rule to succeed in creating the lock directory, after
+## removing the actual stamp file in order to guarantee that MAKE will
+## execute this rule.
+##
+## Call SWIG to generate the various output files; special
+## post-processing on 'mingw32' host OS for the dependency file.
+##
+       if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(usrp2_swig_args) \
+               -MD -MF $(DEPDIR)/usrp2.Std \
+               -module usrp2 -o usrp2.cc $(WHAT); then \
+           if test $(host_os) = mingw32; then \
+               $(RM) $(DEPDIR)/usrp2.Sd; \
+               $(SED) 's,\\\\,/,g' < $(DEPDIR)/usrp2.Std \
+                       > $(DEPDIR)/usrp2.Sd; \
+               $(RM) $(DEPDIR)/usrp2.Std; \
+               $(MV) $(DEPDIR)/usrp2.Sd $(DEPDIR)/usrp2.Std; \
+           fi; \
+       else \
+           $(RM) $(DEPDIR)/usrp2.S*; exit 1; \
+       fi;
+##
+## Mess with the SWIG output .Std dependency file, to create a
+## dependecy file valid for the input .i file: Basically, simulate the
+## dependency file created for libraries by GNU's libtool for C++,
+## where all of the dependencies for the target are first listed, then
+## each individual dependency is listed as a target with no further
+## dependencies.
+##
+## (1) remove the current dependency file
+##
+       $(RM) $(DEPDIR)/usrp2.d
+##
+## (2) Copy the whole SWIG file:
+##
+       cp $(DEPDIR)/usrp2.Std $(DEPDIR)/usrp2.d
+##
+## (3) all a carriage return to the end of the dependency file.
+##
+       echo "" >> $(DEPDIR)/usrp2.d
+##
+## (4) from the SWIG file, remove the first line (the target); remove
+##     trailing " \" and " " from each line.  Append ":" to each line,
+##     followed by 2 carriage returns, then append this to the end of
+##     the dependency file.
+##
+       $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/usrp2.Std | \
+               awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/usrp2.d
+##
+## (5) remove the SWIG-generated file
+##
+       $(RM) $(DEPDIR)/usrp2.Std
+##
+## Create the stamp for this filename generation, to signal success in
+## executing this rule; allows other threads waiting on this process
+## to continue.
+##
+       touch $(DEPDIR)/usrp2-generate-stamp
+
+# KLUDGE: Force runtime include of a SWIG 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@./$(DEPDIR)/usrp2.d@am__quote@
+
index 5eb2ae555622f69c26ce3963c91114bed77ec418..b58faa9bf9a0d113ae6c8dbf60083f0c3adc9473 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2007 Free Software Foundation, Inc.
+# Copyright 2007,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -56,5 +56,3 @@ bin_SCRIPTS = \
     usrp2_rx_cfile.py \
     usrp2_siggen.py \
     usrp2_siggen_gui.py
-
-MOSTLYCLEANFILES = *~ *.pyc
index a42531f08884e47044a8699b3e57c04d07ece426..04139afde5f51d5516a544d5e8192c4381605f69 100644 (file)
 
 include $(top_srcdir)/Makefile.common
 
-# Install this stuff so that it ends up as the gnuradio.video_sdl module
-# This usually ends up at:
-#   ${prefix}/lib/python${python_version}/site-packages/gnuradio
-
-ourpythondir = $(grpythondir)
-ourlibdir    = $(grpyexecdir)
-
 EXTRA_DIST = run_tests.in
-TESTS = run_tests
 
-LOCAL_IFILES =                                 \
-       $(top_srcdir)/gr-video-sdl/src/video_sdl.i                              
-
-NON_LOCAL_IFILES =                     \
-       $(GNURADIO_I)
-
-ALL_IFILES =                           \
-       $(LOCAL_IFILES)                 \
-       $(NON_LOCAL_IFILES)             
+TESTS = run_tests
 
-BUILT_SOURCES =                        \
-       video_sdl.cc                    \
-       video_sdl.py                            
+DISTCLEANFILES = run_tests
 
-ourpython_PYTHON =                     \
-       video_sdl.py
+noinst_PYTHON =                                \
+       qa_video_sdl.py
 
 AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(SDL_CFLAGS) \
        $(WITH_INCLUDES)
 
-ourlib_LTLIBRARIES = _video_sdl.la
-
-_video_sdl_la_SOURCES =                \
-       video_sdl.cc                    \
-       video_sdl_sink_uc.cc            \
-       video_sdl_sink_s.cc
-
-
 grinclude_HEADERS =                    \
        video_sdl_sink_uc.h             \
        video_sdl_sink_s.h
 
-swiginclude_HEADERS =                  \
-       $(LOCAL_IFILES)
+#################################
+# SWIG interface and library
 
-_video_sdl_la_LIBADD =                         \
-       $(PYTHON_LDFLAGS)               \
-       $(GNURADIO_CORE_LA)             \
-        $(SDL_LIBS)                    \
-       -lstdc++                                
+TOP_SWIG_IFILES =                      \
+       video_sdl.i
 
-_video_sdl_la_LDFLAGS = $(NO_UNDEFINED) -module -avoid-version
+# Install so that they end up available as:
+#   import gnuradio.video_sdl
+# This ends up at:
+#   ${prefix}/lib/python${python_version}/site-packages/gnuradio
+video_sdl_pythondir_category =         \
+       gnuradio
+
+# additional sources for the SWIG-generated library
+video_sdl_la_swig_sources =            \
+       video_sdl_sink_uc.cc            \
+       video_sdl_sink_s.cc
 
-video_sdl.cc video_sdl.py: $(ALL_IFILES)
-       $(SWIG) $(STD_SWIG_PYTHON_ARGS) -module video_sdl \
-               -o video_sdl.cc $(LOCAL_IFILES)
+# additional libraries for linking with the SWIG-generated library
+video_sdl_la_swig_libadd =             \
+       $(SDL_LIBS)                     \
+       $(GNURADIO_CORE_LA)
 
-noinst_PYTHON = qa_video_sdl.py
+include $(top_srcdir)/Makefile.swig
 
-MOSTLYCLEANFILES = \
-       $(BUILT_SOURCES) *~ *.pyc
+# add some of the variables generated inside the Makefile.swig.gen
+BUILT_SOURCES = $(swig_built_sources)
 
-# 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
+# Do not distribute the output of SWIG
+no_dist_files = $(swig_built_sources)
diff --git a/gr-video-sdl/src/Makefile.swig.gen b/gr-video-sdl/src/Makefile.swig.gen
new file mode 100644 (file)
index 0000000..a2728a4
--- /dev/null
@@ -0,0 +1,259 @@
+# -*- Makefile -*-
+#
+# Copyright 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.
+# 
+
+# Makefile.swig.gen for video_sdl.i
+
+## Default install locations for these files:
+##
+## Default location for the Python directory is:
+##  ${prefix}/lib/python${python_version}/site-packages/[category]/video_sdl
+## Default location for the Python exec directory is:
+##  ${exec_prefix}/lib/python${python_version}/site-packages/[category]/video_sdl
+##
+## The following can be overloaded to change the install location, but
+## this has to be done in the including Makefile.am -before-
+## Makefile.swig is included.
+
+video_sdl_pythondir_category ?= gnuradio/video_sdl
+video_sdl_pylibdir_category ?= $(video_sdl_pythondir_category)
+video_sdl_pythondir = $(pythondir)/$(video_sdl_pythondir_category)
+video_sdl_pylibdir = $(pyexecdir)/$(video_sdl_pylibdir_category)
+
+## SWIG headers are always installed into the same directory.
+
+video_sdl_swigincludedir = $(swigincludedir)
+
+## This is a template file for a "generated" Makefile addition (in
+## this case, "Makefile.swig.gen").  By including the top-level
+## Makefile.swig, this file will be used to generate the SWIG
+## dependencies.  Assign the variable TOP_SWIG_FILES to be the list of
+## SWIG .i files to generated wrappings for; there can be more than 1
+## so long as the names are unique (no sorting is done on the
+## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i
+## file will generate .cc, .py, and possibly .h files -- meaning that
+## all of these files will have the same base name (that provided for
+## the SWIG .i file).
+##
+## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the
+## right thing.  For more info, see <
+## http://sources.redhat.com/automake/automake.html#Multiple-Outputs >
+
+## Stamps used to ensure parallel make does the right thing.  These
+## are removed by "make clean", but otherwise unused except during the
+## parallel built.  These will not be included in a tarball, because
+## the SWIG-generated files will be removed from the distribution.
+
+STAMPS += $(DEPDIR)/video_sdl-generate-*
+
+## Other cleaned files: dependency files generated by SWIG or this Makefile
+
+MOSTLYCLEANFILES += $(DEPDIR)/*.S*
+
+## Add the .py and .cc files to the list of SWIG built sources.  The
+## .h file is sometimes built, but not always ... so that one has to
+## be added manually by the including Makefile.am .
+
+swig_built_sources += video_sdl.py video_sdl.cc
+
+## Various SWIG variables.  These can be overloaded in the including
+## Makefile.am by setting the variable value there, then including
+## Makefile.swig .
+
+video_sdl_swiginclude_HEADERS =                \
+       video_sdl.i                     \
+       $(video_sdl_swiginclude_headers)
+
+video_sdl_pylib_LTLIBRARIES =          \
+       _video_sdl.la
+
+_video_sdl_la_SOURCES =                        \
+       video_sdl.cc                    \
+       $(video_sdl_la_swig_sources)
+
+_video_sdl_la_LIBADD =                 \
+       $(STD_SWIG_LA_LIB_ADD)          \
+       $(video_sdl_la_swig_libadd)
+
+_video_sdl_la_LDFLAGS =                        \
+       $(STD_SWIG_LA_LD_FLAGS)         \
+       $(video_sdl_la_swig_ldflags)
+
+_video_sdl_la_CXXFLAGS =                       \
+       $(STD_SWIG_CXX_FLAGS)           \
+       $(video_sdl_la_swig_cxxflags)
+
+video_sdl_python_PYTHON =                      \
+       video_sdl.py                    \
+       $(video_sdl_python)
+
+## Entry rule for running SWIG
+
+video_sdl.h video_sdl.py video_sdl.cc: video_sdl.i
+## This rule will get called only when MAKE decides that one of the
+## targets needs to be created or re-created, because:
+##
+## * The .i file is newer than any or all of the generated files;
+##
+## * Any or all of the .cc, .h, or .py files does not exist and is
+##   needed (in the case this file is not needed, the rule for it is
+##   ignored); or
+##
+## * Some SWIG-based dependecy of the .cc file isn't met and hence the
+##   .cc file needs be be regenerated.  Explanation: Because MAKE
+##   knows how to handle dependencies for .cc files (regardless of
+##   their name or extension), then the .cc file is used as a target
+##   instead of the .i file -- but with the dependencies of the .i
+##   file.  It is this last reason why the line:
+##
+##             if test -f $@; then :; else
+##
+##   cannot be used in this case: If a .i file dependecy is not met,
+##   then the .cc file needs to be rebuilt.  But if the stamp is newer
+##   than the .cc file, and the .cc file exists, then in the original
+##   version (with the 'test' above) the internal MAKE call will not
+##   be issued and hence the .cc file will not be rebuilt.
+##
+## Once execution gets to here, it should always proceed no matter the
+## state of a stamp (as discussed in link above).  The
+## $(DEPDIR)/video_sdl-generate stuff is used to allow for parallel
+## builds to "do the right thing".  The stamp has no relationship with
+## either the target files or dependency file; it is used solely for
+## the protection of multiple builds during a given call to MAKE.
+##
+## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM
+## (15).  At a caught signal, the quoted command will be issued before
+## exiting.  In this case, remove any stamp, whether temporary of not.
+## The trap is valid until the process exits; the process includes all
+## commands appended via "\"s.
+##
+       trap 'rm -rf $(DEPDIR)/video_sdl-generate-*' 1 2 13 15; \
+##
+## Create a temporary directory, which acts as a lock.  The first
+## process to create the directory will succeed and issue the MAKE
+## command to do the actual work, while all subsequent processes will
+## fail -- leading them to wait for the first process to finish.
+##
+       if mkdir $(DEPDIR)/video_sdl-generate-lock 2>/dev/null; then \
+##
+## This code is being executed by the first process to succeed in
+## creating the directory lock.
+##
+## Remove the stamp associated with this filename.
+##
+               rm -f $(DEPDIR)/video_sdl-generate-stamp; \
+##
+## Tell MAKE to run the rule for creating this stamp.
+##
+               $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/video_sdl-generate-stamp WHAT=$<; \
+##
+## Now that the .cc, .h, and .py files have been (re)created from the
+## .i file, future checking of this rule during the same MAKE
+## execution will come back that the rule doesn't need to be executed
+## because none of the conditions mentioned at the start of this rule
+## will be positive.  Remove the the directory lock, which frees up
+## any waiting process(es) to continue.
+##
+               rmdir $(DEPDIR)/video_sdl-generate-lock; \
+       else \
+##
+## This code is being executed by any follower processes while the
+## directory lock is in place.
+##
+## Wait until the first process is done, testing once per second.
+##
+               while test -d $(DEPDIR)/video_sdl-generate-lock; do \
+                       sleep 1; \
+               done; \
+##
+## Succeed if and only if the first process succeeded; exit this
+## process returning the status of the generated stamp.
+##
+               test -f $(DEPDIR)/video_sdl-generate-stamp; \
+               exit $$?; \
+       fi;
+
+$(DEPDIR)/video_sdl-generate-stamp:
+## This rule will be called only by the first process issuing the
+## above rule to succeed in creating the lock directory, after
+## removing the actual stamp file in order to guarantee that MAKE will
+## execute this rule.
+##
+## Call SWIG to generate the various output files; special
+## post-processing on 'mingw32' host OS for the dependency file.
+##
+       if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(video_sdl_swig_args) \
+               -MD -MF $(DEPDIR)/video_sdl.Std \
+               -module video_sdl -o video_sdl.cc $(WHAT); then \
+           if test $(host_os) = mingw32; then \
+               $(RM) $(DEPDIR)/video_sdl.Sd; \
+               $(SED) 's,\\\\,/,g' < $(DEPDIR)/video_sdl.Std \
+                       > $(DEPDIR)/video_sdl.Sd; \
+               $(RM) $(DEPDIR)/video_sdl.Std; \
+               $(MV) $(DEPDIR)/video_sdl.Sd $(DEPDIR)/video_sdl.Std; \
+           fi; \
+       else \
+           $(RM) $(DEPDIR)/video_sdl.S*; exit 1; \
+       fi;
+##
+## Mess with the SWIG output .Std dependency file, to create a
+## dependecy file valid for the input .i file: Basically, simulate the
+## dependency file created for libraries by GNU's libtool for C++,
+## where all of the dependencies for the target are first listed, then
+## each individual dependency is listed as a target with no further
+## dependencies.
+##
+## (1) remove the current dependency file
+##
+       $(RM) $(DEPDIR)/video_sdl.d
+##
+## (2) Copy the whole SWIG file:
+##
+       cp $(DEPDIR)/video_sdl.Std $(DEPDIR)/video_sdl.d
+##
+## (3) all a carriage return to the end of the dependency file.
+##
+       echo "" >> $(DEPDIR)/video_sdl.d
+##
+## (4) from the SWIG file, remove the first line (the target); remove
+##     trailing " \" and " " from each line.  Append ":" to each line,
+##     followed by 2 carriage returns, then append this to the end of
+##     the dependency file.
+##
+       $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/video_sdl.Std | \
+               awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/video_sdl.d
+##
+## (5) remove the SWIG-generated file
+##
+       $(RM) $(DEPDIR)/video_sdl.Std
+##
+## Create the stamp for this filename generation, to signal success in
+## executing this rule; allows other threads waiting on this process
+## to continue.
+##
+       touch $(DEPDIR)/video_sdl-generate-stamp
+
+# KLUDGE: Force runtime include of a SWIG 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@./$(DEPDIR)/video_sdl.d@am__quote@
+
index fab6f87adce81026bb430ffdfcc9515738dde6dd..b167a0c66d96e6aee2e6ee371b06327593e2bd7b 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2008 Free Software Foundation, Inc.
+# Copyright 2008,2009 Free Software Foundation, Inc.
 #
 # This file is part of GNU Radio
 #
@@ -41,7 +41,6 @@ grc_setup_freedesktop: Makefile grc_setup_freedesktop.in
 
 EXTRA_DIST = $(srcdir)/grc_setup_freedesktop.in
 BUILT_SOURCES = grc_setup_freedesktop
-MOSTLYCLEANFILES = $(BUILT_SOURCES)
 
 install-data-hook:
        @printf "\n*** GRC Post-Install Message ***\
index 48209d8bb590b8f6a1e8ee516c29ba51ca72adf5..e391283336de77dbbcc1573fbc22f6a96c30340a 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2008 Free Software Foundation, Inc.
+# Copyright 2008,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -43,4 +43,3 @@ Constants.py: Makefile Constants.py.in
 
 EXTRA_DIST = $(srcdir)/Constants.py.in
 BUILT_SOURCES = Constants.py
-MOSTLYCLEANFILES = $(BUILT_SOURCES)
index 4232234a18dbc5899f2e2076f3c39d88970427f7..3790b84f0517f0159751a69504617e1e0f720140 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2008 Free Software Foundation, Inc.
+# Copyright 2008,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -46,4 +46,3 @@ Constants.py: Makefile Constants.py.in
 
 EXTRA_DIST = $(srcdir)/Constants.py.in
 BUILT_SOURCES = Constants.py
-MOSTLYCLEANFILES = $(BUILT_SOURCES)
index 269c8ae22849498d592ec6b3f828739aeaf13eb5..81079f032a480e3db5178638aa055a04b861bc9c 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright 2006,2007,2008 Free Software Foundation, Inc.
+# Copyright 2006,2007,2008,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -130,5 +130,3 @@ test_mblock_LDADD   = libmblock-qa.la
 
 benchmark_send_SOURCES = benchmark_send.cc
 benchmark_send_LDADD   = libmblock-qa.la
-
-CLEANFILES = $(BUILT_SOURCES) *.pyc
index 5565e0986c505e3d12df6d0ebf2c3acc63935da5..32e5210d5420063be07770e4df6fe4623dc2778a 100644 (file)
@@ -31,7 +31,7 @@ lib_LTLIBRARIES = libpmt.la libpmt-qa.la
 # ----------------------------------------------------------------
 # these scripts generate code
 
-CODE_GENERATOR =                       \
+code_generator =                       \
        generate_unv.py                 \
        unv_template.h.t                \
        unv_template.cc.t               \
@@ -45,49 +45,14 @@ GENERATED_CC =                              \
        pmt_unv.cc                      \
        qa_pmt_unv.cc                   
 
+python_built_sources = $(GENERATED_H) $(GENERATED_I) $(GENERATED_CC)
 
-
-# Ensure parallel make does the right thing.
-# http://sources.redhat.com/automake/automake.html#Multiple-Outputs
-
-STAMPS = generate-stamp
-
-generate-stamp: $(CODE_GENERATOR)
-       @rm -f generate-tmp
-       @touch generate-tmp
-       PYTHONPATH=$(top_srcdir)/pmt/src/lib srcdir=$(srcdir) $(PYTHON) $(srcdir)/generate_unv.py
-       @mv -f generate-tmp $@
-
-$(GENERATED_H) $(GENERATED_I) $(GENERATED_CC): generate-stamp
-## Recover from the removal of $@
-       @if test -f $@; then :; else \
-               trap 'rm -rf generate-lock generate-stamp' 1 2 13 15; \
-               if mkdir generate-lock 2>/dev/null; then \
-## This code is being executed by the first process.
-                 rm -f generate-stamp; \
-                 $(MAKE) $(AM_MAKEFLAGS) generate-stamp; \
-                 rmdir generate-lock; \
-               else \
-## This code is being executed by the follower processes.
-## Wait until the first process is done.
-                 while test -d generate-lock; do sleep 1; done; \
-## Succeed if and only if the first process succeeded.
-                 test -f generate-stamp; exit $$?; \
-               fi; \
-             fi
-
-
-pmt_serial_tags.h: $(srcdir)/../scheme/gnuradio/gen-serial-tags.scm $(srcdir)/../scheme/gnuradio/pmt-serial-tags.scm
-       $(RUN_GUILE) $(srcdir)/../scheme/gnuradio/gen-serial-tags.scm $(srcdir)/../scheme/gnuradio/pmt-serial-tags.scm pmt_serial_tags.h
-
-BUILT_SOURCES = $(GENERATED_H) $(GENERATED_CC) pmt_serial_tags.h
+BUILT_SOURCES = $(python_built_sources) pmt_serial_tags.h
 
 # ----------------------------------------------------------------
 
 EXTRA_DIST =                           \
-       $(CODE_GENERATOR)               \
-       $(STAMPS)
-
+       $(code_generator)
 
 # These are the source files that go into the pmt shared library
 libpmt_la_SOURCES =                    \
@@ -143,5 +108,16 @@ LIBPMTQA = libpmt-qa.la $(LIBPMT)
 test_pmt_SOURCES = test_pmt.cc
 test_pmt_LDADD   = $(LIBPMTQA)
 
+# Do creation and inclusion of other Makefiles last
 
-CLEANFILES = $(BUILT_SOURCES) $(STAMPS) *.pyc
+# common way for generating sources from templates when using
+# BUILT_SOURCES, using parallel build protection.
+gen_sources = $(python_built_sources)
+gen_sources_deps = $(core_generator)
+par_gen_command = PYTHONPATH=$(top_srcdir)/pmt/src/lib srcdir=$(srcdir) $(PYTHON) $(srcdir)/generate_unv.py
+include $(top_srcdir)/Makefile.par.gen
+
+# Rule to create the build header file using GUILE
+# Doesn't need parallel protections because there is a single target
+pmt_serial_tags.h: $(srcdir)/../scheme/gnuradio/gen-serial-tags.scm $(srcdir)/../scheme/gnuradio/pmt-serial-tags.scm
+       $(RUN_GUILE) $(srcdir)/../scheme/gnuradio/gen-serial-tags.scm $(srcdir)/../scheme/gnuradio/pmt-serial-tags.scm pmt_serial_tags.h
index ca9009f54ad369e91308a80aeba7ccf82b94f048..650a25ff95ea57fd95e29c2203fa3625b31e781f 100644 (file)
@@ -112,6 +112,3 @@ noinst_PROGRAMS =                   \
 
 test_inband_SOURCES = test_inband.cc
 test_inband_LDADD   = libusrp-inband-qa.la
-
-MOSTLYCLEANFILES = \
-       $(BUILT_SOURCES) *~ *.pyc
index 7b880924cd119dee84fb8984d607dbe66633b6e1..7063bbadce8491a1b5d5e043e82402cdd37cac32 100644 (file)
@@ -1,7 +1,7 @@
 #
 #  USRP - Universal Software Radio Peripheral
 # 
-#  Copyright (C) 2003,2004,2006,2007,2008 Free Software Foundation, Inc.
+#  Copyright (C) 2003,2004,2006,2007,2008,2009 Free Software Foundation, Inc.
 # 
 #  This program is free software; you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
@@ -184,10 +184,11 @@ noinst_PYTHON =                           \
        check_data.py                   \
        dump_data.py
 
-usrp_dbid.py usrp_dbid.h usrp_dbid.cc: gen_usrp_dbid.py usrp_dbid.dat
-       PYTHONPATH=$(top_srcdir)/usrp/src srcdir=$(srcdir) $(PYTHON) $(srcdir)/gen_usrp_dbid.py $(srcdir)/usrp_dbid.dat
-
 swiginclude_HEADERS = db_base.i
 
-MOSTLYCLEANFILES = \
-       $(BUILT_SOURCES) *~ *.pyc
+# common way for generating sources from templates when using
+# BUILT_SOURCES, using parallel build protection.
+gen_sources = $(BUILT_SOURCES)
+gen_sources_deps = gen_usrp_dbid.py usrp_dbid.dat
+par_gen_command = PYTHONPATH=$(top_srcdir)/usrp/src srcdir=$(srcdir) $(PYTHON) $(srcdir)/gen_usrp_dbid.py $(srcdir)/usrp_dbid.dat
+include $(top_srcdir)/Makefile.par.gen
index 08e6c436b51490814c697838bd58d2e94b72c018..6af452b020858859a33cef34a766a3b7a297d9e0 100644 (file)
 
 include $(top_srcdir)/Makefile.common
 
-ourpythondir = $(usrppythondir)
-ourlibdir    = $(usrppyexecdir)
+AM_CPPFLAGS =                  \
+       $(USRP_INCLUDES)        \
+       $(PYTHON_CPPFLAGS)      \
+       -I$(srcdir)             \
+       $(WITH_INCLUDES)
 
+#################################
+# SWIG interface and library
 
-AM_CPPFLAGS = $(USRP_INCLUDES)                 \
-          $(PYTHON_CPPFLAGS)           \
-          -I$(srcdir)                  \
-          $(WITH_INCLUDES)
+TOP_SWIG_IFILES =              \
+       usrp_prims.i
 
-LOCAL_IFILES =                         \
-       prims.i
+# Install so that they end up available as:
+#   import usrpm.usrp_prims
+# This ends up at:
+#   ${prefix}/lib/python${python_version}/site-packages/usrpm
+usrp_prims_pythondir_category =        \
+       usrpm
 
+# additional arguments to the SWIG command
+usrp_prims_swig_args =         \
+       $(USRP_INCLUDES)
 
-ALL_IFILES =                           \
-       $(LOCAL_IFILES)                 
+# additional libraries for linking with the SWIG-generated library
+usrp_prims_la_swig_libadd =    \
+       $(USRP_LA)
 
+# additional Python files to be installed along with the SWIG-generated one
+usrp_prims_python =            \
+       __init__.py             \
+       usrp_fpga_regs.py
 
-EXTRA_DIST =                           \
-       $(LOCAL_IFILES)
+include $(top_srcdir)/Makefile.swig
 
+# add some of the variables generated inside the Makefile.swig.gen
+BUILT_SOURCES = $(swig_built_sources)
 
-BUILT_SOURCES =                                \
-       prims.cc                        \
-       usrp_prims.py
-
-
-ourpython_PYTHON =                     \
-       __init__.py                     \
-       usrp_fpga_regs.py               \
-       usrp_prims.py                   
-
-# special SWIG flags
-LOCAL_SWIG_DEFINES_AND_INCLUDES = $(USRP_INCLUDES)
-
-ourlib_LTLIBRARIES =                   \
-       _usrp_prims.la
-
-_usrp_prims_la_SOURCES =               \
-       prims.cc                
-
-
-noinst_HEADERS =
-
-_usrp_prims_la_LIBADD  = $(USRP_LA) -lstdc++ $(PYTHON_LDFLAGS)
-_usrp_prims_la_LDFLAGS = $(NO_UNDEFINED) -module -avoid-version
-
-_usrp_prims_la_CXXFLAGS = @swig_CXXFLAGS@
-
-prims.cc usrp_prims.py : $(srcdir)/prims.i ../../firmware/include/fpga_regs_common.h ../../firmware/include/fpga_regs_standard.h
-       $(SWIG) $(STD_SWIG_PYTHON_ARGS) -module usrp_prims \
-               -o prims.cc $(srcdir)/prims.i
-
-MOSTLYCLEANFILES = \
-       prims.cc usrp_prims.py *~ *.pyc
-
-# 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
-
+# Do not distribute the output of SWIG
+no_dist_files = $(swig_built_sources)
diff --git a/usrp/host/swig/Makefile.swig.gen b/usrp/host/swig/Makefile.swig.gen
new file mode 100644 (file)
index 0000000..00de3e4
--- /dev/null
@@ -0,0 +1,259 @@
+# -*- Makefile -*-
+#
+# Copyright 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.
+# 
+
+# Makefile.swig.gen for usrp_prims.i
+
+## Default install locations for these files:
+##
+## Default location for the Python directory is:
+##  ${prefix}/lib/python${python_version}/site-packages/[category]/usrp_prims
+## Default location for the Python exec directory is:
+##  ${exec_prefix}/lib/python${python_version}/site-packages/[category]/usrp_prims
+##
+## The following can be overloaded to change the install location, but
+## this has to be done in the including Makefile.am -before-
+## Makefile.swig is included.
+
+usrp_prims_pythondir_category ?= gnuradio/usrp_prims
+usrp_prims_pylibdir_category ?= $(usrp_prims_pythondir_category)
+usrp_prims_pythondir = $(pythondir)/$(usrp_prims_pythondir_category)
+usrp_prims_pylibdir = $(pyexecdir)/$(usrp_prims_pylibdir_category)
+
+## SWIG headers are always installed into the same directory.
+
+usrp_prims_swigincludedir = $(swigincludedir)
+
+## This is a template file for a "generated" Makefile addition (in
+## this case, "Makefile.swig.gen").  By including the top-level
+## Makefile.swig, this file will be used to generate the SWIG
+## dependencies.  Assign the variable TOP_SWIG_FILES to be the list of
+## SWIG .i files to generated wrappings for; there can be more than 1
+## so long as the names are unique (no sorting is done on the
+## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i
+## file will generate .cc, .py, and possibly .h files -- meaning that
+## all of these files will have the same base name (that provided for
+## the SWIG .i file).
+##
+## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the
+## right thing.  For more info, see <
+## http://sources.redhat.com/automake/automake.html#Multiple-Outputs >
+
+## Stamps used to ensure parallel make does the right thing.  These
+## are removed by "make clean", but otherwise unused except during the
+## parallel built.  These will not be included in a tarball, because
+## the SWIG-generated files will be removed from the distribution.
+
+STAMPS += $(DEPDIR)/usrp_prims-generate-*
+
+## Other cleaned files: dependency files generated by SWIG or this Makefile
+
+MOSTLYCLEANFILES += $(DEPDIR)/*.S*
+
+## Add the .py and .cc files to the list of SWIG built sources.  The
+## .h file is sometimes built, but not always ... so that one has to
+## be added manually by the including Makefile.am .
+
+swig_built_sources += usrp_prims.py usrp_prims.cc
+
+## Various SWIG variables.  These can be overloaded in the including
+## Makefile.am by setting the variable value there, then including
+## Makefile.swig .
+
+usrp_prims_swiginclude_HEADERS =               \
+       usrp_prims.i                    \
+       $(usrp_prims_swiginclude_headers)
+
+usrp_prims_pylib_LTLIBRARIES =         \
+       _usrp_prims.la
+
+_usrp_prims_la_SOURCES =                       \
+       usrp_prims.cc                   \
+       $(usrp_prims_la_swig_sources)
+
+_usrp_prims_la_LIBADD =                        \
+       $(STD_SWIG_LA_LIB_ADD)          \
+       $(usrp_prims_la_swig_libadd)
+
+_usrp_prims_la_LDFLAGS =                       \
+       $(STD_SWIG_LA_LD_FLAGS)         \
+       $(usrp_prims_la_swig_ldflags)
+
+_usrp_prims_la_CXXFLAGS =                      \
+       $(STD_SWIG_CXX_FLAGS)           \
+       $(usrp_prims_la_swig_cxxflags)
+
+usrp_prims_python_PYTHON =                     \
+       usrp_prims.py                   \
+       $(usrp_prims_python)
+
+## Entry rule for running SWIG
+
+usrp_prims.h usrp_prims.py usrp_prims.cc: usrp_prims.i
+## This rule will get called only when MAKE decides that one of the
+## targets needs to be created or re-created, because:
+##
+## * The .i file is newer than any or all of the generated files;
+##
+## * Any or all of the .cc, .h, or .py files does not exist and is
+##   needed (in the case this file is not needed, the rule for it is
+##   ignored); or
+##
+## * Some SWIG-based dependecy of the .cc file isn't met and hence the
+##   .cc file needs be be regenerated.  Explanation: Because MAKE
+##   knows how to handle dependencies for .cc files (regardless of
+##   their name or extension), then the .cc file is used as a target
+##   instead of the .i file -- but with the dependencies of the .i
+##   file.  It is this last reason why the line:
+##
+##             if test -f $@; then :; else
+##
+##   cannot be used in this case: If a .i file dependecy is not met,
+##   then the .cc file needs to be rebuilt.  But if the stamp is newer
+##   than the .cc file, and the .cc file exists, then in the original
+##   version (with the 'test' above) the internal MAKE call will not
+##   be issued and hence the .cc file will not be rebuilt.
+##
+## Once execution gets to here, it should always proceed no matter the
+## state of a stamp (as discussed in link above).  The
+## $(DEPDIR)/usrp_prims-generate stuff is used to allow for parallel
+## builds to "do the right thing".  The stamp has no relationship with
+## either the target files or dependency file; it is used solely for
+## the protection of multiple builds during a given call to MAKE.
+##
+## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM
+## (15).  At a caught signal, the quoted command will be issued before
+## exiting.  In this case, remove any stamp, whether temporary of not.
+## The trap is valid until the process exits; the process includes all
+## commands appended via "\"s.
+##
+       trap 'rm -rf $(DEPDIR)/usrp_prims-generate-*' 1 2 13 15; \
+##
+## Create a temporary directory, which acts as a lock.  The first
+## process to create the directory will succeed and issue the MAKE
+## command to do the actual work, while all subsequent processes will
+## fail -- leading them to wait for the first process to finish.
+##
+       if mkdir $(DEPDIR)/usrp_prims-generate-lock 2>/dev/null; then \
+##
+## This code is being executed by the first process to succeed in
+## creating the directory lock.
+##
+## Remove the stamp associated with this filename.
+##
+               rm -f $(DEPDIR)/usrp_prims-generate-stamp; \
+##
+## Tell MAKE to run the rule for creating this stamp.
+##
+               $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/usrp_prims-generate-stamp WHAT=$<; \
+##
+## Now that the .cc, .h, and .py files have been (re)created from the
+## .i file, future checking of this rule during the same MAKE
+## execution will come back that the rule doesn't need to be executed
+## because none of the conditions mentioned at the start of this rule
+## will be positive.  Remove the the directory lock, which frees up
+## any waiting process(es) to continue.
+##
+               rmdir $(DEPDIR)/usrp_prims-generate-lock; \
+       else \
+##
+## This code is being executed by any follower processes while the
+## directory lock is in place.
+##
+## Wait until the first process is done, testing once per second.
+##
+               while test -d $(DEPDIR)/usrp_prims-generate-lock; do \
+                       sleep 1; \
+               done; \
+##
+## Succeed if and only if the first process succeeded; exit this
+## process returning the status of the generated stamp.
+##
+               test -f $(DEPDIR)/usrp_prims-generate-stamp; \
+               exit $$?; \
+       fi;
+
+$(DEPDIR)/usrp_prims-generate-stamp:
+## This rule will be called only by the first process issuing the
+## above rule to succeed in creating the lock directory, after
+## removing the actual stamp file in order to guarantee that MAKE will
+## execute this rule.
+##
+## Call SWIG to generate the various output files; special
+## post-processing on 'mingw32' host OS for the dependency file.
+##
+       if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(usrp_prims_swig_args) \
+               -MD -MF $(DEPDIR)/usrp_prims.Std \
+               -module usrp_prims -o usrp_prims.cc $(WHAT); then \
+           if test $(host_os) = mingw32; then \
+               $(RM) $(DEPDIR)/usrp_prims.Sd; \
+               $(SED) 's,\\\\,/,g' < $(DEPDIR)/usrp_prims.Std \
+                       > $(DEPDIR)/usrp_prims.Sd; \
+               $(RM) $(DEPDIR)/usrp_prims.Std; \
+               $(MV) $(DEPDIR)/usrp_prims.Sd $(DEPDIR)/usrp_prims.Std; \
+           fi; \
+       else \
+           $(RM) $(DEPDIR)/usrp_prims.S*; exit 1; \
+       fi;
+##
+## Mess with the SWIG output .Std dependency file, to create a
+## dependecy file valid for the input .i file: Basically, simulate the
+## dependency file created for libraries by GNU's libtool for C++,
+## where all of the dependencies for the target are first listed, then
+## each individual dependency is listed as a target with no further
+## dependencies.
+##
+## (1) remove the current dependency file
+##
+       $(RM) $(DEPDIR)/usrp_prims.d
+##
+## (2) Copy the whole SWIG file:
+##
+       cp $(DEPDIR)/usrp_prims.Std $(DEPDIR)/usrp_prims.d
+##
+## (3) all a carriage return to the end of the dependency file.
+##
+       echo "" >> $(DEPDIR)/usrp_prims.d
+##
+## (4) from the SWIG file, remove the first line (the target); remove
+##     trailing " \" and " " from each line.  Append ":" to each line,
+##     followed by 2 carriage returns, then append this to the end of
+##     the dependency file.
+##
+       $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/usrp_prims.Std | \
+               awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/usrp_prims.d
+##
+## (5) remove the SWIG-generated file
+##
+       $(RM) $(DEPDIR)/usrp_prims.Std
+##
+## Create the stamp for this filename generation, to signal success in
+## executing this rule; allows other threads waiting on this process
+## to continue.
+##
+       touch $(DEPDIR)/usrp_prims-generate-stamp
+
+# KLUDGE: Force runtime include of a SWIG 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@./$(DEPDIR)/usrp_prims.d@am__quote@
+
diff --git a/usrp/host/swig/prims.i b/usrp/host/swig/prims.i
deleted file mode 100644 (file)
index d973c6d..0000000
+++ /dev/null
@@ -1,266 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2003,2004 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.
- */
-
-/*
- * Low level primitives for directly messing with USRP hardware.
- *
- * If you're trying to use the USRP, you'll probably want to take a
- * look at the usrp_standard_rx and usrp_standard_tx classes.  They
- * hide a bunch of low level details and provide high performance
- * streaming i/o.
- *
- * This interface is built on top of libusb, which allegedly works under
- * Linux, *BSD and Mac OS/X.  http://libusb.sourceforge.net
- */
-
-%include <stl.i>       // pick up string stuff
-
-
-%{
-#include <usrp_prims.h>
-%}
-
-
-enum usrp_load_status_t { ULS_ERROR = 0, ULS_OK, ULS_ALREADY_LOADED };
-
-struct usb_dev_handle;
-struct usb_device;
-
-/*!
- * \brief initialize libusb; probe busses and devices.
- * Safe to call more than once.
- */
-void usrp_one_time_init ();
-
-void usrp_rescan ();
-
-/*!
- * \brief locate Nth (zero based) USRP device in system.
- * Return pointer or 0 if not found.
- *
- * The following kinds of devices are considered USRPs:
- *
- *   unconfigured USRP (no firwmare loaded)
- *   configured USRP (firmware loaded)
- *   unconfigured Cypress FX2 (only if fx2_ok_p is true)
- */
-struct usb_device *usrp_find_device (int nth, bool fx2_ok_p = false);
-
-bool usrp_usrp_p (struct usb_device *q);               //< is this a USRP
-bool usrp_usrp0_p (struct usb_device *q);              //< is this a USRP Rev 0
-bool usrp_usrp1_p (struct usb_device *q);              //< is this a USRP Rev 1
-bool usrp_usrp2_p (struct usb_device *q);              //< is this a USRP Rev 2
-int  usrp_hw_rev (struct usb_device *q);               //< return h/w rev code
-bool usrp_fx2_p (struct usb_device *q);                        //< is this an unconfigured Cypress FX2
-
-bool usrp_unconfigured_usrp_p (struct usb_device *q);  //< some kind of unconfigured USRP
-bool usrp_configured_usrp_p (struct usb_device *q);    //< some kind of configured USRP
-
-/*!
- * \brief given a usb_device return an instance of the appropriate usb_dev_handle
- *
- * These routines claim the specified interface and select the
- * correct alternate interface.  (USB nomenclature is totally screwed!)
- *
- * If interface can't be opened, or is already claimed by some other
- * process, 0 is returned.
- */
-struct usb_dev_handle *usrp_open_cmd_interface (struct usb_device *dev);
-struct usb_dev_handle *usrp_open_rx_interface (struct usb_device *dev);
-struct usb_dev_handle *usrp_open_tx_interface (struct usb_device *dev);
-
-/*!
- * \brief close interface.
- */
-bool usrp_close_interface (struct usb_dev_handle *udh);
-
-/*!
- * \brief load intel hex format file into USRP/Cypress FX2 (8051).
- *
- * The filename extension is typically *.ihx
- *
- * Note that loading firmware may cause the device to renumerate.  I.e.,
- * change its configuration, invalidating the current device handle.
- */
-
-usrp_load_status_t 
-usrp_load_firmware (struct usb_dev_handle *udh, const char *filename, bool force);
-
-/*!
- * \brief load intel hex format file into USRP FX2 (8051).
- *
- * The filename extension is typically *.ihx
- *
- * Note that loading firmware may cause the device to renumerate.  I.e.,
- * change its configuration, invalidating the current device handle.
- * If the result is ULS_OK, usrp_load_firmware_nth delays 1 second
- * then rescans the busses and devices.
- */
-usrp_load_status_t
-usrp_load_firmware_nth (int nth, const char *filename, bool force);
-
-/*!
- * \brief load fpga configuration bitstream
- */
-usrp_load_status_t
-usrp_load_fpga (struct usb_dev_handle *udh, const char *filename, bool force);
-
-/*!
- * \brief load the regular firmware and fpga bitstream in the Nth USRP.
- *
- * This is the normal starting point...
- */
-bool usrp_load_standard_bits (int nth, bool force);
-
-
-%include <fpga_regs_common.h>
-%include <fpga_regs_standard.h>
-
-
-bool usrp_write_fpga_reg (struct usb_dev_handle *udh, int reg, int value);
-
-%inline %{
-
-int 
-usrp_read_fpga_reg (struct usb_dev_handle *udh, int reg)
-{
-  int value;
-  bool ok = usrp_read_fpga_reg (udh, reg, &value);
-  if (ok)
-    return value;
-  else
-    return -999;
-}
-
-%}
-
-bool usrp_set_fpga_reset (struct usb_dev_handle *udh, bool on);
-bool usrp_set_fpga_tx_enable (struct usb_dev_handle *udh, bool on);
-bool usrp_set_fpga_rx_enable (struct usb_dev_handle *udh, bool on);
-bool usrp_set_fpga_tx_reset (struct usb_dev_handle *udh, bool on);
-bool usrp_set_fpga_rx_reset (struct usb_dev_handle *udh, bool on);
-bool usrp_set_led (struct usb_dev_handle *udh, int which, bool on);
-
-bool usrp_check_rx_overrun (struct usb_dev_handle *udh, bool *overrun_p);
-bool usrp_check_tx_underrun (struct usb_dev_handle *udh, bool *underrun_p);
-
-// i2c_read and i2c_write are limited to a maximum len of 64 bytes.
-
-bool usrp_i2c_write (struct usb_dev_handle *udh, int i2c_addr,
-                    void *buf, int len);
-
-bool usrp_i2c_read (struct usb_dev_handle *udh, int i2c_addr,
-                   void *buf, int len);
-
-// spi_read and spi_write are limited to a maximum of 64 bytes
-// See usrp_spi_defs.h for more info
-
-bool usrp_spi_write (struct usb_dev_handle *udh,
-                    int optional_header, int enables, int format,
-                    unsigned char *buf, int len);
-
-bool usrp_spi_read (struct usb_dev_handle *udh,
-                    int optional_header, int enables, int format,
-                    unsigned char *buf, int len);
-
-
-bool usrp_9862_write (struct usb_dev_handle *udh,
-                     int which_codec,                  // [0,  1]
-                     int regno,                        // [0, 63]
-                     int value);                       // [0, 255]     
-
-%inline %{
-
-int 
-usrp_9862_read (struct usb_dev_handle *udh, int which_codec, int reg)
-{
-  unsigned char value;
-  bool ok = usrp_9862_read (udh, which_codec, reg, &value);
-  if (ok)
-    return value;
-  else
-    return -999;
-}
-
-%}
-
-%inline %{
-
-bool 
-usrp_eeprom_write (struct usb_dev_handle *udh, int i2c_addr,
-                  int eeprom_offset, const std::string buf)
-{
-  return usrp_eeprom_write (udh, i2c_addr, eeprom_offset,
-                           buf.data (), buf.size ());
-}
-  
-std::string
-usrp_eeprom_read (struct usb_dev_handle *udh, int i2c_addr,
-                 int eeprom_offset, int len)
-{
-  if (len <= 0)
-    return "";
-  
-  char buf[len];
-
-  if (!usrp_eeprom_read (udh, i2c_addr, eeprom_offset, buf, len))
-    return "";
-
-  return std::string (buf, len);
-}
-
-%}
-
-bool usrp_write_aux_dac (struct usb_dev_handle *uhd, int slot,
-                        int which_dac, int value);
-
-%inline %{
-
-int usrp_read_aux_adc (struct usb_dev_handle *udh, int slot, int which_adc)
-{
-  int value;
-  bool ok = usrp_read_aux_adc (udh, slot, which_adc, &value);
-  if (ok)
-    return value;
-  else
-    return -999;
-}
-
-%}
-
-/*!
- * \brief return a usrp's serial number.
- *
- * Note that this only works on a configured usrp.
- * \returns non-zero length string iff successful.
- */
-std::string usrp_serial_number(struct usb_dev_handle *udh);
-
-/*!
- * \brief usrp daughterboard id to name mapping
- */
-const std::string usrp_dbid_to_string (int dbid);
-
-%inline %{
-#include "../../firmware/include/fpga_regs_common.h"
-#include "../../firmware/include/fpga_regs_standard.h"
-%}
diff --git a/usrp/host/swig/usrp_prims.i b/usrp/host/swig/usrp_prims.i
new file mode 100644 (file)
index 0000000..d973c6d
--- /dev/null
@@ -0,0 +1,266 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2003,2004 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.
+ */
+
+/*
+ * Low level primitives for directly messing with USRP hardware.
+ *
+ * If you're trying to use the USRP, you'll probably want to take a
+ * look at the usrp_standard_rx and usrp_standard_tx classes.  They
+ * hide a bunch of low level details and provide high performance
+ * streaming i/o.
+ *
+ * This interface is built on top of libusb, which allegedly works under
+ * Linux, *BSD and Mac OS/X.  http://libusb.sourceforge.net
+ */
+
+%include <stl.i>       // pick up string stuff
+
+
+%{
+#include <usrp_prims.h>
+%}
+
+
+enum usrp_load_status_t { ULS_ERROR = 0, ULS_OK, ULS_ALREADY_LOADED };
+
+struct usb_dev_handle;
+struct usb_device;
+
+/*!
+ * \brief initialize libusb; probe busses and devices.
+ * Safe to call more than once.
+ */
+void usrp_one_time_init ();
+
+void usrp_rescan ();
+
+/*!
+ * \brief locate Nth (zero based) USRP device in system.
+ * Return pointer or 0 if not found.
+ *
+ * The following kinds of devices are considered USRPs:
+ *
+ *   unconfigured USRP (no firwmare loaded)
+ *   configured USRP (firmware loaded)
+ *   unconfigured Cypress FX2 (only if fx2_ok_p is true)
+ */
+struct usb_device *usrp_find_device (int nth, bool fx2_ok_p = false);
+
+bool usrp_usrp_p (struct usb_device *q);               //< is this a USRP
+bool usrp_usrp0_p (struct usb_device *q);              //< is this a USRP Rev 0
+bool usrp_usrp1_p (struct usb_device *q);              //< is this a USRP Rev 1
+bool usrp_usrp2_p (struct usb_device *q);              //< is this a USRP Rev 2
+int  usrp_hw_rev (struct usb_device *q);               //< return h/w rev code
+bool usrp_fx2_p (struct usb_device *q);                        //< is this an unconfigured Cypress FX2
+
+bool usrp_unconfigured_usrp_p (struct usb_device *q);  //< some kind of unconfigured USRP
+bool usrp_configured_usrp_p (struct usb_device *q);    //< some kind of configured USRP
+
+/*!
+ * \brief given a usb_device return an instance of the appropriate usb_dev_handle
+ *
+ * These routines claim the specified interface and select the
+ * correct alternate interface.  (USB nomenclature is totally screwed!)
+ *
+ * If interface can't be opened, or is already claimed by some other
+ * process, 0 is returned.
+ */
+struct usb_dev_handle *usrp_open_cmd_interface (struct usb_device *dev);
+struct usb_dev_handle *usrp_open_rx_interface (struct usb_device *dev);
+struct usb_dev_handle *usrp_open_tx_interface (struct usb_device *dev);
+
+/*!
+ * \brief close interface.
+ */
+bool usrp_close_interface (struct usb_dev_handle *udh);
+
+/*!
+ * \brief load intel hex format file into USRP/Cypress FX2 (8051).
+ *
+ * The filename extension is typically *.ihx
+ *
+ * Note that loading firmware may cause the device to renumerate.  I.e.,
+ * change its configuration, invalidating the current device handle.
+ */
+
+usrp_load_status_t 
+usrp_load_firmware (struct usb_dev_handle *udh, const char *filename, bool force);
+
+/*!
+ * \brief load intel hex format file into USRP FX2 (8051).
+ *
+ * The filename extension is typically *.ihx
+ *
+ * Note that loading firmware may cause the device to renumerate.  I.e.,
+ * change its configuration, invalidating the current device handle.
+ * If the result is ULS_OK, usrp_load_firmware_nth delays 1 second
+ * then rescans the busses and devices.
+ */
+usrp_load_status_t
+usrp_load_firmware_nth (int nth, const char *filename, bool force);
+
+/*!
+ * \brief load fpga configuration bitstream
+ */
+usrp_load_status_t
+usrp_load_fpga (struct usb_dev_handle *udh, const char *filename, bool force);
+
+/*!
+ * \brief load the regular firmware and fpga bitstream in the Nth USRP.
+ *
+ * This is the normal starting point...
+ */
+bool usrp_load_standard_bits (int nth, bool force);
+
+
+%include <fpga_regs_common.h>
+%include <fpga_regs_standard.h>
+
+
+bool usrp_write_fpga_reg (struct usb_dev_handle *udh, int reg, int value);
+
+%inline %{
+
+int 
+usrp_read_fpga_reg (struct usb_dev_handle *udh, int reg)
+{
+  int value;
+  bool ok = usrp_read_fpga_reg (udh, reg, &value);
+  if (ok)
+    return value;
+  else
+    return -999;
+}
+
+%}
+
+bool usrp_set_fpga_reset (struct usb_dev_handle *udh, bool on);
+bool usrp_set_fpga_tx_enable (struct usb_dev_handle *udh, bool on);
+bool usrp_set_fpga_rx_enable (struct usb_dev_handle *udh, bool on);
+bool usrp_set_fpga_tx_reset (struct usb_dev_handle *udh, bool on);
+bool usrp_set_fpga_rx_reset (struct usb_dev_handle *udh, bool on);
+bool usrp_set_led (struct usb_dev_handle *udh, int which, bool on);
+
+bool usrp_check_rx_overrun (struct usb_dev_handle *udh, bool *overrun_p);
+bool usrp_check_tx_underrun (struct usb_dev_handle *udh, bool *underrun_p);
+
+// i2c_read and i2c_write are limited to a maximum len of 64 bytes.
+
+bool usrp_i2c_write (struct usb_dev_handle *udh, int i2c_addr,
+                    void *buf, int len);
+
+bool usrp_i2c_read (struct usb_dev_handle *udh, int i2c_addr,
+                   void *buf, int len);
+
+// spi_read and spi_write are limited to a maximum of 64 bytes
+// See usrp_spi_defs.h for more info
+
+bool usrp_spi_write (struct usb_dev_handle *udh,
+                    int optional_header, int enables, int format,
+                    unsigned char *buf, int len);
+
+bool usrp_spi_read (struct usb_dev_handle *udh,
+                    int optional_header, int enables, int format,
+                    unsigned char *buf, int len);
+
+
+bool usrp_9862_write (struct usb_dev_handle *udh,
+                     int which_codec,                  // [0,  1]
+                     int regno,                        // [0, 63]
+                     int value);                       // [0, 255]     
+
+%inline %{
+
+int 
+usrp_9862_read (struct usb_dev_handle *udh, int which_codec, int reg)
+{
+  unsigned char value;
+  bool ok = usrp_9862_read (udh, which_codec, reg, &value);
+  if (ok)
+    return value;
+  else
+    return -999;
+}
+
+%}
+
+%inline %{
+
+bool 
+usrp_eeprom_write (struct usb_dev_handle *udh, int i2c_addr,
+                  int eeprom_offset, const std::string buf)
+{
+  return usrp_eeprom_write (udh, i2c_addr, eeprom_offset,
+                           buf.data (), buf.size ());
+}
+  
+std::string
+usrp_eeprom_read (struct usb_dev_handle *udh, int i2c_addr,
+                 int eeprom_offset, int len)
+{
+  if (len <= 0)
+    return "";
+  
+  char buf[len];
+
+  if (!usrp_eeprom_read (udh, i2c_addr, eeprom_offset, buf, len))
+    return "";
+
+  return std::string (buf, len);
+}
+
+%}
+
+bool usrp_write_aux_dac (struct usb_dev_handle *uhd, int slot,
+                        int which_dac, int value);
+
+%inline %{
+
+int usrp_read_aux_adc (struct usb_dev_handle *udh, int slot, int which_adc)
+{
+  int value;
+  bool ok = usrp_read_aux_adc (udh, slot, which_adc, &value);
+  if (ok)
+    return value;
+  else
+    return -999;
+}
+
+%}
+
+/*!
+ * \brief return a usrp's serial number.
+ *
+ * Note that this only works on a configured usrp.
+ * \returns non-zero length string iff successful.
+ */
+std::string usrp_serial_number(struct usb_dev_handle *udh);
+
+/*!
+ * \brief usrp daughterboard id to name mapping
+ */
+const std::string usrp_dbid_to_string (int dbid);
+
+%inline %{
+#include "../../firmware/include/fpga_regs_common.h"
+#include "../../firmware/include/fpga_regs_standard.h"
+%}