BTW, I think the action would be better as:
        umask 333  &&  cp $< $@

Rationale:
  1. umask'ing will create the target immediately with read-only permissions with no 
window for writing (even if you're not concerned about the security issues, I think 
it's still much cleaner)
  2. using '&&' halves the number of shells per target created; ';' would do the same 
thing but would have the consequence of allowing the 'cp' to execute if the umask 
failed.

HTH,
Noel

Ram Bhamidipaty wrote:
> 
> I have a series of rules like this in my Makefile:
> 
> $(ROOT)etc/dir1/%: $(ROOT)etc/dir1/%: %
>         cp $< $@
>         chmod 644 $@
> 
> $(ROOT)etc/dir2/%: $(ROOT)etc/dir2/%: %
>         cp $< $@
>         chmod 644 $@
> 
> ...
> 
> $(ROOT)etc/dirN/%: $(ROOT)etc/dirN/%: %
>         cp $< $@
>         chmod 644 $@
> 
> Is there a way to write all of these static pattern rules with one rule?
> 
> When I did a google search on this I saw that there was a patch submitted
> for that back in 1997, but there is no documentation in the make manuals
> that suggests that this feature has been incorporated into gnu make.
> 
> Thanks for any info?
> -Ram
> 
> _______________________________________________
> Bug-make mailing list
> [EMAIL PROTECTED]
> http://mail.gnu.org/mailman/listinfo/bug-make

-- 
NOTICE: If received in error, please destroy and notify sender.  Sender does not waive 
confidentiality or privilege, and use is prohibited.


_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make

Reply via email to