I always try to write nonrecursive makefiles. But now I'm working on
a project that has several trees of files that all need to go to
different places, while preserving their relative hierarchy. For
example I have $(top_srcdir)/www/cgi-bin/* that needs to go to
$(cgidir), and $(top_srcdir)/perlmod/* that needs to go to perl's
sitelibdir.
For now I just make sub-makefiles in each of the base directories for
each of these hierarchies, but it would be nice if I could install all
files to their correct places using just the single toplevel
Makefile.am.
Right now I have in the toplevel Makefile.am:
dist_rsperlmod_DATA = \
perlmod/Rocketseed/CGI.pm \
perlmod/Rocketseed/LDAP.pm \
perlmod/Rocketseed/Table/Cell.pm \
perlmod/Rocketseed/Table.pm \
perlmod/Rocketseed/Template.pm \
perlmod/Rocketseed/Tracker.pm \
perlmod/Rocketseed/Treepath.pm \
perlmod/Rocketseed/Treeview.pm
and then I install all of those into $(sitelibdir)/Rocketseed.
Unfortunately, Rocketseed::Table::Cell.pm ends up in te same directory
as all the others.
What I'd like to be able to do is something like this:
nobase_1_dist_perlmod_DATA = \
perlmod/Rocketseed/CGI.pm \
perlmod/Rocketseed/LDAP.pm \
perlmod/Rocketseed/Table/Cell.pm \
perlmod/Rocketseed/Table.pm \
perlmod/Rocketseed/Template.pm \
perlmod/Rocketseed/Tracker.pm \
perlmod/Rocketseed/Treepath.pm \
perlmod/Rocketseed/Treeview.pm
where the '1' would tell automake to strip just 1 pathname component.
A bit like patch -pN does.