用automake将头文件放在/usr/include的子目录中? [英] Placing header files in a subdirectory of /usr/include with automake?

查看:264
本文介绍了用automake将头文件放在/usr/include的子目录中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我编写了一个库,并且包含了用于开发的头文件,并且具有这样的src/Makefile.am:

If I write a library, and have header files for development included, and have a src/Makefile.am like this:

AM_CFLAGS = -std=c99 -Wall -Werror -Os
lib_LTLIBRARIES = libmylibrary.la
libmylibrary_la_SOURCES = a.c b.c
include_HEADERS = a.h b.h

一切正常.但是,a.hb.h直接安装在/usr/include(或/usr/local/include)下.我应该怎么做才能将它们安装在特定于我的库的子目录中,例如/usr/include/mylibrary?

Everything works nicely. However, a.h and b.h are installed directly under /usr/include (or /usr/local/include). What should I do to get them installed, in a subdirectory specific to my library, e.g. /usr/include/mylibrary?

推荐答案

以及您提到的pkginclude_HEADERS,您还可以将标头文件安装到/usr/include的任意子目录中,并使用您喜欢的任何名称,如下所示:

As well as pkginclude_HEADERS, which you mention, you can also install header files into an arbitrary subdirectory of /usr/include with any name you like, like this:

otherincludedir = $(includedir)/arbitrary_name
otherinclude_HEADERS = a.h b.h

这篇关于用automake将头文件放在/usr/include的子目录中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