diff options
-rw-r--r-- | Makefile.common | 29 | ||||
-rw-r--r-- | Makefile.swig | 32 | ||||
-rw-r--r-- | gr-howto-write-a-block/Makefile.common | 29 | ||||
-rw-r--r-- | gr-howto-write-a-block/Makefile.swig | 32 |
4 files changed, 60 insertions, 62 deletions
diff --git a/Makefile.common b/Makefile.common index fbdbf4e7e..ddde9a78b 100644 --- a/Makefile.common +++ b/Makefile.common @@ -126,35 +126,6 @@ gr_prefsdir = $(GR_PREFSDIR) # Data directory for grc block wrappers grc_blocksdir = $(pkgdatadir)/grc/blocks -## 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]\+-->/<top>/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; \ diff --git a/Makefile.swig b/Makefile.swig index 327b566e1..2ed69c6c7 100644 --- a/Makefile.swig +++ b/Makefile.swig @@ -92,8 +92,8 @@ STD_SWIG_CXX_FLAGS = @swig_CXXFLAGS@ # We drive the dependencies off of swig_built_sources. This variable # ends up containing only the generated .py and/or .scm files, not the .h -# or .cc files. This allows us to use the pattern rules in -# Makefile.common to generate all the pieces without the parallel make +# or .cc files. This allows us to use the pattern rules defined +# below to generate all the pieces without the parallel make # problems that occur when both the .py's and .cc's are in swig_built_sources. swig_built_sources = @@ -137,6 +137,34 @@ CLEANFILES += python/*.lo python/*.o python/*.d CLEANFILES += guile/*.lo guile/*.o guile/*.d +## 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]\+-->/<top>/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 + ## ------------------------------------------------------------------------ ## Rule that (re)generates Makefile.swig.gen using TOP_SWIG_IFILES and ## Makefile.swig.gen.t 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]\+-->/<top>/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; \ diff --git a/gr-howto-write-a-block/Makefile.swig b/gr-howto-write-a-block/Makefile.swig index 327b566e1..2ed69c6c7 100644 --- a/gr-howto-write-a-block/Makefile.swig +++ b/gr-howto-write-a-block/Makefile.swig @@ -92,8 +92,8 @@ STD_SWIG_CXX_FLAGS = @swig_CXXFLAGS@ # We drive the dependencies off of swig_built_sources. This variable # ends up containing only the generated .py and/or .scm files, not the .h -# or .cc files. This allows us to use the pattern rules in -# Makefile.common to generate all the pieces without the parallel make +# or .cc files. This allows us to use the pattern rules defined +# below to generate all the pieces without the parallel make # problems that occur when both the .py's and .cc's are in swig_built_sources. swig_built_sources = @@ -137,6 +137,34 @@ CLEANFILES += python/*.lo python/*.o python/*.d CLEANFILES += guile/*.lo guile/*.o guile/*.d +## 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]\+-->/<top>/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 + ## ------------------------------------------------------------------------ ## Rule that (re)generates Makefile.swig.gen using TOP_SWIG_IFILES and ## Makefile.swig.gen.t |