[Top][All Lists]

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

Re: dealing with executable shell scripts

From: Nick Bowler
Subject: Re: dealing with executable shell scripts
Date: Tue, 20 Mar 2012 11:04:00 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

On 2012-03-20 16:01 +0200, Andrew W. Nosenko wrote:
> On Tue, Mar 20, 2012 at 15:47, Nick Bowler <address@hidden> wrote:
> >  SUFFIXES = .sh
> >
> >  .sh:
> >        $(shbin_verbose) cp $< address@hidden
> >        $(AM_V_at) chmod +x address@hidden
> >        $(AM_V_at) mv -f address@hidden $@
> >
> Why do not use install(1) instead of cp(1)+chmod(1) or cp(1)+chmod(1)+mv(1)?

Unfortunately, use of the install tool is not portable (it's not even in
POSIX).  However, automake-using packages provide a replacement on
systems where a working install tool is not available.

Therefore, in this instance, you could alternately use a single call to
$(INSTALL) (which gets set appropriately by AC_PROG_INSTALL) instead of
the 3-command dance above.

On the other hand, install ignores the process umask (unlike the above),
which is appropriate when installing files to the system, but may not be
suitable for files the build tree.

Nick Bowler, Elliptic Technologies (

reply via email to

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