Commit 27b4d2d7 authored by simonmar's avatar simonmar
Browse files

[project @ 2001-03-26 16:53:35 by simonmar]

- make the pkgconf program independent of the location of the build
  tree - instead of Config.hs, we pass the configuration parameters in
  as options.  This is necessary for .hc bootstrapping.

- remove the ghci driver stuff, it moved to the ghci subdirectory.

- remove ghc5.hs
parent b99be402
#-----------------------------------------------------------------------------
# $Id: Makefile,v 1.56 2001/03/19 18:15:59 sewardj Exp $
# $Id: Makefile,v 1.57 2001/03/26 16:53:35 simonmar Exp $
#
TOP=..
......@@ -10,37 +10,23 @@ include $(TOP)/mk/boilerplate.mk
INSTALLING=1
ifeq "$(INSTALLING)" "1"
SUBDIRS = mangler split
SUBDIRS = mangler split ghc ghci
endif
# -----------------------------------------------------------------------------
# Create compiler configuration
CURRENT_DIR=ghc/compiler
CONFIG_HS = Config.hs
boot :: $(CONFIG_HS)
$(CONFIG_HS) : $(FPTOOLS_TOP)/mk/config.mk Makefile
@$(RM) -f $(CONFIG_HS)
@echo -n "Creating $(CONFIG_HS) ... "
@echo "module Config where" >>$(CONFIG_HS)
@echo "cTARGETPLATFORM = \"$(TARGETPLATFORM)\"" >> $(CONFIG_HS)
@echo "cCURRENT_DIR = \"$(CURRENT_DIR)\"" >> $(CONFIG_HS)
@echo "cHaveLibGmp = \"$(HaveLibGmp)\"" >> $(CONFIG_HS)
@echo "cLibsReadline = \"$(LibsReadline)\"" >> Config.hs
@echo "clibdir = \"$(libdir)\"" >> $(CONFIG_HS)
@echo "cGHC_LIB_DIR = \"$(GHC_LIB_DIR)\"" >> $(CONFIG_HS)
@echo "cGHC_RUNTIME_DIR = \"$(GHC_RUNTIME_DIR)\"" >> $(CONFIG_HS)
@echo "cGHC_UTILS_DIR = \"$(GHC_UTILS_DIR)\"" >> $(CONFIG_HS)
@echo "cGHC_INCLUDE_DIR = \"$(GHC_INCLUDE_DIR)\"" >> $(CONFIG_HS)
@echo "cFPTOOLS_TOP_ABS = \"$(FPTOOLS_TOP_ABS)\"" >> $(CONFIG_HS)
@echo done.
CLEAN_FILES += $(CONFIG_HS)
# -----------------------------------------------------------------------------
# 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"
......@@ -56,14 +42,14 @@ 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
......@@ -71,59 +57,6 @@ 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
SCRIPT_OBJS = ghci.sh
INTERP = $(SHELL)
SCRIPT_SUBST_VARS = GHCBIN TOPDIROPT
INSTALL_SCRIPTS += $(SCRIPT_PROG) ghc5
ifeq "$(INSTALLING)" "1"
SCRIPT_PROG = $(INSTALLED_SCRIPT_PROG)
TOPDIROPT =
LINK = ghci
else
TOPDIROPT = -B$(FPTOOLS_TOP_ABS)
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
# -----------------------------------------------------------------------------
# installation...
override datadir=$(libdir)
INSTALL_DATAS += ghc-usage.txt
ghc5 :
rm -f ghc5
echo "#!/bin/sh" > ghc5
echo "# You (the user) need to set GHC_TOPDIR to make it work!" >> ghc5
echo "GHC_TOPDIR=/path/to/root/of/ghc/installation/tree" >> ghc5
echo "GHC_PLATFORM=$(TARGETPLATFORM)" >> ghc5
cat ghc5.sh >> ghc5
# -----------------------------------------------------------------------------
include $(TOP)/mk/target.mk
......@@ -6,20 +6,30 @@ import Utils
import IO
import System
import Config
import Package
main :: IO ()
main = do
args <- getArgs
case args of
[ "install" ] -> do { putStrLn (dumpPackages (package_details True)) }
[ "in-place" ] -> do { putStrLn (dumpPackages (package_details False)) }
_ -> do hPutStr stderr "usage: pkgconf (install | in-place)\n"
exitWith (ExitFailure 1)
("install":rest) -> do { putStrLn (dumpPackages (package_details True rest)) }
("in-place":rest) -> do { putStrLn (dumpPackages (package_details False rest)) }
_ -> do hPutStr stderr "usage: pkgconf (install | in-place) ...\n"
exitWith (ExitFailure 1)
package_details :: Bool -> [String] -> [PackageConfig]
package_details installing
[ cTARGETPLATFORM
, cCURRENT_DIR
, cHaveLibGmp
, cLibsReadline
, clibdir
, cGHC_LIB_DIR
, cGHC_RUNTIME_DIR
, cGHC_UTILS_DIR
, cGHC_INCLUDE_DIR
, cFPTOOLS_TOP_ABS ] =
package_details :: Bool -> [PackageConfig]
package_details installing =
[
Package {
name = "gmp", -- GMP is at the bottom of the heap
......@@ -383,6 +393,6 @@ package_details installing =
extra_ld_opts = []
}
]
ghc_src_dir :: String -> String
ghc_src_dir path = cFPTOOLS_TOP_ABS ++ '/':cCURRENT_DIR ++ '/':path
where
ghc_src_dir :: String -> String
ghc_src_dir path = cFPTOOLS_TOP_ABS ++ '/':cCURRENT_DIR ++ '/':path
# generic driver for ghc-5.X
exec $GHC_TOPDIR/bin/$GHC_PLATFORM/ghc-4.11 -B$GHC_TOPDIR/lib/$GHC_PLATFORM "$@"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment