On Thu, May 08, 2008 at 03:38:00PM +0200, Brian Foster wrote:
> | Date: Thu, 8 May 2008 14:11:26 +0100
> | From: "Braun Brelin" <bbrelin at gmail.com>
> | Someone sent me the following lines in a Makefile:
> | XML_RULE = @echo " xml-rule $< xml2hpp.xsl $@" && \
> | $(JAVA_BIN) -cp $(XT_DIR)/xp.jar:$(XT_DIR)/xt.jar \
> | com.jclark.xsl.sax.Driver \
> | $< $(CMKCMK)/xml2hpp.xsl $@
> | They wanted to know what the "$<" and "$@" symbols mean.
> |[ ... ]
> | Anyone else know what $< is in KSH?
>> AFAICR, there is $< in ksh(1).
>> ‘make’ has truely awful syntax, and the semantics
> can be rather daunting at times as well.
"info make" and look at the quick reference is an easy way to checkup
what any of the syntax in make does.
keep in mind that $< resolves in fact to the "first" dependency of the
rule it is used under. That might not have been clear from the example
A clearer example would be
monday: tuesday wednesday
@echo $< $@
'make monday' would print
"Nothing is foolproof to a sufficiently talented fool."
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!