[project @ 2005-03-08 19:14:09 by sof]
[ghc-hetmet.git] / ghc / utils / runghc / Makefile
index 213422e..a083a50 100644 (file)
@@ -1,7 +1,7 @@
 TOP=../..
 include $(TOP)/mk/boilerplate.mk
 
-HS_PROG                = runghc
+HS_PROG                = runghc$(exeext)
 INSTALL_PROGS   += $(HS_PROG)
 
 UseGhcForCc = YES
@@ -31,4 +31,16 @@ SRC_MKDEPENDHS_OPTS += \
        -optdep--exclude-module=Distribution.Version \
        -optdep--exclude-module=System.Directory.Internals
 
+all :: runhaskell
+
+runhaskell : $(HS_PROG)
+       $(CP) $< runhaskell$(exeext)
+
+# Only install runhaskell if there isn't already one installed
+ifneq "$(findstring install, $(MAKECMDGOALS))" ""
+ifeq "$(wildcard $(bindir)/runhaskell)" ""
+INSTALL_PROGS += runhaskell$(exeext)
+endif
+endif
+
 include $(TOP)/mk/target.mk