bug-groff
[Top][All Lists]
Advanced

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

More Portability Fixes


From: Larry Jones
Subject: More Portability Fixes
Date: Tue, 29 Apr 2008 18:06:59 -0400 (EDT)

In makefiles, the $< macro is only guaranteed to be defined in inference
rules, not in explicit target rules.  Since there is only one input file
in the places where it's used, the $? macro (which is guaranteed to be
defined for both kinds of rules) is a suitable replacement:

Index: contrib/chem/Makefile.sub
===================================================================
RCS file: /sources/groff/groff/contrib/chem/Makefile.sub,v
retrieving revision 1.7
diff -u -r1.7 Makefile.sub
--- contrib/chem/Makefile.sub   11 Nov 2006 23:32:35 -0000      1.7
+++ contrib/chem/Makefile.sub   29 Apr 2008 21:54:26 -0000
@@ -35,11 +35,11 @@
 all: README examples/README chem $(MAN1)
 
 README: $(srcdir)/README.txt
-       sed -e "s|@g@|$(g)|g" $< >$@
+       sed -e "s|@g@|$(g)|g" $? >$@
 
 examples/README: $(srcdir)/examples/README.txt
        -test -d examples || $(mkinstalldirs) examples
-       sed -e "s|@g@|$(g)|g" $< >$@
+       sed -e "s|@g@|$(g)|g" $? >$@
 
 chem: $(srcdir)/chem.pl $(SH_DEPS_SED_SCRIPT)
        sed -f "$(SH_DEPS_SED_SCRIPT)" \


Most versions of ls don't have a --color option.  If it's really needed,
it should be tested for in configure:

Index: contrib/hdtbl/examples/fonts_n.in
===================================================================
RCS file: /sources/groff/groff/contrib/hdtbl/examples/fonts_n.in,v
retrieving revision 1.1
diff -u -r1.1 fonts_n.in
--- contrib/hdtbl/examples/fonts_n.in   13 Sep 2006 19:27:15 -0000      1.1
+++ contrib/hdtbl/examples/fonts_n.in   29 Apr 2008 21:54:26 -0000
@@ -49,7 +49,7 @@
 .
 .  pso bash -c \
        "echo -n .ds *f\ ; \
-        ls --color=never \\*[fontpath]/dev\*[.T] \
+        ls \\*[fontpath]/dev\*[.T] \
         | tr '[:cntrl:]' ' '"
 .  \"  This dummy line is necessary; the preceding line eats it.
 .
Index: contrib/hdtbl/examples/fonts_x.in
===================================================================
RCS file: /sources/groff/groff/contrib/hdtbl/examples/fonts_x.in,v
retrieving revision 1.1
diff -u -r1.1 fonts_x.in
--- contrib/hdtbl/examples/fonts_x.in   13 Sep 2006 19:27:15 -0000      1.1
+++ contrib/hdtbl/examples/fonts_x.in   29 Apr 2008 21:54:26 -0000
@@ -49,7 +49,7 @@
 .
 .  pso bash -c \
        "echo -n .ds *f\ ; \
-        ls --color=never \\*[fontpath]/dev\*[.T] \
+        ls \\*[fontpath]/dev\*[.T] \
         | tr '[:cntrl:]' ' '"
 .  \"  This dummy line is necessary; the preceding line eats it.
 .

-Larry Jones

Oh, now don't YOU start on me. -- Calvin




reply via email to

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