[project @ 1999-10-05 10:30:26 by simonmar]
authorsimonmar <unknown>
Tue, 5 Oct 1999 10:30:35 +0000 (10:30 +0000)
committersimonmar <unknown>
Tue, 5 Oct 1999 10:30:35 +0000 (10:30 +0000)
Build System Cleanup
--------------------

This commit is intended to clear the way for automatic RPM building.
In particular, the idea is that 'make install' doesn't build anything,
so you can do

make install prefix=/some/tmp/prefix

to install everything in /some/tmp/prefix, but leave the hardwired-in
install directories the same.

For scripts that depend on the install dir (currently just the GHC
driver and mkdependHS), we now build two versions: <script>-inplace,
which is used for running the script from the build tree, and
<script>, which is the to-be-installed version.

NOTE: binary distributions are now a little bit trickier to build.
You *must* include the line "BIN_DIST=1" in your build.mk if you
intend to make a binary distribution from the current build tree.
This is because certain scripts have to be built differently, and we
don't rebuild them when doing 'make binary-dist' anymore (since 'make
binary-dist' just does a 'make install' with a re-targetted prefix,
just like the RPM builder).

Other changes

- the binary-dist machinery is now all in fptools/Makefile
- removed a gratuitous $(package)-$(version) level of
  directories from the binary distribution.
- binary distributions are now placed under the package
  name, rather than fptools/fptools.
- various other minor cleanups.

14 files changed:
Makefile
distrib/Makefile-bin.in
ghc/driver/Makefile
ghc/driver/ghc.lprl
ghc/lib/concurrent/Makefile
ghc/lib/exts/Makefile
ghc/lib/misc/Makefile
ghc/lib/posix/Makefile
ghc/lib/std/Makefile
ghc/mk/paths.mk
ghc/mk/version.mk
ghc/utils/hscpp/Makefile
ghc/utils/mkdependHS/Makefile
mk/target.mk

index a70a037..3ce1f82 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -24,17 +24,17 @@ endif
 #
 # Files to include in fptools source distribution
 #
-SRC_DIST_DIRS += mk docs CONTRIB distrib $(ProjectsToBuild)
+SRC_DIST_DIRS += mk docs distrib $(ProjectsToBuild)
 SRC_DIST_FILES += configure.in config.guess config.sub configure aclocal.m4 acconfig.h README INSTALL Makefile install-sh
 
-#
+# -----------------------------------------------------------------------------
 # Making a binary distribution
 #
 # To make a particular binary distribution: 
 # set $(Project) to the name of the project (currently Ghc or Happy).
 
-BIN_DIST_TMPDIR=$(shell pwd)
-BIN_DIST_NAME=fptools
+BIN_DIST_TMPDIR=$(FPTOOLS_TOP_ABS)
+BIN_DIST_NAME=$(ProjectNameShort)-$(ProjectVersion)
 
 #
 # list of toplevel directories to include in binary distrib.
@@ -58,6 +58,44 @@ BIN_DIST_TOP= distrib/Makefile-bin.in \
              config.sub   \
              aclocal.m4
 
+#
+# binary-dist creates a binary bundle, set BIN_DIST_NAME
+# to package name and do `make binary-dist Project=<project-name>'
+# (normally this just a thing you would do from the toplevel of fptools)
+#
+.PHONY: binary-dist-pre binary-dist binary-pack
+
+BIN_DIST_NAME=$(ProjectNameShort)-$(ProjectVersion)
+BIN_DIST_TMPDIR=$(FPTOOLS_TOP_ABS)
+
+binary-dist-pre::
+       -rm -rf $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)
+       -rm -f $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME).tar.gz
+       @for i in $(BIN_DIST_DIRS); do                   \
+         if test -d "$$i"; then                         \
+          echo $(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM); \
+          $(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM); \
+          echo $(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM); \
+          $(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM); \
+          echo $(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/share; \
+          $(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/share; \
+          echo $(MAKE) -C $$i $(MFLAGS) install \
+               prefix=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME) \
+               exec_prefix=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME) \
+               bindir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM) \
+               libdir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM) \
+               libexecdir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM) \
+               datadir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/share; \
+          $(MAKE) -C $$i $(MFLAGS) install \
+               prefix=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME) \
+               exec_prefix=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME) \
+               bindir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM) \
+               libdir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM) \
+               libexecdir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM) \
+               datadir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/share; \
+         fi; \
+       done
+
 binary-dist::
        @for i in $(BIN_DIST_TOP); do \
          if test -f "$$i"; then \
@@ -105,7 +143,7 @@ ifneq "$($(Project)BinDistPrlScripts)" ""
 binary-dist::
        @for i in $($(Project)BinDistPrlScripts); do \
             echo "Renaming $$i to $$i.prl"; \
-           $(MV) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM)/$(ProjectNameShort)-$(ProjectVersion)/$$i  $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM)/$(ProjectNameShort)-$(ProjectVersion)/$$i.prl; \
+           $(MV) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM)/$$i  $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM)/$$i.prl; \
        done
 endif
 
@@ -113,7 +151,7 @@ ifneq "$($(Project)BinDistLibPrlScripts)" ""
 binary-dist::
        @for i in $($(Project)BinDistLibPrlScripts); do \
             echo "Renaming $$i to $$i.prl"; \
-           $(MV) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/$(ProjectNameShort)-$(ProjectVersion)/$$i  $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/$(ProjectNameShort)-$(ProjectVersion)/$$i.prl; \
+           $(MV) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/$$i  $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/$$i.prl; \
        done
 endif
 
@@ -121,13 +159,33 @@ ifneq "$($(Project)BinDistShScripts)" ""
 binary-dist::
        @for i in $($(Project)BinDistShScripts); do \
             echo "Renaming $$i to $$i.sh"; \
-           $(MV) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM)/$(ProjectNameShort)-$(ProjectVersion)/$$i  $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM)/$(ProjectNameShort)-$(ProjectVersion)/$$i.sh; \
+           $(MV) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM)/$$i  $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM)/$$i.sh; \
        done
 endif
 
+#
+# Do this separately for now
+# 
+binary-pack::
+       ( cd $(BIN_DIST_TMPDIR); $(TAR) chzf $(BIN_DIST_NAME).tar.gz $(BIN_DIST_NAME) )
+
+ifneq "$(way)" ""
+package-way-dist::
+       ( cd $(BIN_DIST_TMPDIR); find $(BIN_DIST_NAME)/ \( -name "*$(_way).a" -o -name "*.$(way_)hi" \) -print | xargs tar cvf $(BIN_DIST_TMPDIR)/ghc-$(ProjectVersion)-$(way)-$(TARGETPLATFORM).tar )
+       gzip $(BIN_DIST_TMPDIR)/ghc-$(ProjectVersion)-$(way)-$(TARGETPLATFORM).tar
+endif
+
+ifneq "$(way)" ""
+remove-way-dist::
+       ( cd $(BIN_DIST_TMPDIR); find $(BIN_DIST_NAME)/ \( -name "*$(_way).a" -o -name "*.$(way_)hi" \) -print -exec rm -f {} \; )
+endif
+
+binary-dist::
+       @echo "Mechanical and super-natty! Inspect the result and *if* happy; freeze, sell and get some sleep!"
+
+# -----------------------------------------------------------------------------
+
 dist :: dist-pre
 include $(TOP)/mk/target.mk
 dist :: dist-post
 
-binary-dist::
-       @echo "Mechanical and super-natty! Inspect the result and *if* happy; freeze, sell and get some sleep!"
index a40ff0d..61c0cf5 100644 (file)
 
 # Where the different pieces of the bundle should go:
 bindir      = @bindir@
-libdir      = @libdir@
-datadir     = @datadir@
+libdir      = @libdir@/$(package)-$(version)
+datadir     = @datadir@/$(package)-$(version)
 
 platform    = @TargetPlatform@
 prefix      = @prefix@
 exec_prefix = @exec_prefix@
 
 # default
-infodir   = $(real_datadir)
-htmldir   = $(real_datadir)
-dvidir    = $(real_datadir)
+infodir   = $(datadir)
+htmldir   = $(datadir)
+dvidir    = $(datadir)
 
-#
-# Putting the package stuff in package-specific
-# directories:
-#
-real_libdir      = $(libdir)/$(package)-$(version)
-real_datadir     = $(datadir)/$(package)-$(version)
 
 PERL        = @PerlCmd@
 SH         = /bin/sh
@@ -128,51 +122,51 @@ config-pkgs ::
        @for i in $(PACKAGE_PRL_SCRIPTS) ""; do \
          if test "$$i"; then \
           echo "Creating a configured version of $$i .."; \
-          $(RM) bin/$(platform)/$(package)-$(version)/$$i.bak; \
-          if [ -f bin/$(platform)/$(package)-$(version)/$$i ]; then $(MV) bin/$(platform)/$(package)-$(version)/$$i bin/$(platform)/$(package)-$(version)/$$i.bak; fi; \
-          echo "#! $(PERL)"                                    > bin/$(platform)/$(package)-$(version)/$$i ; \
-          echo '$$'"bindir='$(bindir)';"                        >> bin/$(platform)/$(package)-$(version)/$$i ; \
-          echo '$$'"libdir='$(real_libdir)';"                   >> bin/$(platform)/$(package)-$(version)/$$i ; \
-          echo '$$'"libexecdir='$(real_libdir)';"               >> bin/$(platform)/$(package)-$(version)/$$i ; \
-          echo '$$'"datadir='$(real_datadir)';"                 >> bin/$(platform)/$(package)-$(version)/$$i ; \
-          echo '$$'"SED='$(SED)';"             >> bin/$(platform)/$(package)-$(version)/$$i ; \
-          echo '$$'"TMPDIR='$(TMPDIR)';"               >> bin/$(platform)/$(package)-$(version)/$$i ; \
-          cat bin/$(platform)/$(package)-$(version)/$$i.prl   >> bin/$(platform)/$(package)-$(version)/$$i ; \
-          $(CHMOD) $(BIN_PERMS) bin/$(platform)/$(package)-$(version)/$$i; \
+          $(RM) bin/$(platform)/$$i.bak; \
+          if [ -f bin/$(platform)/$$i ]; then $(MV) bin/$(platform)/$$i bin/$(platform)/$$i.bak; fi; \
+          echo "#! $(PERL)"                        >  bin/$(platform)/$$i ; \
+          echo '$$'"bindir='$(bindir)';"           >> bin/$(platform)/$$i ; \
+          echo '$$'"libdir='$(libdir)';"           >> bin/$(platform)/$$i ; \
+          echo '$$'"libexecdir='$(libdir)';"       >> bin/$(platform)/$$i ; \
+          echo '$$'"datadir='$(datadir)';"         >> bin/$(platform)/$$i ; \
+          echo '$$'"SED='$(SED)';"                 >> bin/$(platform)/$$i ; \
+          echo '$$'"TMPDIR='$(TMPDIR)';"           >> bin/$(platform)/$$i ; \
+          cat bin/$(platform)/$$i.prl              >> bin/$(platform)/$$i ; \
+          $(CHMOD) $(BIN_PERMS) bin/$(platform)/$$i; \
           echo "Done."; \
          fi; \
        done
        @for i in $(PACKAGE_LIB_PRL_SCRIPTS) ""; do \
          if test "$$i"; then \
           echo "Creating a configured version of $$i .."; \
