summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-03-02 10:57:56 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-03-14 05:26:49 -0400
commit4f117135673b36816c343bc11efcbb8396160c75 (patch)
tree23af6eaaef1bef8e7298bbcb452510dfde8df96f
parentb989845e378081f0932a7fec528e68daeeaa14fb (diff)
downloadhaskell-4f117135673b36816c343bc11efcbb8396160c75.tar.gz
Make: refactor GMP rules
Document and use simpler rules for the ghc-gmp.h header.
-rw-r--r--libraries/integer-gmp/gmp/ghc.mk15
1 files changed, 8 insertions, 7 deletions
diff --git a/libraries/integer-gmp/gmp/ghc.mk b/libraries/integer-gmp/gmp/ghc.mk
index 4272e86924..9fb13ecb79 100644
--- a/libraries/integer-gmp/gmp/ghc.mk
+++ b/libraries/integer-gmp/gmp/ghc.mk
@@ -43,8 +43,6 @@ ifeq "$(GMP_PREFER_FRAMEWORK)" "YES"
libraries/integer-gmp_CONFIGURE_OPTS += --with-gmp-framework-preferred
endif
-ifeq "$(phase)" "final"
-
ifneq "$(CLEANING)" "YES"
# Hack. The file config.mk doesn't exist yet after running ./configure in
# the toplevel (ghc) directory. To let some toplevel make commands such as
@@ -85,20 +83,24 @@ UseIntreeGmp = YES
endif
endif
+# wrappers.c includes "ghc-gmp.h"
+libraries/integer-gmp/cbits/wrappers.c: libraries/integer-gmp/include/ghc-gmp.h
+
ifeq "$(UseIntreeGmp)" "YES"
-$(libraries/integer-gmp_dist-install_depfile_c_asm): libraries/integer-gmp/gmp/gmp.h libraries/integer-gmp/include/ghc-gmp.h
+# Copy header from in-tree build (gmp.h => ghc-gmp.h)
libraries/integer-gmp/include/ghc-gmp.h: libraries/integer-gmp/gmp/gmp.h
$(CP) $< $@
-gmp_CC_OPTS += -Ilibraries/integer-gmp/gmp
-
+# Link in-tree GMP objects
libraries/integer-gmp_dist-install_EXTRA_OBJS += libraries/integer-gmp/gmp/objs/*.o
+
else
-$(libraries/integer-gmp_dist-install_depfile_c_asm): libraries/integer-gmp/include/ghc-gmp.h
+# Copy header from source tree
libraries/integer-gmp/include/ghc-gmp.h: libraries/integer-gmp/gmp/ghc-gmp.h
$(CP) $< $@
+
endif
libraries/integer-gmp_dist-install_EXTRA_CC_OPTS += $(gmp_CC_OPTS)
@@ -135,4 +137,3 @@ libraries/integer-gmp/gmp/libgmp.a libraries/integer-gmp/gmp/gmp.h:
$(RANLIB_CMD) libraries/integer-gmp/gmp/libgmp.a
endif # CLEANING
-endif # phase