diff options
author | Ian Lynagh <igloo@earth.li> | 2007-05-31 14:35:05 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2007-05-31 14:35:05 +0000 |
commit | 430453c5131592b6147a80202dc5f7fbe3f3d5fd (patch) | |
tree | 9c7cdf6b13a8586dfa653bb9ff393da5640d2599 /driver/ghci | |
parent | ad9d754d2b18d4dd027884e082c20777a29ef7d4 (diff) | |
download | haskell-430453c5131592b6147a80202dc5f7fbe3f3d5fd.tar.gz |
Rework the build system a bit
Key changes:
* Always build as if BIN_DIST is 1. BIN_DIST is thus removed.
* Libraries are configured with prefix set to $$topdir rather than $(prefix)
Diffstat (limited to 'driver/ghci')
-rw-r--r-- | driver/ghci/Makefile | 57 |
1 files changed, 26 insertions, 31 deletions
diff --git a/driver/ghci/Makefile b/driver/ghci/Makefile index 7c67ac546c..14e0c33775 100644 --- a/driver/ghci/Makefile +++ b/driver/ghci/Makefile @@ -11,22 +11,6 @@ INSTALLING=1 # ----------------------------------------------------------------------------- # ghci script -ifeq "$(INSTALLING)" "1" -ifeq "$(BIN_DIST)" "1" -GHCBIN=$$\"\"libexecdir/ghc-$(ProjectVersion) -GHCLIB=$$\"\"libdir -else -GHCBIN=$(libexecdir)/ghc-$(ProjectVersion) -GHCLIB=$(libdir) -endif # BIN_DIST -else -GHCBIN=$(FPTOOLS_TOP_ABS)/$(GHC_COMPILER_DIR_REL)/ghc-$(ProjectVersion) -GHCLIB=$(FPTOOLS_TOP_ABS) -endif - -INSTALLED_SCRIPT_PROG = ghci-$(ProjectVersion) -INPLACE_SCRIPT_PROG = ghci-inplace - ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32" C_PROG = ghci C_OBJS += ghci.res @@ -34,31 +18,42 @@ else C_SRCS= endif -SCRIPT_OBJS = ghci.sh -INTERP = $(SHELL) -SCRIPT_SUBST_VARS = GHCBIN TOPDIROPT -ifneq "$(TARGETPLATFORM)" "i386-unknown-mingw32" -INSTALL_SCRIPTS += $(SCRIPT_PROG) -else -INSTALL_SCRIPTS += ghcii.sh +ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32" INSTALL_PROGS += $(C_PROG) +GHCII_SCRIPT=$(bindir)/ghcii.sh +install:: + $(RM) -f $(GHCII_SCRIPT) + echo "#!$(SHELL)" >> $(GHCII_SCRIPT) + echo 'exec "$0"/../ghc --interactive $${1+"$$@"}' >> $(GHCII_SCRIPT) +else +LINK = ghci +LINK_TARGET = $(LINK)-$(ProjectVersion) +INSTALLED_SCRIPT=$(bindir)/$(LINK_TARGET) +install:: + $(RM) -f $(INSTALLED_SCRIPT) + echo "#!$(SHELL)" >> $(INSTALLED_SCRIPT) + echo "GHCBIN=$(libexecdir)/ghc-$(ProjectVersion)" >> $(INSTALLED_SCRIPT) + echo "TOPDIROPT=-B$(libdir)" >> $(INSTALLED_SCRIPT) + echo 'exec $$GHCBIN $$TOPDIROPT --interactive $${1+"$$@"}' >> $(INSTALLED_SCRIPT) + $(EXECUTABLE_FILE) $(INSTALLED_SCRIPT) endif -TOPDIROPT = -B$(GHCLIB) -ifeq "$(INSTALLING)" "1" -SCRIPT_PROG = $(INSTALLED_SCRIPT_PROG) ifneq "$(TARGETPLATFORM)" "i386-unknown-mingw32" -LINK = ghci -endif -else -SCRIPT_PROG = $(INPLACE_SCRIPT_PROG) +INPLACE_SCRIPT=ghc-pkg-inplace +all:: + $(RM) -f $(INPLACE_SCRIPT) + echo "#!$(SHELL)" >> $(INPLACE_SCRIPT) + echo "GHCBIN=$(FPTOOLS_TOP_ABS)/$(GHC_COMPILER_DIR_REL)/ghc-$(ProjectVersion)" >> $(INPLACE_SCRIPT) + echo "TOPDIROPT=$(FPTOOLS_TOP_ABS)" >> $(INPLACE_SCRIPT) + echo 'exec $$GHCPKGBIN --global-conf $$PKGCONF $${1+"$$@"}' >> $(INPLACE_SCRIPT) + $(EXECUTABLE_FILE) $(INPLACE_SCRIPT) endif # don't recurse on 'make install' # ifeq "$(INSTALLING)" "1" all clean distclean maintainer-clean :: - $(MAKE) INSTALLING=0 BIN_DIST=0 $(MFLAGS) $@ + $(MAKE) INSTALLING=0 $(MFLAGS) $@ endif ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32" |