-          $(RM) lib/$(platform)/$(package)-$(version)/$$i.bak; \
-          if [ -f lib/$(platform)/$(package)-$(version)/$$i ]; then $(MV) lib/$(platform)/$(package)-$(version)/$$i lib/$(platform)/$(package)-$(version)/$$i.bak; fi; \
-          echo "#! $(PERL)"                      > lib/$(platform)/$(package)-$(version)/$$i ; \
-          echo '$$'"bindir='$(bindir)';"          >> lib/$(platform)/$(package)-$(version)/$$i ; \
-          echo '$$'"libdir='$(real_libdir)';"     >> lib/$(platform)/$(package)-$(version)/$$i ; \
-          echo '$$'"libexecdir='$(real_libdir)';" >> lib/$(platform)/$(package)-$(version)/$$i ; \
-          echo '$$'"datadir='$(real_datadir)';"   >> lib/$(platform)/$(package)-$(version)/$$i ; \
-          echo '$$'"SED='$(SED)';"              >> lib/$(platform)/$(package)-$(version)/$$i ; \
-          echo '$$'"TMPDIR='$(TMPDIR)';"                >> lib/$(platform)/$(package)-$(version)/$$i ; \
-          cat lib/$(platform)/$(package)-$(version)/$$i.prl >> lib/$(platform)/$(package)-$(version)/$$i; \
-          $(CHMOD) $(BIN_PERMS) lib/$(platform)/$(package)-$(version)/$$i; \
+          $(RM) lib/$(platform)/$$i.bak; \
+          if [ -f lib/$(platform)/$$i ]; then $(MV) lib/$(platform)/$$i lib/$(platform)/$$i.bak; fi; \
+          echo "#! $(PERL)"                       >  lib/$(platform)/$$i ; \
+          echo '$$'"bindir='$(bindir)';"          >> lib/$(platform)/$$i ; \
+          echo '$$'"libdir='$(libdir)';"          >> lib/$(platform)/$$i ; \
+          echo '$$'"libexecdir='$(libdir)';"      >> lib/$(platform)/$$i ; \
+          echo '$$'"datadir='$(datadir)';"        >> lib/$(platform)/$$i ; \
+          echo '$$'"SED='$(SED)';"                >> lib/$(platform)/$$i ; \
+          echo '$$'"TMPDIR='$(TMPDIR)';"          >> lib/$(platform)/$$i ; \
+          cat lib/$(platform)/$$i.prl >> lib/$(platform)/$$i; \
+          $(CHMOD) $(BIN_PERMS) lib/$(platform)/$$i; \
           echo "Done."; \
          fi; \
        done
        @for i in $(PACKAGE_SH_SCRIPTS) ""; do \
          if test "$$i"; then \
           echo "Creating a configured version of $$i .."; \
-          $(RM) bin/$(platform)/$(package)-$(version)/$$i.bak; \
-          if [ -f bin/$(platform)/$(package)-$(version)/$$i ]; then $(MV) bin/$(platform)/$(package)-$(version)/$$i bin/$(platform)/$(package)-$(version)/$$i.bak; fi; \
-          echo "#! $(SH)"                      > bin/$(platform)/$(package)-$(version)/$$i ; \
-          echo "bindir='$(bindir)'"          >> bin/$(platform)/$(package)-$(version)/$$i ; \
-          echo "libdir='$(real_libdir)'"     >> bin/$(platform)/$(package)-$(version)/$$i ; \
-          echo "libexecdir='$(real_libdir)'" >> bin/$(platform)/$(package)-$(version)/$$i ; \
-          echo "datadir='$(real_datadir)'"   >> bin/$(platform)/$(package)-$(version)/$$i ; \
-          echo "SED='$(SED)'"                   >> bin/$(platform)/$(package)-$(version)/$$i ; \
-          echo "TMPDIR='$(TMPDIR)'"             >> bin/$(platform)/$(package)-$(version)/$$i ; \
-          cat bin/$(platform)/$(package)-$(version)/$$i.sh >> bin/$(platform)/$(package)-$(version)/$$i; \
-          $(CHMOD) $(BIN_PERMS) bin/$(platform)/$(package)-$(version)/$$i; \
+          $(RM) bin/$(platform)/$$i.bak; \
+          if [ -f bin/$(platform)/$$i ]; then $(MV) bin/$(platform)/$$i bin/$(platform)/$$i.bak; fi; \
+          echo "#! $(SH)"                      >  bin/$(platform)/$$i ; \
+          echo "bindir='$(bindir)'"            >> bin/$(platform)/$$i ; \
+          echo "libdir='$(libdir)'"            >> bin/$(platform)/$$i ; \
+          echo "libexecdir='$(libdir)'"        >> bin/$(platform)/$$i ; \
+          echo "datadir='$(datadir)'"          >> bin/$(platform)/$$i ; \
+          echo "SED='$(SED)'"                  >> bin/$(platform)/$$i ; \
+          echo "TMPDIR='$(TMPDIR)'"            >> bin/$(platform)/$$i ; \
+          cat bin/$(platform)/$$i.sh >> bin/$(platform)/$$i; \
+          $(CHMOD) $(BIN_PERMS) bin/$(platform)/$$i; \
           echo "Done."; \
          fi; \
        done
