[project @ 2001-03-26 16:51:26 by simonmar]
[ghc-hetmet.git] / ghc / driver / ghci / Makefile
diff --git a/ghc/driver/ghci/Makefile b/ghc/driver/ghci/Makefile
new file mode 100644 (file)
index 0000000..e4caf48
--- /dev/null
@@ -0,0 +1,51 @@
+#-----------------------------------------------------------------------------
+# $Id: Makefile,v 1.1 2001/03/26 16:51:27 simonmar Exp $
+#
+
+TOP=../..
+include $(TOP)/mk/boilerplate.mk
+
+# hack for ghci-inplace script, see below
+INSTALLING=1
+
+# -----------------------------------------------------------------------------
+# ghci script
+
+ifeq "$(INSTALLING)" "1"
+ifeq "$(BIN_DIST)"   "1"
+GHCBIN=$$\"\"libdir/ghc
+GHCLIB=$$\"\"libdir
+else
+GHCBIN=$(libdir)/ghc
+GHCLIB=$(libdir)
+endif # BIN_DIST
+else
+GHCBIN=$(FPTOOLS_TOP_ABS)/ghc/compiler/ghc
+GHCLIB=$(FPTOOLS_TOP_ABS)
+endif
+
+INSTALLED_SCRIPT_PROG  = ghci-$(ProjectVersion)
+INPLACE_SCRIPT_PROG    = ghci-inplace
+
+SCRIPT_OBJS      = ghci.sh
+INTERP           = $(SHELL)
+SCRIPT_SUBST_VARS = GHCBIN TOPDIROPT
+INSTALL_SCRIPTS  += $(SCRIPT_PROG) ghc5
+TOPDIROPT        = -B$(GHCLIB)
+
+ifeq "$(INSTALLING)" "1"
+SCRIPT_PROG    =  $(INSTALLED_SCRIPT_PROG)
+LINK           =  ghci
+else
+SCRIPT_PROG    =  $(INPLACE_SCRIPT_PROG)
+endif
+
+# don't recurse on 'make install'
+#
+ifeq "$(INSTALLING)" "1"
+all clean distclean maintainer-clean ::
+       $(MAKE) INSTALLING=0 BIN_DIST=0 $(MFLAGS) $@
+endif
+
+include $(TOP)/mk/target.mk
+