[nycbug-talk] umask in Makefile

Ray Lai nycbug
Tue Jan 31 21:00:49 EST 2006


On Tue, Jan 31, 2006 at 07:27:37PM -0500, George Georgalis wrote:
> On Tue, Jan 31, 2006 at 03:10:37PM -0501, Ray Lai wrote:
> >On Tue, Jan 31, 2006 at 02:43:37PM -0500, 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?
> >
> >http://groups.google.com/group/gnu.utils.bug/browse_thread/thread/277afe41cc5c0d67/22cc0a52143931ea?lnk=st&q=makefile+umask&rnum=1&hl=en
> >
> >Not much better, but it's an alternative.
> 
> 
> like the OP on that thread... if it works it's infinitely better!
> I was imagining using $SHELL but I only spent :15 looking for doc
> on it and didn't experiment ;)
> 
> I really wasn't sure what to use either, didn;t think of ";" or "exec"
> 
>  SHELL = umask $(UMASK); exec /bin/sh
> 
> I'm gona try that or maybe
> 
>  SHELL = umask $(UMASK) && exec /bin/sh
> 
> That is a really great thread, did you just find it (how) or had
> you saved it?

As the highlighted terms reveal, I did a Google Groups search for
makefile and umask. =)

-Ray-



More information about the talk mailing list