【问题标题】:How to setup autotools for glib-compile-resources?如何为 glib-compile-resources 设置自动工具?
【发布时间】:2021-09-07 10:45:29
【问题描述】:

如何设置我的Makefile.am 文件以运行glib-compile-resources 来编译资源。

这是我的Makefile.am 目前的样子:


INTLTOOL_FILES = intltool-extract.in \
                 intltool-merge.in \
                 intltool-update.in

ACLOCAL_AMFLAGS = -I m4

SUBDIRS = src data po gnome pixmaps dicfiles

EXTRA_DIST = COPYING rpm/gjiten.spec scripts/make_debs scripts/make_release\
         intltool-extract.in intltool-merge.in intltool-update.in


DISTCLEANFILES = ${INTLTOOL_FILES} \
                 po/.intltool-merge-cache

MAINTAINERCLEANFILES += configure config.sub config.guess aclocal.m4 compile \
      depcomp install-sh \
      ${DISTCLEANFILES} intltool-extract intltool-merge intltool-update.in \
        ltmain.sh missing mkinstalldirs config.h.in po/*stamp* *stamp* 

或者我必须在 autogen.h 或 configure.ac 中设置命令吗?

【问题讨论】:

  • 一般情况下,您不应在 CLEANFILESDISTCLEANFILESMAINTAINERCLEANFILES 中明确命名 Autotools 生成的文件。 Automake 已经知道这些,并会在适当的时候清理它们。它还知道哪些文件根本不应该被清理,并且您已将其中一些文件放在您的MAINTAINERCLEAN 列表中。

标签: gtk autotools


【解决方案1】:

如何设置我的Makefile.am 文件以运行glib-compile-resources 来编译资源。

有很多方法,但我向您推荐的方法是add an all-local target。例如:

all-local:
        glib-compile-resources

您还需要确保清理生成的文件,这可以通过将它们添加到CLEANFILES 或通过使用适当的配方添加clean-local 目标来完成。

【讨论】:

  • 我还需要使用SUBDIRS = . src data po gnome pixmaps dicfiles 强制首先处理顶级目录(来自stackoverflow.com/a/34957591/6702598 的建议)。也许您可以将其添加到您的答案中?
  • 不,我不认为,因为任何需要这样的步骤是问题中未提出的项目细节的特征。我很满意您已经提供的评论足以作为建议。
猜你喜欢
  • 2016-10-27
  • 1970-01-01
  • 1970-01-01
  • 2013-12-12
  • 1970-01-01
  • 2011-02-13
  • 2015-05-20
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多