开发者

Autotools copy data files to staging area

So I've been working with Autotools trying to learn the toolchain so I can use it in some of my cross-platform projects. I've got a pretty good handle on the very basics, but I've run into an issue here.

In my source tree I have a "data" folder that contains a sub-directory with XML files and another sub-directory with image files.

i.e.:

data\
    cars\
    images

I want to be able to copy these files into the staging area using the same directory structure.

I've tried creating a Makefile.am in data and then doing something like:

data_DATA = cars/file1.xml cars/file2.xml images/image1.png images/image2.png

etc...

This "almost" works. It copies all of the files into the "share" folder in the staging area, but the underlying directory structure is lost; all of the files are in the 'share' root.

Any tips on how to accomplish this?


Edit:

Ahh I seem to have figured it out (I think.)

data_carsdir = $(prefix)/data/cars
data_cars_DATA =  cars/file1.xml cars/file2.xml

data_imagesdir = $(prefix)/data/images
data_images_DATA =  imag开发者_如何学Ces/image1.png images/image1.png

This seems to work the way I want.


What you want is:

nobase_data_DATA = cars/file1.xml cars/file2.xml \
                   images/image1.png images/image2.png
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