commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r10452 - in gnuradio/branches/developers/michaelld/fix


From: michaelld
Subject: [Commit-gnuradio] r10452 - in gnuradio/branches/developers/michaelld/fix_makefile_gen: . gnuradio-core/src/lib/filter gnuradio-core/src/lib/gengen gnuradio-core/src/python gr-trellis/src/lib
Date: Tue, 17 Feb 2009 09:57:29 -0700 (MST)

Author: michaelld
Date: 2009-02-17 09:57:29 -0700 (Tue, 17 Feb 2009)
New Revision: 10452

Added:
   gnuradio/branches/developers/michaelld/fix_makefile_gen/Makefile.gen.gen
Modified:
   
gnuradio/branches/developers/michaelld/fix_makefile_gen/gnuradio-core/src/lib/filter/Makefile.am
   
gnuradio/branches/developers/michaelld/fix_makefile_gen/gnuradio-core/src/lib/filter/generate_gr_fir_sysconfig.py
   
gnuradio/branches/developers/michaelld/fix_makefile_gen/gnuradio-core/src/lib/filter/generate_gr_fir_sysconfig_generic.py
   
gnuradio/branches/developers/michaelld/fix_makefile_gen/gnuradio-core/src/lib/filter/generate_gr_fir_util.py
   
gnuradio/branches/developers/michaelld/fix_makefile_gen/gnuradio-core/src/lib/gengen/Makefile.am
   
gnuradio/branches/developers/michaelld/fix_makefile_gen/gnuradio-core/src/python/build_utils.py
   
gnuradio/branches/developers/michaelld/fix_makefile_gen/gr-trellis/src/lib/Makefile.am
Log:
Robust fix for Makefile.gen issues.  By default when compiling, will
not regenerate any Makefile.gen, but provides a MAKE rule for doing
so.  Uses a top-level common file, which simplities individual
Makefile.am's.  Tweaked the template-generating Python utilities to be
able to produce sources and Makefile.gen independently via an
environment variable.  Passes distcheck on latest OSX and Ubuntu, for
both VPATH and non-VPATH builds.  Should be parallel build safe, but
this feature wasn't tested beyond "-j2" on OSX.



Added: gnuradio/branches/developers/michaelld/fix_makefile_gen/Makefile.gen.gen
===================================================================
--- gnuradio/branches/developers/michaelld/fix_makefile_gen/Makefile.gen.gen    
                        (rev 0)
+++ gnuradio/branches/developers/michaelld/fix_makefile_gen/Makefile.gen.gen    
2009-02-17 16:57:29 UTC (rev 10452)
@@ -0,0 +1,81 @@
+# -*- 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 += $(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
+
+STAMPS += $(DEPDIR)/generate-makefile-generate-*
+
+generate-makefile:
+## parallel make protection; can't hurt
+       trap 'rm -rf $(DEPDIR)/address@hidden' 1 2 13 15; \
+       if mkdir $(DEPDIR)/address@hidden 2>/dev/null; then \
+## This code is being executed by the first process.
+               rm -f $(DEPDIR)/address@hidden; \
+               $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/address@hidden; \
+               rmdir $(DEPDIR)/address@hidden; \
+       else \
+## This code is being executed by the follower processes.
+## Wait until the first process is done.
+               while test -d $(DEPDIR)/address@hidden; do sleep 1; done; \
+## Succeed if and only if the first process succeeded.
+               test -f $(DEPDIR)/address@hidden; exit $$?; \
+       fi;
+
+$(DEPDIR)/generate-makefile-generate-stamp:
+       @rm -f $(DEPDIR)/Makefile.gen-generate-tmp
+       @touch $(DEPDIR)/Makefile.gen-generate-tmp
+               PYTHONPATH=$(top_srcdir)/gnuradio-core/src/python 
srcdir=$(srcdir) do_makefile=1 do_sources=0 $(PYTHON) $(srcdir)/generate_all.py
+       @mv -f $(DEPDIR)/Makefile.gen-generate-tmp $@
+
+## ----------------------------------------------------------------
+
+MOSTLYCLEANFILES += $(STAMPS) Makefile.gen

Modified: 
gnuradio/branches/developers/michaelld/fix_makefile_gen/gnuradio-core/src/lib/filter/Makefile.am
===================================================================
--- 
gnuradio/branches/developers/michaelld/fix_makefile_gen/gnuradio-core/src/lib/filter/Makefile.am
    2009-02-17 16:57:00 UTC (rev 10451)
