Our test data is organized with two folders. We have TestData/
and TestVectors/
, depending on the form of the data:
- TestData
|
+ a.dat
+ b.dat
+ ...
- TestVector
|
+ x.vec
+ y.vec
+ ...
Our Makefile.am
has:
dist_pkgdata_DATA = \
$(testdata_FILES) \
$(testvector_FILES)
testdata_FILES = \
TestData/a.dat TestData/b.dat \
...
testvector_FILES = \
TestVectors/x.vec TestVectors/y.vec \
...
Automake installs them in @datadir@/@PACKAGE@/
, but we lose the TestData
and TestVectors
prefix upon installation. That is, once installed, all the files are lumped together:
- @datadir@/@PACKAGE@/
|
+ a.dat
+ b.dat
+ ...
+ x.vec
+ y.vec
+ ...
There's a very similar question at Install arbitrary data files in arbitrary locations with Automake?, but I am not quite following what needs to be done to ensure make install
works as expected.
My question is, how do we preserve the prefix of TestData
or TestVectors
during install?
This is what the nobase
prefix was invented for. The name stands for "don't call basename" and would be used like:
nobase_dist_pkgdata_DATA = \
$(testdata_FILES) \
$(testvector_FILES)
This should result in the listed files keeping their directory names in the install tree.