@@ -182,13 +176,13 @@ config-pkgs ::
 CURRENT_DIR = $(shell pwd | sed 's|^//\(.\)|\1:|' )
 
 in-place ::
-       $(MAKE) $(MFLAGS) config-pkgs bindir=$(CURRENT_DIR)/bin/$(platform)/$(package)-$(version) libdir=$(CURRENT_DIR)/lib/$(platform) datadir=$(CURRENT_DIR)/share/$(package)-$(version)
-       @echo "Finished configuring..to use, add $(CURRENT_DIR)/bin/$(platform)/$(package)-$(version) to your PATH."
+       $(MAKE) $(MFLAGS) config-pkgs bindir=$(CURRENT_DIR)/bin/$(platform) libdir=$(CURRENT_DIR)/lib/$(platform) datadir=$(CURRENT_DIR)/share
+       @echo "Finished configuring..to use, add $(CURRENT_DIR)/bin/$(platform) to your PATH."
 
 install-dirs ::
        $(INSTALL_DIR) $(bindir)
-       (cd lib/$(platform)/$(package)-$(version); find . -type d -exec sh -c '../../../$(INSTALL_DIR) $$0 $(real_libdir)/$$0' {} \; )
-       (cd share/$(package)-$(version); find . -type d -exec sh -c '../../$(INSTALL_DIR) $(real_datadir)/$$0' {} \; )
+       (cd lib/$(platform); find . -type d -exec sh -c '../../$(INSTALL_DIR) $$0 $(libdir)/$$0' {} \; )
+       (cd share; find . -type d -exec sh -c '../$(INSTALL_DIR) $(datadir)/$$0' {} \; )
 
 install :: config-pkgs install-dirs install-bin install-libs install-datas
 
@@ -196,10 +190,10 @@ install :: config-pkgs install-dirs install-bin install-libs install-datas
 
 install-bin:
        for i in $(PACKAGE_BIN_INSTALL) ""; do \
-          if test -n "$$i" ; then $(INSTALL_BIN) bin/$(platform)/$(package)-$(version)/$$i $(bindir); fi; \
+          if test -n "$$i" ; then $(INSTALL_BIN) bin/$(platform)/$$i $(bindir); fi; \
        done;
        for i in $(PACKAGE_BINS) ""; do \
-          if test -n "$$i" ; then $(INSTALL_BIN) bin/$(platform)/$(package)-$(version)/$$i$(exeext) $(bindir); fi; \
+          if test -n "$$i" ; then $(INSTALL_BIN) bin/$(platform)/$$i$(exeext) $(bindir); fi; \
        done;
        for i in $(VERSION_SYMLINKS_FOR) ""; do \
           if [ "x$$i" != "x" ]; then           \
@@ -219,16 +213,16 @@ install-bin:
 
 
 install-libs:
-       (cd lib/$(platform)/$(package)-$(version); find . -type f -exec sh -c '$(CP) $$0 $(real_libdir)/$$0' {} \; )
+       (cd lib/$(platform); find . -type f -exec sh -c '$(CP) $$0 $(libdir)/$$0' {} \; )
 
 install-datas:
-       (cd share/$(package)-$(version); find . -type f -exec sh -c '$(INSTALL_DATA) $$0 $(real_datadir)/$$0' {} \; )
+       (cd share; find . -type f -exec sh -c '$(INSTALL_DATA) $$0 $(datadir)/$$0' {} \; )
 
 show-install-setup:
        @echo "Install setup..."
        @echo "bindir  = $(bindir)"
-       @echo "libdir  = $(libdir) (real_libdir  = $(real_libdir))"
-       @echo "datadir = $(datadir) (real_datadir = $(real_datadir))"
+       @echo "libdir  = $(libdir) (libdir  = $(libdir))"
+       @echo "datadir = $(datadir) (datadir = $(datadir))"
 
 #
 # Documentation targets, install-docs for the whole lot, or
@@ -240,13 +234,13 @@ show-install-setup:
 install-docs : install-html install-dvi install-info
 
 install-dvi: install-dirs-dvi
