Try to improve Make dependency for `ghc-gmp.h`
authorHerbert Valerio Riedel <hvr@gnu.org>
Mon, 24 Nov 2014 11:01:37 +0000 (12:01 +0100)
committerHerbert Valerio Riedel <hvr@gnu.org>
Mon, 24 Nov 2014 11:43:19 +0000 (12:43 +0100)
This will hopefully workaround an issue where
`libraries/integer-gmp2/include/ghc-gmp.h` gets deleted
during cleanup but isn't regenerated.

This situation is caused by `./validate` cleaning the tree with

  $make maintainer-clean NO_CLEAN_GMP=YES

which doesn't doesn't clean the `gmp/` folder, and so the `include/ghc-gmp.h`
file wasn't recreated (as it was previously a side-effect of building
the intree GMP).

Reviewed By: luite

Differential Revision: https://phabricator.haskell.org/D523

libraries/integer-gmp2/gmp/ghc.mk

index 5bc3131..45991d0 100644 (file)
@@ -84,7 +84,10 @@ endif
 endif
 
 ifeq "$(UseIntreeGmp)" "YES"
-$(libraries/integer-gmp2_dist-install_depfile_c_asm): libraries/integer-gmp2/gmp/gmp.h
+$(libraries/integer-gmp2_dist-install_depfile_c_asm): libraries/integer-gmp2/gmp/gmp.h libraries/integer-gmp2/include/ghc-gmp.h
+
+libraries/integer-gmp2/include/ghc-gmp.h: libraries/integer-gmp2/gmp/gmp.h
+       $(CP) $< $@
 
 gmp_CC_OPTS += -Ilibraries/integer-gmp2/gmp
 
@@ -128,7 +131,6 @@ libraries/integer-gmp2/gmp/libgmp.a libraries/integer-gmp2/gmp/gmp.h:
                  --host=$(HOSTPLATFORM) --build=$(BUILDPLATFORM)
        $(MAKE) -C libraries/integer-gmp2/gmp/gmpbuild MAKEFLAGS=
        $(CP) libraries/integer-gmp2/gmp/gmpbuild/gmp.h libraries/integer-gmp2/gmp/
-       $(CP) libraries/integer-gmp2/gmp/gmpbuild/gmp.h libraries/integer-gmp2/include/ghc-gmp.h
        $(CP) libraries/integer-gmp2/gmp/gmpbuild/.libs/libgmp.a libraries/integer-gmp2/gmp/
        $(MKDIRHIER) libraries/integer-gmp2/gmp/objs
        cd libraries/integer-gmp2/gmp/objs && $(AR_STAGE1) x ../libgmp.a