Fix ghc and ghci wrappers on Windows
authorIan Lynagh <igloo@earth.li>
Wed, 18 Feb 2009 00:50:34 +0000 (00:50 +0000)
committerIan Lynagh <igloo@earth.li>
Wed, 18 Feb 2009 00:50:34 +0000 (00:50 +0000)
driver/ghc/Makefile
driver/ghci/Makefile
mk/install.mk

index 55167ec..dcde994 100644 (file)
@@ -2,7 +2,7 @@ TOP=../..
 include $(TOP)/mk/boilerplate.mk
 
 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
 include $(TOP)/mk/boilerplate.mk
 
 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
-C_PROG = ghc-$(ProjectVersion)
+C_PROG = ghc-$(ProjectVersion)$(exeext)
 INSTALL_PROGS += $(C_PROG)
 else
 SCRIPT_DIR = $(DESTDIR)$(bindir)
 INSTALL_PROGS += $(C_PROG)
 else
 SCRIPT_DIR = $(DESTDIR)$(bindir)
index 8bb2538..47f51b8 100644 (file)
@@ -9,8 +9,8 @@ include $(TOP)/mk/boilerplate.mk
 # ghci script
 
 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
 # ghci script
 
 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
-C_PROG = ghci
-C_PROG_VERSIONED = $(C_PROG)-$(ProjectVersion)
+C_PROG = ghci$(exeext)
+C_PROG_VERSIONED = ghci-$(ProjectVersion)$(exeext)
 C_OBJS += ghci.res
 
 all :: $(C_PROG_VERSIONED)
 C_OBJS += ghci.res
 
 all :: $(C_PROG_VERSIONED)
index 41b312c..1efb695 100644 (file)
@@ -145,7 +145,12 @@ ifneq "$(strip $(INSTALL_PROGS))" ""
 # entry in the INSTALL_PROGS list. If there's no suffix, use
 # $(exeext).
 # 
 # entry in the INSTALL_PROGS list. If there's no suffix, use
 # $(exeext).
 # 
-INSTALL_PROGS := $(foreach p, $(INSTALL_PROGS), $(addsuffix $(if $(suffix $(p)),,$(exeext)), $(basename $(p))))
+INSTALL_PROGS := $(foreach p, $(INSTALL_PROGS),\
+                   $(if $(filter $(exeext),$(suffix $p)),\
+                        $p,\
+                        $(addsuffix $(exeext),$p)\
+                    )\
+                  )
 
 install:: $(INSTALL_PROGS)
        $(INSTALL_DIR) $(DESTDIR)$(bindir)
 
 install:: $(INSTALL_PROGS)
        $(INSTALL_DIR) $(DESTDIR)$(bindir)