+## If nsdiff(1) is available then we can show what changes we will make if
+## we install the new zone files.
+ALL_ZONEDIFFS = $(foreach s,$(ZONESETS), \
+ $(foreach v,$($s_VIEWS), \
+ $(foreach z,$($s_all_ZONES) $($s_$v_ZONES), \
+ $v/$z.zonediff)))
+run-nsdiff = nsdiff -v "" $2 \
+ $($($(call notdir,$1)_ZONESET)_$(call dir-nosl,$1)_NSDIFF) \
+ $(call notdir,$1) $1.zone
+$(ALL_ZONEDIFFS) : %.zonediff : %.zone
+ $(call v_tag,NSDIFF)$(call run-nsdiff,$*,-q); \
+ rc=$$?; case $$rc in 1) $(call run-nsdiff,$*); rc=$$? ;; esac; \
+ case $$rc in 0 | 1) : ;; *) exit $$rc ;; esac
+diff: $(ALL_ZONEDIFFS)
+
+## Finally we have to install the zone files.
+ALL_INSTALLS = $(foreach s,$(ZONESETS), \
+ $(foreach v,$($s_VIEWS), \
+ $(foreach z,$($s_all_ZONES) $($s_$v_ZONES), \
+ $v/$z.inst)))
+$(ALL_INSTALLS) : %.inst : %.check
+ $(call v_tag,INST)$(ZONEINST) \
+ $(call dir-nosl,$*) $(notdir $*) <$*.zone
+install: $(ALL_INSTALLS)
+.PHONY: install $(ALL_INSTALLS)
+