[project @ 1999-07-14 13:26:48 by simonmar]
[ghc-hetmet.git] / ghc / utils / mkdependHS / Makefile
index 7a2b69a..6f8fe79 100644 (file)
@@ -1,39 +1,43 @@
 TOP=../..
 include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/version.mk
 INSTALLING=0
 
-WAYS=
-
 boot :: all
 
 SCRIPT_PROG=mkdependHS
 SCRIPT_OBJS=mkdependHS.prl
 SCRIPT_SUBST_VARS= \
- RAWCPP TMPDIR UNLIT_PROG \
  TOP_PWD \
- INSTALL_LIB_DIR INSTALL_DATA_DIR \
- INSTALL_HSLIBS_DIR INSTALLING \
- PRELUDE_DIRS \
- PROJECTVERSION SED
+ INSTALLING \
+ RAWCPP \
+ HscIfaceFileVersion
+
+INTERP=perl
 
-INTERP=$(PERL)
 #
 # install setup
 #
-INSTALL_PROGS += $(SCRIPT_PROG)
+INSTALL_LIB_SCRIPTS += $(SCRIPT_PROG)
+
+ifneq "$(BIN_DIST)" "1"
+SCRIPT_SUBST_VARS += libdir datadir TMPDIR SED
+endif
 
-INSTALL_HSLIBS_DIR:=$(libdir)/../hslibs-$(ProjectVersion)
-INSTALL_LIB_DIR:=$(libdir)
-INSTALL_DATA_DIR:=$(datadir)
+
+#
+# Prepend an infomercial if installing (binary-dist or the real thing).
+#
+ifeq "$(INSTALLING)" "1"
+ifeq "$(BIN_DIST)" "1"
+SCRIPT_PREFIX_FILES += prefix.txt
+endif
+endif
 
 ifeq "$(INSTALLING)" "1"
 TOP_PWD:=$(prefix)
-UNLIT_PROG:=$(libexecdir)/unlit
-PRELUDE_DIRS:=$(libdir)/imports
 else
 TOP_PWD:=$(FPTOOLS_TOP_ABS)
-UNLIT_PROG:=$(FPTOOLS_TOP_ABS)/ghc/utils/unlit/unlit
-PRELUDE_DIRS:="$(FPTOOLS_TOP_ABS)/ghc/lib/ghc:$(FPTOOLS_TOP_ABS)/ghc/lib/required:$(FPTOOLS_TOP_ABS)/ghc/lib/glaExts:$(FPTOOLS_TOP_ABS)/ghc/lib/concurrent"
 endif
 
 #
@@ -45,13 +49,15 @@ install ::
        $(RM) $(SCRIPT_PROG)
        $(MAKE) $(MFLAGS) INSTALLING=1 $(SCRIPT_PROG)
 
-CLEAN_FILES += $(SCRIPT_PROG)
+CLEAN_FILES += $(SCRIPT_PROG) $(SCRIPT_LINK)
 
 include $(TOP)/mk/target.mk
 
+#
 # Hack to re-create the in-situ build tree script after 
-# having just installed it.
+# having just installed it (if you don't, confusion ensues
+# if you try to use the build tree copy afterwards..)
 #
 install ::
        @$(RM) $(SCRIPT_PROG)
-       @$(MAKE) $(MFLAGS) $(SCRIPT_PROG)
+       @$(MAKE) $(MFLAGS) BIN_DIST=0 INSTALLING=0 $(SCRIPT_PROG)