Use different exeext variables for each stage; fixes #7709
authorIan Lynagh <ian@well-typed.com>
Sat, 20 Apr 2013 17:51:18 +0000 (18:51 +0100)
committerIan Lynagh <ian@well-typed.com>
Sat, 20 Apr 2013 17:51:18 +0000 (18:51 +0100)
Currently they are all set to the same value, but when cross-compiling
they could be set to different values.

driver/ghci/ghc.mk
mk/project.mk.in
rules/build-prog.mk
utils/ghc-cabal/ghc.mk
utils/runghc/ghc.mk

index 736b7a9..bd4bf36 100644 (file)
@@ -38,7 +38,7 @@ driver/ghci_dist_OTHER_OBJS = driver/ghci/ghci.res
 
 $(eval $(call build-prog,driver/ghci,dist,1))
 
-driver/ghci_dist_PROG_VER = ghci-$(ProjectVersion)$(exeext)
+driver/ghci_dist_PROG_VER = ghci-$(ProjectVersion)$(exeext1)
 
 INSTALL_BINS += driver/ghci/dist/build/tmp/$(driver/ghci_dist_PROG_VER)
 
index e47663f..004e9b1 100644 (file)
@@ -125,7 +125,10 @@ BuildVendor_CPP                 = @BuildVendor_CPP@
 LeadingUnderscore=@LeadingUnderscore@
 
 # Pin a suffix on executables? If so, what (Windows only).
-exeext=@exeext@
+exeext0=@exeext@
+exeext1=@exeext@
+exeext2=@exeext@
+exeext3=@exeext@
 soext=@soext@
 
 # Windows_Host=YES if on a Windows platform
index b788bc1..0f4bb49 100644 (file)
@@ -33,7 +33,7 @@ endif
 ifneq "$$($1_$2_PROG)" ""
 $$(error $1_$2_PROG is set)
 endif
-$1_$2_PROG = $$($1_$2_PROGNAME)$$(exeext)
+$1_$2_PROG = $$($1_$2_PROGNAME)$$(exeext$3)
 endif
 
 ifeq "$$(findstring $3,0 1 2)" ""
index ecdef07..987c59c 100644 (file)
@@ -18,8 +18,9 @@ CABAL_DOTTED_VERSION := $(shell grep "^version:" libraries/Cabal/Cabal/Cabal.cab
 CABAL_VERSION := $(subst .,$(comma),$(CABAL_DOTTED_VERSION))
 CABAL_CONSTRAINT := --constraint="Cabal == $(CABAL_DOTTED_VERSION)"
 
-ghc-cabal_DIST_BINARY = utils/ghc-cabal/dist/build/tmp/ghc-cabal$(exeext)
-ghc-cabal_INPLACE = inplace/bin/ghc-cabal$(exeext)
+ghc-cabal_DIST_BINARY_NAME = ghc-cabal$(exeext0)
+ghc-cabal_DIST_BINARY = utils/ghc-cabal/dist/build/tmp/$(ghc-cabal_DIST_BINARY_NAME)
+ghc-cabal_INPLACE = inplace/bin/ghc-cabal$(ghc-cabal_DIST_BINARY_NAME)
 
 ifneq "$(BINDIST)" "YES"
 $(ghc-cabal_INPLACE) : $(ghc-cabal_DIST_BINARY) | $$(dir $$@)/.
index cde8102..5a56af5 100644 (file)
@@ -32,7 +32,7 @@ install: install_runhaskell
 .PHONY: install_runhaskell
 ifeq "$(Windows_Host)" "YES"
 install_runhaskell: install_bins
-       "$(CP)" $(DESTDIR)$(bindir)/runghc$(exeext) $(DESTDIR)$(bindir)/runhaskell$(exeext)
+       "$(CP)" $(DESTDIR)$(bindir)/runghc$(exeext1) $(DESTDIR)$(bindir)/runhaskell$(exeext1)
 else
 install_runhaskell:
        $(call removeFiles,"$(DESTDIR)$(bindir)/runhaskell")