Commit 02b60157 authored by simonm's avatar simonm
Browse files

[project @ 1996-11-21 16:45:53 by simonm]

New Build System!
parent c7cfec62
#-----------------------------------------------------------------------------
# $Id: Makefile,v 1.2 1996/11/21 16:45:54 simonm Exp $
TOP = .
SUBDIRS = glafp-utils ghc
include $(TOP)/mk/gen.mk
include $(TOP)/mk/subdir.mk
line = @echo "------------------------------------------------------------------------------"
boot ::
@echo "Bootstrapping $(PROJECTNAME)..."
$(line)
@echo "Booting glafp-utils"
$(line)
@$(MAKE) -C glafp-utils boot
$(line)
@echo "Booting ghc"
$(line)
@$(MAKE) -C ghc boot
@echo "Done!"
# @configure_input@
srcdir = @srcdir@
VPATH = @srcdir@
CC = @CC@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
LIBS = @LIBS@
CFLAGS = -O
LDFLAGS = -O
prefix = /usr/local
exec_prefix = $(prefix)
binprefix =
manprefix =
bindir = $(exec_prefix)/bin
libdir = $(exec_prefix)/lib
mandir = $(prefix)/man/man1
manext = 1
SHELL = /bin/sh
Makefile: Makefile.in config.status
$(SHELL) config.status
config.status: configure
$(SHELL) config.status --recheck
configure: configure.in
cd $(srcdir) && autoconf < configure.in > configure.new
grep -v '# Generated automatically from' < configure.new > configure
#! /bin/sh
#
# die quickly if anything goes astray...
set -e
# figure out the absolute pathname of the "top" directory
# (the one which has "mkworld", "nofib", "glafp-utils", etc., as subdirs)
hardtop=`pwd`
hardtop=`echo $hardtop | sed 's|^/tmp_mnt/|/|' | sed 's|^/export/|/|' | sed 's|^/grasp_tmp|/local/grasp_tmp|'`
echo ''
echo "*** The top of your build tree is: $hardtop"
case "$hardtop" in
# NeXTStep brain damage
/private/tmp_mnt/auto* )
echo '***'
echo '*** AAARRRGGGHHHH!!!'
echo '***'
echo '*** Stupid automounter (and pwd) will not tell me'
echo '*** the absolute pathname for the current directory.'
echo '*** Be sure to set TopDirPwd in mkworld/site-DEF.jm.'
echo '*** (Then it does not matter what this script decides.)'
echo '***'
;;
esac
# make "mkworld", "literate", and "glafp-utils" (no special configuration)
# make all the Makefiles first
for i in @DoingMkWorld@ @DoingGlaFpUtils@ @DoingLiterate@ ; do
if [ -d $i ] ; then
( set -e; \
cd $i ; \
echo '' ; \
echo "*** configuring $i ..." ; \
@MakeCmd@ -f Makefile.BOOT BOOT_DEFINES="-P none -S std -DTopDirPwd=$hardtop"; \
echo '' ; \
echo "*** making Makefiles in $i ..." ; \
@MakeCmd@ Makefile ; \
@MakeCmd@ Makefiles \
)
else
echo warning: $i is not a directory -- doing nothing for it
fi
done
# now make the dependencies and Real Stuff
for i in @DoingMkWorld@ @DoingGlaFpUtils@ @DoingLiterate@ ; do
if [ -d $i ] ; then
( set -e; \
cd $i ; \
echo '' ; \
echo "*** making dependencies in $i ..." ; \
@MakeCmd@ depend ; \
echo '' ; \
echo "*** making all in $i ..." ; \
@MakeCmd@ all \
)
else
echo warning: $i is not a directory -- doing nothing for it
fi
done
# OK, now make the \`real' Makefiles
passed_in_setup="-S @MkWorldSetup@"
for i in @DoingGHC@ @DoingHsLibs@ @DoingHappy@ @DoingHaggis@ @DoingNoFib@ EndOfList ; do
if [ $i = nofib ] ; then
setup=$passed_in_setup
else
setup=''
fi
if [ -d $i ] ; then
( set -e; \
cd $i ; \
echo '' ; \
echo "*** configuring $i ..." ; \
@MakeCmd@ -f Makefile.BOOT BOOT_DEFINES="-P $i $setup -C mkworld -DTopDirPwd=$hardtop"; \
echo '' ; \
echo "*** making Makefiles in $i ..." ; \
@MakeCmd@ Makefile ; \
@MakeCmd@ Makefiles \
)
else
if [ $i != EndOfList ] ; then
echo warning: $i is not a directory -- doing nothing for it
fi
fi
done
# Finally, the dependencies
for i in @DoingGHC@ @DoingHsLibs@ @DoingHappy@ @DoingHaggis@ @DoingNoFib@ EndOfList ; do
if [ -d $i ] ; then
( set -e; \
cd $i ; \
echo '' ; \
echo "*** making dependencies in $i ..." ; \
@MakeCmd@ depend \
)
else
if [ $i != EndOfList ] ; then
echo warning: $i is not a directory -- doing nothing for it
fi
fi
done
echo ''
echo '*******************************************************************'
echo "* Looking good! All you should need to do now is... *"
echo '* *'
for i in @DoingGHC@ @DoingHsLibs@ @DoingHappy@ @DoingHaggis@ @DoingNoFib@ EndOfList ; do
if [ $i != EndOfList ] ; then
echo " cd $i"
if [ $i = nofib ] ; then
echo ' make all # or...'
echo ' make runtests'
else
echo ' make all'
echo ' make install # if you are so inclined...'
fi
fi
done
echo '* *'
echo '*******************************************************************'
exit 0
......@@ -12,88 +12,60 @@ dnl * INITIAL SETUP, CHOICE OF PLATFORM(S)
# Do "./configure --help" to see what flags are available.
# (Better yet, read the documentation!)
#
AC_INIT(mk/platform.mk)
# -------------------------------------------------------------------------
AC_INIT(STARTUP.in)
#
# Prepare to generate the following header files
#
AC_CONFIG_HEADER(ghc/includes/config.h)
# and literate/config.h ???
# ToDo !!!!!!!!!!!!!!!!
#
AC_CONFIG_HEADER(ghc/includes/config.h literate/lit-deatify/config.h)
# No, we don't do `--srcdir'...
if test x"$srcdir" != 'x.' ; then
echo "This configuration does not support the \`--srcdir' option."
exit 1
fi
hardtop=`pwd`
hardtop=`echo $hardtop | sed 's|^/tmp_mnt/|/|' | sed 's|^/export/|/|' | sed 's|^/grasp_tmp|/local/grasp_tmp|'`
echo ''
echo "*** The top of your build tree is: $hardtop"
AC_SUBST(hardtop)
# -------------------------------------------------------------------------
dnl ** choose what blobs to build (ghc,hslibs,haggis,happy,nofib,????)
# set to the name for the dir if doing it, otherwise empty
DoingGHC='ghc'
DoingHsLibs=''
DoingNoFib=''
DoingHappy=''
DoingHaggis=''
DoingLiterate=''
# the following are not normally changed
DoingMkWorld='mkworld'
DoingGlaFpUtils='glafp-utils'
MkWorldSetup='std'
AC_ARG_ENABLE(ghc,
AC_ARG_ENABLE(hslibs,
[
**********************************************************************
* Configuration options for the Glasgow functional-programming tools *
**********************************************************************
First, select *which* of the tools you want to build,
with --{enable,disable}-{ghc,hslibs,nofib,happy,haggis}.
(The default is: only GHC (Glasgow Haskell compiler).)
First, select *which* of the tools you want to build, with
--{enable,disable}-{hslibs,nofib,happy,haggis}. (Currently, you have to
build ghc.)
Second, you may set one of a few applies-in-all-cases options.
For example, --with-tmpdir=/usr/tmp.
Second, you may set one of a few applies-in-all-cases options. For
example, --with-tmpdir=/usr/tmp.
Then you may set various options which are specifically for the
tools you choose in step 1. For GHC, perhaps --enable-concurrent.
For NoFib, perhaps --enable-all-tests. And so on.
Then you may set various options which are specifically for the tools you
choose in step 1. For GHC, perhaps --enable-concurrent. For NoFib,
perhaps --enable-all-tests. And so on.
The rest of this message lists all of the configure options. If the
option is enabled by default, the message says how to disable it. And
vice versa.
The rest of this message lists all of the configure options. If the option
is enabled by default, the message says how to disable it. And vice versa.
If you are confused, don't forget the installation documents that came
with the software!
If you are confused, don't forget the installation documents that came with
the software!
*******************************************************************
** FOR SELECTING WHICH GLASGOW FP TOOLS TO BUILD:
--disable-ghc do *not* build GHC as part of Glasgow FP tools],
[case "$enableval" in
yes) DoingGHC='ghc'
;;
no) DoingGHC=''
;;
*) echo "I don't understand this option: --enable-ghc=$enableval"
exit 1
;;
esac])
if test "xxx$DoingGHC" = 'xxxghc' -a \( ! -d ghc \) ; then
DoingGHC=''
echo 'Doing --disable-ghc, as there is no ghc directory'
fi
ghc_mkworld_site_ghc_jm='ghc/mkworld/site-ghc.jm'
ghc_includes_platform_h='ghc/includes/platform.h'
# duznae work: ghc_includes_config_h='ghc/includes/config.h'
if test "xxx$DoingGHC" = 'xxx' ; then
ghc_mkworld_site_ghc_jm=''
ghc_includes_platform_h=''
# ghc_includes_config_h=''
fi
AC_ARG_ENABLE(hslibs,
** FOR SELECTING WHICH GLASGOW FP TOOLS TO BUILD:]
[--enable-hslibs build suite of Haskell libraries],
[case "$enableval" in
yes) DoingHsLibs='hslibs'
......@@ -108,10 +80,6 @@ if test "xxx$DoingHsLibs" = 'xxxhslibs' -a \( ! -d hslibs \) ; then
DoingHsLibs=''
echo 'Doing --disable-hslibs, as there is no hslibs directory'
fi
hslibs_mkworld_site_hslibs_jm='hslibs/mkworld/site-hslibs.jm'
if test "xxx$DoingHsLibs" = 'xxx' ; then
hslibs_mkworld_site_hslibs_jm=''
fi
AC_ARG_ENABLE(nofib,
[--enable-nofib build NoFib suite as part of Glasgow FP tools],
......@@ -128,10 +96,6 @@ if test "xxx$DoingNoFib" = 'xxxnofib' -a \( ! -d nofib \) ; then
DoingNoFib=''
echo 'Doing --disable-nofib, as there is no nofib directory'
fi
nofib_mkworld_site_nofib_jm='nofib/mkworld/site-nofib.jm'
if test "xxx$DoingNoFib" = 'xxx' ; then
nofib_mkworld_site_nofib_jm=''
fi
AC_ARG_ENABLE(happy,
[--enable-happy build Happy parser-generator as part of Glasgow FP tools],
......@@ -165,64 +129,10 @@ if test "xxx$DoingHaggis" = 'xxxhaggis' -a \( ! -d haggis \) ; then
echo 'Doing --disable-haggis, as there is no haggis directory'
fi
AC_ARG_ENABLE(literate,
[
The following three are \`for hackers only':
--disable-literate do *not* build literate-programming stuff],
[case "$enableval" in
yes) DoingLiterate='literate'
;;
no) DoingLiterate=''
;;
*) echo "I don't understand this option: --enable-literate=$enableval"
exit 1
;;
esac])
if test "xxx$DoingLiterate" = 'xxxliterate' -a \( ! -d literate \) ; then
DoingLiterate=''
echo 'Doing --disable-literate, as there is no literate directory'
fi
AC_ARG_ENABLE(mkworld,
[--disable-mkworld do *not* build \`mkworld' configuration stuff],
[case "$enableval" in
yes) DoingMkWorld='mkworld'
;;
no) DoingMkWorld=''
;;
*) echo "I don't understand this option: --enable-mkworld=$enableval"
exit 1
;;
esac])
if test "xxx$DoingMkWorld" = 'xxxmkworld' -a \( ! -d mkworld \) ; then
DoingMkWorld=''
echo 'Doing --disable-mkworld, as there is no mkworld directory'
fi
AC_ARG_ENABLE(glafp-utils,
[--disable-glafp-utils do *not* build \`glafp utilities'],
[case "$enableval" in
yes) DoingGlaFpUtils='glafp-utils'
;;
no) DoingGlaFpUtils=''
;;
*) echo "I don't understand this option: --enable-glafp-utils=$enableval"
exit 1
;;
esac])
if test "xxx$DoingGlaFpUtils" = 'xxxglafp-utils' -a \( ! -d glafp-utils \) ; then
DoingGlaFpUtils=''
echo 'Doing --disable-glafp-utils, as there is no glafp-utils directory'
fi
AC_SUBST(DoingGHC)
AC_SUBST(DoingHsLibs)
AC_SUBST(DoingNoFib)
AC_SUBST(DoingHappy)
AC_SUBST(DoingHaggis)
AC_SUBST(DoingLiterate)
AC_SUBST(DoingMkWorld)
AC_SUBST(DoingGlaFpUtils)
# -------------------------------------------------------------------------
dnl ** choose host(/target/build) platform
......@@ -726,19 +636,22 @@ AC_ARG_WITH(tmpdir,
AC_SUBST(TmpDir)
dnl ** possibly set a max heap for Haskell compilations
# let the user specify a maximum heap to be used; the old
# "I have a 64MB machine, why not use a 32MB heap?" thing.
HcMaxHeapWasSet='NO'
HcMaxHeap='0'
HcMaxHeapFlag=''
AC_ARG_WITH(max-heap,
[
--with-max-heap=<heap size, e.g., 32m>
Do all Haskell compilations with a heap of this size. (If
you've got it, flaunt it.)],
[HcMaxHeapWasSet='YES'
HcMaxHeap="$withval"])
AC_SUBST(HcMaxHeapWasSet)
AC_SUBST(HcMaxHeap)
Do all Haskell compilations with a heap of this size.],
[HcMaxHeapFlag="-H$withval"])
AC_SUBST(HcMaxHeapFlag)
dnl ** possibly set a max stack for Haskell compilations
HcMaxStackFlag=''
AC_ARG_WITH(max-stack,
[
--with-max-stack=<stack size, e.g., 4m>
Do all Haskell compilations with a stack of this size.],
[HcMaxStackFlag="-K$withval"])
AC_SUBST(HcMaxStackFlag)
dnl ** figure out about mkdependHS
MkDependHSCmd='mkdependHS'
......@@ -1273,14 +1186,8 @@ dnl as some seds (notably OSF) only allow 99 commands (!!!).
dnl We will do the equivalent by a HACK further down.
# -------------------------------------------------------------------------
dnl
dnl * `GHC' CONFIGURATION STUFF
dnl GHC CONFIGURATION STUFF
if test "xxx$DoingGHC" = 'xxxghc' ; then
# a very big "if"!
#
#---------------------------------------------------------------
#
dnl ** which Haskell compiler to bootstrap GHC with?
# Figure out what Haskell compiler(s) to use for booting
#
......@@ -1517,23 +1424,14 @@ AC_SUBST(GhcWithSockets)
# Here, by HACK means, we dump all the Build_ info
# into a file. See comment above.
rm -f ghc/mkworld/buildinfo.jm
echo creating ghc/mkworld/buildinfo.jm
cat > ghc/mkworld/buildinfo.jm <<EOF
XCOMM ** DO NOT EDIT! **
XCOMM This file is obliterated every time 'configure' is run!
EOF
rm -f ghc/mk/buildinfo.mk
echo creating ghc/mk/buildinfo.mk
touch ghc/mk/buildinfo.mk
for xx in normal p t u mc mr mt mp mg 2s 1s du a b c d e f g h i j k l m n o A B ; do
eval "yy=\$Build_$xx"
echo "#ifndef Build_$xx" >> ghc/mkworld/buildinfo.jm
echo "#define Build_$xx $yy" >> ghc/mkworld/buildinfo.jm
echo "#endif" >> ghc/mkworld/buildinfo.jm
echo "Build_$xx = $yy" >> ghc/mk/buildinfo.mk
done
# here ends a very big if DoingGHC = 'ghc' ...
fi
# -------------------------------------------------------------------------
dnl
dnl * `HsLibs' CONFIGURATION STUFF
......@@ -1593,20 +1491,19 @@ AC_SUBST(WithHsLibsHcType)
# Here, by HACK means, we dump all the Build_ info
# into a file. See comment above.
rm -f hslibs/mkworld/buildinfo.jm
echo creating hslibs/mkworld/buildinfo.jm
cat > hslibs/mkworld/buildinfo.jm <<EOF
XCOMM ** DO NOT EDIT! **
XCOMM This file is obliterated every time 'configure' is run!
rm -f hslibs/mk/buildinfo.mk
echo creating hslibs/mk/buildinfo.mk
cat > hslibs/mk/buildinfo.mk <<EOF
# ** DO NOT EDIT! **
# This file is obliterated every time 'configure' is run!
EOF
for xx in normal p t u mc mr mt mp mg 2s 1s du a b c d e f g h i j k l m n o A B ; do
eval "yy=\$Build_$xx"
echo "#ifndef Build_$xx" >> hslibs/mkworld/buildinfo.jm
echo "#define Build_$xx $yy" >> hslibs/mkworld/buildinfo.jm
echo "#endif" >> hslibs/mkworld/buildinfo.jm
echo "Build_$xx = $yy" >> hslibs/mk/buildinfo.mk
done
# here ends a very big if DoingHsLibs = 'hslibs' ...
fi
#
......@@ -1757,16 +1654,6 @@ fi
#
# -------------------------------------------------------------------------
dnl
dnl * `Literate' CONFIGURATION STUFF
dnl if test "xxx$DoingLiterate" = 'xxxliterate' ; then
dnl # a very big "if"!
dnl
dnl # here ends a very big if DoingLiterate = 'literate' ...
dnl fi
#
# -------------------------------------------------------------------------
dnl
dnl * `NoFib' CONFIGURATION STUFF
if test "xxx$DoingNoFib" = 'xxxnofib' ; then
......@@ -2009,28 +1896,24 @@ dnl AC_SUBST(IncludeParallelNoFibTests)
# Here, by HACK means, we dump all the Include*NoFibTests info
# into a file. See comment above.
rm -f nofib/mkworld/buildinfo.jm
echo creating nofib/mkworld/buildinfo.jm
rm -f nofib/mk/buildinfo.mk
echo creating nofib/mk/buildinfo.mk
cat > nofib/mkworld/buildinfo.jm <<EOF
XCOMM ** DO NOT EDIT! **
XCOMM This file is obliterated every time 'configure' is run!
# ** DO NOT EDIT! **
# This file is obliterated every time 'configure' is run!
EOF
for xx in Real Spectral Imaginary GHC_ONLY Specialise PRIVATE Parallel ; do
eval "yy=\$Include${xx}NoFibTests"
echo "#ifndef Include${xx}NoFibTests" >> nofib/mkworld/buildinfo.jm
echo "#define Include${xx}NoFibTests $yy" >> nofib/mkworld/buildinfo.jm
echo "#endif" >> nofib/mkworld/buildinfo.jm
echo "Include${xx}NoFibTests = $yy" >> nofib/mk/buildinfo.mk
done
# Here, by HACK means, we add all the Build_ info
# into a file. See comment above.
for xx in normal p t u mc mr mt mp mg 2s 1s du a b c d e f g h i j k l m n o A B ; do
eval "yy=\$Build_$xx"
echo "#ifndef Build_$xx" >> nofib/mkworld/buildinfo.jm
echo "#define Build_$xx $yy" >> nofib/mkworld/buildinfo.jm
echo "#endif" >> nofib/mkworld/buildinfo.jm
echo "Build_$xx = $yy" >> nofib/mk/buildinfo.mk
done
# here ends a very big if DoingNoFib = 'nofib' ...
......@@ -2042,9 +1925,9 @@ dnl * extract non-header files with substitution (end)
#
AC_SUBST(MkWorldSetup)
AC_OUTPUT(Makefile STARTUP mkworld/site.jm mkworld/platform.h mkworld/config.h $ghc_mkworld_site_ghc_jm $ghc_includes_platform_h $hslibs_mkworld_site_hslibs_jm $nofib_mkworld_site_nofib_jm)
AC_OUTPUT(mk/platform.mk mk/utils.mk mk/install.mk ghc/mk/ghcconfig.mk ghc/includes/platform.h)
echo '************************************************'
echo '*** NOW DO: sh < STARTUP'
echo '*** NOW DO: make boot; make all'
echo '************************************************'
exit 0
#define IHaveSubdirs
/* order in SUBDIRS is not supposed to be important but ...
"compiler" must be before "lib", because we use
the compiler just built to compile pieces of "lib".
"includes" also needs to be v early, to ensure that
GhcConstants.h is made before needed.
if we're building from .hc files, we do the libraries
first, then the compiler; otherwise the other way around
*/
#if HaskellCompilerType == HC_USE_HC_FILES
#define __compiler_and_lib lib compiler
#else
#define __compiler_and_lib compiler lib
#endif
SUBDIRS = includes \
utils \
driver \
runtime \
docs \
__compiler_and_lib
/*OUT: parsers */
#undef __compiler_and_lib
/* "CONTRIB" is also a SUBDIR, but there is nothing to build there.
*/
/* the standard "whoami" target will give the basic info. */
/* this target adds to it. */
whoami::
@echo using a \`$(BUILDPLATFORM)\' host to build a Haskell compiler to run on a
@echo \`$(HOSTPLATFORM)\' host that will generate \`C\' target code
#-----------------------------------------------------------------------------
# $Id: Makefile,v 1.2 1996/11/21 16:46:26 simonm Exp $
TOP=..
include $(TOP)/ghc/mk/ghc.mk
line = @echo "------------------------------------------------------------------------------"
define BuildLibs
$(line)
@echo "Building Libraries"
$(line)
@$(MAKE) -C lib depend all
endef
define BuildCompiler
$(line)
@echo "Building Compiler"
$(line)
@$(MAKE) -C compiler depend all
endef
# dependencies:
# everything needs utils
# includes needs driver (for mkNativeGen.c)
# make depend except in {utils,driver} needs includes
# RTS and compiler need includes
boot ::
$(line)
@echo "Building Utils"
$(line)
@$(MAKE) -C utils depend all
$(line)
@echo "Building Driver"
$(line)
@$(MAKE) -C driver all
$(line)
@echo "Building Includes"
$(line)
@$(MAKE) -C includes all
$(line)
@echo "Building Runtime System"
$(line)
@$(MAKE) -C runtime depend all
$(line)
@echo "Building Docs"
$(line)
@$(MAKE) -C docs depend all
ifeq ($(HaskellCompilerType), HC_USE_HC_FILES)
$(BuildLibs)
$(BuildCompiler)