Search code examples
makefileautomakeautoconf

Automake/Autoconf scripts custom directory


My project's root folder is PROJECT, and there is only one script in PROJECT/scripts/abc.sh, which I want to install it into the directory /usr/share/xxx/abc.sh.

Because it is not install into /usr/bin/abc.sh, so bin_SCRIPTS = abc.sh is incorrect.

Could you please tell me how to write the Makefile.am?


Solution

  • You'll need to define the install directory:

    xxxdir = $(datarootdir)/xxx
    
    xxx_SCRIPTS = scripts/abc.sh
    

    More typically as something like:

    pkgdata_SCRIPTS = scripts/abc.sh
    

    where automake has already setup pkgdatadir.