help-make
[Top][All Lists]
Advanced

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

chain pattern rules


From: Luke Shumaker
Subject: chain pattern rules
Date: Mon, 26 Apr 2010 17:56:42 -0400

Hello,

I'm a little confused about how chained pattern rules work, I though I
understood it, but now I'm getting cases where make cannot figure out
how to make my files.

For example, I have a Makefile containing:
%: %.gz; gzip -cd $< > $@
%: %.tar; tar -xf $<


If I have the file ``bash-4.1.tar.gz'' in the directory, why can't I
type `make bash-4.1' and have it extract the tarball?  It does work if I
type `make bash-4.1.tar' then `make bash-4.1' separately.

Yes, I realize that I could just define:
%: %.tar.gz; tar -xzf $<

But this was the most simple/general example I could come up with to
demonstrate this problem.

Thanks,
~ Luke





reply via email to

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