Dpkg::Vendor: Make the add_build_flags() a non-private method
[dpkg.git] / scripts / mk / vendor.mk
blobf3241a57be57455e6a400bf877a938cf42b9b94e
1 # This Makefile fragment (since dpkg 1.16.1) defines the following
2 # vendor-related variables:
4 # DEB_VENDOR: output of «dpkg-vendor --query Vendor».
5 # DEB_PARENT_VENDOR: output of «dpkg-vendor --query Parent» (can be empty).
7 # This Makefile fragment also defines a set of "dpkg_vendor_derives_from"
8 # macros that can be used to verify if the current vendor derives from
9 # another vendor. The unversioned variant defaults to the v0 version if
10 # undefined or to the v1 version when on build API 1, otherwise it can be
11 # defined explicitly to one of the versions or the versioned macros can be
12 # used directly. The following are example usages:
14 # - dpkg_vendor_derives_from (since dpkg 1.16.1)
16 # ifeq ($(shell $(call dpkg_vendor_derives_from,ubuntu)),yes)
17 # ...
18 # endif
20 # - dpkg_vendor_derives_from_v0 (since dpkg 1.19.3)
22 # ifeq ($(shell $(call dpkg_vendor_derives_from_v0,ubuntu)),yes)
23 # ...
24 # endif
26 # - dpkg_vendor_derives_from_v1 (since dpkg 1.19.3)
28 # dpkg_vendor_derives_from = $(dpkg_vendor_derives_from_v1)
29 # ifeq ($(call dpkg_vendor_derives_from,ubuntu),yes)
30 # ...
31 # endif
32 # ifeq ($(call dpkg_vendor_derives_from_v1,ubuntu),yes)
33 # ...
34 # endif
36 dpkg_datadir = $(srcdir)/mk
37 include $(dpkg_datadir)/buildapi.mk
39 dpkg_late_eval ?= $(or $(value DPKG_CACHE_$(1)),$(eval DPKG_CACHE_$(1) := $(shell $(2)))$(value DPKG_CACHE_$(1)))
41 DEB_VENDOR = $(call dpkg_late_eval,DEB_VENDOR,dpkg-vendor --query Vendor)
42 DEB_PARENT_VENDOR = $(call dpkg_late_eval,DEB_PARENT_VENDOR,dpkg-vendor --query Parent)
44 dpkg_vendor_derives_from_v0 = dpkg-vendor --derives-from $(1) && echo yes || echo no
45 dpkg_vendor_derives_from_v1 = $(shell $(dpkg_vendor_derives_from_v0))
47 ifeq ($(call dpkg_build_api_ge,1),yes)
48 dpkg_vendor_derives_from ?= $(dpkg_vendor_derives_from_v1)
49 else
50 dpkg_vendor_derives_from ?= $(dpkg_vendor_derives_from_v0)
51 endif