title: automake - how to change permissions to an installed binary
body: <p>I have this Makefile.am:</p>
  
  <pre><code>AUTOMAKE_OPTIONS = subdir-objects
  sbin_PROGRAMS = foo
  foo_SOURCES = foo.c
  
  install-exec-hook:
      chmod +s $(sbindir)/foo
  </code></pre>
  
  <p>everything works well except for the target <em>distcheck</em> which gives this error:</p>
  
  <pre><code>&gt; make distcheck
  ...
  ...
  ...
  Making install in sub-module
  make[2]: Entering directory '/home/users/a/myproj/_build/sub-module'
  make[3]: Entering directory '/home/users/a/myproj/_build/sub-module'
   ../../install-sh -c -d '/var/folders/pp/jbr_vq091s7gd8x9scrc7drw0000gn/T//am-dc-71151//home/users/a/myproj/_inst/sbin'
      /bin/sh ../libtool   --mode=install /usr/bin/install -c foo '/var/folders/pp/jbr_vq091s7gd8x9scrc7drw0000gn/T//am-dc-71151//home/users/a/myproj/_inst/sbin'
  libtool: install: /usr/bin/install -c foo /var/folders/pp/jbr_vq091s7gd8x9scrc7drw0000gn/T//am-dc-71151//home/users/a/myproj/_inst/sbin/foo
  make  install-exec-hook
  make[4]: Entering directory '/home/users/a/myproj/_build/sub-module'
  chmod +s /home/users/a/myproj/_inst/sbin/foo
  chmod: /home/users/a/myproj/_inst/sbin/foo: No such file or directory
  Makefile:645: recipe for target 'install-exec-hook' failed
  make[4]: *** [install-exec-hook] Error 1
  </code></pre>
  
  <p>it looks like the <em>foo</em> binary is copied to some temp directory (/var/folders/pp/jbr_vq091s7gd8x9scrc7drw0000gn/T//am-dc-71151//home/users/a/myproj/_inst/sbin) and not to where it is looked at in the install-exec-hook target (/home/users/a/myproj/_inst/sbin)</p>
  
  <p>What am I missing??</p>