diff --git a/Makefile b/Makefile index a70a037edf83139267f6ce9135c512237e6f8435..3ce1f8212850a0dc8116721c1c0ea1b8da0afda4 100644 --- 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!" diff --git a/distrib/Makefile-bin.in b/distrib/Makefile-bin.in index a40ff0dd4c684c221729f34245400b4af83749e0..61c0cf5e81aba9e6f95928fc8b03b76a3f0b8910 100644 --- a/distrib/Makefile-bin.in +++ b/distrib/Makefile-bin.in @@ -58,24 +58,18 @@ # 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) diff --git a/ghc/driver/Makefile b/ghc/driver/Makefile index d8c3ccc689a1ed8aca8c8710ca79ac2bbfbd6076..7b936bdc78bcce74a776102f792162de68a1e399 100644 --- a/ghc/driver/Makefile +++ b/ghc/driver/Makefile @@ -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 @@ -72,15 +87,6 @@ all :: $(DYN_LOADABLE_BITS) 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. @@ -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 diff --git a/ghc/driver/ghc.lprl b/ghc/driver/ghc.lprl index 99baf9fd57d587a2a1b310b846e60a51e3183ce4..965a8d6d1940576665b20cc75f55cc874688828b 100644 --- a/ghc/driver/ghc.lprl +++ b/ghc/driver/ghc.lprl @@ -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; }; diff --git a/ghc/lib/concurrent/Makefile b/ghc/lib/concurrent/Makefile index f99e2c5ac8a7337fc1dd7af78eef992f200be6a8..99f587613417b684ddb5040a76c846fe390217e4 100644 --- a/ghc/lib/concurrent/Makefile +++ b/ghc/lib/concurrent/Makefile @@ -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 # diff --git a/ghc/lib/exts/Makefile b/ghc/lib/exts/Makefile index d662b0763ff67f0ce876919c2a20d46d74d9a0b3..1bf2d90bf70320db64b7e4064fe24cd2104564fb 100644 --- a/ghc/lib/exts/Makefile +++ b/ghc/lib/exts/Makefile @@ -12,6 +12,8 @@ include $(TOP)/mk/boilerplate.mk WAYS=$(GhcLibWays) +HC = $(GHC) + #----------------------------------------------------------------------------- # Setting the standard variables # diff --git a/ghc/lib/misc/Makefile b/ghc/lib/misc/Makefile index 2da481ed2833333b0cb7415903cb81b1b780b929..5852b2577a0f8b582836b71bcc54e6796f4c4258 100644 --- a/ghc/lib/misc/Makefile +++ b/ghc/lib/misc/Makefile @@ -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 # diff --git a/ghc/lib/posix/Makefile b/ghc/lib/posix/Makefile index d4b80657e89dc1cb35bef1bc727fd8b8b72b4568..b1b02cdf539dd0c59a7df4f4f52cf0f40eaed5b2 100644 --- a/ghc/lib/posix/Makefile +++ b/ghc/lib/posix/Makefile @@ -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 # diff --git a/ghc/lib/std/Makefile b/ghc/lib/std/Makefile index eab2b40561db446712c06a10b37cae0cf93eafc5..126400eada8b1a495f696faca1f7fbfa1c1bb0b4 100644 --- a/ghc/lib/std/Makefile +++ b/ghc/lib/std/Makefile @@ -18,6 +18,8 @@ else SUBDIRS= endif +HC = $(GHC) + #----------------------------------------------------------------------------- # Setting the standard variables # diff --git a/ghc/mk/paths.mk b/ghc/mk/paths.mk index 58331ad5d31404778b0bb34af9d9fc82152fbf32..bf10fec36523ab04db9c878ab4136aad4a2674f8 100644 --- a/ghc/mk/paths.mk +++ b/ghc/mk/paths.mk @@ -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 diff --git a/ghc/mk/version.mk b/ghc/mk/version.mk index b52f1bd2a2be115854d2d0050f8d6cc73e90fd3e..4c7b2b56c5a3af0af6813153f047929ffaa5abda 100644 --- a/ghc/mk/version.mk +++ b/ghc/mk/version.mk @@ -16,14 +16,22 @@ # # 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 diff --git a/ghc/utils/hscpp/Makefile b/ghc/utils/hscpp/Makefile index 6a85958ef5ced787c1816e5e5d9fb515788c6193..65835ea7ee50ed62b54e723eafb7b95de1072e0d 100644 --- a/ghc/utils/hscpp/Makefile +++ b/ghc/utils/hscpp/Makefile @@ -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) - diff --git a/ghc/utils/mkdependHS/Makefile b/ghc/utils/mkdependHS/Makefile index c2bb0d17bcd719e8675fe37199a7a92223f49545..2ceeb700ca463f80743060d2dba9c3ea2c41df48 100644 --- a/ghc/utils/mkdependHS/Makefile +++ b/ghc/utils/mkdependHS/Makefile @@ -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) diff --git a/mk/target.mk b/mk/target.mk index 4a98ebcb7bf4ef96766049eb526fde1911855665..612f58b2321ecad54e4dc46d62882efe75e29a9f 100644 --- a/mk/target.mk +++ b/mk/target.mk @@ -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