[project @ 2001-02-11 16:32:48 by simonmar]
authorsimonmar <unknown>
Sun, 11 Feb 2001 16:32:48 +0000 (16:32 +0000)
committersimonmar <unknown>
Sun, 11 Feb 2001 16:32:48 +0000 (16:32 +0000)
Create ghci-$(ProjectVersion) and ghci-inplace mini-scripts, and a
ghci->ghci-$(ProjectVersion) link.

I put these in here rather than ghc/compiler, because ghc/compiler
already has a ghci subdirectory.

ghc/driver/Makefile
ghc/driver/ghci.sh [new file with mode: 0644]

index 524abd4..c9d19f6 100644 (file)
@@ -1,11 +1,14 @@
 #-----------------------------------------------------------------------------
-# $Id: Makefile,v 1.50 2000/12/20 10:42:54 simonmar Exp $
+# $Id: Makefile,v 1.51 2001/02/11 16:32:48 simonmar Exp $
 #
 
 TOP=..
 CURRENT_DIR=ghc/driver
 include $(TOP)/mk/boilerplate.mk
 
+# hack for ghci-inplace script, see below
+INSTALLING=1
+
 ifeq "$(GhcWithHscBuiltViaC)" "YES"
 HC=$(GHC_INPLACE)
 endif
@@ -21,7 +24,9 @@ else
 SRC_HC_OPTS += -fglasgow-exts -cpp -syslib concurrent -syslib posix -syslib misc
 endif
 
+ifeq "$(INSTALLING)" "1"       
 SUBDIRS = mangler split
+endif
 
 # -----------------------------------------------------------------------------
 # Create compiler configuration
@@ -67,6 +72,46 @@ INSTALL_DATAS += package.conf
 CLEAN_FILES += pkgconf package.conf.inplace package.conf
 
 # -----------------------------------------------------------------------------
+# ghci script
+
+ifeq "$(INSTALLING)" "1"
+ifeq "$(BIN_DIST)"   "1"
+GHCBIN=$$\"\"bindir/ghc
+else
+GHCBIN=$(bindir)/ghc
+endif # BIN_DIST
+else
+GHCBIN=$(FPTOOLS_TOP_ABS)/ghc/compiler/ghc
+endif
+
+INSTALLED_SCRIPT_PROG  = ghci-$(ProjectVersion)
+INPLACE_SCRIPT_PROG    = ghci-inplace
+
+ifeq "$(INSTALLING)" "1"
+TOP_PWD        := $(prefix)
+SCRIPT_PROG    =  $(INSTALLED_SCRIPT_PROG)
+SCRIPT_LINK    =  ghci
+else
+TOP_PWD        := $(FPTOOLS_TOP_ABS)
+SCRIPT_PROG    =  $(INPLACE_SCRIPT_PROG)
+endif
+
+SCRIPT_OBJS=ghci.sh
+
+INTERP=$(SHELL)
+
+SCRIPT_SUBST_VARS = GHCBIN
+
+INSTALL_SCRIPTS += $(SCRIPT_PROG)
+
+# don't recurse on 'make install'
+#
+ifeq "$(INSTALLING)" "1"
+all clean distclean maintainer-clean ::
+       $(MAKE) INSTALLING=0 BIN_DIST=0 $(MFLAGS) $@
+endif
+
+# -----------------------------------------------------------------------------
 # installation...
 
 override datadir=$(libdir)
diff --git a/ghc/driver/ghci.sh b/ghc/driver/ghci.sh
new file mode 100644 (file)
index 0000000..2df307b
--- /dev/null
@@ -0,0 +1,2 @@
+# Mini-driver for GHCi
+exec $GHCBIN --interactive $*