# HG changeset patch # User jwe # Date 1067047155 0 # Node ID 308feb0e564632d2386f2769af43c5bd0a1b22c2 # Parent a4796ccde726eeae73c6b7b6a1d9497ed1951902 [project @ 2003-10-25 01:59:15 by jwe] diff -r a4796ccde726 -r 308feb0e5646 liboctave/Makefile.in --- 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 diff -r a4796ccde726 -r 308feb0e5646 liboctave/mk-ops.awk --- 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 +}