-       $(INSTALL_DATA) dvi/$(package)-$(version)/* $(dvidir)
+       $(INSTALL_DATA) dvi/* $(dvidir)
 
 install-info: install-dirs-info
-       $(INSTALL_DATA) info/$(package)-$(version)/* $(infodir)
+       $(INSTALL_DATA) info/* $(infodir)
 
 install-html: install-dirs-html
-       $(INSTALL_DATA) html/$(package)-$(version)/* $(htmldir)
+       $(INSTALL_DATA) html/* $(htmldir)
 
 install-dirs-html:
        $(INSTALL_DIR) $(htmldir) 
index d8c3ccc..7b936bd 100644 (file)
@@ -1,14 +1,18 @@
 #-----------------------------------------------------------------------------
+# $Id: Makefile,v 1.24 1999/10/05 10:30:35 simonmar Exp $
+
+# We create two driver scripts: 
+#      - one to run in-place in the build tree for building libraries
+#      - one wired to the install locations for later installation
 #
+# the installation script is built first, and we invoke make recursively
+# to build the in-place version.
 
 TOP=..
 CURRENT_DIR=ghc/driver
 include $(TOP)/mk/boilerplate.mk
-#
-# The driver needs to get at the version
-include $(TOP)/mk/version.mk
 
-INSTALLING=0
+INSTALLING=1
 
 DYN_LOADABLE_BITS = \
        ghc-asm.prl \
@@ -16,8 +20,18 @@ DYN_LOADABLE_BITS = \
        ghc-consist.prl \
        ghc-split.prl
 
-SCRIPT_PROG = ghc-$(ProjectVersion)
-SCRIPT_LINK = ghc
+INSTALLED_SCRIPT_PROG  = ghc-$(ProjectVersion)
+INPLACE_SCRIPT_PROG    = ghc-inplace
+
+ifeq "$(INSTALLING)" "1"
+TOP_PWD        := $(prefix)
+SCRIPT_PROG    =  $(INSTALLED_SCRIPT_PROG)
+SCRIPT_LINK    =  ghc
+else
+TOP_PWD        := $(FPTOOLS_TOP_ABS)
+SCRIPT_PROG    =  $(INPLACE_SCRIPT_PROG)
+endif
+
 SCRIPT_OBJS = ghc.prl
  
 INTERP=perl
@@ -31,20 +45,14 @@ INTERP=perl
 USER_WAY_NAMES = $(foreach way,$(USER_WAYS),WAY_$(way)_NAME)
 USER_WAY_OPTS  = $(foreach way,$(USER_WAYS),WAY_$(way)_REAL_OPTS)
 
-ifeq "$(INSTALLING)" "1"
-TOP_PWD := $(prefix)
-else
-TOP_PWD := $(FPTOOLS_TOP_ABS)
-endif
-
 SCRIPT_SUBST_VARS := \
   INSTALLING \
-  ProjectName ProjectVersion ProjectVersionInt ProjectPatchLevel \
+  ProjectName ProjectVersion ProjectVersionInt \
   HscMajorVersion HscMinorVersion CcMajorVersion CcMinorVersion \
   CURRENT_DIR HOSTPLATFORM TARGETPLATFORM \
-  GHC_LIB_DIR GHC_RUNTIME_DIR GHC_UTILS_DIR GHC_INCLUDE_DIR \
+  GHC_LIB_DIR GHC_RUNTIME_DIR GHC_INCLUDE_DIR \
   GHC_OPT_HILEV_ASM GhcWithNativeCodeGen LeadingUnderscore\
-  GHC_UNLIT GHC_HSCPP GHC_HSC GHC_SYSMAN EnableWin32DLLs \
+  GHC_UNLIT GHC_HSCPP GHC_MKDEPENDHS GHC_HSC GHC_SYSMAN EnableWin32DLLs \
   CP RM CONTEXT_DIFF LibGmp GhcWithRegisterised \
   USER_WAY_NAMES USER_WAY_OPTS
 
@@ -62,6 +70,13 @@ endif
 
 all :: $(DYN_LOADABLE_BITS)
 
+# don't recurse on 'make install'
+#
+ifeq "$(INSTALLING)" "1"
+all clean veryclean maintainer-clean ::
+       $(MAKE) INSTALLING=0 BIN_DIST=0 $(MFLAGS) $@
+endif
+
 #
 # Install setup:
 #   the driver goes in $(bindir), the perl script helpers
@@ -73,15 +88,6 @@ INSTALL_SCRIPTS += $(SCRIPT_PROG)
 INSTALL_LIBS    += $(DYN_LOADABLE_BITS)
 
 #
-# Before really installing the driver, we have to
-# reconfigure it such that the paths it refers to,
-# point to the installed utils.
-#
-install ::
-       @$(RM) $(SCRIPT_PROG)
-       @$(MAKE) $(MFLAGS) INSTALLING=1 $(SCRIPT_PROG)
-
-#
 # depend setup: other directories need the driver script to compute
 # their dependencies, so `depend' is simply an alias for `all' here.
 depend :: all
@@ -100,13 +106,6 @@ include $(TOP)/mk/target.mk
 
 ghc.prl : $(TOP)/mk/version.mk
 
-# Hack to re-create the in-situ build tree driver script after 
-# having installed it.
-#
-install ::
-       @$(RM) $(SCRIPT_PROG)
-       @$(MAKE) $(MFLAGS) BIN_DIST=0 INSTALLING=0 $(SCRIPT_PROG)
-
 #
 # Another hack (hmm..I can see a pattern developing here :-)
 # In ghc/driver, we create a symlink from ghc-<whatever-version> to
index 99baf9f..965a8d6 100644 (file)
@@ -98,7 +98,7 @@ INSTALLING
 
 HOSTPLATFORM TARGETPLATFORM
 
-ProjectName ProjectVersion ProjectVersionInt ProjectPatchLevel 
+ProjectName ProjectVersion ProjectVersionInt
 
 HscMajorVersion HscMinorVersion CcMajorVersion CcMinorVersion
 
@@ -108,11 +108,11 @@ bindir libdir libexecdir datadir
 
 CURRENT_DIR TMPDIR
 
-GHC_LIB_DIR GHC_RUNTIME_DIR GHC_UTILS_DIR GHC_INCLUDE_DIR
+GHC_LIB_DIR GHC_RUNTIME_DIR GHC_INCLUDE_DIR
 
 GHC_OPT_HILEV_ASM GhcWithNativeCodeGen
 
-GHC_UNLIT GHC_HSCPP GHC_HSC GHC_SYSMAN
+GHC_UNLIT GHC_HSCPP GHC_MKDEPENDHS GHC_HSC GHC_SYSMAN
 
 CP RM CONTEXT_DIFF
 
@@ -385,15 +385,10 @@ $Haskell1Version = 5; # i.e., Haskell 1.4
                      )
                  );
 
-$TopClosureFile # defaults to 1.2 one; will be mangled later
-       = '';
-#      ( $INSTALLING)  ? "$InstLibDirGhc/TopClosureXXXX.o"
-#                        : "$TopPwd/$CURRENT_DIR/$GHC_RUNTIME_DIR/main/TopClosureXXXX.o";
-
 # make depend for Haskell
 $MkDependHS
        = ( $INSTALLING ) ? "$InstLibExecDirGhc/mkdependHS"
-                         : "$TopPwd/$CURRENT_DIR/$GHC_UTILS_DIR/mkdependHS/mkdependHS";
+                         : "$TopPwd/$CURRENT_DIR/$GHC_MKDEPENDHS";
 # Fill in later
 @MkDependHS_flags = ();
 
@@ -1228,8 +1223,7 @@ if ($#Input_file < 0 && $#Link_file < 0) {
 
 Tell the world who we are, if they asked.
 \begin{code}
-print STDERR "${ProjectName}, version ${ProjectVersion}, patchlevel ${ProjectPatchLevel}\n"
-    if $Verbose;
+print STDERR "${ProjectName}, version ${ProjectVersion}\n" if $Verbose;
 \end{code}
 
 %************************************************************************
@@ -1849,7 +1843,7 @@ sub runLinker
 
     &prepareWin32DllLink(1);
 
-    local($to_do) = "$lnkr $Verbose @Ld_flags $output @Link_file $TopClosureFile $libdirs @UserLibrary @SysLibrary";
+    local($to_do) = "$lnkr $Verbose @Ld_flags $output @Link_file $libdirs @UserLibrary @SysLibrary";
     &run_something($to_do, 'Linker');
 
     # finally, check the consistency info in the binary
@@ -1894,7 +1888,7 @@ eval 'exec perl -S \$0 \${1+"\$@"}'
   if \$running_under_some_shell;
 # =!=!=!=!=!=!=!=!=!=!=!
 # This script is automatically generated: DO NOT EDIT!!!
-# Generated by Glasgow Haskell, version ${ProjectVersion} ${ProjectPatchLevel}
+# Generated by Glasgow Haskell, version ${ProjectVersion}
 #
 \$pvm_executable      = '$pvm_executable';
 \$pvm_executable_base = '$pvm_executable_base';
@@ -2775,7 +2769,7 @@ arg: while($_ = $Args[0]) {
     if (/^-\?$/ || /^--?help$/) { print $LongUsage; exit $Status; }
 
     #-----------version ----------------------------------------------------
-    /^--version$/   && do { print STDERR "${ProjectName}, version ${ProjectVersion}, patchlevel ${ProjectPatchLevel}\n"; exit $Status; };
+    /^--version$/   && do { print STDERR "${ProjectName}, version ${ProjectVersion}\n"; exit $Status; };
 
     #---------- verbosity and such -----------------------------------------
     /^-v$/         && do { $Verbose = '-v'; $Time = 'time'; next arg; };
index f99e2c5..99f5876 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.7 1999/09/17 10:43:51 sof Exp $
+# $Id: Makefile,v 1.8 1999/10/05 10:30:27 simonmar Exp $
 #
 # Makefile for concurrent libraries.
 #
@@ -8,6 +8,8 @@ include $(TOP)/mk/boilerplate.mk
 
 WAYS=$(GhcLibWays)
 
+HC = $(GHC)
+
 #-----------------------------------------------------------------------------
 #      Setting the standard variables
 #
index d662b07..1bf2d90 100644 (file)
@@ -12,6 +12,8 @@ include $(TOP)/mk/boilerplate.mk
 
 WAYS=$(GhcLibWays)
 
+HC = $(GHC)
+
 #-----------------------------------------------------------------------------
 #      Setting the standard variables
 #
index 2da481e..5852b25 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.18 1999/09/17 10:43:52 sof Exp $
+# $Id: Makefile,v 1.19 1999/10/05 10:30:28 simonmar Exp $
 #
 # Makefile for miscellaneous libraries.
 #
@@ -14,6 +14,8 @@ else
 SUBDIRS=
 endif
 
+HC = $(GHC)
+
 #-----------------------------------------------------------------------------
 #      Setting the standard variables
 #
index d4b8065..b1b02cd 100644 (file)
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile,v 1.7 1999/05/11 17:05:48 keithw Exp $
+# $Id: Makefile,v 1.8 1999/10/05 10:30:29 simonmar Exp $
 #
 # Makefile for POSIX library
 #
@@ -15,6 +15,8 @@ else
 SUBDIRS=
 endif
 
+HC = $(GHC)
+
 #-----------------------------------------------------------------------------
 #      Setting the standard variables
 #
index eab2b40..126400e 100644 (file)
@@ -18,6 +18,8 @@ else
 SUBDIRS=
 endif
 
+HC = $(GHC)
+
 #-----------------------------------------------------------------------------
 #      Setting the standard variables
 #
index 58331ad..bf10fec 100644 (file)
@@ -42,9 +42,11 @@ GHC_LIB_DIR          = $(TOP)/lib
 GHC_INCLUDE_DIR        = $(TOP)/includes
 GHC_UTILS_DIR          = $(TOP)/utils
 
-GHC                    = $(GHC_DRIVER_DIR)/ghc
+GHC                    = $(GHC_DRIVER_DIR)/ghc-inplace
 GHC_HSCPP_DIR          = $(GHC_UTILS_DIR)/hscpp
 GHC_HSCPP              = $(GHC_HSCPP_DIR)/hscpp
+GHC_MKDEPENDHS_DIR     = $(GHC_UTILS_DIR)/mkdependHS
+GHC_MKDEPENDHS                 = $(GHC_MKDEPENDHS_DIR)/mkdependHS-inplace
 GHC_HSP                = $(GHC_HSP_DIR)/hsp
 GHC_HSP_DIR            = $(GHC_HSC_DIR)
 GHC_HSC                = $(GHC_HSC_DIR)/hsc
index b52f1bd..4c7b2b5 100644 (file)
 #
 # Ghc project settings:
 # 
-# *ProjectVersion    is treated as a *string*
-# *ProjectVersionInt is treated as an *integer* (for cpp defines)
+# ProjectVersion    is treated as a *string*
+# ProjectVersionInt is treated as an *integer* (for cpp defines)
+
+# Versioning scheme: A.BB.C
+#         A: major version, any number of digits
+#         B: minor version, two digits padded with leading zeros
+#        C: patchlevel, one digit, omitted if zero.
+#
+# ProjectVersionInt does *not* contain the patchlevel (rationale: this
+# figure is used for conditional compilations, and library interfaces
+# etc. are not supposed to change between patchlevels).
 
 ProjectName       = The Glorious Glasgow Haskell Compilation System
 ProjectNameShort  = ghc
 ProjectVersion    = 4.05
 ProjectVersionInt = 405
-ProjectPatchLevel = 0
 
 #
 # Optionally, you can get the compiler driver to check the
index 6a85958..65835ea 100644 (file)
@@ -1,3 +1,9 @@
+#-----------------------------------------------------------------------------
+# $Id: Makefile,v 1.11 1999/10/05 10:30:33 simonmar Exp $
+#
+# hscpp doesn't depend on any of the install paths, so we don't need to
+# play the same tricks we play with mkdependHS and the GHC driver script.
+
 TOP=../..
 include $(TOP)/mk/boilerplate.mk
 
@@ -5,9 +11,6 @@ SCRIPT_PROG=hscpp
 SCRIPT_OBJS=hscpp.prl
 SCRIPT_SUBST_VARS= RAWCPP
 
-# Note: might be overridden from cmd-line (see install rule below)
-INSTALLING=0
-
 INTERP=perl
 
 #
@@ -16,24 +19,4 @@ INTERP=perl
 INSTALL_LIB_SCRIPTS+=$(SCRIPT_PROG)
 INSTALL_LIBEXECS=$(C_PROG)
 
-
-#
-# Before really installing the script, we have to
-# reconfigure it such that the paths it refers to,
-# point to the installed utils.
-#
-install ::
-       @$(RM) $(SCRIPT_PROG)
-       @$(MAKE) $(MFLAGS) INSTALLING=1 $(SCRIPT_PROG)
-
-
 include $(TOP)/mk/target.mk
-
-
-# Hack to re-create the in-situ build tree script after 
-# having just installed it.
-#
-install ::
-       @$(RM) $(SCRIPT_PROG)
-       @$(MAKE) $(MFLAGS) BIN_DIST=0 $(SCRIPT_PROG)
-
index c2bb0d1..2ceeb70 100644 (file)
@@ -1,12 +1,13 @@
+#-----------------------------------------------------------------------------
+# $Id: Makefile,v 1.18 1999/10/05 10:30:33 simonmar Exp $
+
 TOP=../..
 include $(TOP)/mk/boilerplate.mk
-include $(TOP)/mk/version.mk
-INSTALLING=0
+
+INSTALLING=1
 
 boot :: all
 
-SCRIPT_PROG=mkdependHS
-SCRIPT_OBJS=mkdependHS.prl
 SCRIPT_SUBST_VARS= \
  TOP_PWD \
  INSTALLING \
@@ -15,47 +16,36 @@ SCRIPT_SUBST_VARS= \
 
 INTERP=perl
 
-#
-# install setup
-#
-INSTALL_LIB_SCRIPTS += $(SCRIPT_PROG)
+INSTALLED_SCRIPT_PROG  = mkdependHS
+INPLACE_SCRIPT_PROG    = mkdependHS-inplace
 
-ifneq "$(BIN_DIST)" "1"
-SCRIPT_SUBST_VARS += libdir datadir TMPDIR SED
+ifeq "$(INSTALLING)" "1"
+TOP_PWD        := $(prefix)
+SCRIPT_PROG    =  $(INSTALLED_SCRIPT_PROG)
+SCRIPT_LINK    =  ghc
+else
+TOP_PWD        := $(FPTOOLS_TOP_ABS)
+SCRIPT_PROG    =  $(INPLACE_SCRIPT_PROG)
 endif
 
+SCRIPT_OBJS=mkdependHS.prl
 
-#
-# Prepend an infomercial if installing (binary-dist or the real thing).
-#
-ifeq "$(INSTALLING)" "1"
 ifeq "$(BIN_DIST)" "1"
 SCRIPT_PREFIX_FILES += prefix.txt
-endif
+else
+SCRIPT_SUBST_VARS += libdir datadir TMPDIR SED
 endif
 
+# don't recurse on 'make install'
+#
 ifeq "$(INSTALLING)" "1"
-TOP_PWD:=$(prefix)
-else
-TOP_PWD:=$(FPTOOLS_TOP_ABS)
+all clean veryclean maintainer-clean ::
+       $(MAKE) INSTALLING=0 BIN_DIST=0 $(MFLAGS) $@
 endif
 
 #
-# Before really installing the script, we have to
-# reconfigure it such that the paths it refers to,
-# point to the installed utils.
+# install setup
 #
-install ::
-       $(RM) $(SCRIPT_PROG)
-       $(MAKE) $(MFLAGS) INSTALLING=1 $(SCRIPT_PROG)
+INSTALL_LIB_SCRIPTS += $(SCRIPT_PROG)
 
 include $(TOP)/mk/target.mk
-
-#
-# Hack to re-create the in-situ build tree script after 
-# 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) BIN_DIST=0 INSTALLING=0 $(SCRIPT_PROG)
index 4a98ebc..612f58b 100644 (file)
@@ -724,59 +724,6 @@ dist-package-tar-gz ::
 dist-package-zip ::
        cd $(SRC_DIST_DIR); cd ..; $(ZIP) $(ZIP_OPTS) -r $(SRC_DIST_NAME).zip $(SRC_DIST_NAME)
 
-#
-# binary-dist creates a binary bundle, set BIN_DIST_NAME
-# to package name and do `make binary-dist' (normally this
-# just a thing you would do from the toplevel of fptools or)
-# from the top of a project.
-#
-.PHONY: binary-dist-pre binary-dist binary-pack
-
-binary-dist-pre::
-       -rm -rf $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)
-       -rm -f $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME).tar.gz
-       @for i in $(BIN_DIST_DIRS); do                   \
-         if test -d "$$i"; then                         \
-          echo $(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM)/$(ProjectNameShort)-$(ProjectVersion); \
-          $(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM)/$(ProjectNameShort)-$(ProjectVersion); \
-          echo $(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/$(ProjectNameShort)-$(ProjectVersion); \
-          $(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/$(ProjectNameShort)-$(ProjectVersion); \
-          echo $(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/share/$(ProjectNameShort)-$(ProjectVersion); \
-          $(MKDIRHIER) $(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/share/$(ProjectNameShort)-$(ProjectVersion); \
-          echo $(MAKE) -C $$i $(MFLAGS) install BIN_DIST=1 BIN_DIST_NAME=$(BIN_DIST_NAME) \
-                       prefix=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME) \
-                       exec_prefix=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME) \
-                       bindir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM)/$(ProjectNameShort)-$(ProjectVersion) \
-                       libdir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/$(ProjectNameShort)-$(ProjectVersion) \
-                       libexecdir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/$(ProjectNameShort)-$(ProjectVersion) \
-                       datadir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/share/$(ProjectNameShort)-$(ProjectVersion) ; \
-          $(MAKE) -C $$i $(MFLAGS) install BIN_DIST=1 BIN_DIST_NAME=$(BIN_DIST_NAME) \
-                       prefix=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME) \
-                       exec_prefix=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME) \
-                       bindir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/bin/$(TARGETPLATFORM)/$(ProjectNameShort)-$(ProjectVersion) \
-                       libdir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/$(ProjectNameShort)-$(ProjectVersion) \
-                       libexecdir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/lib/$(TARGETPLATFORM)/$(ProjectNameShort)-$(ProjectVersion) \
-                       datadir=$(BIN_DIST_TMPDIR)/$(BIN_DIST_NAME)/share/$(ProjectNameShort)-$(ProjectVersion) ; \
-         fi; \
-       done
-
-#
-# Do this separately for now
-# 
-binary-pack::
-       ( cd $(BIN_DIST_TMPDIR); $(TAR) chzf $(BIN_DIST_NAME).tar.gz $(BIN_DIST_NAME); rm -rf $(BIN_DIST_NAME) )
-
-ifneq "$(way)" ""
-package-way-dist::
-       ( cd $(BIN_DIST_TMPDIR); find $(BIN_DIST_NAME)/ \( -name "*$(_way).a" -o -name "*.$(way_)hi" \) -print | xargs tar cvf $(BIN_DIST_TMPDIR)/ghc-$(ProjectVersion)-$(way)-$(TARGETPLATFORM).tar )
-       gzip $(BIN_DIST_TMPDIR)/ghc-$(ProjectVersion)-$(way)-$(TARGETPLATFORM).tar
-endif
-
-ifneq "$(way)" ""
-remove-way-dist::
-       ( cd $(BIN_DIST_TMPDIR); find $(BIN_DIST_NAME)/ \( -name "*$(_way).a" -o -name "*.$(way_)hi" \) -print -exec rm -f {} \; )
-endif
-
 ###########################################
 #
 #      Targets: check tags show info