[nycbug-talk] umask in Makefile

Johnny Lam jlam
Tue Jan 31 15:21:06 EST 2006


George Georgalis wrote:
> Is there any way to set the umask within a makefile for all the
> files it creates? with a default umask of 002 in my shell, I'd
> like to have make use 022 without starting each line that creates
> a file with "umask 022 ;"
> 
> I don't particulary want to write a wrapper to call make, but that
> seems the only way. Ideas?

I think that's the only sane way to do it with BSD make.  The other 
ways, e.g. hacking the file named by $ENV, etc., are all too gimmicky. 
Alternatively, you could just fix permissions after the targets are 
created -- that's what I do for some simple websites that I manage using 
makefiles.

	Cheers,

	-- Johnny Lam <jlam at pkgsrc.org>



More information about the talk mailing list