summaryrefslogtreecommitdiff
path: root/utils/runghc
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2009-04-26 11:42:15 +0000
committerIan Lynagh <igloo@earth.li>2009-04-26 11:42:15 +0000
commit34cc75e1a62638f2833815746ebce0a9114dc26b (patch)
treeef21e8fd7af1356beea9cce7d6efb8a65374e24c /utils/runghc
parent74e1368d4688ee16f6decdf2cd3ebe27506b26ba (diff)
downloadhaskell-34cc75e1a62638f2833815746ebce0a9114dc26b.tar.gz
GHC new build system megapatch
Diffstat (limited to 'utils/runghc')
-rw-r--r--utils/runghc/Makefile15
-rw-r--r--utils/runghc/ghc.mk29
-rw-r--r--utils/runghc/runghc.hs4
3 files changed, 33 insertions, 15 deletions
diff --git a/utils/runghc/Makefile b/utils/runghc/Makefile
index 1415921b04..fb5c1c1c55 100644
--- a/utils/runghc/Makefile
+++ b/utils/runghc/Makefile
@@ -1,12 +1,3 @@
-
-TOP=../..
-ENABLE_SHELL_WRAPPERS = YES
-
-include $(TOP)/mk/boilerplate.mk
-include $(TOP)/mk/cabal.mk
-
-distclean maintainer-clean:
- $(RM) -f runghc.cabal
-
-# XXX Need to make runhaskell somehow
-
+dir = utils/runghc
+TOP = ../..
+include $(TOP)/mk/sub-makefile.mk
diff --git a/utils/runghc/ghc.mk b/utils/runghc/ghc.mk
new file mode 100644
index 0000000000..1eb2d87c47
--- /dev/null
+++ b/utils/runghc/ghc.mk
@@ -0,0 +1,29 @@
+utils/runghc_dist_MODULES = Main
+utils/runghc_dist_HC_OPTS = -cpp -DVERSION="\"$(ProjectVersion)\""
+utils/runghc_dist_PROG = runghc$(exeext)
+utils/runghc_dist_SHELL_WRAPPER = YES
+utils/runghc_dist_INSTALL_SHELL_WRAPPER = YES
+
+ifneq "$(BINDIST)" "YES"
+
+# hack: the build system has trouble with Main modules not called Main.hs
+utils/runghc/dist/build/Main.hs : utils/runghc/runghc.hs $(MKDIRHIER)
+ $(MKDIRHIER) $(dir $@)
+ $(CP) $< $@
+
+$(eval $(call build-prog,utils/runghc,dist,1))
+
+endif
+
+install: install_runhaskell
+
+.PHONY: install_runhaskell
+ifeq "$(Windows)" "YES"
+install_runhaskell: install_bins
+ $(CP) $(DESTDIR)$(bindir)/runghc$(exeext) $(DESTDIR)$(bindir)/runhaskell$(exeext)
+else
+install_runhaskell:
+ $(RM) $(DESTDIR)$(bindir)/runhaskell
+ $(LN_S) runghc $(DESTDIR)$(bindir)/runhaskell
+endif
+
diff --git a/utils/runghc/runghc.hs b/utils/runghc/runghc.hs
index 47615def3a..aadafd9a71 100644
--- a/utils/runghc/runghc.hs
+++ b/utils/runghc/runghc.hs
@@ -22,8 +22,6 @@
module Main (main) where
-import Paths_runghc
-
import Control.Exception
import Data.Char
import Data.List
@@ -85,7 +83,7 @@ parseRunGhcFlags = f mempty
printVersion :: IO ()
printVersion = do
- putStrLn ("runghc " ++ showVersion version)
+ putStrLn ("runghc " ++ VERSION)
printUsage :: IO ()
printUsage = do