Commit 4f117135 authored by Sylvain Henry's avatar Sylvain Henry Committed by Marge Bot

Make: refactor GMP rules

Document and use simpler rules for the ghc-gmp.h header.
parent b989845e
Pipeline #16697 failed with stages
in 23 minutes and 23 seconds
......@@ -43,8 +43,6 @@ ifeq "$(GMP_PREFER_FRAMEWORK)" "YES"
libraries/integer-gmp_CONFIGURE_OPTS += --with-gmp-framework-preferred
ifeq "$(phase)" "final"
ifneq "$(CLEANING)" "YES"
# Hack. The file 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
# 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
$(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) $< $@
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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment