Check Cabal packages when validating
[ghc-hetmet.git] / rules / build-package.mk
index c598ef8..8e81389 100644 (file)
@@ -49,6 +49,14 @@ ifneq "$$($1_$2_GROUP)" ""
 all_$$($1_$2_GROUP): all_$1_$2
 endif
 
+ifneq "$$(CHECKED_$1)" "YES"
+CHECKED_$1 = YES
+check_packages: check_$1
+.PHONY: check_$1
+check_$1: $$(GHC_CABAL_INPLACE)
+       $$(GHC_CABAL_INPLACE) check $1
+endif
+
 distclean : clean_$1_$2_config
 
 maintainer-clean : distclean
@@ -150,7 +158,7 @@ endif # package-data.mk exists
 
 # Don't put bootstrapping packages in the bindist
 ifneq "$3" "0"
-BINDIST_EXTRAS += $1/*.cabal $1/$2/setup-config $1/LICENSE
+BINDIST_EXTRAS += $1/*.cabal $$(wildcard $1/*.buildinfo) $1/$2/setup-config $1/LICENSE
 BINDIST_EXTRAS += $$($1_$2_INSTALL_INCLUDES_SRCS)
 endif