Commit aa06f5d7 authored by ian@well-typed.com's avatar ian@well-typed.com

Follow build system changes in integer-gmp

Also a couple of other fixes and sanity checks along the way.
parent 9e4e2c24
...@@ -614,8 +614,10 @@ endif ...@@ -614,8 +614,10 @@ endif
ifeq "$(INTEGER_LIBRARY)" "integer-gmp" ifeq "$(INTEGER_LIBRARY)" "integer-gmp"
BUILD_DIRS += libraries/integer-gmp/gmp BUILD_DIRS += libraries/integer-gmp/gmp
BUILD_DIRS += libraries/integer-gmp/mkGmpDerivedConstants
else ifneq "$(findstring clean,$(MAKECMDGOALS))" "" else ifneq "$(findstring clean,$(MAKECMDGOALS))" ""
BUILD_DIRS += libraries/integer-gmp/gmp BUILD_DIRS += libraries/integer-gmp/gmp
BUILD_DIRS += libraries/integer-gmp/mkGmpDerivedConstants
endif endif
ifeq "$(CrossCompiling)-$(phase)" "YES-final" ifeq "$(CrossCompiling)-$(phase)" "YES-final"
......
...@@ -220,7 +220,7 @@ endef ...@@ -220,7 +220,7 @@ endef
# And expand the above for each way: # And expand the above for each way:
$(foreach way,$(rts_WAYS),$(eval $(call build-rts-way,$(way)))) $(foreach way,$(rts_WAYS),$(eval $(call build-rts-way,$(way))))
$(eval $(call distdir-opts,rts,dist)) $(eval $(call distdir-opts,rts,dist,1))
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Flags for compiling every file # Flags for compiling every file
......
...@@ -152,7 +152,7 @@ $(call c-sources,$1,$2) ...@@ -152,7 +152,7 @@ $(call c-sources,$1,$2)
# --- IMPLICIT RULES # --- IMPLICIT RULES
$(call distdir-opts,$1,$2,,$3) $(call distdir-opts,$1,$2,$3)
$(call distdir-way-opts,$1,$2,$$($1_$2_PROGRAM_WAY),$3) $(call distdir-way-opts,$1,$2,$$($1_$2_PROGRAM_WAY),$3)
ifeq "$3" "0" ifeq "$3" "0"
...@@ -209,7 +209,9 @@ ifeq "$$(TargetOS_CPP)" "darwin" ...@@ -209,7 +209,9 @@ ifeq "$$(TargetOS_CPP)" "darwin"
ifneq "$3" "0" ifneq "$3" "0"
ifeq "$$($1_$2_PROGRAM_WAY)" "dyn" ifeq "$$($1_$2_PROGRAM_WAY)" "dyn"
# Use relative paths for all the libraries # Use relative paths for all the libraries
ifneq "$$($1_$2_TRANSITIVE_DEP_NAMES)" ""
install_name_tool $$(foreach d,$$($1_$2_TRANSITIVE_DEP_NAMES), -change $$(TOP)/$$($$($$d_INSTALL_INFO)_dyn_LIB) @loader_path/../$$d-$$($$($$d_INSTALL_INFO)_VERSION)/$$($$($$d_INSTALL_INFO)_dyn_LIB_NAME)) $$@ install_name_tool $$(foreach d,$$($1_$2_TRANSITIVE_DEP_NAMES), -change $$(TOP)/$$($$($$d_INSTALL_INFO)_dyn_LIB) @loader_path/../$$d-$$($$($$d_INSTALL_INFO)_VERSION)/$$($$($$d_INSTALL_INFO)_dyn_LIB_NAME)) $$@
endif
# Use relative paths for the RTS. Rather than try to work out which RTS # Use relative paths for the RTS. Rather than try to work out which RTS
# way is being linked, we just change it for all ways # way is being linked, we just change it for all ways
install_name_tool $$(foreach w,$$(rts_WAYS), -change $$(TOP)/$$(rts_$$w_LIB) @loader_path/../rts-$$(rts_VERSION)/$$(rts_$$w_LIB_NAME)) $$@ install_name_tool $$(foreach w,$$(rts_WAYS), -change $$(TOP)/$$(rts_$$w_LIB) @loader_path/../rts-$$(rts_VERSION)/$$(rts_$$w_LIB_NAME)) $$@
...@@ -232,11 +234,11 @@ ifneq "$$($1_$2_HS_SRCS)" "" ...@@ -232,11 +234,11 @@ ifneq "$$($1_$2_HS_SRCS)" ""
ifeq "$$(strip $$(ALL_STAGE1_LIBS))" "" ifeq "$$(strip $$(ALL_STAGE1_LIBS))" ""
$$(error ordering failure in $1 ($2): ALL_STAGE1_LIBS is empty) $$(error ordering failure in $1 ($2): ALL_STAGE1_LIBS is empty)
endif endif
endif
$1/$2/build/tmp/$$($1_$2_PROG) : $$(ALL_STAGE1_LIBS) $$(ALL_RTS_LIBS) $$(OTHER_LIBS) $1/$2/build/tmp/$$($1_$2_PROG) : $$(ALL_STAGE1_LIBS) $$(ALL_RTS_LIBS) $$(OTHER_LIBS)
endif endif
endif endif
endif endif
endif
ifneq "$$($1_$2_INSTALL_INPLACE)" "NO" ifneq "$$($1_$2_INSTALL_INPLACE)" "NO"
$(call all-target,$1_$2,$$($1_$2_INPLACE)) $(call all-target,$1_$2,$$($1_$2_INPLACE))
......
...@@ -15,6 +15,10 @@ ...@@ -15,6 +15,10 @@
define distdir-opts # args: $1 = dir, $2 = distdir, $3 = stage define distdir-opts # args: $1 = dir, $2 = distdir, $3 = stage
ifeq "$3" ""
$$(error Stage not given for distdir-opts $1 $2)
endif
ifeq "$3" "0" ifeq "$3" "0"
# This is a bit of a hack. # This is a bit of a hack.
# If we are compiling something with the bootstrapping compiler on # If we are compiling something with the bootstrapping compiler on
......
...@@ -140,6 +140,7 @@ $1_$2_$3_ALL_CC_OPTS = \ ...@@ -140,6 +140,7 @@ $1_$2_$3_ALL_CC_OPTS = \
$$($1_$2_DIST_GCC_CC_OPTS) \ $$($1_$2_DIST_GCC_CC_OPTS) \
$$($1_$2_$3_CC_OPTS) \ $$($1_$2_$3_CC_OPTS) \
$$($$(basename $$<)_CC_OPTS) \ $$($$(basename $$<)_CC_OPTS) \
$$($1_$2_EXTRA_CC_OPTS) \
$$(EXTRA_CC_OPTS) $$(EXTRA_CC_OPTS)
$1_$2_$3_GHC_CC_OPTS = \ $1_$2_$3_GHC_CC_OPTS = \
...@@ -148,6 +149,7 @@ $1_$2_$3_GHC_CC_OPTS = \ ...@@ -148,6 +149,7 @@ $1_$2_$3_GHC_CC_OPTS = \
$$($1_$2_DIST_CC_OPTS) \ $$($1_$2_DIST_CC_OPTS) \
$$($1_$2_$3_CC_OPTS) \ $$($1_$2_$3_CC_OPTS) \
$$($$(basename $$<)_CC_OPTS) \ $$($$(basename $$<)_CC_OPTS) \
$$($1_$2_EXTRA_CC_OPTS) \
$$(EXTRA_CC_OPTS)) \ $$(EXTRA_CC_OPTS)) \
$$($1_$2_$3_MOST_HC_OPTS) $$($1_$2_$3_MOST_HC_OPTS)
......
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