+++ 
gnuradio/branches/developers/michaelld/fix_makefile_gen/gnuradio-core/src/lib/filter/Makefile.am
    2009-02-17 16:57:29 UTC (rev 10452)
@@ -1,5 +1,5 @@
 #
-# Copyright 2001,2002,2004,2005,2006,2007,2008 Free Software Foundation, Inc.
+# Copyright 2001,2002,2004,2005,2006,2007,2008,2009 Free Software Foundation, 
Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -34,7 +34,7 @@
 # these scripts generate FIR code
 #
 
-CODE_GENERATOR =                                       \
+code_generator =                                       \
        generate_all.py                                 \
        generate_gr_fir_XXX.py                          \
        generate_gr_fir_filter_XXX.py                   \
@@ -62,42 +62,29 @@
        gr_freq_xlating_fir_filter_XXX.h.t              \
        gr_freq_xlating_fir_filter_XXX.i.t
 
-include Makefile.gen
+# include the srcdir's Makefile.gen; doing this creates an implicit
+# dependency between $(srcdir)/Makefile.in and $(srcdir)/Makefile.gen.
+include $(srcdir)/Makefile.gen
 
-# Ensure parallel make does the right thing.
-# http://sources.redhat.com/automake/automake.html#Multiple-Outputs
+# Source built by Python into $(builddir)
+python_built_sources =         \
+       $(GENERATED_H)          \
+       $(GENERATED_I)          \
+       $(GENERATED_CC)         \
+       filter_generated.i
 
-STAMPS = generate-stamp
+BUILT_SOURCES = $(python_built_sources)
 
-generate-stamp: $(CODE_GENERATOR)
-       @rm -f generate-tmp
-       @touch generate-tmp
-       PYTHONPATH=$(top_srcdir)/gnuradio-core/src/python srcdir=$(srcdir) 
$(PYTHON) $(srcdir)/generate_all.py
-       @mv -f generate-tmp $@
+# Required when including Makefile.gen.gen
 
+STAMPS =
+gen_sources = $(BUILT_SOURCES)
+gen_sources_deps = $(core_generator)
+MOSTLYCLEANFILES = $(BUILT_SOURCES) *.pyc
 
-$(GENERATED_H) $(GENERATED_I) $(GENERATED_CC) filter_generated.i: 
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
+# common way for generating sources from templates, using the above parameters
+include $(top_srcdir)/Makefile.gen.gen
 
-
-BUILT_SOURCES = $(GENERATED_H) $(GENERATED_I) $(GENERATED_CC)
-
-
 # ----------------------------------------------------------------
 # MD_CPU and MD_SUBCPU are set at configure time by way of 
 #   gnuradio/config/gr_set_md_cpu.m4.  
@@ -195,10 +182,8 @@
 EXTRA_DIST =                                   \
        3dnow_float_dotprod_really_simple.S     \
        3dnow_float_dotprod_simple.S            \
-       $(CODE_GENERATOR)                       \
-       $(STAMPS)
+       $(code_generator)
 
-
 # work around automake deficiency
 libfilter_la_common_SOURCES =          \
        $(GENERATED_CC)                 \
@@ -341,6 +326,3 @@
        gr_single_pole_iir_filter_ff.i  \
        gr_single_pole_iir_filter_cc.i  \
        $(GENERATED_I)
-
-
-CLEANFILES = $(BUILT_SOURCES) $(STAMPS) *.pyc

Modified: 
gnuradio/branches/developers/michaelld/fix_makefile_gen/gnuradio-core/src/lib/filter/generate_gr_fir_sysconfig.py
===================================================================
--- 
gnuradio/branches/developers/michaelld/fix_makefile_gen/gnuradio-core/src/lib/filter/generate_gr_fir_sysconfig.py
   2009-02-17 16:57:00 UTC (rev 10451)
+++ 
gnuradio/branches/developers/michaelld/fix_makefile_gen/gnuradio-core/src/lib/filter/generate_gr_fir_sysconfig.py
   2009-02-17 16:57:29 UTC (rev 10452)
@@ -1,7 +1,7 @@
 #!/bin/env python
 # -*- python -*-
 #
-# Copyright 2003 Free Software Foundation, Inc.
+# Copyright 2003,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -28,6 +28,9 @@
 
 def make_gr_fir_sysconfig_h ():
     out = open_and_log_name ('gr_fir_sysconfig.h', 'w')
