changeset 4547:308feb0e5646

[project @ 2003-10-25 01:59:15 by jwe]
author jwe
date Sat, 25 Oct 2003 01:59:15 +0000
parents a4796ccde726
children 820323598f4f
files liboctave/Makefile.in liboctave/mk-ops.awk
diffstat 2 files changed, 22 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/Makefile.in	Fri Oct 24 18:58:22 2003 +0000
+++ b/liboctave/Makefile.in	Sat Oct 25 01:59:15 2003 +0000
@@ -178,7 +178,7 @@
 	  mkdir pic; \
 	fi
 
-stamp-prereq: $(OPTS_INC) $(VX_OP_INC) $(VX_OP_SRC) $(MX_OP_INC) $(MX_OP_SRC)
+stamp-prereq: $(OPTS_INC) $(VX_OP_INC) $(VX_OP_SRC) $(MX_OP_INC) $(MX_OP_SRC) mx-ops.h
 	touch stamp-prereq
 
 ifeq ($(SHARED_LIBS), true)
@@ -322,8 +322,8 @@
 	$(AWK) -f $(srcdir)/mk-ops.awk prefix=mx $(srcdir)/mx-ops
 
 mx-ops.h : $(srcdir)/mk-ops.awk mx-ops
-	$(AWK) -f $(srcdir)/mk-ops.awk make_inclusive_header=mx-ops.h > $@.t
-	@$(top_srcdir)/move-if-change $@-t $@
+	$(AWK) -f $(srcdir)/mk-ops.awk prefix=mx make_inclusive_header=mx-ops.h $(srcdir)/mx-ops > $@-t
+	$(top_srcdir)/move-if-change $@-t $@
 
 
 # If missing, GNU make attempts to create them in the reverse of the
--- a/liboctave/mk-ops.awk	Fri Oct 24 18:58:22 2003 +0000
+++ b/liboctave/mk-ops.awk	Sat Oct 25 01:59:15 2003 +0000
@@ -2,25 +2,26 @@
   declare_types = 0;
   generate_ops = 0;
   ntypes = 0;
-  if (make_inclusive_header)
+} {
+  if (NR == 1 && make_inclusive_header)
     {
+      print "// DO NOT EDIT -- generated by mk-ops";
       tmp = make_inclusive_header;
-      gsub ("\\.-", "_", tmp);
+      gsub (/[\.-]/, "_", tmp);
       printf ("#if !defined (octave_%s)\n", tmp);
       printf ("#define octave_%s 1\n", tmp);
     }
 }
-  /^#/ {
-    if ($2 == "types")
-      declare_types = 1;
-    else if ($2 == "ops")
-      {
-        generate_ops = 1;
-        declare_types = 0;
-      }
-    next;
-  }
-{
+/^#/ {
+  if ($2 == "types")
+    declare_types = 1;
+  else if ($2 == "ops")
+    {
+      generate_ops = 1;
+      declare_types = 0;
+    }
+  next;
+} {
   if (declare_types)
     {
       ntypes++;
@@ -84,7 +85,10 @@
 	    }
 
 	  if (make_inclusive_header)
-            printf ("#include \"%s\"\n", h_file);
+	    {
+              printf ("#include \"%s\"\n", h_file);
+              next;
+            }
 
 	  h_guard = sprintf ("octave_%s_%s_%s_h", prefix, lhs_tag, rhs_tag);
 
@@ -192,4 +196,4 @@
 END {
   if (make_inclusive_header)
     print "#endif";
-}
\ No newline at end of file
+}