summaryrefslogtreecommitdiff
path: root/Makefile.common
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile.common')
-rw-r--r--Makefile.common46
1 files changed, 45 insertions, 1 deletions
diff --git a/Makefile.common b/Makefile.common
index 95dacf987..a09b9fbdb 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -20,6 +20,10 @@
# Boston, MA 02110-1301, USA.
#
+# Make rebuilds less verbose with stuff we can safely ignore
+# about GNU make only extensions.
+AUTOMAKE += -Wno-portability -Wnone
+
AM_CFLAGS = @autoconf_default_CFLAGS@ @lf_CFLAGS@
AM_CXXFLAGS = @autoconf_default_CXXFLAGS@ @lf_CXXFLAGS@
@@ -29,10 +33,14 @@ LTVERSIONFLAGS = -version-info 0:0:0 -release $(LIBVER)
# includes
grincludedir = $(includedir)/gnuradio
-if PYTHON
# swig includes
swigincludedir = $(grincludedir)/swig
+# Guile scheme code ends up under here:
+guiledir = $(prefix)/share/guile/site
+grguiledir = $(guiledir)/gnuradio
+
+if PYTHON
# Install the gnuradio stuff in the appropriate subdirectory
# This usually ends up at:
# ${prefix}/lib/python${python_version}/site-packages/gnuradio
@@ -114,9 +122,45 @@ grc_blocksdir = $(pkgdatadir)/grc/blocks
STAMPS =
MOSTLYCLEANFILES = $(BUILT_SOURCES) $(STAMPS) *.pyc *.pyo *~ *.tmp *.loT
+## SWIG suffixes for automake to know about
+SUFFIXES = .i .scm .py
+
+if GUILE
+# Compile a .i to what guile needs. We use -o to set the output file name,
+# or even with -outdir guile in SWIG_GUILE_ARGS, swig keeps putting a
+# gnuradio_core_*_wrap.cxx in the source directory.
+gnuradio/%.scm : %.i
+ @echo "Compile .i to .scm"
+ @test -d "guile" || $(mkinstalldirs) "guile"
+ @test -d "gnuradio" || $(mkinstalldirs) "gnuradio"
+ $(SWIG) $(STD_SWIG_GUILE_ARGS) $($*_swig_args) \
+ -MD -MF guile/$*.Std \
+ -module $* -o guile/$*.cc $<
+ $(SED) -e 's|guile/\(.*\)\.cc:|gnuradio/\1.scm:|' guile/$*.Std > guile/$*.d
+ $(SED) -i -e 's/<--dummy-[0-9]\+-->/<top>/g' gnuradio/$*.scm
+ $(SED) -i -e 's/^(export /(export-safely /' gnuradio/$*.scm
+ $(RM) guile/$*.Std
+endif
+
+# Compile a .i file to what python needs
+.i.py:
+ @echo "Compile .i to .py"
+ @test -d "python" || $(mkinstalldirs) "python"
+ $(SWIG) $(STD_SWIG_PYTHON_ARGS) $($*_swig_args) \
+ -MD -MF python/$*.Std \
+ -module $* -o python/$*.cc -oh python/$*.h $<
+ $(SED) -e 's|python/\(.*\)\.cc:|\1.py:|' python/$*.Std > python/$*.d
+ $(RM) python/$*.Std
+
# Don't distribute the files defined in the variable 'no_dist_files'
+no_dist_dirs = python gnuradio guile
dist-hook:
+ @for dir in $(no_dist_dirs); do \
+ echo $(RM) -fr $(distdir)/$$dir; \
+ $(RM) -fr $(distdir)/$$dir; \
+ done;
@for file in $(no_dist_files); do \
echo $(RM) $(distdir)/$$file; \
$(RM) $(distdir)/$$file; \
done;
+