我可以在 Makefile 中区分 "all" 与特定的 debian arch

Can I differentiate "all" vs specific debian arch in a Makefile

我正在开发一个私有构建系统,该系统使用顶级 Makefile 生成 debian 软件包。通过包含 /usr/share/dpkg/default.mk,我从 debian/control 和 debian/changelog 中获取包名称和版本。还有 $(DEB_TARGET_ARCH),这很有用,除非它不够聪明,无法注意到包是否为 "all" 架构。 有没有官方的方法可以在构建时获取包 arch? 就目前而言,我需要 2 个版本。一个用于 arch(例如 "amd64")包,一个用于 "all"

这是我的 Makefile 的顶部

include /usr/share/dpkg/default.mk

DEB_PKG := ../$(DEB_SOURCE)_$(DEB_VERSION)_all.deb
my_stuff := blabity blah and so forth

all:

deb: $(DEB_PKG)

$(DEB_PKG): debian $(my_stuff)
        gbp buildpackage --git-ignore-new

我认为在一般情况下您无法确定 Debian 软件包构建是否只会生成与体系结构无关的软件包。你必须 运行 debian/rules binary 看看会产生什么。即使是 debian/control 中列出的软件包,最终也可能不会实际构建。