From c8835c285c6abbc334701238f53f87f93e6f125a Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Mon, 15 Nov 2010 19:08:28 -0700 Subject: make howto build the new way --- gr-howto-write-a-block/Makefile.common | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'gr-howto-write-a-block/Makefile.common') diff --git a/gr-howto-write-a-block/Makefile.common b/gr-howto-write-a-block/Makefile.common index 15a521698..0787b4eec 100644 --- a/gr-howto-write-a-block/Makefile.common +++ b/gr-howto-write-a-block/Makefile.common @@ -23,6 +23,10 @@ # The name of this "out-of-tree" module modname = howto +# Make rebuilds less verbose with stuff we can safely ignore +# about GNU make only extensions. +AUTOMAKE += -Wno-portability -Wnone + # these flags are used when compiling non-SWIG-wrapper files # when going in to non-SWIG libraries AM_CXXFLAGS = @autoconf_default_CXXFLAGS@ @@ -69,6 +73,36 @@ RM=$(RM_PROG) -f 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]\+-->//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' dist-hook: @for file in $(no_dist_files); do \ -- cgit From ea8a60ad9c2e0f9bdc57f77f5506c5906f8d1d6f Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 3 Dec 2010 23:58:48 -0800 Subject: Make gr-howto-write-a-block work again... Copied Makefile.swig, Mkefile.swig.gen.t from .. Renamed howto.i to howto_swig.i Regenerated Makefile.swig.gen --- gr-howto-write-a-block/Makefile.common | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'gr-howto-write-a-block/Makefile.common') diff --git a/gr-howto-write-a-block/Makefile.common b/gr-howto-write-a-block/Makefile.common index 0787b4eec..cfcbce9c8 100644 --- a/gr-howto-write-a-block/Makefile.common +++ b/gr-howto-write-a-block/Makefile.common @@ -20,6 +20,16 @@ # Boston, MA 02110-1301, USA. # +# Every Makefile starts with common vars so we can +# consistently use += +BUILT_SOURCES = +MOSTLYCLEANFILES = $(BUILT_SOURCES) $(STAMPS) *.pyc *.pyo *~ *.tmp *.loT +CLEANFILES = guile.log +DISTCLEANFILES = +#EXTRA_DIST = +STAMPS = + + # The name of this "out-of-tree" module modname = howto -- cgit From 6ba2c80cdedf6d4eea99c565ffa8b204174d0576 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sat, 4 Dec 2010 00:31:22 -0800 Subject: Some piece of this commit triggers a syntax error running swig: make[2]: Entering directory `/home/eb/git/wf-exec/gr-howto-write-a-block/swig' Compile .i to .py /usr/bin/swig -fvirtual -python -modern -keyword -w511 -outdir . -I/home/eb/git/wf-exec/gr-howto-write-a-block/lib -I/home/eb/install/include/gnuradio -I/home/eb/install/include/gnuradio/swig \ -MD -MF python/howto_swig.Std \ -module howto_swig -o python/howto_swig.cc -oh python/howto_swig.h howto_swig.i /usr/share/swig/1.3.40/python/std_complex.i:12: Error: Syntax error in input(1). make[2]: *** [howto_swig.py] Error 1 --- gr-howto-write-a-block/Makefile.common | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'gr-howto-write-a-block/Makefile.common') diff --git a/gr-howto-write-a-block/Makefile.common b/gr-howto-write-a-block/Makefile.common index cfcbce9c8..d89cbaa16 100644 --- a/gr-howto-write-a-block/Makefile.common +++ b/gr-howto-write-a-block/Makefile.common @@ -79,14 +79,9 @@ grc_blocksdir = $(prefix)/share/gnuradio/grc/blocks # 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 - ## 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. @@ -101,7 +96,6 @@ gnuradio/%.scm : %.i $(SED) -i -e 's/<--dummy-[0-9]\+-->//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: @@ -113,9 +107,9 @@ endif $(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' + dist-hook: @for file in $(no_dist_files); do \ echo $(RM) $(distdir)/$$file; \ $(RM) $(distdir)/$$file; \ - done; + done -- cgit From 95254c28c18277012907354ae9fa5aef295271b8 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sat, 4 Dec 2010 00:49:17 -0800 Subject: Move swig related suffix/pattern rules from Makefile.common to Makefile.swig. --- gr-howto-write-a-block/Makefile.common | 29 ----------------------------- 1 file changed, 29 deletions(-) (limited to 'gr-howto-write-a-block/Makefile.common') diff --git a/gr-howto-write-a-block/Makefile.common b/gr-howto-write-a-block/Makefile.common index d89cbaa16..f751532ed 100644 --- a/gr-howto-write-a-block/Makefile.common +++ b/gr-howto-write-a-block/Makefile.common @@ -79,35 +79,6 @@ grc_blocksdir = $(prefix)/share/gnuradio/grc/blocks # here have to add a -f to be like GNU make. RM=$(RM_PROG) -f -## SWIG suffixes for automake to know about -SUFFIXES = .i .scm .py - -# 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]\+-->//g' gnuradio/$*.scm - $(SED) -i -e 's/^(export /(export-safely /' gnuradio/$*.scm - $(RM) guile/$*.Std - -# 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 - - dist-hook: @for file in $(no_dist_files); do \ echo $(RM) $(distdir)/$$file; \ -- cgit From cc088ab014791450d9d5d88564f3f889ece74909 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Mon, 6 Dec 2010 19:47:42 -0800 Subject: Add guile QA code to gr-howto-write-a-block --- gr-howto-write-a-block/Makefile.common | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gr-howto-write-a-block/Makefile.common') diff --git a/gr-howto-write-a-block/Makefile.common b/gr-howto-write-a-block/Makefile.common index f751532ed..fca6133c1 100644 --- a/gr-howto-write-a-block/Makefile.common +++ b/gr-howto-write-a-block/Makefile.common @@ -64,6 +64,9 @@ modincludedir = $(includedir)/$(modname) # swig includes swigincludedir = $(modincludedir)/swig +# Guile scheme code ends up under here: +guiledir = $(prefix)/share/guile/site + # Install this stuff in the appropriate subdirectory # This usually ends up at: # ${prefix}/lib/python${python_version}/site-packages/$(modname) -- cgit