Resources
---------
+The GHC Developer's Wiki
+
+ The home for GHC Developers, with information on accessing the latest sources,
+ the bug tracker, and further documentation on the code.
+ http://hackage.haskell.org/trac/ghc
+
+
The Building Guide
Full documentation on the build system.
############################################################################
#
-# fptools/Makefile
+# This is the top-level Makefile for GHC
#
-# This is the main Makefile for fptools.
+# Targets:
+#
+# bootsrap (DEFAULT)
+# Builds GHC, then builds the libraries,
+# then uses this GHC ("stage 1") to build itself
+# ("stage 2").
+#
+# bootstrap2
+# Same as bootstrap
+#
+# bootstrap3
+# bootstrap2 + we build GHC one more time ("stage 3")
+#
+# stage1
+# Just build up to stage 1
+#
+# stage2
+# Just build stage 2 (stage 1 must be built)
+#
+# stage3
+# Just build stage 3 (stage 2 must be built)
+#
+# all
+# Same as bootstrap
+#
+# install
+# Install everything, including stage 2 compiler by default
+# (override with stage=3, for example).
+#
+# dist
+# Make a source dist (WARNING: runs 'make distclean' first)
+#
+# binary-dist
+# Builds a binary distribution
+#
+# hc-file-bundle
+# Builds an HC-file bundle, for bootstrapping
+#
+# clean, distclean, maintainer-clean
+# Increasing levels of cleanliness
#
############################################################################
TOP=.
include $(TOP)/mk/boilerplate.mk
-# find the projects that actually exist...
-ProjectsThatExist = $(filter $(patsubst %/, %, $(wildcard */)), $(AllProjects))
-
-# and filter only those that the user requested, if necessary
-ifeq "$(ProjectsToBuild)" ""
-SUBDIRS = $(ProjectsThatExist)
-else
-SUBDIRS = $(filter $(ProjectsToBuild), $(ProjectsThatExist))
-endif
-
-ifneq "$(Project)" ""
- ifeq "$(Project)" "GreenCard"
- ProjectDirectory=greencard
- else
- ifeq "$(Project)" "HaskellDirect"
- ProjectDirectory=hdirect
- else
- ProjectDirectory=$(Project)
- endif
- endif
- -include $(shell echo $(ProjectDirectory) | tr A-Z a-z)/mk/config.mk
- -include $(shell echo $(ProjectDirectory) | tr A-Z a-z)/mk/version.mk
-endif
-
-# -----------------------------------------------------------------------------
-# Certain targets require that Project is set from the command line.
-
-CURRENT_TARGET = $(MAKECMDGOALS)
-project-check :
- @if [ "$(Project)" = "" ]; then \
- echo " You need to set \"Project\" in order to make $(CURRENT_TARGET)"; \
- echo " eg. make $(CURRENT_TARGET) Project=Ghc"; \
- exit 1; \
- fi
-
-# -----------------------------------------------------------------------------
-# Targets: all, stage1, stage2, stage3
-
-DIST_CLEAN_FILES += config.cache config.status mk/config.h mk/stamp-h
-
-extraclean::
- $(RM) -rf autom4te.cache
-
#
-# If you've ended up using an in-place version of Happy,
-# make sure it gets built early on.
+# Order is important! It's e.g. necessary to descend into include/
+# before the rest to have a config.h, etc.
#
-ifeq "$(HAPPY)" "$(FPTOOLS_TOP_ABS)/happy/src/happy-inplace"
-build :: $(FPTOOLS_TOP_ABS)/happy/src/happy-inplace
+# If we're booting from .hc files, swap the order
+# we descend into subdirs - to boot utils must be before driver.
+#
+.PHONY: stage1 stage2 stage3 bootstrap bootstrap2 bootstrap3
-$(FPTOOLS_TOP_ABS)/happy/src/happy-inplace : glafp-utils
- $(MAKE) -C happy boot all
+# We can't 'make boot' in libraries until stage1 is built
+ifeq "$(BootingFromHc)" "YES"
+SUBDIRS_NOLIB = includes rts docs compiler compat utils driver
+else
+SUBDIRS_NOLIB = includes compat utils driver docs compiler rts
endif
-# Build all projects that we know about
-build ::
+SUBDIRS = $(SUBDIRS_NOLIB) libraries
+
+stage1 :
+ $(MAKE) -C utils/mkdependC boot
@case '${MFLAGS}' in *-[ik]*) x_on_err=0;; *-r*[ik]*) x_on_err=0;; *) x_on_err=1;; esac; \
- for i in $(SUBDIRS); do \
- if [ -d $$i ]; then \
- $(MAKE) -C $$i boot; \
- if [ $$? -eq 0 -o $$x_on_err -eq 0 ] ; then true; else exit 1; fi; \
- $(MAKE) -C $$i all; \
- if [ $$? -eq 0 -o $$x_on_err -eq 0 ] ; then true; else exit 1; fi; \
- fi; \
+ for i in $(SUBDIRS_NOLIB); do \
+ echo "------------------------------------------------------------------------"; \
+ echo "== $(MAKE) boot $(MFLAGS);"; \
+ echo " in $(shell pwd)/$$i"; \
+ echo "------------------------------------------------------------------------"; \
+ $(MAKE) --no-print-directory -C $$i $(MFLAGS) boot; \
+ if [ $$? -eq 0 -o $$x_on_err -eq 0 ] ; then true; else exit 1; fi; \
+ done; \
+ for i in $(SUBDIRS_NOLIB); do \
+ echo "------------------------------------------------------------------------"; \
+ echo "== $(MAKE) all $(MFLAGS);"; \
+ echo " in $(shell pwd)/$$i"; \
+ echo "------------------------------------------------------------------------"; \
+ $(MAKE) --no-print-directory -C $$i $(MFLAGS) all; \
+ if [ $$? -eq 0 -o $$x_on_err -eq 0 ] ; then true; else exit 1; fi; \
done
-
-ifeq "$(findstring ghc, $(SUBDIRS))" "ghc"
-
-.PHONY: stage1 stage2 stage3 bootstrap bootstrap2 bootstrap3
-
-stage1 : build
+ @$(MAKE) -C libraries boot
+ @$(MAKE) -C libraries all
stage2 :
- $(MAKE) -C ghc/compiler boot stage=2
- $(MAKE) -C ghc/compiler stage=2
+ $(MAKE) -C compiler boot stage=2
+ $(MAKE) -C compiler stage=2
stage3 :
- $(MAKE) -C ghc/compiler boot stage=3
- $(MAKE) -C ghc/compiler stage=3
+ $(MAKE) -C compiler boot stage=3
+ $(MAKE) -C compiler stage=3
bootstrap : bootstrap2
all :: bootstrap
+# -----------------------------------------------------------------------------
+# Installing
+
# We want to install the stage 2 bootstrapped compiler by default, but we let
# the user override this by saying 'make install stage=1', for example.
ifeq "$(stage)" ""
INSTALL_STAGE =
endif
-else # Not building GHC
-
-all :: build
-
-INSTALL_STAGE =
-
-endif
-
-boot ::
- @echo "Please use \`make all' only from the top-level, or \`make boot' followed"
- @echo "by \`make all' in an individual project subdirectory (ghc, hslibs etc.)."
-
+# Same as default rule, but we pass $(INSTALL_STAGE) to $(MAKE) too
install ::
@case '${MFLAGS}' in *-[ik]*) x_on_err=0;; *-r*[ik]*) x_on_err=0;; *) x_on_err=1;; esac; \
- for i in $(filter-out $(ProjectsDontInstall), $(SUBDIRS)); do \
- if [ -d $$i ]; then \
- $(MAKE) -C $$i $(INSTALL_STAGE) install; \
- if [ $$? -eq 0 -o $$x_on_err -eq 0 ] ; then true; else exit 1; fi; \
- fi; \
+ for i in $(SUBDIRS); do \
+ echo "------------------------------------------------------------------------"; \
+ echo "== $(MAKE) $@ $(MFLAGS);"; \
+ echo " in $(shell pwd)/$$i"; \
+ echo "------------------------------------------------------------------------"; \
+ $(MAKE) --no-print-directory -C $$i $(INSTALL_STAGE) $(MFLAGS) $@; \
+ if [ $$? -eq 0 -o $$x_on_err -eq 0 ] ; then true; else exit 1; fi; \
done
+ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
+# These files need to be in the InstallShield
+# INSTALL_DATAS rather than INSTALL_DOCS is used so these files go
+# in the top-level directory of the distribution
+INSTALL_DATAS += ANNOUNCE LICENSE README VERSION
+endif
+
# If installing on Windows with MinGW32, copy the gcc compiler, headers and libs
# and the perl interpreter and dll into the GHC prefix directory.
# Gcc and Perl source locations derived from configuration data.
install-docs ::
@case '${MFLAGS}' in *-[ik]*) x_on_err=0;; *-r*[ik]*) x_on_err=0;; *) x_on_err=1;; esac; \
- for i in $(filter-out $(ProjectsDontInstall), $(SUBDIRS)); do \
- if [ -d $$i ]; then \
- $(MAKE) -C $$i $(INSTALL_STAGE) install-docs; \
- if [ $$? -eq 0 -o $$x_on_err -eq 0 ] ; then true; else exit 1; fi; \
- fi; \
+ for i in $(SUBDIRS); do \
+ echo "------------------------------------------------------------------------"; \
+ echo "== $(MAKE) $@ $(MFLAGS);"; \
+ echo " in $(shell pwd)/$$i"; \
+ echo "------------------------------------------------------------------------"; \
+ $(MAKE) --no-print-directory -C $$i $(INSTALL_STAGE) $(MFLAGS) $@; \
+ if [ $$? -eq 0 -o $$x_on_err -eq 0 ] ; then true; else exit 1; fi; \
done
# -----------------------------------------------------------------------------
# binary-dist is an FPtools addition for binary distributions
#
-binary-dist :: project-check
+ifneq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
+GhcBinDistShScripts = ghc-$(ProjectVersion) ghci-$(ProjectVersion) ghc-pkg-$(ProjectVersion) hsc2hs
+else
+GhcBinDistShScripts =
+endif
+
+GhcBinDistPrlScripts = ghcprof
+GhcBinDistLibPrlScripts = ghc-asm ghc-split
+GhcBinDistBins = hp2ps runghc
+GhcBinDistOptBins = runhaskell
+GhcBinDistLinks = ghc ghci ghc-pkg
+GhcBinDistLibSplicedFiles = package.conf
BIN_DIST_TMPDIR=$(FPTOOLS_TOP_ABS)
BIN_DIST_NAME=$(ProjectNameShort)-$(ProjectVersion)
# Do it like this:
#
# $ make
-# $ make dist Project=Ghc
+# $ make dist
#
# WARNING: `make dist' calls `make distclean' before tarring up the tree.
#
hc-file-bundle : project-check
$(RM) -r $(ProjectNameShort)-$(ProjectVersion)
$(LN_S) . $(ProjectNameShort)-$(ProjectVersion)
- $(FIND) $(ProjectNameShort)-$(ProjectVersion)/ghc/compiler \
- $(ProjectNameShort)-$(ProjectVersion)/ghc/utils \
- $(ProjectNameShort)-$(ProjectVersion)/ghc/lib \
+ $(FIND) $(ProjectNameShort)-$(ProjectVersion)/compiler \
+ $(ProjectNameShort)-$(ProjectVersion)/utils \
+ $(ProjectNameShort)-$(ProjectVersion)/compat \
$(ProjectNameShort)-$(ProjectVersion)/libraries -follow \
\( -name "*.hc" -o -name "*_hsc.[ch]" -o -name "*_stub.[ch]" \) -print > hc-files-to-go
- for f in `$(FIND) $(ProjectNameShort)-$(ProjectVersion)/ghc/compiler $(ProjectNameShort)-$(ProjectVersion)/ghc/utils $(ProjectNameShort)-$(ProjectVersion)/libraries -name "*.hsc" -follow -print` ""; do \
+ for f in `$(FIND) $(ProjectNameShort)-$(ProjectVersion)/compiler $(ProjectNameShort)-$(ProjectVersion)/utils $(ProjectNameShort)-$(ProjectVersion)/libraries -name "*.hsc" -follow -print` ""; do \
if test "x$$f" != "x" && test -e `echo "$$f" | sed 's/hsc$$/hs/g'`; then \
echo `echo "$$f" | sed 's/hsc$$/hs/g' ` >> hc-files-to-go ; \
fi; \
done;
- for f in `$(FIND) $(ProjectNameShort)-$(ProjectVersion)/ghc/compiler $(ProjectNameShort)-$(ProjectVersion)/ghc/rts -name "*.cmm" -follow -print` ""; do \
+ for f in `$(FIND) $(ProjectNameShort)-$(ProjectVersion)/compiler $(ProjectNameShort)-$(ProjectVersion)/rts -name "*.cmm" -follow -print` ""; do \
if test "x$$f" != "x"; then \
echo `echo "$$f" | sed 's/cmm$$/hc/g' ` >> hc-files-to-go ; \
fi; \
done;
echo $(ProjectNameShort)-$(ProjectVersion)/libraries/base/GHC/PrimopWrappers.hs >> hc-files-to-go
- echo $(ProjectNameShort)-$(ProjectVersion)/ghc/compiler/parser/Parser.hs >> hc-files-to-go
- echo $(ProjectNameShort)-$(ProjectVersion)/ghc/compiler/parser/ParserCore.hs >> hc-files-to-go
- echo $(ProjectNameShort)-$(ProjectVersion)/ghc/compiler/main/ParsePkgConf.hs >> hc-files-to-go
+ echo $(ProjectNameShort)-$(ProjectVersion)/compiler/parser/Parser.hs >> hc-files-to-go
+ echo $(ProjectNameShort)-$(ProjectVersion)/compiler/parser/ParserCore.hs >> hc-files-to-go
+ echo $(ProjectNameShort)-$(ProjectVersion)/compiler/main/ParsePkgConf.hs >> hc-files-to-go
echo $(ProjectNameShort)-$(ProjectVersion)/libraries/haskell-src/Language/Haskell/Parser.hs >> hc-files-to-go
tar czf $(ProjectNameShort)-$(ProjectVersion)-$(TARGETPLATFORM)-hc.tar.gz `cat hc-files-to-go`
+# -----------------------------------------------------------------------------
+# Cleaning
+
CLEAN_FILES += hc-files-to-go *-hc.tar.gz
+DIST_CLEAN_FILES += config.cache config.status mk/config.h mk/stamp-h \
+ ghc.spec docs/users_guide/ug-book.xml
+
+# don't clean config.mk: it's needed when cleaning stuff later on
+LATE_DIST_CLEAN_FILES += mk/config.mk
+
+extraclean::
+ $(RM) -rf autom4te.cache
+
# -----------------------------------------------------------------------------
# Turn off target.mk's rules for 'all', 'boot' and 'install'.
-GHC build system
-================
+The Glasgow Haskell Compiler
+============================
-This is the top-level directory of the fptools build system. Several
-packages are part of this build system; if you got this as part of a
-source distribution (eg. for GHC), then you will have one or more of
-the following directories:
+This is the source tree for GHC, a compiler and interactive
+environment for the Haskell functional programming language.
- ghc The Glasgow Haskell Compiler
- hslibs A Collection of Haskell libraries
- haddock A Haskell documentation tool
- haggis The Haggis GUI toolkit
- happy The Happy Haskell parser generator
- hdirect Haskell interop tool
- greencard A foreign function interface pre-processor for Haskell.
- libraries Haskell libraries (reqd. by ghc)
- nofib The NoFib Haskell benchmarking suite
+For more information, visit GHC's web site:
-Additional documentation for each project can be found in its
-respective directory.
+ http://www.haskell.org/ghc/
-In addition, the following directories contain project-independent bits:
+Information for developers of GHC can be found here:
- mk GNU make setup used by all of fptools
- glafp-utils Shared utility programs
- docs Documentation on the installing and using
- the fptools build system.
- distrib Tools and additional bits for building distributions
+ http://hackage.haskell.org/trac/ghc/
-Quick start: the following is *supposed* to work
+Building & Installing
+=====================
+
+NB. you need GHC installed in order to build GHC, because the compiler
+is itself written in Haskell. It is possible to build GHC using just
+a C compiler, but we don't recommend this as the normal route. If you
+*really* want to do it this way, then see the Building Guide (link
+below).
+
+You also need a few other tools installed: Happy [4], Alex [5], and
+Haddock [6] (for building library documentation), and a good DocBook
+XML toolchain if you want to build the compiler documentation.
+
+Quick start: the following gives you a default build:
+
+ $ autoreconf
$ ./configure
$ make
$ make install
-where 'make' is whatever GNU make is called on your system (GNU make
-is *required*). If there are any other tools required for the build,
-then the configure script will detect them and tell you if any are
-missing. For example, a working GHC installation is required for
-building most of the tools (including GHC itself).
+The autoreconf step is only necessary if this is a tree checked out
+from darcs. For source distributions downloaded from GHC's web site,
+this step has already been performed.
+
+These steps give you the default build, which includes everything
+optimised and built in various ways (eg. profiling libs are built).
+It can take a long time. To customise the build, see the file
+HACKING.
+
+For full information on building GHC, see the GHC Building Guide [3],
+which is also available in source form (DocBook XML) in docs/building.
-The configuration script is a standard GNU autoconf script which
-accepts all the normal arguments, eg. --prefix=<blah> to install the
-package somewhere other than /usr/local. Try ./configure --help to
-get a full list of the options.
-There is usually an ANNOUNCE* file with any distribution. Please
-consult that, or the <piece>/README file, to find out how to proceed.
+References
+==========
-Full documentation for the fptools build system can be found in the
-Building Guide:
+ [1] http://www.haskell.org/ghc/ GHC Home Page
+ [2] http://hackage.haskell.org/trac/ghc GHC Developer's Wiki
+ [3] http://www.haskell.org/ghc/docs/latest/html/building/index.html
+ Building Guide
- http://www.haskell.org/ghc/docs/latest/html/building/building-guide.html
+ [4] http://www.haskell.org/happy/ Happy
+ [5] http://www.haskell.org/alex/ Alex
+ [6] http://www.haskell.org/haddock/ Haddock
-More information about GHC can be found here:
- http://www.haskell.org/ghc/
+Contributors
+============
---
-The GHC Team, glasgow-haskell-users@haskell.org
+Please see
+
+ http://www.haskell.org/ghc/contributors.html
GhcPkgCmd=$fp_cv_matching_ghc_pkg
fi])# FP_PROG_GHC_PKG
+
+# FP_GHC_HAS_READLINE
+# -------------------
+AC_DEFUN([FP_GHC_HAS_READLINE],
+[AC_REQUIRE([FP_PROG_GHC_PKG])
+AC_CACHE_CHECK([whether ghc has readline package], [fp_cv_ghc_has_readline],
+[if "${GhcPkgCmd-ghc-pkg}" --show-package readline >/dev/null 2>&1; then
+ fp_cv_ghc_has_readline=yes
+else
+ fp_cv_ghc_has_readline=no
+ fi])
+AC_SUBST([GhcHasReadline], [`echo $fp_cv_ghc_has_readline | sed 'y/yesno/YESNO/'`])
+])# FP_GHC_HAS_READLINE
+
+
+# FP_GCC_NEEDS_NO_OMIT_LFPTR
+# --------------------------
+# Some OSs (Mandrake Linux, in particular) configure GCC with
+# -momit-leaf-frame-pointer on by default. If this is the case, we need to turn
+# it off for mangling to work. The test is currently a bit crude, using only the
+# version number of gcc. Defines HAVE_GCC_MNO_OMIT_LFPTR.
+AC_DEFUN([FP_GCC_NEEDS_NO_OMIT_LFPTR],
+[AC_REQUIRE([FP_HAVE_GCC])
+AC_CACHE_CHECK([whether gcc needs -mno-omit-leaf-frame-pointer], [fp_cv_gcc_needs_no_omit_lfptr],
+[FP_COMPARE_VERSIONS([$gcc_version_str], [-ge], [3.2],
+ [fp_cv_gcc_needs_no_omit_lfptr=yes],
+ [fp_cv_gcc_needs_no_omit_lfptr=no])])
+if test "$fp_cv_gcc_needs_no_omit_lfptr" = "yes"; then
+ AC_DEFINE([HAVE_GCC_MNO_OMIT_LFPTR], [1], [Define to 1 if gcc supports -mno-omit-leaf-frame-pointer.])
+fi])# FP_GCC_NEEDS_NO_OMIT_LFPTR
+
+
+# FP_SETUP_PROJECT_VERSION
+# ---------------------
+AC_DEFUN([FP_SETUP_PROJECT_VERSION],
+[# Some renamings
+AC_SUBST([ProjectVersion], [$PACKAGE_VERSION])
+
+# Split PACKAGE_VERSION into (possibly empty) parts
+VERSION_MAJOR=`echo $PACKAGE_VERSION | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\1'/`
+VERSION_TMP=`echo $PACKAGE_VERSION | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\3'/`
+VERSION_MINOR=`echo $VERSION_TMP | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\1'/`
+ProjectPatchLevel=`echo $VERSION_TMP | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\3'/`
+
+# Calculate project version as an integer, using 2 digits for minor version
+case $VERSION_MINOR in
+ ?) ProjectVersionInt=${VERSION_MAJOR}0${VERSION_MINOR} ;;
+ ??) ProjectVersionInt=${VERSION_MAJOR}${VERSION_MINOR} ;;
+ *) AC_MSG_ERROR([bad minor version in $PACKAGE_VERSION]) ;;
+esac
+AC_SUBST([ProjectVersionInt])
+
+# The project patchlevel is zero unless stated otherwise
+test -z "$ProjectPatchLevel" && ProjectPatchLevel=0
+
+# Remove dots from the patch level; this allows us to have versions like 6.4.1.20050508
+ProjectPatchLevel=`echo $ProjectPatchLevel | sed 's/\.//'`
+
+AC_SUBST([ProjectPatchLevel])
+])# FP_SETUP_PROJECT_INFO
+
# LocalWords: fi
-TOP=../..
+TOP=..
include $(TOP)/mk/boilerplate.mk
ALL_DIRS = \
# Settings for using the libghccompat.a library elsewhere in the build
# tree: this file is just included into Makefiles, see
-# ghc/utils/ghc-pkg/Makefile for example.
+# utils/ghc-pkg/Makefile for example.
#
# This is a poor-mans package, but simpler because we don't
# have to deal with variations in the package support of different
# versions of GHC.
# Use libghccompat.a:
-SRC_HC_OPTS += -i$(GHC_LIB_COMPAT_DIR)
-SRC_LD_OPTS += -L$(GHC_LIB_COMPAT_DIR) -lghccompat
+SRC_HC_OPTS += -i$(GHC_COMPAT_DIR)
+SRC_LD_OPTS += -L$(GHC_COMPAT_DIR) -lghccompat
# Do *not* use the installed Cabal:
ifeq "$(ghc_ge_603)" "YES"
endif
# And similarly for when booting from .hc files:
-HC_BOOT_LD_OPTS += -L$(GHC_LIB_COMPAT_DIR)
+HC_BOOT_LD_OPTS += -L$(GHC_COMPAT_DIR)
HC_BOOT_LIBS += -lghccompat
ifeq "$(Windows)" "YES"
SRC_MKDEPENDHS_OPTS += \
-optdep--exclude-module=Compat.RawSystem \
-optdep--exclude-module=Compat.Directory \
+ -optdep--exclude-module=Compat.Unicode \
-optdep--exclude-module=Distribution.Compat.FilePath \
-optdep--exclude-module=Distribution.Compat.ReadP \
-optdep--exclude-module=Distribution.Extension \
# -----------------------------------------------------------------------------
-# Main ghc/compiler Makefile
+# Main compiler Makefile
# Targets:
#
# Generate supporting stuff for prelude/PrimOp.lhs
# from prelude/primops.txt
-GENPOC=$(TOP)/utils/genprimopcode/genprimopcode
-
PRIMOP_BITS=primop-data-decl.hs-incl \
primop-tag.hs-incl \
primop-list.hs-incl \
endif
primop-data-decl.hs-incl: prelude/primops.txt
- $(GENPOC) --data-decl < $< > $@
+ $(GENPRIMOP) --data-decl < $< > $@
primop-tag.hs-incl: prelude/primops.txt
- $(GENPOC) --primop-tag < $< > $@
+ $(GENPRIMOP) --primop-tag < $< > $@
primop-list.hs-incl: prelude/primops.txt
- $(GENPOC) --primop-list < $< > $@
+ $(GENPRIMOP) --primop-list < $< > $@
primop-has-side-effects.hs-incl: prelude/primops.txt
- $(GENPOC) --has-side-effects < $< > $@
+ $(GENPRIMOP) --has-side-effects < $< > $@
primop-out-of-line.hs-incl: prelude/primops.txt
- $(GENPOC) --out-of-line < $< > $@
+ $(GENPRIMOP) --out-of-line < $< > $@
primop-commutable.hs-incl: prelude/primops.txt
- $(GENPOC) --commutable < $< > $@
+ $(GENPRIMOP) --commutable < $< > $@
primop-needs-wrapper.hs-incl: prelude/primops.txt
- $(GENPOC) --needs-wrapper < $< > $@
+ $(GENPRIMOP) --needs-wrapper < $< > $@
primop-can-fail.hs-incl: prelude/primops.txt
- $(GENPOC) --can-fail < $< > $@
+ $(GENPRIMOP) --can-fail < $< > $@
primop-strictness.hs-incl: prelude/primops.txt
- $(GENPOC) --strictness < $< > $@
+ $(GENPRIMOP) --strictness < $< > $@
primop-primop-info.hs-incl: prelude/primops.txt
- $(GENPOC) --primop-primop-info < $< > $@
+ $(GENPRIMOP) --primop-primop-info < $< > $@
# Usages aren't used any more; but the generator
# can still generate them if we want them back
primop-usage.hs-incl: prelude/primops.txt
- $(GENPOC) --usage < $< > $@
+ $(GENPRIMOP) --usage < $< > $@
#-----------------------------------------------------------------------------
# libraries will be available from the main libraries.
ifeq "$(stage)" "1"
-include $(GHC_LIB_COMPAT_DIR)/compat.mk
+include $(GHC_COMPAT_DIR)/compat.mk
endif
SRC_LD_OPTS += -no-link-chk
$(odir)/ghc-inplace : $(HS_PROG)
@$(RM) $@
echo '#!/bin/sh' >>$@
- echo exec $(FPTOOLS_TOP_ABS)/ghc/compiler/$(HS_PROG) '-B$(subst \,\\,$(FPTOOLS_TOP_ABS_PLATFORM))' '"$$@"' >>$@
+ echo exec $(GHC_COMPILER_DIR_ABS)/$(HS_PROG) '-B$(subst \,\\,$(FPTOOLS_TOP_ABS_PLATFORM))' '"$$@"' >>$@
chmod 755 $@
ghc-inplace : stage1/ghc-inplace
LIBOBJS = $(filter-out $(odir)/main/Main.o $(odir)/parser/hschooks.o, $(OBJS))
# disable splitting: it won't really help with GHC, and the specialised
-# build system for ghc/compiler isn't set up to handle it.
+# build system for compiler/ isn't set up to handle it.
SplitObjs = NO
# the package build system likes to set WAYS=$(GhcLibWays), but we don't
# see what flags are available. (Better yet, read the documentation!)
#
-AC_INIT([fptools build system], [1.0], [cvs-fptools@haskell.org], [fptools])
+AC_INIT([The Glorious Glasgow Haskell Compilation System], [6.5], [glasgow-haskell-bugs@haskell.org], [ghc])
+
+FP_SETUP_PROJECT_VERSION
+
+# Hmmm, we fix the RPM release number to 1 here... Is this convenient?
+AC_SUBST([release], [1])
# First off, a distrib sanity check..
AC_CONFIG_SRCDIR([mk/config.mk.in])
dnl After the toplevel configuration is complete, the script will recurse into
dnl these subdirectories if they exist. The use of a cache file makes repeated
dnl checks cheap.
-AC_CONFIG_SUBDIRS([ghc libraries])
+AC_CONFIG_SUBDIRS([libraries])
# -------------------------------------------------------------------------
# Prepare to generate the following header files
AC_SUBST(GhcPatchLevel)dnl
fi
+# Check whether this GHC has readline installed
+FP_GHC_HAS_READLINE
+
AC_PATH_PROGS(NHC,nhc nhc98)
AC_PATH_PROG(HBC,hbc)
AC_MSG_ERROR([GHC is required unless bootstrapping from .hc files.])
fi;
-dnl ** --enable-threaded-rts (not used any more)
-dnl --------------------------------------------------------------
-AC_ARG_ENABLE(threaded-rts,
-[AC_HELP_STRING([--enable-threaded-rts],
-[DEPRECATED (backwards compatibility only). [default=no]])],
-[ if test x"$enableval" = x"yes"; then
- ThreadedRts=YES
- else
- ThreadedRts=NO
- fi
-],
-[ThreadedRts=NO]
-)
-AC_SUBST(ThreadedRts)
-
dnl ** Enable the construction of Win32 DLLs?
dnl --------------------------------------------------------------
dnl
dnl
FP_HAVE_GCC
FP_MINGW_GCC
+FP_GCC_NEEDS_NO_OMIT_LFPTR
dnl ** figure out how to invoke cpp directly (gcc -E is no good)
AC_PROG_CPP
[Define to 1 if we have printf$LDBLStub (Apple Mac OS >= 10.4, PPC).])
])
+# test for GTK+
+AC_PATH_PROGS([GTK_CONFIG], [pkg-config])
+if test -n "$GTK_CONFIG"; then
+ if $GTK_CONFIG gtk+-2.0 --atleast-version=2.0; then
+ GTK_CONFIG="$GTK_CONFIG gtk+-2.0"
+ else
+ AC_MSG_WARN([GTK+ not usable, need at least version 2.0])
+ GTK_CONFIG=
+ fi
+fi
+AC_SUBST([GTK_CONFIG])
-AC_CONFIG_FILES([mk/config.mk])
+AC_CONFIG_FILES([mk/config.mk ghc.spec docs/users_guide/ug-book.xml])
AC_CONFIG_COMMANDS([mk/stamp-h],[echo timestamp > mk/stamp-h])
AC_OUTPUT
echo "*** Building compiler..."
./configure --enable-hc-boot $configopts
-$MAKE -C glafp-utils boot all
+$MAKE -C utils boot all
$MAKE -C ghc boot
$MAKE -C libraries boot all GhcBootLibs=YES
$MAKE -C ghc all
# Reconfigure, using the newly-build ghc binary as our $(GHC), and
# with hc bootstrapping disabled.
-HappyCmd="$PWD/distrib/fake-happy" ./configure --with-ghc="$PWD/ghc/compiler/ghc-inplace" $configopts
+HappyCmd="$PWD/distrib/fake-happy" ./configure --with-ghc="$PWD/compiler/ghc-inplace" $configopts
PRIMOP_BITS="primop-data-decl.hs-incl \
primop-tag.hs-incl \
find libraries hslibs | grep '\.[oa]$' | xargs rm -f
# Do includes and RTS now
-$MAKE -C ghc/includes boot && $MAKE -C ghc/includes all
-$MAKE -C ghc/rts boot && $MAKE -C ghc/rts all
+$MAKE -C includes boot && $MAKE -C includes all
+$MAKE -C rts boot && $MAKE -C rts all
# Now build a new set of libraries (GhcBootLibs only for now)
$MAKE -C libraries boot all GhcBootLibs=YES
-# Build all of ghc/lib
-$MAKE -C ghc/lib clean && $MAKE -C ghc/lib boot all
+# Build all of compat
+$MAKE -C compat clean && $MAKE -C compat boot all
-# Build all of ghc/utils
-$MAKE -C ghc/utils clean && $MAKE -C ghc/utils boot all
+# Build all of utils
+$MAKE -C utils clean && $MAKE -C utils boot all
# Build the rest of the libraries
$MAKE -C libraries boot all
-# Now we can build hslibs (hsc2hs is required, so must be after ghc/utils)
-$MAKE -C hslibs boot all
-
# The reconfigure step updates a few files, which can lead to
# unnecessary recompilations. Touch a bunch of things here to avoid
# having to recompile stuff that we've already built.
-(cd ghc/compiler; touch $PRIMOP_BITS parser/hschooks.o prelude/PrimOp.o main/Config.hs main/Config.o ghc-*)
+(cd compiler; touch $PRIMOP_BITS parser/hschooks.o prelude/PrimOp.o main/Config.hs main/Config.o ghc-*)
# At this point, the tree should be safe to do 'make install' in.
TOP = ..
include $(TOP)/mk/boilerplate.mk
-SUBDIRS = docbook-cheat-sheet
+SUBDIRS = building docbook-cheat-sheet ext-core storage-mgt users_guide
include $(TOP)/mk/target.mk
GHCLIB=$(libdir)
endif # BIN_DIST
else
-GHCBIN=$(FPTOOLS_TOP_ABS)/ghc/compiler/ghc-$(ProjectVersion)
+GHCBIN=$(FPTOOLS_TOP_ABS)/$(GHC_COMPILER_DIR_REL)/ghc-$(ProjectVersion)
GHCLIB=$(FPTOOLS_TOP_ABS)
endif
endif
endif
-ifeq ($(IncludeTestDirsInBuild),YES)
-SUBDIRS += tests
-endif
-
SRC_DIST_FILES += configure
# Clean everything created by configure:
+++ /dev/null
-The Glasgow Haskell Compiler
-============================
-
-(this file is fptools/ghc/README in a source distribution, and
-fptools/README in a binary distribution).
-
-GHC is a batch compiler for Haskell 98. See the file ANNOUNCE for
-information on the current version.
-
-Haskell is "the" standard lazy functional programming language.
-Haskell 98 is the current version of the language, released in
-December 1998. The language definition is on the Web at
-http://www.haskell.org/definition/.
-
-More information on GHC can be found on its web page
-
- http://www.haskell.org/ghc/
-
-Documentation
-=============
-
-In a binary distribution, pre-formatted documentation can be found in
-the html and ps directories. Pre-formatted HTML documentation is also
-available on the GHC web page.
-
-In a source distribution, the unformatted (DocBook XML) documentation
-is in the following places:
-
- * fptools/ghc/docs/users_guide Users' Guide.
- * fptools/hslibs/doc/hslibs Library documentation.
- * fptools/docs Build System Guide.
-
-We welcome your comments and suggestions about this software! Please
-do not suffer or grumble in silence. The "bug reports" section of the
-User's Guide says what we would like to know when you report a
-problem.
-
-Mailing Lists
-=============
-
- glasgow-haskell-bugs@haskell.org (bug reports mailing list)
- glasgow-haskell-users@haskell.org (users' mailing list)
- cvs-ghc@haskell.org (developers & bleeding-edge users list)
-
- subscribe at http://www.haskell.org/mailman/listinfo/
-
-Contributors
-=============
-
-Please see
-
- http://www.haskell.org/ghc/contributors.html
-
+++ /dev/null
-@ProjectName@, version @ProjectVersion@
+++ /dev/null
-# FP_SETUP_PROJECT_INFO
-# ---------------------
-AC_DEFUN([FP_SETUP_PROJECT_INFO],
-[# Some renamings
-AC_SUBST([ProjectName], [$PACKAGE_NAME])
-AC_SUBST([ProjectNameShort], [$PACKAGE_TARNAME])
-AC_SUBST([ProjectVersion], [$PACKAGE_VERSION])
-
-# Split PACKAGE_VERSION into (possibly empty) parts
-VERSION_MAJOR=`echo $PACKAGE_VERSION | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\1'/`
-VERSION_TMP=`echo $PACKAGE_VERSION | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\3'/`
-VERSION_MINOR=`echo $VERSION_TMP | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\1'/`
-ProjectPatchLevel=`echo $VERSION_TMP | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\3'/`
-
-# Calculate project version as an integer, using 2 digits for minor version
-case $VERSION_MINOR in
- ?) ProjectVersionInt=${VERSION_MAJOR}0${VERSION_MINOR} ;;
- ??) ProjectVersionInt=${VERSION_MAJOR}${VERSION_MINOR} ;;
- *) AC_MSG_ERROR([bad minor version in $PACKAGE_VERSION]) ;;
-esac
-AC_SUBST([ProjectVersionInt])
-
-# The project patchlevel is zero unless stated otherwise
-test -z "$ProjectPatchLevel" && ProjectPatchLevel=0
-
-# Remove dots from the patch level; this allows us to have versions like 6.4.1.20050508
-ProjectPatchLevel=`echo $ProjectPatchLevel | sed 's/\.//'`
-
-AC_SUBST([ProjectPatchLevel])
-])# FP_SETUP_PROJECT_INFO
-
-
-# FP_PROG_GHC_PKG
-# ----------------
-# Try to find a ghc-pkg matching the ghc mentioned in the environment variable
-# WithGhc. If the latter is unset or no matching ghc-pkg can be found, try to
-# find a plain ghc-pkg. Sets the output variable GhcPkgCmd.
-AC_DEFUN([FP_PROG_GHC_PKG],
-[AC_CACHE_CHECK([for ghc-pkg matching $WithGhc], fp_cv_matching_ghc_pkg,
-[fp_ghc_pkg_guess=`echo $WithGhc | sed 's,ghc\(@<:@^/\\@:>@*\)$,ghc-pkg\1,'`
-if "$fp_ghc_pkg_guess" -l > /dev/null 2>&1; then
- fp_cv_matching_ghc_pkg=$fp_ghc_pkg_guess
-else
- fp_cv_matching_ghc_pkg=no
-fi])
-if test x"$fp_cv_matching_ghc_pkg" = xno; then
- AC_PATH_PROG([GhcPkgCmd], [ghc-pkg])
-else
- GhcPkgCmd=$fp_cv_matching_ghc_pkg
-fi])# FP_PROG_GHC_PKG
-
-
-# FP_GHC_HAS_READLINE
-# -------------------
-AC_DEFUN([FP_GHC_HAS_READLINE],
-[AC_REQUIRE([FP_PROG_GHC_PKG])
-AC_CACHE_CHECK([whether ghc has readline package], [fp_cv_ghc_has_readline],
-[if "${GhcPkgCmd-ghc-pkg}" --show-package readline >/dev/null 2>&1; then
- fp_cv_ghc_has_readline=yes
-else
- fp_cv_ghc_has_readline=no
- fi])
-AC_SUBST([GhcHasReadline], [`echo $fp_cv_ghc_has_readline | sed 'y/yesno/YESNO/'`])
-])# FP_GHC_HAS_READLINE
-
-
-# FP_COMPARE_VERSIONS(VERSION1, TEST, VERSION2, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
-# ----------------------------------------------------------------------------------
-# Compare dotted version numbers VERSION1 and VERSION2 lexicographically according
-# to TEST (one of -eq, -ne, -lt, -le, -gt, or -ge).
-AC_DEFUN([FP_COMPARE_VERSIONS],
-[fp_version1=$1; fp_version2=$3
-fp_save_IFS=$IFS; IFS='.'
-while test x"$fp_version1" != x || test x"$fp_version2" != x
-do
-
- set dummy $fp_version1; shift
- fp_num1=""
- test $[@%:@] = 0 || { fp_num1="[$]1"; shift; }
- test x"$fp_num1" = x && fp_num1="0"
- fp_version1="[$]*"
-
- set dummy $fp_version2; shift
- fp_num2=""
- test $[@%:@] = 0 || { fp_num2="[$]1"; shift; }
- test x"$fp_num2" = x && fp_num2="0"
- fp_version2="[$]*"
-
- test "$fp_num1" = "$fp_num2" || break;
-done
-IFS=$fp_save_IFS
-AS_IF([test "$fp_num1" $2 "$fp_num2"], [$4], [$5])[]dnl
-])# FP_COMPARE_VERSIONS
-
-
-# FP_HAVE_GCC
-# -----------
-# Extra testing of the result AC_PROG_CC, testing the gcc version no. Sets the
-# output variables HaveGcc and GccVersion.
-AC_DEFUN([FP_HAVE_GCC],
-[AC_REQUIRE([AC_PROG_CC])
-AC_CACHE_CHECK([whether your gcc is OK], [fp_cv_have_gcc],
-[if test -z "$GCC"; then
- fp_cv_have_gcc='no'
- AC_MSG_WARN([You would be better off with gcc, perhaps it is already installed, but not in your PATH?])
-else
- fp_cv_have_gcc='yes'
- gcc_version_str="`$CC -v 2>&1 | grep 'version ' | sed -e 's/.*version [[^0-9]]*\([[0-9]][[0-9]]*\)\.\([[0-9]][[0-9]]*\).*/\1\.\2/g' `"
- FP_COMPARE_VERSIONS([$gcc_version_str], [-lt], [2.0],
- [AC_MSG_ERROR([Need at least gcc version 2.0 (2.95.3 recommend)])])
-fi])
-AC_SUBST([HaveGcc], [`echo $fp_cv_have_gcc | sed 'y/yesno/YESNO/'`])
-AC_SUBST([GccVersion], [`gcc --version | grep mingw | cut -f 3 -d ' '`])
-])# FP_HAVE_GCC
-
-
-# FP_GCC_NEEDS_NO_OMIT_LFPTR
-# --------------------------
-# Some OSs (Mandrake Linux, in particular) configure GCC with
-# -momit-leaf-frame-pointer on by default. If this is the case, we need to turn
-# it off for mangling to work. The test is currently a bit crude, using only the
-# version number of gcc. Defines HAVE_GCC_MNO_OMIT_LFPTR.
-AC_DEFUN([FP_GCC_NEEDS_NO_OMIT_LFPTR],
-[AC_REQUIRE([FP_HAVE_GCC])
-AC_CACHE_CHECK([whether gcc needs -mno-omit-leaf-frame-pointer], [fp_cv_gcc_needs_no_omit_lfptr],
-[FP_COMPARE_VERSIONS([$gcc_version_str], [-ge], [3.2],
- [fp_cv_gcc_needs_no_omit_lfptr=yes],
- [fp_cv_gcc_needs_no_omit_lfptr=no])])
-if test "$fp_cv_gcc_needs_no_omit_lfptr" = "yes"; then
- AC_DEFINE([HAVE_GCC_MNO_OMIT_LFPTR], [1], [Define to 1 if gcc supports -mno-omit-leaf-frame-pointer.])
-fi])# FP_GCC_NEEDS_NO_OMIT_LFPTR
+++ /dev/null
-TOP=..
-include $(TOP)/mk/boilerplate.mk
-
-SUBDIRS = compat
-
-include $(TOP)/mk/target.mk
+++ /dev/null
-# GHC boilerplate.mk
-
-GHC_TOP := $(TOP)
-
-# Include this first, because the top-level .mk files might depend on
-# the values of $(ProjectXXX) variables. (in fact they might/should not,
-# but we're not brave enough to move this include later --SDM).
--include $(GHC_TOP)/mk/version.mk
-
-# We need to set TOP to be the TOP that the next level up expects!
-# The TOP variable is reset after the inclusion of the fptools
-# boilerplate, so we stash TOP away first:
-TOP:=$(GHC_TOP)/..
-
-include $(TOP)/mk/boilerplate.mk
-
-# Reset TOP
-TOP:=$(GHC_TOP)
-
-# -----------------------------------------------------------------
-# Everything after this point
-# augments or overrides previously set variables.
-# -----------------------------------------------------------------
-
--include $(GHC_TOP)/mk/config.mk
--include $(GHC_TOP)/mk/paths.mk
--include $(GHC_TOP)/mk/opts.mk
--include $(GHC_TOP)/mk/suffix.mk
+++ /dev/null
-# -*-makefile-*-
-# @configure_input@
-
-# -----------------------------------------------------------------------------
-# GHC binary distribution configuration
-
-# These settings are used by the top-level Makefile when building
-# binary distributions.
-
-# what to include in a binary distribution
-GhcMainDir = ghc
-GhcBinDistDirs = ghc libraries hslibs
-
-ifneq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
-GhcBinDistShScripts = ghc-$(ProjectVersion) ghci-$(ProjectVersion) ghc-pkg-$(ProjectVersion) hsc2hs
-else
-GhcBinDistShScripts =
-endif
-
-GhcBinDistPrlScripts = ghcprof
-GhcBinDistLibPrlScripts = ghc-asm ghc-split
-GhcBinDistBins = hp2ps runghc
-GhcBinDistOptBins = runhaskell
-GhcBinDistLinks = ghc ghci ghc-pkg
-GhcBinDistLibSplicedFiles = package.conf
-
-# -----------------------------------------------------------------------------
-# GHC-specific configuration settings
-
-# Set to YES if $(GHC) has the readline package installed
-GhcHasReadline = @GhcHasReadline@
-
-# GTK+
-GTK_CONFIG = @GTK_CONFIG@
-
-# -----------------------------------------------------------------------------
-
-# We can build using the stage1 compiler by setting UseStage1=YES.
-# This is useful when building up a set of .hc files for
-# bootstrapping, because we need the ghc/lib/compat library and the
-# contents of ghc/utils compiled with the stage1 compiler.
-
-ifeq "$(UseStage1)" "YES"
-HC=$(GHC_STAGE1)
-MKDEPENDHS=$(GHC_STAGE1)
-endif
-
-# Some useful GHC version predicates:
-
-ifeq "$(UseStage1)" "YES"
-ghc_ge_504 = YES
-ghc_ge_601 = YES
-ghc_ge_602 = YES
-ghc_ge_603 = YES
-else
-ifeq "$(BootingFromHc)" "YES"
-ghc_ge_504 = YES
-ghc_ge_601 = YES
-ghc_ge_602 = YES
-ghc_ge_603 = YES
-else
-ghc_ge_504 = $(shell if (test $(GhcCanonVersion) -ge 504); then echo YES; else echo NO; fi)
-ghc_ge_601 = $(shell if (test $(GhcCanonVersion) -ge 601); then echo YES; else echo NO; fi)
-ghc_ge_602 = $(shell if (test $(GhcCanonVersion) -ge 602); then echo YES; else echo NO; fi)
-ghc_ge_603 = $(shell if (test $(GhcCanonVersion) -ge 603); then echo YES; else echo NO; fi)
-endif
-endif
+++ /dev/null
-# -----------------------------------------------------------------------------
-# $Id: paths.mk,v 1.44 2004/11/11 09:36:40 simonmar Exp $
-#
-# ghc project specific make variables
-#
-
-PROJECT_DIR := ghc
-
-#-----------------------------------------------------------------------------
-# Useful directories
-#
-# xxx_DIR_REL a directory relative to $(GHC_TOP)
-# xxx_DIR a directory (including $(GHC_TOP))
-
-GHC_INCLUDE_DIR_REL = includes
-GHC_COMPILER_DIR_REL = compiler
-GHC_RUNTIME_DIR_REL = rts
-GHC_UTILS_DIR_REL = utils
-GHC_DRIVER_DIR_REL = driver
-GHC_LIB_DIR_REL = lib
-
-GHC_UNLIT_DIR_REL = $(GHC_UTILS_DIR_REL)/unlit
-GHC_HSTAGS_DIR_REL = $(GHC_UTILS_DIR_REL)/hasktags
-GHC_TOUCHY_DIR_REL = $(GHC_UTILS_DIR_REL)/touchy
-GHC_PKG_DIR_REL = $(GHC_UTILS_DIR_REL)/ghc-pkg
-GHC_GENPRIMOP_DIR_REL = $(GHC_UTILS_DIR_REL)/genprimopcode
-GHC_GENAPPLY_DIR_REL = $(GHC_UTILS_DIR_REL)/genapply
-GHC_MANGLER_DIR_REL = $(GHC_DRIVER_DIR_REL)/mangler
-GHC_SPLIT_DIR_REL = $(GHC_DRIVER_DIR_REL)/split
-GHC_SYSMAN_DIR_REL = $(GHC_RUNTIME_DIR_REL)/parallel
-GHC_LIB_COMPAT_DIR_REL = $(GHC_LIB_DIR_REL)/compat
-
-GHC_INCLUDE_DIR = $(GHC_TOP)/$(GHC_INCLUDE_DIR_REL)
-GHC_COMPILER_DIR = $(GHC_TOP)/$(GHC_COMPILER_DIR_REL)
-GHC_RUNTIME_DIR = $(GHC_TOP)/$(GHC_RUNTIME_DIR_REL)
-GHC_UTILS_DIR = $(GHC_TOP)/$(GHC_UTILS_DIR_REL)
-GHC_DRIVER_DIR = $(GHC_TOP)/$(GHC_DRIVER_DIR_REL)
-GHC_PKG_DIR = $(GHC_TOP)/$(GHC_PKG_DIR_REL)
-GHC_GENPRIMOP_DIR = $(GHC_TOP)/$(GHC_GENPRIMOP_DIR_REL)
-GHC_GENAPPLY_DIR = $(GHC_TOP)/$(GHC_GENAPPLY_DIR_REL)
-GHC_MANGLER_DIR = $(GHC_TOP)/$(GHC_MANGLER_DIR_REL)
-GHC_SPLIT_DIR = $(GHC_TOP)/$(GHC_SPLIT_DIR_REL)
-GHC_LIB_COMPAT_DIR = $(GHC_TOP)/$(GHC_LIB_COMPAT_DIR_REL)
-
-# -----------------------------------------------------------------------------
-# Names of programs in the GHC tree
-#
-# xxx_PGM the name of an executable, without the path
-
-GHC_UNLIT_PGM = unlit$(exeext)
-GHC_HSTAGS_PGM = hasktags
-GHC_TOUCHY_PGM = touchy$(exeext)
-GHC_MANGLER_PGM = ghc-asm
-GHC_SPLIT_PGM = ghc-split
-GHC_SYSMAN_PGM = SysMan
-GHC_PKG_INPLACE_PGM = ghc-pkg-inplace
-GHC_GENPRIMOP_PGM = genprimopcode
-GHC_GENAPPLY_PGM = genapply
-
-# -----------------------------------------------------------------------------
-# Auxilliary programs used by GHC
-#
-# xxx the pathname to an executable (some using $(TOP))
-
-ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
-GHC_CP = "xcopy /y"
-GHC_PERL = perl
-else
-GHC_CP = $(CP)
-GHC_PERL = $(PERL)
-endif
-
-GHC_UNLIT = $(GHC_UNLIT_DIR)/$(GHC_UNLIT_PGM)
-GHC_HSTAGS = $(GHC_HSTAGS_DIR)/$(GHC_HSTAGS_PGM)
-GHC_MANGLER = $(GHC_MANGLER_DIR)/$(GHC_MANGLER_PGM)
-GHC_SPLIT = $(GHC_SPLIT_DIR)/$(GHC_SPLIT_PGM)
-GHC_SYSMAN = $(GHC_SYSMAN_DIR)/$(GHC_SYSMAN_PGM)
-GHC_PKG_INPLACE = $(GHC_PKG_DIR)/$(GHC_PKG_INPLACE_PGM)
-GHC_GENPRIMOP = $(GHC_GENPRIMOP_DIR)/$(GHC_GENPRIMOP_PGM)
-GHC_GENAPPLY = $(GHC_GENAPPLY_DIR)/$(GHC_GENAPPLY_PGM)
+++ /dev/null
-#
-# target.mk project stub
-#
-
-# We need to set TOP to be the TOP that the next level up expects!
-# The TOP variable is reset after the inclusion of the fptools
-# boilerplate, so we stash TOP away first:
-GHC_TOP := $(TOP)
-TOP:=$(TOP)/..
-
-include $(TOP)/mk/target.mk
-
-# Reset TOP
-TOP:=$(GHC_TOP)
+++ /dev/null
-#
-# Project-specific version information.
-#
-# Note:
-# this config file is intended to centralise all
-# project version information. To bump up the version
-# info on your package, edit this file and recompile
-# all the dependents. This file lives in the source tree.
-#
-# In the case of the ghc/ project, if you make changes
-# to this file, you'll *have to* to rebuild the driver
-# in your build tree(s). The ghc/driver/Makefile has got
-# a dependency that will force such rebuilding to happen,
-# but it does require you to do a 'make' in ghc/driver.
-
-#
-# Ghc project settings:
-#
-# ProjectVersion is treated as a *string*
-# ProjectVersionInt is treated as an *integer* (for cpp defines)
-
-# Versioning scheme: A.B.C
-# A: major version, decimal, any number of digits
-# B: minor version, decimal, any number of digits
-# 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).
-#
-# The ProjectVersionInt is included in interface files, and GHC
-# checks that it's reading interface generated by the same ProjectVersion
-# as itself. It does this even though interface file syntax may not
-# change between versions. Rationale: calling conventions or other
-# random .o-file stuff might change even if the .hi syntax doesn't
-
-ProjectName = @ProjectName@
-ProjectNameShort = @ProjectNameShort@
-ProjectVersion = @ProjectVersion@
-ProjectVersionInt = @ProjectVersionInt@
-ProjectPatchLevel = @ProjectPatchLevel@
-
-# Interface file version (hi-boot files only)
-#
-# A GHC built with HscIfaceFileVersion=n will look for
-# M.hi-boot-n, and only then for
-# M.hi-boot.
-# (It'll be happy with the latter if the former doesn't exist.)
-#
-#
-# This variable is used ONLY for hi-boot files. Its only purpose is
-# to allow you to have a single directory with multiple .hi-boot files
-# for the same module, each corresponding to a different version of
-# GHC.
-#
-# HscIfaceFileVersion is propagated to hsc via
-# ghc/compiler/main/Config.hs, which is automatically generated by
-# ghc/compiler/Makefile.
-
-HscIfaceFileVersion=6
+++ /dev/null
-#-----------------------------------------------------------------------------
-# $Id: Makefile,v 1.2 2003/08/01 15:38:41 panne Exp $
-#
-# (c) The GHC Team, 2000
-#
-
-TOP=../../..
-include $(TOP)/mk/boilerplate.mk
-
-C_PROG = cgprof
-INSTALL_LIBEXECS=$(C_PROG)
-
-SRC_CC_OPTS += -Wall -I$(GHC_INCLUDE_DIR)
-
-include $(TOP)/mk/target.mk
+++ /dev/null
-#-----------------------------------------------------------------------------
-# $Id: Makefile,v 1.1 2000/04/05 10:11:55 simonmar Exp $
-#
-# (c) The GHC Team, 2000
-#
-
-TOP=../../..
-include $(TOP)/mk/boilerplate.mk
-
-override datadir=$(libdir)/icons
-INSTALL_DATAS=$(wildcard *.xbm)
-
-include $(TOP)/mk/target.mk
+++ /dev/null
-#################################################################################
-#
-# glafp-utils/Makefile
-#
-# Main Makefile for project glafp-utils
-#
-#################################################################################
-
-TOP=.
-include $(TOP)/mk/boilerplate.mk
-
-# We need to write mkdependC first (in that order), to be sure that
-# make depend will succeed in all the other directories.
-SUBDIRS = mkdependC mkdirhier runstdtest
-ifneq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
-SUBDIRS += lndir
-endif
-
-include $(TOP)/mk/target.mk
+++ /dev/null
-Miscellaneous FP-projects-related tools, version 2.01, patchlevel 0
+++ /dev/null
-This directory tree's worth of stuff are utility bits that are used in
-more than one of the Glasgow functional-programming tools. (For the
-project-specific bits, try <project>/utils/<blah>.)
-
- lndir from X imake stuff (via DuBois); make a shadow tree
- of symbolic links
-
- ltx a "latex" wrapper. Re-runs latex/bibtex/makeindex
- enough times to "do the right thing."
-
- mkdependC script version of C makedepend (from X11R4 via DuBois)
-
- mkdirhier "mkdir a/b/c/d" will do "mkdir a; mkdir a/b; ..."
- (assuming none of those dirs exist)
-
- runstdtest runs a pgm with some flags & some stdin; checks for an
- expected exit code, expected stdout, and expected
- stderr. (Expect this to change :-)
-
- verbatim pre-processor for LaTeX files that typesets text between
- @...@ in typewriter font.
-
- sgmlverb pre-processor for SGML that does essentially the same thing
- as verbatim.
-
- docbook scripts to process DocBook files stolen from Cygnus DocBook
- tools.
-
- genargs converts whitespace separated strings into partial
- Haskell lists.
-
+++ /dev/null
-################################################################################
-#
-# GHC boilerplate.mk
-#
-# Boilerplate Makefile for an fptools project
-#
-################################################################################
-
-# Begin by slurping in the boilerplate from one level up.
-# Remember, TOP is the top level of the innermost level
-# (FPTOOLS_TOP is the fptools top)
-
-# We need to set TOP to be the TOP that the next level up expects!
-GLAFP_UTILS_TOP := $(TOP)
-TOP:=$(GLAFP_UTILS_TOP)/..
-
-include $(TOP)/mk/boilerplate.mk
-
-TOP:=$(GLAFP_UTILS_TOP)
-
-# -----------------------------------------------------------------
-# Everything after this point
-# augments or overrides previously set variables.
-# (these files are optional, so `make' won't fret if
-# cannot get to them).
-# -----------------------------------------------------------------
-
-#Not currently used: -include $(GLAFP_UTILS_TOP)/mk/paths.mk
-#Not currently used: -include $(GLAFP_UTILS_TOP)/mk/suffix.mk
-
-# No ways, please
-WAYS=
+++ /dev/null
-#
-# (c) The GHC Team 2000
-#
-
-TOP:=$(TOP)/..
-include $(TOP)/mk/target.mk
-TOP:=$(GLAFP_UTILS_TOP)
+++ /dev/null
-TOP=..
-include $(TOP)/mk/boilerplate.mk
-
-C_SRCS = sgmlverb.c
-C_PROG = sgmlverb
-LIBS = $(FLEX_LIB)
-
-override SRC_FLEX_OPTS=-8
-
-# sgmlverb.c isn't in distclean
-MAINTAINER_CLEAN_FILES += sgmlverb.c
-
-#
-# For src distributions, include flex output.
-#
-SRC_DIST_FILES += sgmlverb.c
-
-include $(TOP)/mk/target.mk
+++ /dev/null
-
- /* This Lex script acts as a filter to pre-process Latex files.
-
- It surrounds groups of lines beginning with a ">" sign, and
- preceded and followed by a blank line, with \begin{verbatim}
- and \end{verbatim}. The ">" may be preceded by a digit or digit
- range (eg 4>, 2-5>, 3->); in this case the digits are removed.
- They are meant to be used for filtering out versions.
-
- It takes words surrounded with @ signs (thus @letrec@) and makes them
- come out in typewriter font, regardless of the current mode.
- */
-
-%START NORM VERB VERBENV
-sp [ \t]*
-nl {sp}\n{sp}
-comment \%.*$
-miranda ([0-9]+(\-([0-9]+)?)?)?>
-%{
-#define PUSH states[top++] =
-#define POP BEGIN states[--top]
-#define yywrap() 1
-#define YY_SKIP_YYWRAP
-%}
-%%
- int states[256];
- int top;
- BEGIN NORM;
- top = 0;
-<NORM>@@ { printf ("@"); }
-<NORM>@ { printf ("<tt>"); PUSH NORM; BEGIN VERB; }
-<NORM>\\% { printf ("%"); }
-<NORM>{comment} { }
-<VERB>@ { printf ("</tt>"); POP; }
-<VERB>@@ { printf ("@"); }
-<VERB>\> { printf (">"); }
-<VERB>\< { printf ("<"); }
-<VERB>\# { printf ("#"); }
-<VERB>\$ { printf ("$"); }
-<VERB>\% { printf ("%"); }
-<VERB>\& { printf ("&"); }
-<VERB>\~ { printf ("˜"); }
-<VERB>\^ { printf ("ˆ"); }
-
-<NORM>\<verb\> { printf ("<verb>"); PUSH NORM; BEGIN VERBENV; }
-<NORM>\<code\> { printf ("<code>"); PUSH NORM; BEGIN VERBENV; }
-<NORM>\\begin\{code\} { printf ("<code>"); PUSH NORM; BEGIN VERBENV; }
-<VERBENV>\<\/verb\> { printf ("</verb>"); POP; }
-<VERBENV>\<\/code\> { printf ("</code>"); POP; }
-<VERBENV>\<\\end\{code\} { printf ("</code>"); POP; }
-<VERBENV>\&\& { printf ("&"); }
-<VERBENV>\& { printf ("&ero;"); }
-<VERBENV>\<\/ { printf ("&etago;"); }
-
-%%
-int
-main()
-{
- yylex();
- return(0);
-}
-
-/*
-<VERB>\_ { printf ("{\\char'137}"); }
-<VERB>\\ { printf ("{\\char'134}"); }
-<VERB>\{ { printf ("{\\char'173}"); }
-<VERB>\} { printf ("{\\char'175}"); }
-*/
all :: $(H_CONFIG) $(H_PLATFORM)
# gmp.h is copied from the GMP directory
-gmp.h : $(FPTOOLS_TOP)/ghc/rts/gmp/gmp.h
+gmp.h : $(FPTOOLS_TOP)/rts/gmp/gmp.h
$(CP) $< $@
# The fptools configure script creates the configuration header file and puts it
-# -----------------------------------------------------------------------------
-# $Id: boilerplate.mk,v 1.1 2001/07/31 16:40:34 simonmar Exp $
-
# Begin by slurping in the boilerplate from one level up.
# Remember, TOP is the top level of the innermost level
# (FPTOOLS_TOP is the fptools top)
LIBRARIES_TOP := $(TOP)
TOP:=$(TOP)/..
-# Also set GHC_TOP here, because we need to get at bits of GHC's config
-GHC_TOP := $(TOP)/ghc
-
-# Pull in GHC's version & project info
--include $(GHC_TOP)/mk/version.mk
-
# Pull in the fptools boilerplate
include $(TOP)/mk/boilerplate.mk
# Everything after this point
# augments or overrides previously set variables.
--include $(GHC_TOP)/mk/paths.mk
-
-include $(TOP)/mk/paths.mk
-include $(TOP)/mk/opts.mk
-include $(TOP)/mk/suffix.mk
#
# mk/boilerplate.mk
#
-# The Glorious fptools Boilerplate Makefile
+# The Glorious GHC Boilerplate Makefile
#
# This one file should be included (directly or indirectly) by all Makefiles
-# in the fptools hierarchy.
+# in the GHC hierarchy.
#
#################################################################################
HC_BOOT_CC_OPTS = $(PLATFORM_HC_BOOT_CC_OPTS) $(PLATFORM_CC_OPTS) $(CC_OPTS)
-SRC_CC_OPTS += -I$(FPTOOLS_TOP_ABS)/ghc/includes -I$(FPTOOLS_TOP_ABS)/libraries/base/include -I$(FPTOOLS_TOP_ABS)/libraries/unix/include -I$(FPTOOLS_TOP_ABS)/libraries/parsec/include
+SRC_CC_OPTS += -I$(FPTOOLS_TOP_ABS)/$(GHC_INCLUDE_DIR_REL) -I$(FPTOOLS_TOP_ABS)/libraries/base/include -I$(FPTOOLS_TOP_ABS)/libraries/unix/include -I$(FPTOOLS_TOP_ABS)/libraries/parsec/include
# C code compiled with UseGhcForCc=YES assumes the existence of certain CPP
# symbols defined by GHC (eg. __GLASGOW_HASKELL__), so we better make sure
endif
ifeq "$(HaveLibGmp)" "NO"
-DASH_L_GHC_RTS_GMP_DIR=-L$(FPTOOLS_TOP_ABS)/ghc/rts/gmp
+DASH_L_GHC_RTS_GMP_DIR=-L$(FPTOOLS_TOP_ABS)/$(GHC_RTS_DIR_REL)/gmp
endif
HC_BOOT_LD_OPTS = \
- -L$(FPTOOLS_TOP_ABS)/ghc/rts \
+ -L$(FPTOOLS_TOP_ABS)/$(GHC_RTS_DIR_REL) \
$(DASH_L_GHC_RTS_GMP_DIR) \
-L$(FPTOOLS_TOP_ABS)/libraries/base \
-L$(FPTOOLS_TOP_ABS)/libraries/base/cbits \
#
# This is one of only two files that configure generates (the other is config.h)
#
-# There is a section below for each project within the fptools suite
-#
-# PLUS
-#
-# a section corresponding to each of the main .mk files
-# included by boilerplate.mk (see boilerplate.mk for a list).
ifneq "$(findstring 3.7, $(MAKE_VERSION))" ""
ifeq "$(findstring 3.79.1, $(MAKE_VERSION))" ""
################################################################################
#
-# Project-wide platform variables
+# GHC Version
+#
+
+# ProjectVersion is treated as a *string*
+# ProjectVersionInt is treated as an *integer* (for cpp defines)
+
+# Versioning scheme: A.B.C
+# A: major version, decimal, any number of digits
+# B: minor version, decimal, any number of digits
+# 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).
+#
+# The ProjectVersionInt is included in interface files, and GHC
+# checks that it's reading interface generated by the same ProjectVersion
+# as itself. It does this even though interface file syntax may not
+# change between versions. Rationale: calling conventions or other
+# random .o-file stuff might change even if the .hi syntax doesn't
+
+ProjectVersion = @ProjectVersion@
+ProjectVersionInt = @ProjectVersionInt@
+ProjectPatchLevel = @ProjectPatchLevel@
+
+################################################################################
+#
+# Platform variables
#
################################################################################
@TargetVendor_CPP@_TARGET_VENDOR = 1
@BuildVendor_CPP@_BUILD_VENDOR = 1
+################################################################################
+#
+# Global configuration options
+#
+################################################################################
+
# Leading underscores on symbol names in object files
# Valid options: YES/NO
#
Windows=NO
endif
-################################################################################
-#
-# project-wide flags
-#
-# Set of options applicable to all fptools projects
-#
-################################################################################
-
# BootingFromHc - build GHC and the libraries from .hc files?
BootingFromHc = @BootingFromHc@
# rather than registerised code, i.e., disable the mangler?
BootingFromUnregisterisedHc = @BootingFromUnregisterisedHc@
-# Build Order: we build Happy, Haddock and Alex before GHC if they are
-# in this source tree, just in case our GHC build depends on these
-# local builds rather than installed versions of the tools.
-#
-# Build the libs first if we're bootstrapping from .hc files.
-ifeq "$(BootingFromHc)" "YES"
-AllProjects = glafp-utils happy alex haddock libraries hslibs ghc greencard hdirect hood nofib docs
-else
-AllProjects = glafp-utils happy alex haddock ghc libraries hslibs greencard hdirect hood nofib docs
-endif
-
-#
-# (OPTIONAL) set ProjectsToBuild to a list of projects to be built. If this
-# list is empty, then all projects present in the source tree will be built.
-#
-ProjectsToBuild =
-
-#
-# set ProjectsDontInstall to a list of projects which are normally built but
-# not installed.
-#
-ProjectsDontInstall = glafp-utils nofib
-
-#
-# Should the various project tests directories be built?
-#
-IncludeTestDirsInBuild=NO
-
-#
-# Should the various project example directories be built?
-#
-IncludeExampleDirsInBuild=NO
-
#
# Which ways should DocBook XML documents be built?
# options are: dvi ps pdf html chm HxS
################################################################################
#
-# GHC project
-#
-# Set of (configurable) options needed by the ghc tree
-# plus their default options (if any).
-#
-################################################################################
-
-#---------------------------------------------------------------
-#
# Variables that control how the compiler itself is built
#
-#---------------------------------------------------------------
+################################################################################
# The compiler used to build GHC is $(GHC). To change the actual compiler
# used, re-configure with --with-ghc=<path-to-ghc>.
GhcCompilerWays=
# Extra option flags to pass to the compiler that compiles the compiler
-# (Ones that are essential are wired into ghc/compiler/Makefile)
+# (Ones that are essential are wired into compiler/Makefile)
# Typical options to use here:
#
# -DDEBUG include debugging code and assertions (will make the
BuildingParallel=$(subst mp,YES,$(filter mp,$(WAYS)))
BuildingGranSim=$(subst mg,YES,$(filter mg,$(WAYS)))
+# Interface file version (hi-boot files only)
+#
+# A GHC built with HscIfaceFileVersion=n will look for
+# M.hi-boot-n, and only then for
+# M.hi-boot.
+# (It'll be happy with the latter if the former doesn't exist.)
+#
+#
+# This variable is used ONLY for hi-boot files. Its only purpose is
+# to allow you to have a single directory with multiple .hi-boot files
+# for the same module, each corresponding to a different version of
+# GHC.
+#
+# HscIfaceFileVersion is propagated to hsc via
+# compiler/main/Config.hs, which is automatically generated by
+# compiler/Makefile.
+
+HscIfaceFileVersion=6
+
#------------------------------------------------------------------------------
# Options for Libraries
SplitObjs=NO
endif
-# ----------------------------------------------------------------------------
-# Options for GHC's RTS
-
-# For an optimised RTS (you probably don't want to change these; we build
-# a debugging RTS by default now. Use -debug to get it).
-GhcRtsHcOpts=-optc-O2
-GhcRtsCcOpts=-fomit-frame-pointer
-
-# Include the front panel code? Needs GTK+.
-GhcRtsWithFrontPanel = NO
-
-################################################################################
-#
-# libraries project
-#
-################################################################################
-
# Build the Haskell Readline bindings?
#
GhcLibsWithReadline=@GhcLibsWithReadline@
#
GhcLibsWithUnix=@GhcLibsWithUnix@
-################################################################################
-#
-# happy project
-#
-# Happy specific options
-#
-################################################################################
-
-# The compiler you'd like to use to compile Happy
-WithHappyHc = @WithHc@
-
-# HappyHcOpts gives the flags to pass to the Haskell compiler used
-# to compile the Happy sources with.
-#
-HappyHcOpts = -O
+# ----------------------------------------------------------------------------
+# Options for GHC's RTS
-################################################################################
-#
-# haggis project
-#
-# Haggis specific options
-#
-################################################################################
+# For an optimised RTS (you probably don't want to change these; we build
+# a debugging RTS by default now. Use -debug to get it).
+GhcRtsHcOpts=-optc-O2
+GhcRtsCcOpts=-fomit-frame-pointer
-################################################################################
-#
-# greencard project
-#
-# GreenCard specific options
-#
-################################################################################
+# Include the front panel code? Needs GTK+.
+GhcRtsWithFrontPanel = NO
################################################################################
#
-# nofib project
+# nofib
#
# nofib specific options
#
# Number of times to run each program
NoFibRuns = 5
-# ==============================================================================
-#
-# END OF PROJECT-SPECIFIC STUFF
-#
-# Now come the generic configuration options
-#
-# ==============================================================================
-
################################################################################
#
# Paths (see paths.mk)
else
#
-# Unix: override libdir and datadir to put project-specific stuff in
+# Unix: override libdir and datadir to put ghc-specific stuff in
# a subdirectory with the version number included.
#
-libdir = $(if $(ProjectNameShort),$(libdir0)/$(ProjectNameShort)-$(ProjectVersion),$(libdir0))
-datadir = $(if $(ProjectNameShort),$(datadir0)/$(ProjectNameShort)-$(ProjectVersion),$(datadir0))
+libdir = $(libdir0)/ghc-$(ProjectVersion)
+datadir = $(datadir0)/ghc-$(ProjectVersion)
endif # Windows
################################################################################
#
-# Utilities programs: where to find them
+# Layout of the source tree
#
################################################################################
-#-----------------------------------------------------------------------------
-# FPtools Utility locations
-
-# By default, the various utils needed to be build ghc and chums
-# is set up to point to the utils/ directory. Define here the
-# path prefix for the utilities. Notice that it's a prefix with
-# a trailing slash, so that it can be concatenated directly on
-# front of a program name; if it's not set then we just look
-# along the shell's $(PATH)
-#
-# If instead you want to use installed or your own versions of these,
-# override the various *_PREFIX in build.mk, i.e., having the following
-# in build.mk:
-#
-# MKDEPENDC_PREFIX=
-#
-# will force `make' to rummage around in your PATH to find `mkdependC' (not
-# sure it would need it in the first place, but still).
-#
-GLAFP_UTILS = $(FPTOOLS_TOP)/glafp-utils
+# Here we provide defines for the various directories in the source tree,
+# so we can move things around more easily. A define $(GHC_FOO_DIR_REL)
+# indicates a directory relative to the top of the source tree, whereas
+# $(GHC_FOO_DIR) is a directory relative to the current directory.
+# $(GHC_FOO_DIR_ABS) is the absolute path to the directory.
+
+GHC_UTILS_DIR_REL = utils
+GHC_INCLUDE_DIR_REL = includes
+GHC_COMPILER_DIR_REL = compiler
+GHC_RTS_DIR_REL = rts
+GHC_UTILS_DIR_REL = utils
+GHC_DRIVER_DIR_REL = driver
+GHC_COMPAT_DIR_REL = compat
+
+GHC_MKDEPENDC_DIR_REL = $(GHC_UTILS_DIR_REL)/mkdependC
+GHC_LTX_DIR_REL = $(GHC_UTILS_DIR_REL)/ltx
+GHC_RUNTEST_DIR_REL = $(GHC_UTILS_DIR_REL)/runstdtest
+GHC_LNDIR_DIR_REL = $(GHC_UTILS_DIR_REL)/lndir
+GHC_MKDIRHIER_DIR_REL = $(GHC_UTILS_DIR_REL)/mkdirhier
+GHC_DOCBOOK_DIR_REL = $(GHC_UTILS_DIR_REL)/docbook
+GHC_UNLIT_DIR_REL = $(GHC_UTILS_DIR_REL)/unlit
+GHC_HP2PS_DIR_REL = $(GHC_UTILS_DIR_REL)/hp2ps
+GHC_HSTAGS_DIR_REL = $(GHC_UTILS_DIR_REL)/hasktags
+GHC_HSC2HS_DIR_REL = $(GHC_UTILS_DIR_REL)/hsc2hs
+GHC_TOUCHY_DIR_REL = $(GHC_UTILS_DIR_REL)/touchy
+GHC_PKG_DIR_REL = $(GHC_UTILS_DIR_REL)/ghc-pkg
+GHC_GENPRIMOP_DIR_REL = $(GHC_UTILS_DIR_REL)/genprimopcode
+GHC_GENAPPLY_DIR_REL = $(GHC_UTILS_DIR_REL)/genapply
+
+GHC_MANGLER_DIR_REL = $(GHC_DRIVER_DIR_REL)/mangler
+GHC_SPLIT_DIR_REL = $(GHC_DRIVER_DIR_REL)/split
+GHC_SYSMAN_DIR_REL = $(GHC_RTS_DIR_REL)/parallel
+
+GHC_UTILS_DIR = $(FPTOOLS_TOP)/$(GHC_UTILS_DIR_REL)
+GHC_INCLUDE_DIR = $(FPTOOLS_TOP)/$(GHC_INCLUDE_DIR_REL)
+GHC_COMPILER_DIR = $(FPTOOLS_TOP)/$(GHC_COMPILER_DIR_REL)
+GHC_RTS_DIR = $(FPTOOLS_TOP)/$(GHC_RTS_DIR_REL)
+GHC_UTILS_DIR = $(FPTOOLS_TOP)/$(GHC_UTILS_DIR_REL)
+GHC_DRIVER_DIR = $(FPTOOLS_TOP)/$(GHC_DRIVER_DIR_REL)
+GHC_COMPAT_DIR = $(FPTOOLS_TOP)/$(GHC_COMPAT_DIR_REL)
+
+GHC_MKDEPENDC_DIR = $(FPTOOLS_TOP)/$(GHC_MKDEPENDC_DIR_REL)
+GHC_LTX_DIR = $(FPTOOLS_TOP)/$(GHC_LTX_DIR_REL)
+GHC_RUNTEST_DIR = $(FPTOOLS_TOP)/$(GHC_RUNTEST_DIR_REL)
+GHC_LNDIR_DIR = $(FPTOOLS_TOP)/$(GHC_LNDIR_DIR_REL)
+GHC_MKDIRHIER_DIR = $(FPTOOLS_TOP)/$(GHC_MKDIRHIER_DIR_REL)
+GHC_DOCBOOK_DIR = $(FPTOOLS_TOP)/$(GHC_DOCBOOK_DIR_REL)
+GHC_UNLIT_DIR = $(FPTOOLS_TOP)/$(GHC_UNLIT_DIR_REL)
+GHC_HP2PS_DIR = $(FPTOOLS_TOP)/$(GHC_HP2PS_DIR_REL)
+GHC_HSTAGS_DIR = $(FPTOOLS_TOP)/$(GHC_HSTAGS_DIR_REL)
+GHC_HSC2HS_DIR = $(FPTOOLS_TOP)/$(GHC_HSC2HS_DIR_REL)
+GHC_TOUCHY_DIR = $(FPTOOLS_TOP)/$(GHC_TOUCHY_DIR_REL)
+GHC_PKG_DIR = $(FPTOOLS_TOP)/$(GHC_PKG_DIR_REL)
+GHC_GENPRIMOP_DIR = $(FPTOOLS_TOP)/$(GHC_GENPRIMOP_DIR_REL)
+GHC_GENAPPLY_DIR = $(FPTOOLS_TOP)/$(GHC_GENAPPLY_DIR_REL)
+
+GHC_MANGLER_DIR = $(FPTOOLS_TOP)/$(GHC_MANGLER_DIR_REL)
+GHC_SPLIT_DIR = $(FPTOOLS_TOP)/$(GHC_SPLIT_DIR_REL)
+GHC_SYSMAN_DIR = $(FPTOOLS_TOP)/$(GHC_SYSMAN_DIR_REL)
+
+GHC_UTILS_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_UTILS_DIR_REL)
+GHC_INCLUDE_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_INCLUDE_DIR_REL)
+GHC_COMPILER_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_COMPILER_DIR_REL)
+GHC_RTS_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_RTS_DIR_REL)
+GHC_UTILS_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_UTILS_DIR_REL)
+GHC_DRIVER_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_DRIVER_DIR_REL)
+GHC_COMPAT_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_COMPAT_DIR_REL)
+
+GHC_MKDEPENDC_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_MKDEPENDC_DIR_REL)
+GHC_LTX_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_LTX_DIR_REL)
+GHC_RUNTEST_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_RUNTEST_DIR_REL)
+GHC_LNDIR_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_LNDIR_DIR_REL)
+GHC_MKDIRHIER_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_MKDIRHIER_DIR_REL)
+GHC_DOCBOOK_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_DOCBOOK_DIR_REL)
+GHC_UNLIT_DIR = $(FPTOOLS_TOP_ABS)/$(GHC_UNLIT_DIR_REL)
+GHC_HP2PS_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_HP2PS_DIR_REL)
+GHC_HSTAGS_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_HSTAGS_DIR_REL)
+GHC_HSC2HS_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_HSC2HS_DIR_REL)
+GHC_TOUCHY_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_TOUCHY_DIR_REL)
+GHC_PKG_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_PKG_DIR_REL)
+GHC_GENPRIMOP_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_GENPRIMOP_DIR_REL)
+GHC_GENAPPLY_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_GENAPPLY_DIR_REL)
+
+GHC_MANGLER_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_MANGLER_DIR_REL)
+GHC_SYSMAN_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_SYSMAN_DIR_REL)
+GHC_SPLIT_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_SPLIT_DIR_REL)
-SCRIPT_PREFIX = $(GLAFP_UTILS)/scripts/
-MKDEPENDC_PREFIX = $(GLAFP_UTILS)/mkdependC/
-LTX_PREFIX = $(GLAFP_UTILS)/ltx/
-RUNTEST_PREFIX = $(GLAFP_UTILS)/runstdtest/
-VERBATIM_PREFIX = $(GLAFP_UTILS)/verbatim/
-SGMLVERB_PREFIX = $(GLAFP_UTILS)/sgmlverb/
-ETAGS_PREFIX = $(GLAFP_UTILS)/etags/
-LNDIR_PREFIX = $(GLAFP_UTILS)/lndir/
-MKDIRHIER_PREFIX = $(GLAFP_UTILS)/mkdirhier/
-DOCBOOK_PREFIX = $(GLAFP_UTILS)/docbook/
-
-HADDOCK_PREFIX = $(FPTOOLS_TOP)/haddock/
+# -----------------------------------------------------------------------------
+# Names of programs in the GHC tree
+#
+# xxx_PGM the name of an executable, without the path
+# xxx the executable relative to the current dir
+
+GHC_UNLIT_PGM = unlit$(exeext)
+GHC_HSTAGS_PGM = hasktags
+GHC_HSC2HS_INPLACE_PGM = hsc2hs-inplace
+GHC_TOUCHY_PGM = touchy$(exeext)
+GHC_MANGLER_PGM = ghc-asm
+GHC_SPLIT_PGM = ghc-split
+GHC_SYSMAN_PGM = SysMan
+GHC_PKG_INPLACE_PGM = ghc-pkg-inplace
+GHC_GENPRIMOP_PGM = genprimopcode
+GHC_GENAPPLY_PGM = genapply
+GHC_MKDEPENDC_PGM = mkdependC
+GHC_LTX_PGM = ltx
+GHC_MKDIRHIER_PGM = mkdirhier
+GHC_LNDIR_PGM = lndir
+GHC_RUNTEST_PGM = runstdtest
-LITERATE_PREFIX = $(FPTOOLS_TOP)/literate/
+ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
+GHC_CP = "xcopy /y"
+GHC_PERL = perl
+else
+GHC_CP = $(CP)
+GHC_PERL = $(PERL)
+endif
-UNLIT_PREFIX = $(FPTOOLS_TOP)/ghc/utils/unlit/
-HP2PS_PREFIX = $(FPTOOLS_TOP)/ghc/utils/hp2ps/
-HSTAGS_PREFIX = $(FPTOOLS_TOP)/ghc/utils/hasktags/
-HSC2HS_PREFIX = $(FPTOOLS_TOP)/ghc/utils/hsc2hs/
+UNLIT = $(GHC_UNLIT_DIR)/$(GHC_UNLIT_PGM)
+HSTAGS = $(GHC_HSTAGS_DIR)/$(GHC_HSTAGS_PGM)
+HSC2HS_INPLACE = $(GHC_HSC2HS_DIR)/$(GHC_HSC2HS_INPLACE_PGM)
+MANGLER = $(GHC_MANGLER_DIR)/$(GHC_MANGLER_PGM)
+SPLIT = $(GHC_SPLIT_DIR)/$(GHC_SPLIT_PGM)
+SYSMAN = $(GHC_SYSMAN_DIR)/$(GHC_SYSMAN_PGM)
+GHC_PKG_INPLACE = $(GHC_PKG_DIR)/$(GHC_PKG_INPLACE_PGM)
+GENPRIMOP = $(GHC_GENPRIMOP_DIR)/$(GHC_GENPRIMOP_PGM)
+GENAPPLY = $(GHC_GENAPPLY_DIR)/$(GHC_GENAPPLY_PGM)
+MKDEPENDC = $(GHC_MKDEPENDC_DIR)/$(GHC_MKDEPENDC_PGM)
+LTX = $(GHC_LTX_DIR)/$(GHC_LTX_PGM)
+MKDIRHIER = $(GHC_MKDIRHIER_DIR)/$(GHC_MKDIRHIER_PGM)
+LNDIR = $(GHC_LNDIR_DIR)/$(GHC_LNDIR_PGM)
+RUNTEST = $(GHC_RUNTEST_DIR)/$(GHC_RUNTEST_PGM)
#-----------------------------------------------------------------------------
# Haskell compilers and mkdependHS
GhcMinVersion = @GhcMinVersion@
GhcPatchLevel = @GhcPatchLevel@
+# Set to YES if $(GHC) has the readline package installed
+GhcHasReadline = @GhcHasReadline@
+
# Canonicalised ghc version number, used for easy (integer) version
# comparisons. We must expand $(GhcMinVersion) to two digits by
# adding a leading zero if necessary:
HBC = @HBC@
NHC = @NHC@
+# Setting UseStage1=YES forces use of the stage1 compiler to compile
+# Haskell code, rather than the installed compiler.
+ifeq "$(UseStage1)" "YES"
+HC =$(GHC_STAGE1)
+MKDEPENDHS =$(GHC_STAGE1)
+else
HC = @WithHc@
MKDEPENDHS = $(GHC)
+endif
# Sometimes we want to invoke ghc from the build tree in different
-# projects (eg. it's handy to have a nofib & a ghc build in the same
+# places (eg. it's handy to have a nofib & a ghc build in the same
# tree). We can refer to "this ghc" as $(GHC_INPLACE):
-GHC_INPLACE = $(FPTOOLS_TOP)/ghc/compiler/ghc-inplace
-GHC_STAGE1 = $(FPTOOLS_TOP)/ghc/compiler/stage1/ghc-inplace
-GHC_STAGE2 = $(FPTOOLS_TOP)/ghc/compiler/stage2/ghc-inplace
-GHC_STAGE3 = $(FPTOOLS_TOP)/ghc/compiler/stage3/ghc-inplace
+GHC_INPLACE = $(GHC_COMPILER_DIR)/ghc-inplace
+GHC_STAGE1 = $(GHC_COMPILER_DIR)/stage1/ghc-inplace
+GHC_STAGE2 = $(GHC_COMPILER_DIR)/stage2/ghc-inplace
+GHC_STAGE3 = $(GHC_COMPILER_DIR)/stage3/ghc-inplace
+
+# Some useful GHC version predicates:
+
+ifeq "$(UseStage1)" "YES"
+ghc_ge_504 = YES
+ghc_ge_601 = YES
+ghc_ge_602 = YES
+ghc_ge_603 = YES
+else
+ifeq "$(BootingFromHc)" "YES"
+ghc_ge_504 = YES
+ghc_ge_601 = YES
+ghc_ge_602 = YES
+ghc_ge_603 = YES
+else
+ghc_ge_504 = $(shell if (test $(GhcCanonVersion) -ge 504); then echo YES; else echo NO; fi)
+ghc_ge_601 = $(shell if (test $(GhcCanonVersion) -ge 601); then echo YES; else echo NO; fi)
+ghc_ge_602 = $(shell if (test $(GhcCanonVersion) -ge 602); then echo YES; else echo NO; fi)
+ghc_ge_603 = $(shell if (test $(GhcCanonVersion) -ge 603); then echo YES; else echo NO; fi)
+endif
+endif
#-----------------------------------------------------------------------------
# C compiler
# The reason for having to do this is that overly long command lines
# cause unnecessary trouble with some shells (e.g., /bin/sh on Solaris
# 2.5.1), which is why this backdoor is provided. The situation of overly
-# long command lines is either encountered while doing `make boot' in ghc/compiler,
+# long command lines is either encountered while doing `make boot' in compiler/,
# or when linking the compiler binary (`hsc').
#
# We do not use SHELL to execute long commands, as `make' will more than likely
TROFF = troff
UNAME = uname
+# GTK+
+GTK_CONFIG = @GTK_CONFIG@
+
#-----------------------------------------------------------------------------
# DocBook XML stuff
#-----------------------------------------------------------------------------
# FPtools support software
-# Stuff from fptools/glafp-utils
-MKDEPENDC = $(MKDEPENDC_PREFIX)mkdependC
-LTX = $(LTX_PREFIX)ltx
-MKDIRHIER = $(MKDIRHIER_PREFIX)mkdirhier
-LNDIR = $(LNDIR_PREFIX)lndir
-ETAGS = $(ETAGS_PREFIX)etags
-VERBATIM = $(VERBATIM_PREFIX)verbatim
-SGMLVERB = $(SGMLVERB_PREFIX)sgmlverb
-RUNTEST = $(RUNTEST_PREFIX)runstdtest
-
BLD_DLL = dllwrap
#
# Haddock
#
HADDOCK = @HaddockCmd@
-HADDOCK_INPLACE = $(HADDOCK_PREFIX)/src/haddock-inplace
-
-#
-# Stuff from fptools/literate
-#
-LIT2PGM = $(LITERATE_PREFIX)lit2pgm
-LIT2HTML = $(LITERATE_PREFIX)lit2html
-LIT2LATEX = $(LITERATE_PREFIX)lit2latex
-MKDEPENDLIT = $(LITERATE_PREFIX)mkdependlit
-LIT2CHANGELOG = $(LITERATE_PREFIX)lit2changelog
-LIT2TEXT = $(LITERATE_PREFIX)lit2text
-
-#
-# Stuff from fptools/ghc/utils
-#
-UNLIT = $(UNLIT_PREFIX)unlit$(exeext)
-HP2PS = $(HP2PS_PREFIX)hp2ps$(exeext)
-HSTAGS = $(HSTAGS_PREFIX)hasktags
-HSC2HS = $(HSC2HS_PREFIX)hsc2hs-inplace
#
-# Options for the compiling different `ways'. Various projects within
-# the glorious fptools tree support building in various user-configured
-# ways. For instance, you could set up one `way' such that the prelude
-# libraries all were built with the option -ffoldr-build-on.
+# Options for compiling in different `ways'.
#
# To configure up your own way, have a look at some of the standard ways
# such as profiling, and create your own set of WAY_*_OPTS defs below.
#
#
-# IMPORTANT! The WAYS variable configures the different `ways'
-# you want to build a project (or maybe just parts of it, as is
-# the case for ghc/). This variable is intended set inside the
-# project mk setup, enforcing a global fptools WAYS is a bit too
-# much (do you *really* want to build glafp-utils the profiled-concurrent
-# way?)
-#
-
-#
# Definitions of the different ways:
#
# * their name:
# The following ways currently have treated specially, p u t mg,
# as the driver script treats these guys specially and needs to carefully be told
# about the options for these. Hence, we hide the required command line options
-# for these in the ghc/driver, as this is the only place they are needed.
+# for these in the driver, as this is the only place they are needed.
#
# If you want to add to these default options, fill in the variables below:
ifneq "$(PACKAGE)" ""
-ifeq "$(STANDALONE_PACKAGE)" ""
-ifeq "$(ProjectNameShort)" "ghc"
+# FIXME: does anyone do this any more?
STANDALONE_PACKAGE = NO
-else
-STANDALONE_PACKAGE = YES
-endif
-endif
# -----------------------------------------------------------------------------
# Directory layouts, installation etc.
sed -e 's/""//g' -e 's/:[ ]*,/: /g' >$@
# we could be more accurate here and add a dependency on
-# ghc/driver/package.conf, but that doesn't work too well because of
+# driver/package.conf, but that doesn't work too well because of
# make's limited accuracy with modification times: when doing 'make
# boot' in multiple packages, make won't detect that the package
# configuration needs updating if it was updated already in the last
#
# NOTE: $(SCRIPT_OBJS) is not in MOSTLY_CLEAN_FILES, because in some
# places in the tree it appears that we have source files in $(SCRIPT_OBJS).
-# Specifically glafp-utils/mkdependC/mkdependC.prl and others in ghc/driver and
+# Specifically glafp-utils/mkdependC/mkdependC.prl and others in driver/ and
# possibly others elsewhere in the tree. ToDo: fix this properly.
MOSTLY_CLEAN_FILES += $(HS_OBJS) $(C_OBJS) $(HSC_C_OBJS) $(GC_C_OBJS)
CLEAN_FILES += $(HS_PROG) $(C_PROG) $(SCRIPT_PROG) $(SCRIPT_LINK) \
# Haskell Suffix Rules
# The $(odir) support is for building GHC, where we need to build three
-# different versions from the same sources. See ghc/compiler/Makefile.
+# different versions from the same sources. See compiler/Makefile.
ifneq "$(odir)" ""
odir_ = $(odir)/
else
#
ifneq "$(BootingFromHc)" "YES"
%_hsc.c %_hsc.h %.hs : %.hsc
- $(HSC2HS) $(HSC2HS_OPTS) $<
+ $(HSC2HS_INPLACE) $(HSC2HS_OPTS) $<
@touch $(patsubst %.hsc,%_hsc.c,$<)
endif
#
# target.mk
#
-# Standard targets for fptools
+# Standard targets for GHC
#
#################################################################################
#
# This file contain three groups of target rules:
#
-# 1. FPtools targets
+# 1. GHC targets
# depend*
# runtests*
#
# install-docs*
# clean* distclean* mostlyclean* maintainer-clean*
# tags*
-# dvi ps (no info) FPTOOLS adds: pdf rtf html chm HxS
+# dvi ps (no info) GHC adds: pdf rtf html chm HxS
# check
#
# 3. Some of the above targets have a version that
include $(TOP)/mk/suffix.mk
##################################################################
-# FPtools standard targets
+# GHC standard targets
#
# depend:
#
# directories where files are installed, and their parent
# directories. There is a script called `mkinstalldirs' which is
# convenient for this; find it in the Texinfo package.
-# (FPTOOLS: we use a close relative of the suggested script, situated
+# (GHC: we use a close relative of the suggested script, situated
# in glafp-utils/mkdirhier -- SOF)
ifneq "$(PACKAGE) $(IS_CBITS_LIB)" "std YES"
ifneq "$(PACKAGE)" "rts"
SRC_BLD_DLL_OPTS += -lHSstd_cbits_imp -L$(GHC_LIB_DIR)/std/cbits
-SRC_BLD_DLL_OPTS += -lHSrts_$(way_)imp -L$(GHC_RUNTIME_DIR)
+SRC_BLD_DLL_OPTS += -lHSrts_$(way_)imp -L$(GHC_RTS_DIR)
ifneq "$(PACKAGE)" "std"
ifeq "$(IS_CBITS_LIB)" ""
SRC_BLD_DLL_OPTS += -lHSstd_$(way_)imp -L$(GHC_LIB_DIR)/std
endif
endif
-SRC_BLD_DLL_OPTS += -lgmp -L. -L$(GHC_RUNTIME_DIR)/gmp
+SRC_BLD_DLL_OPTS += -lgmp -L. -L$(GHC_RTS_DIR)/gmp
ifeq "$(IS_CBITS_LIB)" ""
SRC_BLD_DLL_OPTS += $(patsubst %,-lHS%_$(way_)imp, $(PACKAGE_DEPS))
SRC_BLD_DLL_OPTS += $(patsubst %,-L../%, $(PACKAGE_DEPS))
# since these are way-independent
all docs TAGS clean distclean mostlyclean maintainer-clean install ::
@echo "------------------------------------------------------------------------"
- @echo "===fptools== Recursively making \`$@' for ways: $(WAYS) ..."
+ @echo "== Recursively making \`$@' for ways: $(WAYS) ..."
@echo "PWD = $(shell pwd)"
@echo "------------------------------------------------------------------------"
# Don't rely on -e working, instead we check exit return codes from sub-makes.
@case '${MFLAGS}' in *-[ik]*) x_on_err=0;; *-r*[ik]*) x_on_err=0;; *) x_on_err=1;; esac; \
for i in $(WAYS) ; do \
echo "------------------------------------------------------------------------"; \
- echo "==fptools== $(MAKE) way=$$i $@;"; \
+ echo "== $(MAKE) way=$$i $@;"; \
echo "PWD = $(shell pwd)"; \
echo "------------------------------------------------------------------------"; \
$(MAKE) way=$$i --no-print-directory $(MFLAGS) $@ ; \
if [ $$? -eq 0 ] ; then true; else exit $$x_on_err; fi; \
done
@echo "------------------------------------------------------------------------"
- @echo "===fptools== Finished recursively making \`$@' for ways: $(WAYS) ..."
+ @echo "== Finished recursively making \`$@' for ways: $(WAYS) ..."
@echo "PWD = $(shell pwd)"
@echo "------------------------------------------------------------------------"
$(ALL_TARGET) docs runtests $(BOOT_TARGET) TAGS clean distclean mostlyclean maintainer-clean $(INSTALL_TARGET) $(INSTALL_DOCS_TARGET) html chm HxS ps dvi txt::
@echo "------------------------------------------------------------------------"
- @echo "===fptools== Recursively making \`$@' in $(SUBDIRS) ..."
+ @echo "== Recursively making \`$@' in $(SUBDIRS) ..."
@echo "PWD = $(shell pwd)"
@echo "------------------------------------------------------------------------"
# Don't rely on -e working, instead we check exit return codes from sub-makes.
@case '${MFLAGS}' in *-[ik]*) x_on_err=0;; *-r*[ik]*) x_on_err=0;; *) x_on_err=1;; esac; \
for i in $(SUBDIRS); do \
echo "------------------------------------------------------------------------"; \
- echo "==fptools== $(MAKE) $@ $(MFLAGS);"; \
+ echo "== $(MAKE) $@ $(MFLAGS);"; \
echo " in $(shell pwd)/$$i"; \
echo "------------------------------------------------------------------------"; \
$(MAKE) --no-print-directory -C $$i $(MFLAGS) $@; \
if [ $$? -eq 0 -o $$x_on_err -eq 0 ] ; then true; else exit 1; fi; \
done
@echo "------------------------------------------------------------------------"
- @echo "===fptools== Finished making \`$@' in $(SUBDIRS) ..."
+ @echo "== Finished making \`$@' in $(SUBDIRS) ..."
@echo "PWD = $(shell pwd)"
@echo "------------------------------------------------------------------------"
ifneq "$(BootingFromHc)" "YES"
$(AUTO_APPLY_CMM): $(GHC_GENAPPLY)
@$(RM) $@
- $(GHC_GENAPPLY) $(if $(filter $(way), u debug_u), -u) >$@
+ $(GENAPPLY) $(if $(filter $(way), u debug_u), -u) >$@
endif
EXTRA_CMM_SRCS += $(AUTO_APPLY_CMM)
/* force the dist-provided gcc-lib/ into scope. */
# endif
#else /* !INSTALLING */
-library-dirs: FPTOOLS_TOP_ABS"/ghc/rts"
+library-dirs: FPTOOLS_TOP_ABS"/rts"
# if !defined(HAVE_LIBGMP) && !defined(HAVE_FRAMEWORK_GMP)
- , FPTOOLS_TOP_ABS"/ghc/rts/gmp"
+ , FPTOOLS_TOP_ABS"/rts/gmp"
# endif
#endif
, INCLUDE_DIR"/mingw"
# endif
#else /* !INSTALLING */
-include-dirs: FPTOOLS_TOP_ABS"/ghc/includes"
+include-dirs: FPTOOLS_TOP_ABS"/includes"
#endif
includes: Stg.h
ifneq "$(BIN_DIST_NAME)" ""
# We're doing a binary-dist, descend into a subset of the dirs.
-SUBDIRS = hp2ps stat2resid unlit
+SUBDIRS = hp2ps unlit
else
ifeq "$(BootingFromHc)" "YES"
-SUBDIRS = genapply genprimopcode ghc-pkg unlit
+SUBDIRS = mkdependC mkdirhier runstdtest genapply genprimopcode ghc-pkg unlit
else
-SUBDIRS = hasktags ghc-pkg hp2ps hsc2hs parallel stat2resid prof unlit genprimopcode genapply runghc
+SUBDIRS = mkdependC mkdirhier runstdtest ghc-pkg hasktags hp2ps hsc2hs lndir \
+ parallel prof unlit genprimopcode genapply runghc
endif
endif
SUBDIRS += touchy
endif
-# hstags died when the new parser was introduced.
-# hstags \
+# Utils that we don't build by default:
+# nofib-analyse
+
+# Utils that are old and/or bitrotted:
+# stat2resid
+# debugNCG
+# ext-core
+# genargs
+# heap-view
+# pvm
+# verbatim
+# ltx
+# hstags
# "heap-view" is not in the list because (a) it requires
# a Haskell compiler (which you may not have yet), and (b) you are
HS_PROG = $(GHC_GENAPPLY_PGM)
-# genapply is needed to boot in ghc/rts...
+# genapply is needed to boot in rts/...
ifneq "$(BootingFromHc)" "YES"
boot :: all
endif
-# -----------------------------------------------------------------------------
-
TOP=../..
include $(TOP)/mk/boilerplate.mk
SRC_HC_OPTS += -cpp -Wall -fno-warn-name-shadowing -fno-warn-unused-matches
# This causes libghccompat.a to be used:
-include $(GHC_LIB_COMPAT_DIR)/compat.mk
+include $(GHC_COMPAT_DIR)/compat.mk
# This is required because libghccompat.a must be built with
# $(GhcHcOpts) because it is linked to the compiler, and hence
boot :: $(VERSION_HS)
-Version.hs : Makefile $(TOP)/mk/version.mk
+Version.hs : Makefile $(TOP)/mk/config.mk
@$(RM) -f $(VERSION_HS)
@echo "Creating $(VERSION_HS) ... "
@echo "module Version where" >>$(VERSION_HS)
PKGCONF=$(libdir)/package.conf
endif # BIN_DIST
else
-GHCPKGBIN=$(FPTOOLS_TOP_ABS)/ghc/utils/ghc-pkg/$(HS_PROG)
-PKGCONF=$(FPTOOLS_TOP_ABS_PLATFORM)/ghc/driver/package.conf.inplace
+GHCPKGBIN=$(FPTOOLS_TOP_ABS)/utils/ghc-pkg/$(HS_PROG)
+PKGCONF=$(FPTOOLS_TOP_ABS_PLATFORM)/driver/package.conf.inplace
endif
ifneq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
$(MAKE) INSTALLING=0 BIN_DIST=0 $(MFLAGS) $@
endif
-# ghc-pkg is needed to boot in ghc/rts and library dirs
+# ghc-pkg is needed to boot in rts/ and library dirs
# Do a recursive 'make all' after generating dependencies, because this
# will work with 'make -j'.
ifneq "$(BootingFromHc)" "YES"
-
TOP=../..
-
include $(TOP)/mk/boilerplate.mk
-CURRENT_DIR=ghc/utils/hasktags
-
HS_PROG = hasktags
CLEAN_FILES += Main.hi
-#---------------------------------------------------------------------
-# $Id: Makefile,v 1.3 1997/03/13 09:36:28 sof Exp $
-#
-#---------------------------------------------------------------------
-
TOP=../..
include $(TOP)/mk/boilerplate.mk
TOP=../..
include $(TOP)/mk/boilerplate.mk
-CURRENT_DIR=ghc/utils/hsc2hs
-INCLUDE_DIR=ghc/includes
-
INSTALLING=1
# This causes libghccompat.a to be used:
-include $(GHC_LIB_COMPAT_DIR)/compat.mk
+include $(GHC_COMPAT_DIR)/compat.mk
# This is required because libghccompat.a must be built with
# $(GhcHcOpts) because it is linked to the compiler, and hence
HSC2HS_EXTRA=--cc=$(bindir)/ghc-$(ProjectVersion)
endif # BIN_DIST
else
-HSC2HS_BINDIR=$(FPTOOLS_TOP_ABS)/$(CURRENT_DIR)
-HSC2HS_DIR=$(FPTOOLS_TOP_ABS_PLATFORM)/$(CURRENT_DIR)
+HSC2HS_BINDIR=$(FPTOOLS_TOP_ABS)/$(GHC_HSC2HS_DIR_REL)
+HSC2HS_DIR=$(FPTOOLS_TOP_ABS_PLATFORM)/$(GHC_HSC2HS_DIR_REL)
ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
extra_flags=$(addprefix --cflag=,$(filter-out -O,$(SRC_CC_OPTS)))
endif
-HSC2HS_EXTRA="--cc=$(CC) --ld=$(CC) $(extra_flags) --cflag=-D__GLASGOW_HASKELL__=$(ProjectVersionInt) -I$(FPTOOLS_TOP_ABS_PLATFORM)/$(INCLUDE_DIR)"
+HSC2HS_EXTRA="--cc=$(CC) --ld=$(CC) $(extra_flags) --cflag=-D__GLASGOW_HASKELL__=$(ProjectVersionInt) -I$(FPTOOLS_TOP_ABS_PLATFORM)/$(GHC_INCLUDE_DIR_REL)"
endif
$(SCRIPT_PROG) : Makefile
-TOP=..
+TOP=../..
include $(TOP)/mk/boilerplate.mk
C_SRCS=lndir.c
-TOP=..
+TOP=../..
include $(TOP)/mk/boilerplate.mk
SCRIPT_PROG=ltx
# Boilerplate Makefile for building perl script that
# needs some configured constants prepended to it.
#
-TOP=..
+TOP=../..
include $(TOP)/mk/boilerplate.mk
boot :: all
-#
-#
-
-TOP=..
+TOP=../..
include $(TOP)/mk/boilerplate.mk
+boot :: all
+
SCRIPT_PROG=mkdirhier
SCRIPT_OBJS=mkdirhier.sh
INTERP=$(SHELL)
-# -----------------------------------------------------------------------------
-# $Id: Makefile,v 1.6 2005/06/07 10:58:31 simonmar Exp $
-# (c) Simon Marlow 1999-2000
-
-TOP=..
+TOP=../..
include $(TOP)/mk/boilerplate.mk
SRC_HC_OPTS += -fglasgow-exts -package util -package data -package text -cpp -package lang
-#-----------------------------------------------------------------------------
-# $Id: Makefile,v 1.5 2000/09/05 10:16:41 simonmar Exp $
-#
-# (c) The GHC Team, 2000
-#
-
TOP=../..
include $(TOP)/mk/boilerplate.mk
--- /dev/null
+TOP=../../..
+include $(TOP)/mk/boilerplate.mk
+
+C_PROG = cgprof
+INSTALL_LIBEXECS=$(C_PROG)
+
+SRC_CC_OPTS += -Wall -I$(GHC_INCLUDE_DIR)
+
+include $(TOP)/mk/target.mk
--- /dev/null
+TOP=../../..
+include $(TOP)/mk/boilerplate.mk
+
+override datadir=$(libdir)/icons
+INSTALL_DATAS=$(wildcard *.xbm)
+
+include $(TOP)/mk/target.mk
SRC_MKDEPENDC_OPTS += -I$(GHC_INCLUDE_DIR)
# This causes libghccompat.a to be used:
-include $(GHC_LIB_COMPAT_DIR)/compat.mk
+include $(GHC_COMPAT_DIR)/compat.mk
# This is required because libghccompat.a must be built with
# $(GhcHcOpts) because it is linked to the compiler, and hence
-# $Id: Makefile,v 1.5 2000/09/05 10:16:41 simonmar Exp $
-#
-
-TOP=..
+TOP=../..
include $(TOP)/mk/boilerplate.mk
SCRIPT_PROG=runstdtest
-#-----------------------------------------------------------------------------
-# $Id: Makefile,v 1.11 2000/09/05 10:16:41 simonmar Exp $
-
TOP=../..
include $(TOP)/mk/boilerplate.mk
-TOP=..
+TOP=../..
include $(TOP)/mk/boilerplate.mk
C_SRCS = verbatim.c