docs-common Makefile.common,1.53,1.54

Tommy Reynolds Tommy.Reynolds at MegaCoder.com
Mon Feb 13 18:46:06 UTC 2006


Uttered "Paul W. Frields" (pfrields) <fedora-docs-commits at redhat.com>, spake thus:

> Log Message:
> Oops, remember Tommy's rule of good behavior in targets
> 
> Index: Makefile.common
>  	')' -prune -o -print | cpio -pamdv $(DOCBASE)-$(VERSION)
> -	tar -zcvf $@ $(DOCBASE)-$(VERSION)/
> +	tar -zcvf $(DOCBASE)-$(VERSION).src.tar.gz $(DOCBASE)-$(VERSION)/

Is that my rule?

Nothing wrong with the original line; I _like_ shorthands like "$@".  

The problem is when $*, $@ and the like appear in a template; then
they must be written like this:

	define FOO_template
	target-${1}:: file.foo
		cp $$< $$@
	endef
	$(foreach F,abc def,$(eval $(call FOO_template,${F})))

That is, you must escape the '$@' in the template because we don't
want it expanded as part of the template expansion, but later when
the target is evaluated.

Cheers




More information about the fedora-docs-list mailing list