summaryrefslogtreecommitdiffstats
path: root/scripts/mk/vendor.mk
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mk/vendor.mk')
-rw-r--r--scripts/mk/vendor.mk15
1 files changed, 10 insertions, 5 deletions
diff --git a/scripts/mk/vendor.mk b/scripts/mk/vendor.mk
index f3241a5..43898d9 100644
--- a/scripts/mk/vendor.mk
+++ b/scripts/mk/vendor.mk
@@ -33,13 +33,16 @@
# ...
# endif
-dpkg_datadir = $(srcdir)/mk
-include $(dpkg_datadir)/buildapi.mk
+ifndef dpkg_vendor_mk_included
+dpkg_vendor_mk_included = yes
-dpkg_late_eval ?= $(or $(value DPKG_CACHE_$(1)),$(eval DPKG_CACHE_$(1) := $(shell $(2)))$(value DPKG_CACHE_$(1)))
+dpkg_datadir ?= $(dir $(lastword $(MAKEFILE_LIST)))
+include $(dpkg_datadir)/buildapi.mk
-DEB_VENDOR = $(call dpkg_late_eval,DEB_VENDOR,dpkg-vendor --query Vendor)
-DEB_PARENT_VENDOR = $(call dpkg_late_eval,DEB_PARENT_VENDOR,dpkg-vendor --query Parent)
+dpkg_lazy_eval ?= $(eval $(1) = $(2)$$($(1)))
+dpkg_lazy_set ?= $(call dpkg_lazy_eval,$(1),$$(eval $(1) := $(2)))
+$(call dpkg_lazy_set,DEB_VENDOR,$$(shell dpkg-vendor --query Vendor))
+$(call dpkg_lazy_set,DEB_PARENT_VENDOR,$$(shell dpkg-vendor --query Parent))
dpkg_vendor_derives_from_v0 = dpkg-vendor --derives-from $(1) && echo yes || echo no
dpkg_vendor_derives_from_v1 = $(shell $(dpkg_vendor_derives_from_v0))
@@ -49,3 +52,5 @@ dpkg_vendor_derives_from ?= $(dpkg_vendor_derives_from_v1)
else
dpkg_vendor_derives_from ?= $(dpkg_vendor_derives_from_v0)
endif
+
+endif # dpkg_vendor_mk_included