octave-maintainers
[Top][All Lists]
Advanced

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

Re: Makefile rule for symbolic links in src/DLD-FUNCTIONS


From: John W. Eaton
Subject: Re: Makefile rule for symbolic links in src/DLD-FUNCTIONS
Date: Tue, 25 Jan 2011 16:57:26 -0500

On 25-Jan-2011, Rik wrote:

| > OK, now I think I understand what is happening and why.  Yes, the
| > intent of the rule is to check the timestamp of the symbolic link
| > itself.  But it would be nice if we could somehow limit that to just
| > these .oct file targets and not apply it globally unless there is some
| > way to know that there will never be any dependency checks that will
| > now be incorrect if we make this change.
| 
| It is only applicable to this particular Makefile, but I understand if this
| still feels too global.
| 
| I suppose the easiest thing to do would be to depend on an intermediate
| file which could take a proper timestamp.  It could be a '.' file to hide
| it on UNIX platforms.  I'm thinking roughly of a rule like
| 
| .libABC.tstamp : libABC.la
|   ... link -s libABC.so.0.0 libABC.oct ...
|   touch $@
| 
| and then changing the 'all-local' rule to depend on the timestamp files
| rather than the .oct symbolic links.

OK, how about the following change?  If it works for you, please
commit.

Thanks,

jwe

# HG changeset patch
# User John W. Eaton <address@hidden>
# Date 1295992433 18000
# Node ID 7126bcf89c5d6691b1e10b7f05c404102c3bb842
# Parent  1f56327759e5f5c84cbdb7725273cee6cd3a8ce9
create stamp files for .oct symbolic links

diff --git a/src/ChangeLog b/src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
+2011-01-25  John W. Eaton  <address@hidden>
+
+       * Makefile.am (OCT_STAMP_FILES): New variable.
+       (DISTCLEANFILES): Add $(OCT_STAMP_FILES) to the list.
+       (all-local): Depend on $(OCT_STAMP_FILES) instead of $(OCT_FILES).
+
+       * DLD-FUNCTIONS/config-module.awk: Create stamp files when
+       creating .oct file links.
+
 2011-01-25  Konstantinos Poulios  <address@hidden>
 
        * src/graphics.cc (text::properties::update_text_extent):
diff --git a/src/DLD-FUNCTIONS/config-module.awk 
b/src/DLD-FUNCTIONS/config-module.awk
--- a/src/DLD-FUNCTIONS/config-module.awk
+++ b/src/DLD-FUNCTIONS/config-module.awk
@@ -19,22 +19,29 @@
       sep = "\n";
     printf ("  DLD-FUNCTIONS/%s.la%s", basename, sep);
   }
-  print ""
+  print "";
   print "octlib_LTLIBRARIES += $(DLD_FUNCTIONS_LIBS)";
-  print ""
+  print "";
   print "if AMCOND_ENABLE_DYNAMIC_LINKING";
+  print "";
+  print "## Use stamp files to avoid problems with checking timestamps";
+  print "## of symbolic links";
+  print "";
   for (i = 1; i <= nfiles; i++) {
     basename = files[i];
     sub (/\.cc$/, "", basename);
-    printf ("DLD-FUNCTIONS/%s.oct: DLD-FUNCTIONS/%s.la\n", basename, basename);
-    print "\trm -f $@";
+    printf ("DLD-FUNCTIONS/%s.oct-stamp: DLD-FUNCTIONS/%s.la\n", basename, 
basename);
+    print "\trm -f $@ `echo $@ | sed 's,-stamp$$,,'`";
     print "\tla=`echo $< | $(SED) 's,DLD-FUNCTIONS/,,'` && \\";
-    print "\t  of=`echo $@ | $(SED) 's,DLD-FUNCTIONS/,,'` && \\";
+    print "\t  sf=`echo $@ | $(SED) 's,DLD-FUNCTIONS/,,'` && \\";
+    print "\t  of=`echo $@ | $(SED) 's,DLD-FUNCTIONS/,,; s,-stamp$$,,'` && \\";
     print "\t  cd DLD-FUNCTIONS && \\";
-    print "\t  $(LN_S) .libs/`$(SED) -n -e \"s/dlname='\\([^']*\\)'/\\1/p\" < 
$$la` $$of";
+    print "\t  $(LN_S) .libs/`$(SED) -n -e \"s/dlname='\\([^']*\\)'/\\1/p\" < 
$$la` $$of && \\";
+    print "\t  touch $$sf";
+    print "";
   }
   print "endif";
-  print ""
+  print "";
 
   for (i = 1; i <= nfiles; i++) {
     basename = files[i];
diff --git a/src/Makefile.am b/src/Makefile.am
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -467,10 +467,12 @@
   DLD_DYNAMIC_SRC = $(DLD_FUNCTIONS_SRC)
   DLD_STATIC_SRC =
   OCT_FILES = $(DLD_FUNCTIONS_SRC:.cc=.oct)
+  OCT_STAMP_FILES = $(DLD_FUNCTIONS_SRC:.cc=.oct-stamp)
 else
   DLD_DYNAMIC_SRC =
   DLD_STATIC_SRC = $(DLD_FUNCTIONS_SRC)
   OCT_FILES =
+  OCT_STAMP_FILES =
 endif
 
 liboctinterp_la_SOURCES = \
@@ -606,14 +608,15 @@
 DISTCLEANFILES = \
   .DOCSTRINGS \
   DOCSTRINGS \
-  $(OCT_FILES)
+  $(OCT_FILES) \
+  $(OCT_STAMP_FILES)
 
 MAINTAINERCLEANFILES = \
   $(BUILT_DISTFILES)
 
 octave_LDADD = $(OCTAVE_LIBS)
 
-all-local: $(OCT_FILES) DLD-FUNCTIONS/PKG_ADD .DOCSTRINGS
+all-local: $(OCT_STAMP_FILES) DLD-FUNCTIONS/PKG_ADD .DOCSTRINGS
 
 lex.lo lex.o oct-parse.lo oct-parse.o: \
   AM_CXXFLAGS := $(filter-out -Wold-style-cast, $(AM_CXXFLAGS))

reply via email to

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