[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Groff] [patch] improve POSIX conformance of src/roff/groff/Makefile.sub
From: |
Ingo Schwarze |
Subject: |
[Groff] [patch] improve POSIX conformance of src/roff/groff/Makefile.sub |
Date: |
Mon, 10 Mar 2014 19:59:26 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Hi,
the commit message says it all.
Without this, the groff build dies on *BSD with this message:
Using $< in a non-suffix rule context is a GNUmake idiom (Makefile.sub:48)
Yours,
Ingo
commit c89400010ab2b44414b78a8072e9722f21b9284c
Author: Ingo Schwarze <address@hidden>
Date: Mon Mar 10 19:43:33 2014 +0100
Improve POSIX conformance of src/roff/groff/Makefile.sub.
- POSIX says that the meaning of the make(1) $< macro
shall be unspecified except in inference rules.
Consequently, use $? for portability.
That's safe because the rules have only one prerequisite
and are not .PHONY, so $? will always expand to one item.
- While here, clean up two instances of useless use of cat(1).
diff --git a/ChangeLog b/ChangeLog
index 2a57001..f935ebd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
2014-03-10 Ingo Schwarze <address@hidden>
+ * src/roff/groff/Makefile.sub: POSIX conformance
+
+ - POSIX says that the meaning of the make(1) $< macro
+ shall be unspecified except in inference rules.
+ Consequently, use $? for portability.
+ That's safe because the rules have only one prerequisite
+ and are not .PHONY, so $? will always expand to one item.
+ - While here, clean up two instances of useless use of cat(1).
+
+2014-03-10 Ingo Schwarze <address@hidden>
+
* Makefile.in: Improve the top-level "make dist" target.
- Bugfix: Do not error out if one of the DISTDIRS
diff --git a/src/roff/groff/Makefile.sub b/src/roff/groff/Makefile.sub
index 0fff2cb..6b56c3d 100644
--- a/src/roff/groff/Makefile.sub
+++ b/src/roff/groff/Makefile.sub
@@ -44,22 +44,20 @@ RM=rm -f
all: $(srcdir)/groff.cpp groff_opts.tmp $(GROFF_OPTS_OUTPUT)
groff_opts.tmp: $(srcdir)/groff.cpp
- @$(GREP) -e ':.*:.*:' $< \
+ @$(GREP) -e ':.*:.*:' $? \
| sed -e 's/[ \t",]//g' > $@
@echo -n 'groff options: '
@cat $@
groff_opts_no_arg.txt: groff_opts.tmp
@$(RM) $@
- @cat $< \
- | sed -e 's/[a-zA-Z]://g' > $@
+ @sed -e 's/[a-zA-Z]://g' $? > $@
@echo -n 'no arg: '
@cat $@
groff_opts_with_arg.txt: groff_opts_no_arg.txt
@$(RM) $@
- @cat groff_opts.tmp \
- | sed "s/[`cat $<`:]//g" > $@
+ @sed "s/[`cat $?`:]//g" groff_opts.tmp > $@
@echo -n 'with arg: '
@cat $@
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Groff] [patch] improve POSIX conformance of src/roff/groff/Makefile.sub,
Ingo Schwarze <=