I'm trying to create CGI application in C++ that uses autotools build system. This application will be an interface to my embedded device.
As a result of make
/make all
I have bin
directory with *.cgi executables, previously prepared html-templates
and images
directory and lighttpd configuration file.
I need to move my content to proper directories of target device, i.e.:
- all .cgi from bin move to $(wwwdir)/cgi-bin where if not specified than wwwdir would be /var/www/
images
directory recursively to the same $(wwwdir) directory- all of the html templates to $(datarootdir)/$(PACKAGE_NAME)
- lighttpd.conf to $(sysconfdir)
List of my programs is defined like so:bin_PROGRAMS=$(top_builddir)/bin/main.cgi
(here only one main.cgi)
Is there an elegant way to specify installation steps using configure.ac/Makefile.am file so that once user (or some other build system) runs make install
all files will get where they supposed to?
Currently as a result of make install
- binary file main.cgi
lands in /usr/local/bin/
.