Ticket #4460: fix unportable '$<' in Makefiles.

POSIX specifis '$<' only for "inference" rules (i.e. general rule
like '.c.o:'), while for "target" is undefined.
It is supported as extension for targets by some "make" implementations,
but not all.
The workarounds could be easily used.

Closes MidnightCommander/mc#185.

Signed-off-by: Karlson2k (Evgeny Grin) <k2k@narod.ru>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Evgeny Grin 2023-05-19 19:26:02 +03:00 committed by Andrew Borodin
parent 2e3e3a3775
commit 8cd913a28a
2 changed files with 7 additions and 7 deletions

View File

@ -12,13 +12,13 @@ MAN_DATE_CMD = \
print POSIX::strftime("$(DATE_FORMAT)", localtime($$fi[9]));' 2>/dev/null
mc.1: $(srcdir)/mc.1.in
MAN_FILE=$<; MAN_DATE=$$($(MAN_DATE_CMD)); \
$(SED) $(SED_PARAMETERS) $< > $@
MAN_FILE='$(srcdir)/mc.1.in'; MAN_DATE=$$($(MAN_DATE_CMD)); \
$(SED) $(SED_PARAMETERS) '$(srcdir)/mc.1.in' > '$@'
mcedit.1: $(srcdir)/mcedit.1.in
MAN_FILE=$<; MAN_DATE=$$($(MAN_DATE_CMD)); \
$(SED) $(SED_PARAMETERS) $< > $@
MAN_FILE='$(srcdir)/mcedit.1.in'; MAN_DATE=$$($(MAN_DATE_CMD)); \
$(SED) $(SED_PARAMETERS) '$(srcdir)/mcedit.1.in' > '$@'
mcview.1: $(srcdir)/mcview.1.in
MAN_FILE=$<; MAN_DATE=$$($(MAN_DATE_CMD)); \
$(SED) $(SED_PARAMETERS) $< > $@
MAN_FILE='$(srcdir)/mcview.1.in'; MAN_DATE=$$($(MAN_DATE_CMD)); \
$(SED) $(SED_PARAMETERS) '$(srcdir)/mcview.1.in' > '$@'

View File

@ -125,7 +125,7 @@ doc: README.html
# (Thanks to VPATH we don't need to write "$(srcdir)/README". doc/hlp/Makefile.am needlessly does this.)
README.html: README
pandoc --include-in-header=$(srcdir)/README.css.inc -N --old-dashes --toc --toc-depth=4 --standalone -o $@ $<
pandoc --include-in-header=$(srcdir)/README.css.inc -N --old-dashes --toc --toc-depth=4 --standalone -o '$@' '$(srcdir)/README'
EXTRA_DIST += README.css.inc
CLEANFILES += README.html