+    if out == -1:
+        return
+
     out.write (copyright)
 
     out.write (
@@ -96,6 +99,9 @@
 
 def make_gr_fir_sysconfig_cc ():
     out = open_and_log_name ('gr_fir_sysconfig.cc', 'w')
+    if out == -1:
+        return
+
     out.write (copyright)
 
     out.write (

Modified: 
gnuradio/branches/developers/michaelld/fix_makefile_gen/gnuradio-core/src/lib/filter/generate_gr_fir_sysconfig_generic.py
===================================================================
--- 
gnuradio/branches/developers/michaelld/fix_makefile_gen/gnuradio-core/src/lib/filter/generate_gr_fir_sysconfig_generic.py
   2009-02-17 16:57:00 UTC (rev 10451)
+++ 
gnuradio/branches/developers/michaelld/fix_makefile_gen/gnuradio-core/src/lib/filter/generate_gr_fir_sysconfig_generic.py
   2009-02-17 16:57:29 UTC (rev 10452)
@@ -1,7 +1,7 @@
 #!/bin/env python
 # -*- python -*-
 #
-# Copyright 2003 Free Software Foundation, Inc.
+# Copyright 2003,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -28,6 +28,8 @@
 
 def make_gr_fir_sysconfig_generic_h ():
     out = open_and_log_name ('gr_fir_sysconfig_generic.h', 'w')
+    if out == -1:
+        return
     out.write (copyright)
 
     out.write (
@@ -110,6 +112,8 @@
 
 def make_gr_fir_sysconfig_generic_cc ():
     out = open_and_log_name ('gr_fir_sysconfig_generic.cc', 'w')
+    if out == -1:
+        return
     out.write (copyright)
 
     out.write (

Modified: 
gnuradio/branches/developers/michaelld/fix_makefile_gen/gnuradio-core/src/lib/filter/generate_gr_fir_util.py
===================================================================
--- 
gnuradio/branches/developers/michaelld/fix_makefile_gen/gnuradio-core/src/lib/filter/generate_gr_fir_util.py
        2009-02-17 16:57:00 UTC (rev 10451)
+++ 
gnuradio/branches/developers/michaelld/fix_makefile_gen/gnuradio-core/src/lib/filter/generate_gr_fir_util.py
        2009-02-17 16:57:29 UTC (rev 10452)
@@ -1,6 +1,6 @@
 #!/bin/env python
 #
-# Copyright 2003 Free Software Foundation, Inc.
+# Copyright 2003,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -44,6 +44,8 @@
 
 def make_gr_fir_util_h ():
     out = open_and_log_name ('gr_fir_util.h', 'w')
+    if out == -1:
+        return
     out.write (copyright)
 
     out.write (
@@ -142,6 +144,8 @@
     
 def make_gr_fir_util_cc ():
     out = open_and_log_name ('gr_fir_util.cc', 'w')
+    if out == -1:
+        return
     out.write (copyright)
     out.write ('''
 

Modified: 
gnuradio/branches/developers/michaelld/fix_makefile_gen/gnuradio-core/src/lib/gengen/Makefile.am
===================================================================
--- 
gnuradio/branches/developers/michaelld/fix_makefile_gen/gnuradio-core/src/lib/gengen/Makefile.am
    2009-02-17 16:57:00 UTC (rev 10451)
+++ 
gnuradio/branches/developers/michaelld/fix_makefile_gen/gnuradio-core/src/lib/gengen/Makefile.am
    2009-02-17 16:57:29 UTC (rev 10452)
@@ -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
 # 
@@ -29,7 +29,7 @@
 # ----------------------------------------------------------------
 # these scripts generate code
 
-CODE_GENERATOR =                       \
+core_generator =                       \
        generate_all.py                 \
        generate_common.py              \
        gr_add_XX.cc.t                  \
@@ -117,46 +117,33 @@
        gr_moving_average_XX.h.t        \
        gr_moving_average_XX.i.t
 
-include Makefile.gen
+# include the srcdir's Makefile.gen; doing this creates an implicit
+# dependency between $(srcdir)/Makefile.in and $(srcdir)/Makefile.gen.
+include $(srcdir)/Makefile.gen
 
-# Ensure parallel make does the right thing.
-# http://sources.redhat.com/automake/automake.html#Multiple-Outputs
+# Source built by Python into $(builddir)
+python_built_sources =         \
+       $(GENERATED_H)          \
+       $(GENERATED_I)          \
+       $(GENERATED_CC)         \
+       gengen_generated.i
 
-STAMPS = generate-stamp
+BUILT_SOURCES = $(python_built_sources)
 
-generate-stamp: $(CODE_GENERATOR)
-       @rm -f generate-tmp
-       @touch generate-tmp
-       PYTHONPATH=$(top_srcdir)/gnuradio-core/src/python srcdir=$(srcdir) 
$(PYTHON) $(srcdir)/generate_all.py
-       @mv -f generate-tmp $@
+# Required when including Makefile.gen.gen
 
+STAMPS =
+gen_sources = $(BUILT_SOURCES)
+gen_sources_deps = $(core_generator)
+MOSTLYCLEANFILES = $(BUILT_SOURCES) *.pyc
 
-$(GENERATED_H) $(GENERATED_I) $(GENERATED_CC) gengen_generated.i : 
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
+# common way for generating sources from templates, using the above parameters
+include $(top_srcdir)/Makefile.gen.gen
 
-
-BUILT_SOURCES = $(GENERATED_H) $(GENERATED_I) $(GENERATED_CC)
-
 # ----------------------------------------------------------------
 
 EXTRA_DIST =                           \
-       $(CODE_GENERATOR)               \
-       $(STAMPS)
+       $(core_generator)
 
 libgengen_la_SOURCES =                         \
        $(GENERATED_CC)                 
@@ -177,4 +164,4 @@
        gengen.i                        \
        gengen_generated.i              
 
-CLEANFILES = $(BUILT_SOURCES) $(STAMPS) *.pyc
+CLEANFILES = $(BUILT_SOURCES) *.pyc

Modified: 
gnuradio/branches/developers/michaelld/fix_makefile_gen/gnuradio-core/src/python/build_utils.py
===================================================================
--- 
gnuradio/branches/developers/michaelld/fix_makefile_gen/gnuradio-core/src/python/build_utils.py
     2009-02-17 16:57:00 UTC (rev 10451)
+++ 
gnuradio/branches/developers/michaelld/fix_makefile_gen/gnuradio-core/src/python/build_utils.py
     2009-02-17 16:57:29 UTC (rev 10452)
@@ -1,5 +1,5 @@
 #
-# Copyright 2004 Free Software Foundation, Inc.
+# Copyright 2004,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -33,7 +33,24 @@
     srcdir = "."
 srcdir = srcdir + '/'
 
+# set do_makefile to either true or false dependeing on the environment
+try:
+    if os.environ['do_makefile'] == '0':
+        do_makefile = False
+    else:
+        do_makefile = True
+except KeyError, e:
+    do_makefile = False
 
+# set do_sources to either true or false dependeing on the environment
+try:
+    if os.environ['do_sources'] == '0':
+        do_sources = False
+    else:
+        do_sources = True
+except KeyError, e:
+    do_sources = True
+
 name_dict = {}
 
 def log_output_name (name):
@@ -44,45 +61,55 @@
     entry.append (name)
     
 def open_and_log_name (name, dir):
-    f = open (name, dir)
+    global do_sources
+    if do_sources:
+        f = open (name, dir)
+    else:
+        f = -1
     log_output_name (name)
     return f
 
 def expand_template (d, template_filename, extra = ""):
     '''Given a dictionary D and a TEMPLATE_FILENAME, expand template into 
output file
     '''
+    global do_sources
     output_extension = extract_extension (template_filename)
     template = open_src (template_filename, 'r')
     output_name = d['NAME'] + extra + '.' + output_extension
     log_output_name (output_name)
-    output = open (output_name, 'w')
-    do_substitution (d, template, output)
+    if do_sources:
+        output = open (output_name, 'w')
+        do_substitution (d, template, output)
+        output.close ()
     template.close ()
-    output.close ()
 
 def output_glue (dirname):
     output_makefile_fragment ()
     output_ifile_include (dirname)
-    
+
 def output_makefile_fragment ():
-    f = open ('Makefile.gen', 'w')
-    f.write ('#\n# This file is machine generated.  All edits will be 
overwritten\n#\n')
-    output_subfrag (f, 'h')
-    output_subfrag (f, 'i')
-    output_subfrag (f, 'cc')
-    f.close ()
+    global do_makefile
+    if do_makefile:
+        f = open ('Makefile.gen', 'w')
+        f.write ('#\n# This file is machine generated.  All edits will be 
overwritten\n#\n')
+        output_subfrag (f, 'h')
+        output_subfrag (f, 'i')
+        output_subfrag (f, 'cc')
+        f.close ()
 
 def output_ifile_include (dirname):
-    f = open ('%s_generated.i' % (dirname,), 'w')
-    f.write ('//\n// This file is machine generated.  All edits will be 
overwritten\n//\n')
-    files = name_dict.setdefault ('i', [])
-    files.sort ()
-    f.write ('%{\n')
-    for file in files:
-        f.write ('#include <%s>\n' % (file[0:-1] + 'h',))
-    f.write ('%}\n\n')
-    for file in files:
-        f.write ('%%include <%s>\n' % (file,))
+    global do_sources
+    if do_sources:
+        f = open ('%s_generated.i' % (dirname,), 'w')
+        f.write ('//\n// This file is machine generated.  All edits will be 
overwritten\n//\n')
+        files = name_dict.setdefault ('i', [])
+        files.sort ()
+        f.write ('%{\n')
+        for file in files:
+            f.write ('#include <%s>\n' % (file[0:-1] + 'h',))
+        f.write ('%}\n\n')
+        for file in files:
+            f.write ('%%include <%s>\n' % (file,))
 
 def output_subfrag (f, ext):
     files = name_dict.setdefault (ext, [])
@@ -91,7 +118,6 @@
     for file in files:
         f.write (" \\\n\t%s" % (file,))
     f.write ("\n\n")
-    
 
 def extract_extension (template_name):
     # template name is something like: GrFIRfilterXXX.h.t

Modified: 
gnuradio/branches/developers/michaelld/fix_makefile_gen/gr-trellis/src/lib/Makefile.am
===================================================================
--- 
gnuradio/branches/developers/michaelld/fix_makefile_gen/gr-trellis/src/lib/Makefile.am
      2009-02-17 16:57:00 UTC (rev 10451)
+++ 
gnuradio/branches/developers/michaelld/fix_makefile_gen/gr-trellis/src/lib/Makefile.am
      2009-02-17 16:57:29 UTC (rev 10452)
@@ -33,7 +33,7 @@
 # ----------------------------------------------------------------
 # these scripts generate trellis codes from template files
 
-CODE_GENERATOR =                               \
+core_generator =                               \
        generate_all.py                         \
        generate_trellis.py                     \
        trellis_encoder_XX.cc.t                 \
@@ -49,39 +49,27 @@
        trellis_viterbi_X.h.t                   \
        trellis_viterbi_X.i.t
 
-include Makefile.gen
+# 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)          \
+       $(GENERATED_I)          \
+       $(GENERATED_CC)         \
+       trellis_generated.i
 
-# Ensure parallel make does the right thing.
-# http://sources.redhat.com/automake/automake.html#Multiple-Outputs
+# Required when including Makefile.gen.gen
 
-STAMPS = generate-stamp
+STAMPS =
+gen_sources = $(python_built_sources)
+gen_sources_deps = $(core_generator)
+MOSTLYCLEANFILES = $(BUILT_SOURCES) *.pyc
 
-generate-stamp: $(CODE_GENERATOR)
-       @rm -f generate-tmp
-       @touch generate-tmp
-       PYTHONPATH=$(top_srcdir)/gnuradio-core/src/python srcdir=$(srcdir) 
$(PYTHON) $(srcdir)/generate_all.py
-       @mv -f generate-tmp $@
+# common way for generating sources from templates, using the above parameters
+include $(top_srcdir)/Makefile.gen.gen
 
-$(GENERATED_H) $(GENERATED_I) $(GENERATED_CC) trellis_generated.i : 
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
-
-
 # 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.
@@ -90,11 +78,9 @@
        trellis.cc              \
        trellis.py                              
 
-BUILT_SOURCES = \
-       $(GENERATED_H)          \
-       $(GENERATED_I)          \
-       $(GENERATED_CC)         \
-       $(swig_built_sources)   
+BUILT_SOURCES =                        \
+       $(python_built_sources) \
+       $(swig_built_sources)
 
 ALL_IFILES =                   \
        $(LOCAL_IFILES)         \
@@ -107,10 +93,8 @@
        $(srcdir)/trellis.i                     
 
 EXTRA_DIST =                   \
-       $(CODE_GENERATOR)       \
-       $(STAMPS)
+       $(core_generator)
 
-
 # This gets trellis.py installed in the right place
 ourpython_PYTHON =             \
        trellis.py
@@ -171,8 +155,6 @@
        trellis_siso_combined_f.i       \
        trellis_generated.i
 
-CLEANFILES = $(BUILT_SOURCES) $(STAMPS) *.pyc
-
 # Don't distribute output of swig
 dist-hook:
        @for file in $(swig_built_sources); do echo $(RM) $(distdir)/$$file; 
done





reply via email to

[Prev in Thread] Current Thread [Next in Thread]