summaryrefslogtreecommitdiffstats
path: root/scripts/t/mk
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/t/mk')
-rw-r--r--scripts/t/mk/architecture.mk60
-rw-r--r--scripts/t/mk/buildapi.mk13
-rw-r--r--scripts/t/mk/buildflags.mk53
-rw-r--r--scripts/t/mk/buildopts.mk11
-rw-r--r--scripts/t/mk/buildtools.mk64
-rw-r--r--scripts/t/mk/pkg-info.mk31
-rw-r--r--scripts/t/mk/vendor-v0.mk1
-rw-r--r--scripts/t/mk/vendor-v1.mk1
-rw-r--r--scripts/t/mk/vendor.mk17
9 files changed, 150 insertions, 101 deletions
diff --git a/scripts/t/mk/architecture.mk b/scripts/t/mk/architecture.mk
index 2ac0222..295b804 100644
--- a/scripts/t/mk/architecture.mk
+++ b/scripts/t/mk/architecture.mk
@@ -1,36 +1,28 @@
+DEB_BUILD_ARCH := overridden
+TEST_DEB_BUILD_ARCH := overridden
+
include $(srcdir)/mk/architecture.mk
-test:
- test "$(DEB_BUILD_ARCH)" = "$(TEST_DEB_BUILD_ARCH)"
- test "$(DEB_BUILD_ARCH_ABI)" = "$(TEST_DEB_BUILD_ARCH_ABI)"
- test "$(DEB_BUILD_ARCH_BITS)" = "$(TEST_DEB_BUILD_ARCH_BITS)"
- test "$(DEB_BUILD_ARCH_CPU)" = "$(TEST_DEB_BUILD_ARCH_CPU)"
- test "$(DEB_BUILD_ARCH_ENDIAN)" = "$(TEST_DEB_BUILD_ARCH_ENDIAN)"
- test "$(DEB_BUILD_ARCH_LIBC)" = "$(TEST_DEB_BUILD_ARCH_LIBC)"
- test "$(DEB_BUILD_ARCH_OS)" = "$(TEST_DEB_BUILD_ARCH_OS)"
- test "$(DEB_BUILD_GNU_CPU)" = "$(TEST_DEB_BUILD_GNU_CPU)"
- test "$(DEB_BUILD_GNU_SYSTEM)" = "$(TEST_DEB_BUILD_GNU_SYSTEM)"
- test "$(DEB_BUILD_GNU_TYPE)" = "$(TEST_DEB_BUILD_GNU_TYPE)"
- test "$(DEB_BUILD_MULTIARCH)" = "$(TEST_DEB_BUILD_MULTIARCH)"
- test "$(DEB_HOST_ARCH)" = "$(TEST_DEB_HOST_ARCH)"
- test "$(DEB_HOST_ARCH_ABI)" = "$(TEST_DEB_HOST_ARCH_ABI)"
- test "$(DEB_HOST_ARCH_BITS)" = "$(TEST_DEB_HOST_ARCH_BITS)"
- test "$(DEB_HOST_ARCH_CPU)" = "$(TEST_DEB_HOST_ARCH_CPU)"
- test "$(DEB_HOST_ARCH_ENDIAN)" = "$(TEST_DEB_HOST_ARCH_ENDIAN)"
- test "$(DEB_HOST_ARCH_LIBC)" = "$(TEST_DEB_HOST_ARCH_LIBC)"
- test "$(DEB_HOST_ARCH_OS)" = "$(TEST_DEB_HOST_ARCH_OS)"
- test "$(DEB_HOST_GNU_CPU)" = "$(TEST_DEB_HOST_GNU_CPU)"
- test "$(DEB_HOST_GNU_SYSTEM)" = "$(TEST_DEB_HOST_GNU_SYSTEM)"
- test "$(DEB_HOST_GNU_TYPE)" = "$(TEST_DEB_HOST_GNU_TYPE)"
- test "$(DEB_HOST_MULTIARCH)" = "$(TEST_DEB_HOST_MULTIARCH)"
- test "$(DEB_TARGET_ARCH)" = "$(TEST_DEB_TARGET_ARCH)"
- test "$(DEB_TARGET_ARCH_ABI)" = "$(TEST_DEB_TARGET_ARCH_ABI)"
- test "$(DEB_TARGET_ARCH_BITS)" = "$(TEST_DEB_TARGET_ARCH_BITS)"
- test "$(DEB_TARGET_ARCH_CPU)" = "$(TEST_DEB_TARGET_ARCH_CPU)"
- test "$(DEB_TARGET_ARCH_ENDIAN)" = "$(TEST_DEB_TARGET_ARCH_ENDIAN)"
- test "$(DEB_TARGET_ARCH_LIBC)" = "$(TEST_DEB_TARGET_ARCH_LIBC)"
- test "$(DEB_TARGET_ARCH_OS)" = "$(TEST_DEB_TARGET_ARCH_OS)"
- test "$(DEB_TARGET_GNU_CPU)" = "$(TEST_DEB_TARGET_GNU_CPU)"
- test "$(DEB_TARGET_GNU_SYSTEM)" = "$(TEST_DEB_TARGET_GNU_SYSTEM)"
- test "$(DEB_TARGET_GNU_TYPE)" = "$(TEST_DEB_TARGET_GNU_TYPE)"
- test "$(DEB_TARGET_MULTIARCH)" = "$(TEST_DEB_TARGET_MULTIARCH)"
+vars := \
+ ARCH \
+ ARCH_ABI \
+ ARCH_BITS \
+ ARCH_CPU \
+ ARCH_ENDIAN \
+ ARCH_LIBC \
+ ARCH_OS \
+ GNU_CPU \
+ GNU_SYSTEM \
+ GNU_TYPE \
+ MULTIARCH \
+ # EOL
+loop_targets := $(foreach machine,BUILD HOST TARGET,\
+ $(foreach var,$(vars),DEB_$(machine)_$(var)))
+
+test: $(loop_targets)
+
+$(loop_targets):
+ : # Test the $@ Make variable.
+ test '$($@)' = '$(TEST_$@)'
+ : # Test the $@ exported variable.
+ test "$${$@}" = '$(TEST_$@)'
diff --git a/scripts/t/mk/buildapi.mk b/scripts/t/mk/buildapi.mk
index 96269bc..6ac92f9 100644
--- a/scripts/t/mk/buildapi.mk
+++ b/scripts/t/mk/buildapi.mk
@@ -1,4 +1,13 @@
include $(srcdir)/mk/buildapi.mk
-test:
- test "$(DPKG_BUILD_API)" = "0"
+TEST_DPKG_BUILD_API = 0
+
+test_vars := \
+ DPKG_BUILD_API \
+ # EOL
+
+test: $(test_vars)
+
+$(test_vars):
+ : # Test $@ Make variable.
+ test '$($@)' = '$(TEST_$@)'
diff --git a/scripts/t/mk/buildflags.mk b/scripts/t/mk/buildflags.mk
index 94d85a7..74ccac0 100644
--- a/scripts/t/mk/buildflags.mk
+++ b/scripts/t/mk/buildflags.mk
@@ -1,26 +1,37 @@
DEB_CPPFLAGS_MAINT_APPEND = -DTEST_MK=test-host
+TEST_CPPFLAGS += -DTEST_MK=test-host
+
DEB_CPPFLAGS_FOR_BUILD_MAINT_APPEND = -DTEST_MK=test-build
+TEST_CPPFLAGS_FOR_BUILD += -DTEST_MK=test-build
+
+DEB_CXXFLAGS_MAINT_SET := set-host
+TEST_CXXFLAGS := set-host
+
+DEB_CXXFLAGS_FOR_BUILD_MAINT_SET := set-build
+TEST_CXXFLAGS_FOR_BUILD := set-build
+
+DPKG_EXPORT_BUILDFLAGS := 1
include $(srcdir)/mk/buildflags.mk
-test:
- test "$(ASFLAGS)" = "$(TEST_ASFLAGS)"
- test "$(ASFLAGS_FOR_BUILD)" = "$(TEST_ASFLAGS_FOR_BUILD)"
- test "$(CFLAGS)" = "$(TEST_CFLAGS)"
- test "$(CFLAGS_FOR_BUILD)" = "$(TEST_CFLAGS_FOR_BUILD)"
- test "$(CPPFLAGS)" = "$(TEST_CPPFLAGS) -DTEST_MK=test-host"
- test "$(CPPFLAGS_FOR_BUILD)" = "$(TEST_CPPFLAGS_FOR_BUILD)-DTEST_MK=test-build"
- test "$(CXXFLAGS)" = "$(TEST_CXXFLAGS)"
- test "$(CXXFLAGS_FOR_BUILD)" = "$(TEST_CXXFLAGS_FOR_BUILD)"
- test "$(DFLAGS)" = "$(TEST_DFLAGS)"
- test "$(DFLAGS_FOR_BUILD)" = "$(TEST_DFLAGS_FOR_BUILD)"
- test "$(FCFLAGS)" = "$(TEST_FCFLAGS)"
- test "$(FCFLAGS_FOR_BUILD)" = "$(TEST_FCFLAGS_FOR_BUILD)"
- test "$(FFLAGS)" = "$(TEST_FFLAGS)"
- test "$(FFLAGS_FOR_BUILD)" = "$(TEST_FFLAGS_FOR_BUILD)"
- test "$(LDFLAGS)" = "$(TEST_LDFLAGS)"
- test "$(LDFLAGS_FOR_BUILD)" = "$(TEST_LDFLAGS_FOR_BUILD)"
- test "$(OBJCFLAGS)" = "$(TEST_OBJCFLAGS)"
- test "$(OBJCFLAGS_FOR_BUILD)" = "$(TEST_OBJCFLAGS_FOR_BUILD)"
- test "$(OBJCXXFLAGS)" = "$(TEST_OBJCXXFLAGS)"
- test "$(OBJCXXFLAGS_FOR_BUILD)" = "$(TEST_OBJCXXFLAGS_FOR_BUILD)"
+vars := \
+ ASFLAGS \
+ CFLAGS \
+ CPPFLAGS \
+ CXXFLAGS \
+ DFLAGS \
+ FCFLAGS \
+ FFLAGS \
+ LDFLAGS \
+ OBJCFLAGS \
+ OBJCXXFLAGS \
+ # EOL
+loop_targets := $(vars) $(vars:=_FOR_BUILD)
+
+test: $(loop_targets)
+
+$(loop_targets):
+ : # Test the $@ Make variable.
+ test '$($@)' = '$(TEST_$@)'
+ : # Test the $@ exported variable.
+ test "$${$@}" = '$(TEST_$@)'
diff --git a/scripts/t/mk/buildopts.mk b/scripts/t/mk/buildopts.mk
index 46d0efa..a7cf2a3 100644
--- a/scripts/t/mk/buildopts.mk
+++ b/scripts/t/mk/buildopts.mk
@@ -1,4 +1,11 @@
include $(srcdir)/mk/buildopts.mk
-test:
- test "$(DEB_BUILD_OPTION_PARALLEL)" = "$(TEST_DEB_BUILD_OPTION_PARALLEL)"
+test_vars := \
+ DEB_BUILD_OPTION_PARALLEL \
+ # EOL
+
+test: $(test_vars)
+
+$(test_vars):
+ : # Test the $@ Make variable.
+ test '$($@)' = '$(TEST_$@)'
diff --git a/scripts/t/mk/buildtools.mk b/scripts/t/mk/buildtools.mk
index 6c27c5c..745e03b 100644
--- a/scripts/t/mk/buildtools.mk
+++ b/scripts/t/mk/buildtools.mk
@@ -1,33 +1,35 @@
+AR := overridden
+TEST_AR := overridden
+TEST_AR_FOR_BUILD := overridden
+
+DPKG_EXPORT_BUILDTOOLS := 1
+
include $(srcdir)/mk/buildtools.mk
-test:
- test "$(AS)" = "$(TEST_AS)"
- test "$(AS_FOR_BUILD)" = "$(TEST_AS_FOR_BUILD)"
- test "$(CC)" = "$(TEST_CC)"
- test "$(CC_FOR_BUILD)" = "$(TEST_CC_FOR_BUILD)"
- test "$(CXX)" = "$(TEST_CXX)"
- test "$(CXX_FOR_BUILD)" = "$(TEST_CXX_FOR_BUILD)"
- test "$(OBJC)" = "$(TEST_OBJC)"
- test "$(OBJC_FOR_BUILD)" = "$(TEST_OBJC_FOR_BUILD)"
- test "$(OBJCXX)" = "$(TEST_OBJCXX)"
- test "$(OBJCXX_FOR_BUILD)" = "$(TEST_OBJCXX_FOR_BUILD)"
- test "$(F77)" = "$(TEST_F77)"
- test "$(F77_FOR_BUILD)" = "$(TEST_F77_FOR_BUILD)"
- test "$(FC)" = "$(TEST_FC)"
- test "$(FC_FOR_BUILD)" = "$(TEST_FC_FOR_BUILD)"
- test "$(LD)" = "$(TEST_LD)"
- test "$(LD_FOR_BUILD)" = "$(TEST_LD_FOR_BUILD)"
- test "$(STRIP)" = "$(TEST_STRIP)"
- test "$(STRIP_FOR_BUILD)" = "$(TEST_STRIP_FOR_BUILD)"
- test "$(OBJCOPY)" = "$(TEST_OBJCOPY)"
- test "$(OBJCOPY_FOR_BUILD)" = "$(TEST_OBJCOPY_FOR_BUILD)"
- test "$(OBJDUMP)" = "$(TEST_OBJDUMP)"
- test "$(OBJDUMP_FOR_BUILD)" = "$(TEST_OBJDUMP_FOR_BUILD)"
- test "$(NM)" = "$(TEST_NM)"
- test "$(NM_FOR_BUILD)" = "$(TEST_NM_FOR_BUILD)"
- test "$(AR)" = "$(TEST_AR)"
- test "$(AR_FOR_BUILD)" = "$(TEST_AR_FOR_BUILD)"
- test "$(RANLIB)" = "$(TEST_RANLIB)"
- test "$(RANLIB_FOR_BUILD)" = "$(TEST_RANLIB_FOR_BUILD)"
- test "$(PKG_CONFIG)" = "$(TEST_PKG_CONFIG)"
- test "$(PKG_CONFIG_FOR_BUILD)" = "$(TEST_PKG_CONFIG_FOR_BUILD)"
+tools := \
+ AR \
+ AS \
+ CC \
+ CPP \
+ CXX \
+ F77 \
+ FC \
+ LD \
+ NM \
+ OBJC \
+ OBJCOPY \
+ OBJCXX \
+ OBJDUMP \
+ PKG_CONFIG \
+ RANLIB \
+ STRIP \
+ # EOL
+loop_targets := $(tools) $(tools:=_FOR_BUILD)
+
+test: $(loop_targets)
+
+$(loop_targets):
+ : # Test the $@ Make variable.
+ test '$($@)' = '$(TEST_$@)'
+ : # Test the $@ exported variable.
+ test "$${$@}" = '$(TEST_$@)'
diff --git a/scripts/t/mk/pkg-info.mk b/scripts/t/mk/pkg-info.mk
index c0e3287..6eb3786 100644
--- a/scripts/t/mk/pkg-info.mk
+++ b/scripts/t/mk/pkg-info.mk
@@ -1,11 +1,26 @@
include $(srcdir)/mk/pkg-info.mk
-test:
- test "$(DEB_SOURCE)" = "source"
- test "$(DEB_VERSION)" = "1:2:3.4-5-6"
- test "$(DEB_VERSION_EPOCH_UPSTREAM)" = "1:2:3.4-5"
- test "$(DEB_VERSION_UPSTREAM_REVISION)" = "2:3.4-5-6"
- test "$(DEB_VERSION_UPSTREAM)" = "2:3.4-5"
- test "$(DEB_DISTRIBUTION)" = "suite"
- test '$(SOURCE_DATE_EPOCH)' = '$(TEST_SOURCE_DATE_EPOCH)'
+TEST_DEB_SOURCE = source
+TEST_DEB_VERSION = 1:2:3.4-5-6
+TEST_DEB_VERSION_EPOCH_UPSTREAM = 1:2:3.4-5
+TEST_DEB_VERSION_UPSTREAM_REVISION = 2:3.4-5-6
+TEST_DEB_VERSION_UPSTREAM = 2:3.4-5
+TEST_DEB_DISTRIBUTION = suite
+
+test_vars := \
+ DEB_SOURCE \
+ DEB_VERSION \
+ DEB_VERSION_EPOCH_UPSTREAM \
+ DEB_VERSION_UPSTREAM_REVISION \
+ DEB_VERSION_UPSTREAM \
+ DEB_DISTRIBUTION \
+ SOURCE_DATE_EPOCH \
+ # EOL
+
+test: $(test_vars)
+ : # Test the SOURCE_DATE_EPOCH exported variable.
test "$${SOURCE_DATE_EPOCH}" = '$(TEST_SOURCE_DATE_EPOCH)'
+
+$(test_vars):
+ : # Test the $@ Make variable.
+ test '$($@)' = '$(TEST_$@)'
diff --git a/scripts/t/mk/vendor-v0.mk b/scripts/t/mk/vendor-v0.mk
index 602a8c6..fbd0ba1 100644
--- a/scripts/t/mk/vendor-v0.mk
+++ b/scripts/t/mk/vendor-v0.mk
@@ -3,4 +3,5 @@ dpkg_vendor_derives_from = $(dpkg_vendor_derives_from_v0)
include $(srcdir)/mk/vendor.mk
test:
+ : # Test the dpkg_vendor_derives_from v0 macro.
test "$(shell $(call dpkg_vendor_derives_from,debian))" = "yes"
diff --git a/scripts/t/mk/vendor-v1.mk b/scripts/t/mk/vendor-v1.mk
index 11c1314..d468570 100644
--- a/scripts/t/mk/vendor-v1.mk
+++ b/scripts/t/mk/vendor-v1.mk
@@ -3,4 +3,5 @@ include $(srcdir)/mk/vendor.mk
dpkg_vendor_derives_from = $(dpkg_vendor_derives_from_v1)
test:
+ : # Test the dpkg_vendor_derives_from v1 macro.
test "$(call dpkg_vendor_derives_from,debian)" = "yes"
diff --git a/scripts/t/mk/vendor.mk b/scripts/t/mk/vendor.mk
index 4e0d9ff..9d89f0f 100644
--- a/scripts/t/mk/vendor.mk
+++ b/scripts/t/mk/vendor.mk
@@ -1,6 +1,17 @@
include $(srcdir)/mk/vendor.mk
-test:
- test "$(DEB_VENDOR)" = "Debian"
- test "$(DEB_PARENT_VENDOR)" = ""
+TEST_DEB_VENDOR = Debian
+TEST_DEB_PARENT_VENDOR =
+
+test_vars := \
+ DEB_VENDOR \
+ DEB_PARENT_VENDOR \
+ # EOL
+
+test: $(test_vars)
+ : # Test the dpkg_vendor_derives_from macro.
test "$(shell $(call dpkg_vendor_derives_from,debian))" = "yes"
+
+$(test_vars):
+ : # Test $@ Make variable.
+ test '$($@)' = '$(TEST_$@)'