Take the 2-minute tour ×

I'm trying to write a simple Autotool package that just packages a single script. This might seem like overkill, but the script is to be added into the build-system for an embedded system and the build-system is designed to play nicely with Autotools.

I have a shell-script called wifi_query.sh. To package this I've followed the following steps:

  1. Created Makefile.am which contains the following -

    bin_SCRIPTS = wifi_query.sh
  2. I also created wifi_query.sh.in which contains the line exec wifi_query.sh. I'm not sure I understand the purpose of the .in file.
  3. I then run autoscan.
  4. Then I run:

    sed -e 's/FULL-PACKAGE-NAME/wifi_query/' \
    -e 's/VERSION/1/' \
    -e 's|BUG-REPORT-ADDRESS|/dev/null|' \
    -e '10i\
    < configure.scan > configure.ac
  5. Run touch NEWS README AUTHORS ChangeLog.

  6. Run autoreconf -iv

  7. ./configure

  8. make distcheck

When I run make distcheck I get an error saying: "* No rule to make target 'wifi_query.sh', needed by 'all-am'. Stop.".

I don't understand this error, if anyone could give me any pointers that would be good. My suspicion is that the error may be due to wifi_query.sh.in, but I have very limited autotools experience.

share|improve this question
Your own answer is correct, wifi_query.sh.in wasn't causing the problem; but neither should it be necessary. If it was, its purpose would be for swapping platform-dependent code into wifi_query.sh. –  ptomato Jun 3 '13 at 21:48
Consider using AM_INIT_AUTOMAKE([foreign]) if you don’t have meaningful content for NEWS, README etc. You can then remove the empty files. –  chirlu Jun 6 '13 at 0:21
add comment

1 Answer

up vote 1 down vote accepted

It seems I needed to replace the line bin_SCRIPTS = wifi_query.sh with dist_bin_SCRIPTS = wifi_query.sh in Makefile.am. Having done that everything seems to work.

share|improve this answer
This is not the correct approach. If you use dist_bin_SCRIPTS, you must not use wifi_query.sh.in; just call the script wifi_query.sh. If you use wifi_query.sh.in (which it seems you do not need; if you needed it you would understand its purpose), you must add wifi_query.sh to AC_CONFIG_FILES (in configure.ac)to generate a rule to construct it from wifi_query.sh.in –  William Pursell Jun 4 '13 at 7:35
Yeah that's correct, I forgot to add that wifi_query.sh.in has now been removed from the package too. –  Kells1986 Jun 4 '13 at 10:37
add comment

Your Answer


