Flush pending errors in gr_udp_sink on disconnect()
[debian/gnuradio] / Makefile.swig
1 # -*- Makefile -*-
2 #
3 # Copyright 2009 Free Software Foundation, Inc.
4
5 # This file is part of GNU Radio
6
7 # GNU Radio is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3, or (at your option)
10 # any later version.
11
12 # GNU Radio is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
16
17 # You should have received a copy of the GNU General Public License
18 # along with GNU Radio; see the file COPYING.  If not, write to
19 # the Free Software Foundation, Inc., 51 Franklin Street,
20 # Boston, MA 02110-1301, USA.
21
22
23 ## This makefile should be included using 
24 ##     include $(top_srcdir)/Makefile.swig
25 ## in Makefile.am's which require SWIG wrapping / compilation.
26 ## For just installing .i files, this Makefile is not required.
27
28 ## swig flags
29 ## -w511 turns off keyword argument warning
30 ## "-outdir $(builddir)" writes all generated output files to
31 ##   the local builddir (which should always be '.')
32 ##   In some older autotools, $(builddir) is not defined, so
33 ##   just use '.' instead.
34
35 SWIG_PYTHON_FLAGS =     \
36         -fvirtual       \
37         -python         \
38         -modern         \
39         -keyword        \
40         -w511           \
41         -outdir .
42
43 ## standard swig flags used by most components
44
45 STD_SWIG_PYTHON_ARGS =                          \
46         $(SWIG_PYTHON_FLAGS)                    \
47         $(STD_DEFINES_AND_INCLUDES)             \
48         $(WITH_SWIG_INCLUDES)                   \
49         $(WITH_INCLUDES)
50
51 ## standard SWIG LD flags for library creation
52
53 STD_SWIG_LA_LD_FLAGS =          \
54         $(PYTHON_LDFLAGS)       \
55         -module                 \
56         -avoid-version          \
57         $(NO_UNDEFINED)
58
59 ## standard SWIG library additions for library creation
60
61 STD_SWIG_LA_LIB_ADD =           \
62         -lstdc++
63
64 ## standard SWIG CXXFLAGS
65 ## This allows for code to be compiled with "-O1" instead of "-g -O2"
66 ## for some systems, avoiding some optimization issues.
67
68 STD_SWIG_CXX_FLAGS = @swig_CXXFLAGS@
69
70 ## SWIG suffix for automake to know about
71
72 SUFFIXES = .i
73
74 ## Create $(srcdir)/Makefile.swig.gen, containing all of the rules
75 ## for running SWIG to generate or re-generate outputs.  SWIG file
76 ## names are to be defined in TOP_SWIG_IFILES, and must include the
77 ## full path to the file and full filename including extension.  This
78 ## Makefile addition will be made only if either it does not exist or
79 ## if the top-level template has been modified.
80
81 generate-makefile-swig $(srcdir)/Makefile.swig.gen: $(top_srcdir)/Makefile.swig.gen.t
82 ## recreate $(srcdir)/Makefile.swig.gen only if ...
83         @do_recreate=0; \
84         if test -f $(srcdir)/Makefile.swig.gen; then \
85 ## the file exists and can be removed; or ...
86                 if $(RM) $(srcdir)/Makefile.swig.gen 2>/dev/null; then \
87                         if touch $(srcdir)/Makefile.swig.gen 2>/dev/null; then \
88                                 do_recreate=1; \
89                         fi; \
90                 fi; \
91         else \
92 ## the file doesn't exist, but can be created (e.g., by touching it).
93                 if touch $(srcdir)/Makefile.swig.gen 2>/dev/null; then \
94                         do_recreate=1; \
95                 fi; \
96         fi; \
97         if test "$$do_recreate" == "1"; then \
98                 echo "Regenerating $(srcdir)/Makefile.swig.gen"; \
99                 for TFILE in $(TOP_SWIG_IFILES); do \
100 ## retrieve just the filename, without path or extension
101                         TNAME=`python -c "import os.path as op; (dN, fN) = op.split ('$$TFILE'); (fbN, fE) = op.splitext (fN); print fbN;"`; \
102 ## Replace the @-named strings in the template Makefile for SWIG.
103                         $(SED) -e 's|@NAME@|'$$TNAME'|g;' < $(top_srcdir)/Makefile.swig.gen.t >> $(srcdir)/Makefile.swig.gen; \
104                         echo "" >> $(srcdir)/Makefile.swig.gen; \
105                 done; \
106         else \
107                 echo "Cannot recreate $(srcdir)/Makefile.swig.gen because the directory or file is write-protected."; \
108                 exit -1; \
109         fi;
110
111 swig_built_sources =
112
113 ## include the built Makefile.swig.gen, always the one from the
114 ## srcdir; this must be included as the last item, because it depends
115 ## on variables defined above.
116
117 include $(srcdir)/Makefile.swig.gen