[project @ 2001-03-28 14:09:41 by simonmar]
[ghc-hetmet.git] / ghc / driver / Makefile
index bdf9e6d..3e919d2 100644 (file)
@@ -1,15 +1,32 @@
 #-----------------------------------------------------------------------------
-# $Id: Makefile,v 1.48 2000/12/11 10:18:51 simonmar Exp $
+# $Id: Makefile,v 1.58 2001/03/27 08:29:07 qrczak Exp $
 #
 
 TOP=..
 CURRENT_DIR=ghc/driver
 include $(TOP)/mk/boilerplate.mk
 
-ifeq "$(GhcWithHscBuiltViaC)" "YES"
-HC=$(GHC_INPLACE)
+# hack for ghci-inplace script, see below
+INSTALLING=1
+
+ifeq "$(INSTALLING)" "1"       
+SUBDIRS = mangler split ghc ghci
 endif
 
+# -----------------------------------------------------------------------------
+# package configuration files...
+
+PKGCONF_OPTS = "$(TARGETPLATFORM)"             \
+              "$(CURRENT_DIR)"                 \
+              "$(HaveLibGmp)"                  \
+              "$(LibsReadline)"                \
+              "$(libdir)"                      \
+              "$(GHC_LIB_DIR)"                 \
+              "$(GHC_RUNTIME_DIR)"             \
+              "$(GHC_UTILS_DIR)"               \
+              "$(GHC_INCLUDE_DIR)"             \
+              "$(FPTOOLS_TOP_ABS)"
+
 ghc_407_at_least = $(shell expr "$(GhcMinVersion)" \>= 7)
 ifeq "$(ghc_407_at_least)" "1"
 ifneq "$(mingw32_TARGET_OS)" "1"
@@ -21,32 +38,26 @@ else
 SRC_HC_OPTS += -fglasgow-exts -cpp -syslib concurrent -syslib posix -syslib misc
 endif
 
-SUBDIRS = mangler split stats
-
-# -----------------------------------------------------------------------------
-# package configuration files...
+SRC_HC_OPTS += -DWANT_PRETTY
 
 all :: package.conf package.conf.inplace
 
-pkgconf : Config.o Package.o PackageSrc.o Utils.o
-       $(HC) $(HC_OPTS) $(LD_OPTS) Config.o Package.o PackageSrc.o Utils.o -o pkgconf
+HS_OBJS = Package.o PackageSrc.o Utils.o
+HS_PROG = pkgconf
 
-package.conf.inplace : pkgconf
-       ./pkgconf in-place >$@
+package.conf.inplace : $(HS_PROG)
+       ./$(HS_PROG) in-place $(PKGCONF_OPTS) >$@
 
 package.conf : pkgconf
-       ./pkgconf install >$@
+       ./$(HS_PROG) install $(PKGCONF_OPTS) >$@
+
+Package.o : ../utils/ghc-pkg/Package.hs
 
+override datadir = $(libdir)
 INSTALL_DATAS += package.conf
 
 CLEAN_FILES += pkgconf package.conf.inplace package.conf
 
 # -----------------------------------------------------------------------------
-# installation...
-
-override datadir=$(libdir)
-INSTALL_DATAS += ghc-usage.txt
-
-# -----------------------------------------------------------------------------
 
 include $(TOP)/mk/target.mk