Ralf Wildenhues wrote: > > Stab in the dark: > Idea 1) > Put only everything to be installed both times in > bin_PROGRAMS > etc, the other stuff in > noinst_PROGRAMS > etc. Use install-data-local and install-exec-local for installing the > extra stuff within `make install', but only if some variable, say, > RELEASE is not set. Then make your release target like > > release: release-data release-exec > > release-data: > RELEASE=X $(MAKE) install-data > etc. >
This looks too much like a special case to me. I would be interested in a more general solution included with autoconf/automake. Something that doesn't have to be reinvented with every new project. > For your own install rules, look at how Automake writes them, they are a > bit tricky. You will have problems if you use Libtool libraries, > though, and need to adjust (hint: -rpath). Further trouble might loom > elsewhere. > Especially I don't want to write my own m4 macros to create additional install targets (speaking as a user of autoconf/ automake). The list of installation directories (predefined plus defined by the user) combined with the corresponding primaries should keep sufficient information for automake to provide the install targets. Actually the install targets created by Automake can install all files. Somehow it distinguishes between the different installation directories, too. To me it seems that it just needs some cleanup. > Tell us how it goes (I have not tried the above at all). > > Idea 2) > If you don't have to be able to do a `make release' from the same build > tree as you do `make install', you can just use Automake conditionals > and then > > if RELEASE > bin_PROGRAMS = ... > else > noinst_PROGRAMS = .. > endif > Both ideas imply to edit all Makefile.am files if somebody responsible for the top level Makefile.am would like to introduce yet another install target like 'make api' or whatever. I would prefer a more modular solution. > and adjust configure.ac (use AM_CONDITIONAL). This path will surely be > much less error-prone if it suits your needs. > > >>release: install_bin install_lib install_include install_data >> >>The "old" install target could work as before. > > > This already exists almost like you want: > make install-data, make install-exec. > but no make install-include, install-lib, etc. If I put something like api_includedir='$(prefix)/api/include' AC_SUBST([api_includedir]) into my configure.ac, and add api_include_HEADERS = \ src/booltype.h to a Makefile.am, then automake generates some targets install-api_includeHEADERS: $(api_include_HEADERS) and uninstall-api_includeHEADERS: The only thing missing is to generate another target listing all primaries for the installation dir, e.g. install-api_include: install-api_includeHEADERS uninstall-api_include: uninstall-api_includeHEADERS And this scheme should be followed for the default install dirs, too. Regards Harri