summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2007-05-31 14:35:05 +0000
committerIan Lynagh <igloo@earth.li>2007-05-31 14:35:05 +0000
commit430453c5131592b6147a80202dc5f7fbe3f3d5fd (patch)
tree9c7cdf6b13a8586dfa653bb9ff393da5640d2599 /driver
parentad9d754d2b18d4dd027884e082c20777a29ef7d4 (diff)
downloadhaskell-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')
-rw-r--r--driver/ghc/Makefile27
-rw-r--r--driver/ghc/ghc.sh2
-rw-r--r--driver/ghci/Makefile57
-rw-r--r--driver/mangler/Makefile19
-rw-r--r--driver/split/Makefile17
5 files changed, 56 insertions, 66 deletions
diff --git a/driver/ghc/Makefile b/driver/ghc/Makefile
index 26965569a4..69abe6cb8a 100644
--- a/driver/ghc/Makefile
+++ b/driver/ghc/Makefile
@@ -8,23 +8,18 @@ include $(TOP)/mk/boilerplate.mk
# -----------------------------------------------------------------------------
# ghc script
-ifeq "$(BIN_DIST)" "1"
-GHCBIN=$$\"\"libexecdir/ghc-$(ProjectVersion)
-GHCLIB=$$\"\"libdir
-else
-GHCBIN=$(libexecdir)/ghc-$(ProjectVersion)
-GHCLIB=$(libdir)
-endif # BIN_DIST
-
-ifneq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
-SCRIPT_PROG = ghc-$(ProjectVersion)
-LINK = ghc
+ifneq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
+LINK = ghc
+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 $${1+"$$@"}' >> $(INSTALLED_SCRIPT)
+ $(EXECUTABLE_FILE) $(INSTALLED_SCRIPT)
endif
-SCRIPT_OBJS = ghc.sh
-INTERP = $(SHELL)
-TOPDIROPT = -B$(GHCLIB)
-SCRIPT_SUBST_VARS = GHCBIN TOPDIROPT
-INSTALL_SCRIPTS += $(SCRIPT_PROG)
# -----------------------------------------------------------------------------
diff --git a/driver/ghc/ghc.sh b/driver/ghc/ghc.sh
deleted file mode 100644
index 780b9498be..0000000000
--- a/driver/ghc/ghc.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-# Mini-driver for GHC
-exec $GHCBIN $TOPDIROPT ${1+"$@"}
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"
diff --git a/driver/mangler/Makefile b/driver/mangler/Makefile
index 7b482e1d98..7c4d276b0c 100644
--- a/driver/mangler/Makefile
+++ b/driver/mangler/Makefile
@@ -4,15 +4,16 @@
TOP=../..
include $(TOP)/mk/boilerplate.mk
-SCRIPT_PROG = ghc-asm
-
-INTERP=perl
-
-SCRIPT_SUBST_VARS := TARGETPLATFORM
-
-INSTALL_LIBEXEC_SCRIPTS += $(SCRIPT_PROG)
-
-CLEAN_FILES += $(SCRIPT_OBJS)
+PROG = ghc-asm
+all:: $(PROG).prl
+ $(RM) -f $(PROG)
+ echo '#!$(PERL)' >> $(PROG)
+ echo '$$TARGETPLATFORM = "$(TARGETPLATFORM)";' >> $(PROG)
+ cat $< >> $(PROG)
+ $(EXECUTABLE_FILE) $(PROG)
+
+INSTALL_LIBEXEC_SCRIPTS += $(PROG)
+CLEAN_FILES += $(PROG) $(PROG).prl
# needed for bootstrapping with HC files
ifeq "$(BootingFromHc)" "YES"
diff --git a/driver/split/Makefile b/driver/split/Makefile
index 6b545de20f..382388fe77 100644
--- a/driver/split/Makefile
+++ b/driver/split/Makefile
@@ -4,14 +4,15 @@
TOP=../..
include $(TOP)/mk/boilerplate.mk
-SCRIPT_PROG = ghc-split
+PROG = ghc-split
+all:: $(PROG).prl
+ $(RM) -f $(PROG)
+ echo '#!$(PERL)' >> $(PROG)
+ echo '$$TARGETPLATFORM = "$(TARGETPLATFORM)";' >> $(PROG)
+ cat $< >> $(PROG)
+ $(EXECUTABLE_FILE) $(PROG)
-INTERP=perl
-
-SCRIPT_SUBST_VARS := TARGETPLATFORM
-
-INSTALL_LIBEXEC_SCRIPTS += $(SCRIPT_PROG)
-
-CLEAN_FILES += $(SCRIPT_OBJS)
+INSTALL_LIBEXEC_SCRIPTS += $(PROG)
+CLEAN_FILES += $(PROG) $(PROG).prl
include $(TOP)/mk/target.mk