Autotools将数据文件复制到暂存区
因此,我一直在与 Autotools 合作,尝试学习工具链,以便我可以在一些跨平台项目中使用它。我已经很好地掌握了基础知识,但我在这里遇到了一个问题。
在我的源代码树中,我有一个“data”文件夹,其中包含一个包含 XML 文件的子目录和另一个包含图像文件的子目录。
即:
data\
cars\
images
我希望能够使用相同的目录结构将这些文件复制到暂存区域。
我尝试在数据中创建 Makefile.am,然后执行类似以下操作:
data_DATA = cars/file1.xml cars/file2.xml images/image1.png images/image2.png
等等...
这“几乎”有效。它将所有文件复制到暂存区域的“共享”文件夹中,但底层目录结构丢失;所有文件都位于“共享”根目录中。
关于如何实现这一目标有什么建议吗?
编辑:
啊,我似乎已经弄清楚了(我想)。
data_carsdir = $(prefix)/data/cars
data_cars_DATA = cars/file1.xml cars/file2.xml
data_imagesdir = $(prefix)/data/images
data_images_DATA = images/image1.png images/image1.png
这似乎按照我想要的方式工作。
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 = images/image1.png images/image1.png
This seems to work the way I want.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你想要的是:
What you want is: