Fix build on cygwin: Normalise slashes in .depend files to be /
[ghc-hetmet.git] / rules / build-package.mk
index f8c4813..cd02646 100644 (file)
@@ -46,7 +46,7 @@ maintainer-clean : distclean
 .PHONY: clean_$1_$2_config
 clean_$1_$2_config:
        "$$(RM)" $$(RM_OPTS) $1/config.log $1/config.status $1/include/Hs*Config.h
-       "$$(RM)" $$(RM_OPTS) -r $1/autom4te.cache
+       "$$(RM)" $$(RM_OPTS_REC) $1/autom4te.cache
 
 ifneq "$$($1_$2_NOT_NEEDED)" "YES"
 $$(eval $$(call build-package-helper,$1,$2,$3))
@@ -80,12 +80,12 @@ endif
 
 # --- CONFIGURATION
 
-$(call package-config,$1,$2,$3)
-
 ifneq "$$(NO_INCLUDE_PKGDATA)" "YES"
 include $1/$2/package-data.mk
 endif
 
+$(call package-config,$1,$2,$3)
+
 ifeq "$$($1_$2_DISABLE)" "YES"
 
 ifeq "$$(DEBUG)" "YES"
@@ -133,7 +133,7 @@ $(call includes-sources,$1,$2)
 $1_$2_WAYS_DASHED = $$(subst $$(space),,$$(patsubst %,-%,$$(strip $$($1_$2_WAYS))))
 $1_$2_depfile_base = $1/$2/build/.depend$$($1_$2_WAYS_DASHED)
 
-$(call build-dependencies,$1,$2)
+$(call build-dependencies,$1,$2,$3)
 
 # --- BUILDING
 
@@ -161,7 +161,9 @@ $$(foreach way,$$($1_$2_WAYS),$$(eval \
     $$(call build-package-way,$1,$2,$$(way),$3) \
   ))
 
+ifneq "$$($1_$2_HADDOCK_ME)" "NO"
 $(call haddock,$1,$2)
+endif
 
 endif # package-data.mk exists