TOP=.
include $(TOP)/mk/boilerplate.mk
-#
-# Totally evil hack to make the setting of SUBDIRS be dependent
-# on whether we do `make install' or not. Having a $(ifeq ... ) would
-# be preferable..
-CURRENT_TARGET = $(MAKECMDGOALS)
-
# find the projects that actually exist...
SUBDIRS = $(filter $(patsubst %/, %, $(wildcard */)), $(AllProjects))
include $(shell echo $(Project) | tr A-Z a-z)/mk/config.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)"; \
#-----------------------------------------------------------------------------
-# $Id: Makefile,v 1.14 2000/11/06 13:14:52 simonmar Exp $
+# $Id: Makefile,v 1.15 2001/03/23 16:36:20 simonmar Exp $
#
TOP=.
# If we're booting from .hc files, swap the order
# we descend into compiler/ and lib/
#
-ifeq "$(GhcWithHscBuiltViaC)" "NO"
-SUBDIRS = includes utils driver docs compiler rts lib
+ifeq "$(BootingFromHc)" "YES"
+SUBDIRS = includes driver rts docs lib compiler
else
-SUBDIRS = includes utils driver rts docs lib compiler
+SUBDIRS = includes utils driver docs compiler rts lib
endif
# Easier to copy
import JavaGen ( javaGen )
import qualified PrintJava
+import DriverState ( v_HCHeader )
import TyCon ( TyCon )
import Id ( Id )
import CoreSyn ( CoreBind )
import CmdLineOpts ( DynFlags, HscLang(..), dopt_OutName )
import TmpFiles ( newTempName )
-import IO ( IOMode(..), hClose, openFile, Handle )
-import IO ( hPutStr, stderr) -- Debugging
+import IOExts
+import IO
\end{code}
\begin{code}
outputC dflags filenm flat_absC
= do dumpIfSet_dyn dflags Opt_D_dump_realC "Real C" (dumpRealC flat_absC)
- doOutput filenm (\ h -> writeRealC h flat_absC)
+ header <- readIORef v_HCHeader
+ doOutput filenm $ \ h -> do
+ hPutStr h header
+ writeRealC h flat_absC
\end{code}
-----------------------------------------------------------------------------
--- $Id: DriverPipeline.hs,v 1.56 2001/03/22 03:51:08 hwloidl Exp $
+-- $Id: DriverPipeline.hs,v 1.57 2001/03/23 16:36:20 simonmar Exp $
--
-- GHC Driver
--
run_phase Cpp basename suff input_fn output_fn
= do src_opts <- getOptionsFromSource input_fn
unhandled_flags <- processArgs dynamic_flags src_opts []
-
- when (not (null unhandled_flags))
- (throwDyn (OtherError (
- basename ++ "." ++ suff
- ++ ": static flags are not allowed in {-# OPTIONS #-} pragmas:\n\t"
- ++ unwords unhandled_flags)) (ExitFailure 1))
+ checkProcessArgsResult unhandled_flags basename suff
do_cpp <- dynFlag cppFlag
if do_cpp
Nothing -> basename ++ '.':hisuf
Just fn -> fn
+ -- figure out which header files to #include in a generated .hc file
+ c_includes <- getPackageCIncludes
+ cmdline_includes <- dynFlag cmdlineHcIncludes -- -#include options
+
+ let cc_injects = unlines (map mk_include
+ (c_includes ++ reverse cmdline_includes))
+ mk_include h_file =
+ case h_file of
+ '"':_{-"-} -> "#include "++h_file
+ '<':_ -> "#include "++h_file
+ _ -> "#include \""++h_file++"\""
+
+ writeIORef v_HCHeader cc_injects
+
-- figure out if the source has changed, for recompilation avoidance.
-- only do this if we're eventually going to generate a .o file.
-- (ToDo: do when generating .hc files too?)
-- we don't support preprocessing .c files (with -E) now. Doing so introduces
-- way too many hacks, and I can't say I've ever used it anyway.
-run_phase cc_phase _basename _suff input_fn output_fn
+run_phase cc_phase basename suff input_fn output_fn
| cc_phase == Cc || cc_phase == HCc
= do cc <- readIORef v_Pgm_c
cc_opts <- (getOpts opt_c)
let include_paths = map (\p -> "-I"++p) (cmdline_include_dirs
++ pkg_include_dirs)
- c_includes <- getPackageCIncludes
- cmdline_includes <- dynFlag cmdlineHcIncludes -- -#include options
-
- let cc_injects | hcc = unlines (map mk_include
- (c_includes ++ reverse cmdline_includes))
- | otherwise = ""
- mk_include h_file =
- case h_file of
- '"':_{-"-} -> "#include "++h_file
- '<':_ -> "#include "++h_file
- _ -> "#include \""++h_file++"\""
-
- cc_help <- newTempName "c"
- h <- openFile cc_help WriteMode
- hPutStr h cc_injects
- hPutStrLn h ("#include \"" ++ input_fn ++ "\"\n")
- hClose h
-
- ccout <- newTempName "ccout"
-
mangle <- readIORef v_Do_asm_mangling
(md_c_flags, md_regd_c_flags) <- machdepCCOpts
excessPrecision <- readIORef v_Excess_precision
runSomething "C Compiler"
- (unwords ([ cc, "-x", "c", cc_help, "-o", output_fn ]
+ (unwords ([ cc, "-x", "c", input_fn, "-o", output_fn ]
++ md_c_flags
++ (if cc_phase == HCc && mangle
then md_regd_c_flags
++ (if excessPrecision then [] else [ "-ffloat-store" ])
++ include_paths
++ pkg_extra_cc_opts
--- ++ [">", ccout]
))
return True
]
-----------------------------------------------------------------------------
+-- Complain about non-dynamic flags in OPTIONS pragmas
+
+checkProcessArgsResult flags basename suff
+ = do when (not (null flags)) (throwDyn (OtherError (
+ basename ++ "." ++ suff
+ ++ ": static flags are not allowed in {-# OPTIONS #-} pragmas:\n\t"
+ ++ unwords flags)) (ExitFailure 1))
+
+-----------------------------------------------------------------------------
-- Linking
doLink :: [String] -> IO ()
-----------------------------------------------------------------------------
--- $Id: DriverState.hs,v 1.34 2001/03/22 03:51:08 hwloidl Exp $
+-- $Id: DriverState.hs,v 1.35 2001/03/23 16:36:20 simonmar Exp $
--
-- Settings for the driver
--
= do paths <- readIORef ref
writeIORef ref (paths ++ split split_marker path)
+GLOBAL_VAR(v_HCHeader, "", String)
+
-----------------------------------------------------------------------------
-- Packages
import List
import IO
import Monad
-import Outputable ( showSDoc, ppr ) -- debugging only
+import Outputable
\end{code}
The Finder provides a thin filesystem abstraction to the rest of the
("WARNING: error while reading directory " ++ d)
return []
)
-
+
\end{code}
#-----------------------------------------------------------------------------
-# $Id: Makefile,v 1.2 2000/11/03 16:54:52 simonmar Exp $
+# $Id: Makefile,v 1.3 2001/03/23 16:36:21 simonmar Exp $
TOP=../..
include $(TOP)/mk/boilerplate.mk
CLEAN_FILES += $(SCRIPT_OBJS)
+# needed for bootstrapping with HC files
+ifeq "$(BootingFromHc)" "YES"
+boot :: all
+endif
+
include $(TOP)/mk/target.mk
# Setting the standard variables
#
-HC = $(GHC_INPLACE)
-CC = $(GHC_INPLACE)
+HC = $(GHC_INPLACE)
ifneq "$(DLLized)" "YES"
PACKAGE = -package-name std
PrelGHC.$(way_)hi : PrelGHC.hi-boot
cp $< $@
-boot :: PrelPrimopWrappers.hs PrelGHC.hi $(foreach way, $(WAYS), PrelGHC.$(way)_hi)
-all :: PrelPrimopWrappers.hs
+boot :: PrelGHC.hi $(foreach way, $(WAYS), PrelGHC.$(way)_hi)
+
+ifneq "$(BootingFromHc)" "YES"
+boot :: PrelPrimopWrappers.hs
+all :: PrelPrimopWrappers.hs
+endif
DLL_DESCRIPTION="GHC-compiled Haskell Prelude"
# -----------------------------------------------------------------------------
-# $Id: paths.mk,v 1.29 2001/03/05 10:29:00 simonmar Exp $
+# $Id: paths.mk,v 1.30 2001/03/23 16:36:22 simonmar Exp $
#
# ghc project specific make variables
#
GHC_SYSMAN = $(GHC_RUNTIME_DIR)/parallel/SysMan
GHC_SYSMAN_DIR = $(GHC_RUNTIME_DIR)/parallel
-
-#-----------------------------------------------------------------------------
-# Stuff for the C-compiling phase in particular...
-
-#
-# There's no need to compute dependencies when booting from .hc files
-#
-ifneq "$(GhcWithHscBuiltViaC)" "YES"
-MKDEPENDHS_SRCS = $(HS_SRCS)
-else
-MKDEPENDHS_SRCS =
-endif
/* -----------------------------------------------------------------------------
- * $Id: Exception.hc,v 1.19 2001/03/22 03:51:10 hwloidl Exp $
+ * $Id: Exception.hc,v 1.20 2001/03/23 16:36:21 simonmar Exp $
*
* (c) The GHC Team, 1998-2000
*
*
* ---------------------------------------------------------------------------*/
+#include "Stg.h"
#include "Rts.h"
#include "Exception.h"
#include "Schedule.h"
/* -----------------------------------------------------------------------------
- * $Id: HeapStackCheck.hc,v 1.15 2000/12/14 15:19:48 sewardj Exp $
+ * $Id: HeapStackCheck.hc,v 1.16 2001/03/23 16:36:21 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
*
* ---------------------------------------------------------------------------*/
+#include "Stg.h"
#include "Rts.h"
#include "Storage.h" /* for CurrentTSO */
#include "StgRun.h" /* for StgReturn and register saving */
#-----------------------------------------------------------------------------
-# $Id: Makefile,v 1.43 2001/01/26 14:40:18 simonmar Exp $
+# $Id: Makefile,v 1.44 2001/03/23 16:36:21 simonmar Exp $
#
# This is the Makefile for the runtime-system stuff.
# This stuff is written in C (and cannot be written in Haskell).
SRCS_RTS_C := $(filter-out Main.c, $(SRCS_RTS_C))
endif
-#-----------------------------------------------------------------------------
-# creating and installing libHSrts.a (in its many flavors)
-#
LIBOBJS = $(patsubst %.c,%.$(way_)o,$(SRCS_RTS_C)) \
$(patsubst %.hc,%.$(way_)o,$(SRCS_RTS_HC)) \
$(patsubst %.S,%.$(way_)o,$(SRCS_RTS_S))
+#-----------------------------------------------------------------------------
+# Flags for compiling RTS .c and .hc files
+
# gcc provides lots of useful warnings if you ask it.
# This is a pretty good list to start with - use a # to comment out
# any you don't like.
#WARNING_OPTS += -optc-Wconversion
SRC_HC_OPTS += -I../includes -I. -Iparallel $(WARNING_OPTS) $(GhcRtsHcOpts) -optc-DCOMPILING_RTS
-SRC_CC_OPTS = $(GhcRtsCcOpts)
ifneq "$(DLLized)" "YES"
SRC_HC_OPTS += -static
SRC_HC_OPTS += -I$$PVM_ROOT/include
endif
+# compiling straight C files: use all the HC_OPTS, plus any extra options in
+# $(GhcRtsCcOpts).
+SRC_CC_OPTS += $(GhcRtsCcOpts)
+SRC_CC_OPTS += $(HC_OPTS)
+
#-----------------------------------------------------------------------------
# Include the Front panel code?
# ../driver/ghc (a better C compiler :-) to compile the
# different RTS pieces
#
-CC=$(GHC_INPLACE) $(HC_OPTS) $($*_HC_OPTS)
+
+ifeq "$(BootingFromHc)" "YES"
+# use the normal $(CC) when booting from .hc files
+SRC_CC_OPTS := $(patsubst -optc%,%,$(SRC_CC_OPTS))
+SRC_CC_OPTS += $(PLATFORM_CC_OPTS)
+else
+# otherwise, use $(GHC_INPLACE) as the C compiler.
+CC=$(GHC_INPLACE)
+endif
+
HC=$(GHC_INPLACE)
# prevent this value from leaking into the GMP makefile
/* -----------------------------------------------------------------------------
- * $Id: PrimOps.hc,v 1.74 2001/03/22 03:51:10 hwloidl Exp $
+ * $Id: PrimOps.hc,v 1.75 2001/03/23 16:36:21 simonmar Exp $
*
* (c) The GHC Team, 1998-2000
*
*
* ---------------------------------------------------------------------------*/
+#include "Stg.h"
#include "Rts.h"
#include "RtsFlags.h"
/* ---------------------------------------------------------------------------
- * $Id: Schedule.c,v 1.94 2001/03/22 03:51:10 hwloidl Exp $
+ * $Id: Schedule.c,v 1.95 2001/03/23 16:36:21 simonmar Exp $
*
* (c) The GHC Team, 1998-2000
*
tso->why_blocked = NotBlocked;
tso->blocked_exceptions = NULL;
- //tso->splim = (P_)&(tso->stack) + RESERVED_STACK_WORDS;
tso->stack_size = stack_size;
tso->max_stack_size = round_to_mblocks(RtsFlags.GcFlags.maxStkSize)
- TSO_STRUCT_SIZEW;
diff = (P_)new_sp - (P_)tso->sp; /* In *words* */
dest->su = (StgUpdateFrame *) ((P_)dest->su + diff);
dest->sp = new_sp;
- //dest->splim = (P_)dest->splim + (nat)((P_)dest - (P_)tso);
dest->stack_size = new_stack_size;
/* and relocate the update frame list */
/* -----------------------------------------------------------------------------
- * $Id: StgMiscClosures.hc,v 1.65 2001/02/15 14:30:07 sewardj Exp $
+ * $Id: StgMiscClosures.hc,v 1.66 2001/03/23 16:36:21 simonmar Exp $
*
* (c) The GHC Team, 1998-2000
*
*
* ---------------------------------------------------------------------------*/
+#include "Stg.h"
#include "Rts.h"
#include "RtsUtils.h"
#include "RtsFlags.h"
/* -----------------------------------------------------------------------------
- * $Id: StgStartup.hc,v 1.14 2001/02/09 13:09:16 simonmar Exp $
+ * $Id: StgStartup.hc,v 1.15 2001/03/23 16:36:21 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
*
* ---------------------------------------------------------------------------*/
+#include "Stg.h"
#include "Rts.h"
#include "StgRun.h" /* StgReturn */
#include "StgStartup.h"
/* -----------------------------------------------------------------------------
- * $Id: StgStdThunks.hc,v 1.14 2000/12/04 12:31:21 simonmar Exp $
+ * $Id: StgStdThunks.hc,v 1.15 2001/03/23 16:36:21 simonmar Exp $
*
* (c) The GHC Team, 1998-2000
*
*
* ---------------------------------------------------------------------------*/
+#include "Stg.h"
#include "Rts.h"
#include "StoragePriv.h"
#include "HeapStackCheck.h"
/* -----------------------------------------------------------------------------
- * $Id: Updates.hc,v 1.32 2001/03/02 14:26:40 simonmar Exp $
+ * $Id: Updates.hc,v 1.33 2001/03/23 16:36:21 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
*
* ---------------------------------------------------------------------------*/
+#include "Stg.h"
#include "Rts.h"
#include "RtsUtils.h"
#include "RtsFlags.h"
/* ----------------------------------------------------------------------------
Time-stamp: <Tue Mar 06 2001 17:01:46 Stardate: [-30]6288.54 hwloidl>
- $Id: FetchMe.hc,v 1.6 2001/03/22 03:51:11 hwloidl Exp $
+ $Id: FetchMe.hc,v 1.7 2001/03/23 16:36:21 simonmar Exp $
Entry code for a FETCH_ME closure
//@node Includes, Info tables
//@subsection Includes
+#include "Stg.h"
#include "Rts.h"
#include "RtsFlags.h"
#include "RtsUtils.h"
# -----------------------------------------------------------------------------
-# $Id: Makefile,v 1.4 2000/12/30 20:42:03 panne Exp $
+# $Id: Makefile,v 1.5 2001/03/23 16:36:22 simonmar Exp $
TOP=../..
include $(TOP)/mk/boilerplate.mk
SRC_HC_OPTS += -syslib text
# genprimopcode is needed to boot in ghc/compiler...
+ifneq "$(BootingFromHc)" "YES"
boot :: all
+endif
include $(TOP)/mk/target.mk
# -----------------------------------------------------------------------------
-# $Id: Makefile,v 1.12 2001/03/16 09:07:41 qrczak Exp $
+# $Id: Makefile,v 1.13 2001/03/23 16:36:22 simonmar Exp $
TOP=../..
include $(TOP)/mk/boilerplate.mk
# -----------------------------------------------------------------------------
# Create driver configuration
-CURRENT_DIR=ghc/utils/hsc2hs
CONFIG_HS = Config.hs
boot :: $(CONFIG_HS)
endif
# hsc2hs-inplace is needed to boot in ghc/lib/std...
+ifneq "$(BootingFromHc)" "YES"
boot :: all
+endif
include $(TOP)/mk/target.mk
include $(TOP)/mk/suffix.mk
# Suffix rules for Haskell, C and literate
+ifeq "$(BootingFromHc)" "YES"
+include $(TOP)/mk/bootstrap.mk
+endif
+
-include $(TOP)/mk/build.mk
# (Optional) build-specific configuration
#
--- /dev/null
+# -----------------------------------------------------------------------------
+# $Id: bootstrap.mk,v 1.1 2001/03/23 16:36:23 simonmar Exp $
+#
+# Makefile rules for booting from .hc files without a driver.
+#
+
+TOP_SAVED := $(TOP)
+TOP:=$(TOP)/ghc
+
+include $(FPTOOLS_TOP_ABS)/ghc/mk/version.mk
+include $(FPTOOLS_TOP_ABS)/ghc/mk/paths.mk
+
+# Reset TOP
+TOP:=$(TOP_SAVED)
+
+# -----------------------------------------------------------------------------
+# Set the platform-specific options to send to the C compiler. These should
+# match the list in machdepCCOpts in ghc/compiler/DriverFlags.hs.
+#
+
+PLATFORM_CC_OPTS =
+PLATFORM_HC_BOOT_CC_OPTS =
+
+ifeq "$(i386_TARGET_ARCH)" "1"
+PLATFORM_CC_OPTS += -DDONT_WANT_WIN32_DLL_SUPPORT
+PLATFORM_HC_BOOT_CC_OPTS += -fno-defer-pop -fomit-frame-pointer
+# ToDo:
+STOLEN_X86_REGS = 4
+endif
+
+ifeq "$(hppa_TARGET_ARCH)" "1"
+PLATFORM_CC_OPTS += -static -D_HPUX_SOURCE
+endif
+
+ifeq "$(powerpc_TARGET_ARCH)" "1"
+PLATFORM_CC_OPTS += -static
+PLATFORM_HC_BOOT_CC_OPTS += -finhibit-size-directive
+endif
+
+ifeq "$(rs6000_TARGET_ARCH)" "1"
+PLATFORM_CC_OPTS += -static
+PLATFORM_HC_BOOT_CC_OPTS += -static -finhibit-size-directive
+endif
+
+ifeq "$(mingw32_TARGET_OS)" "1"
+PLATFORM_CC_OPTS += -mno-cygwin
+endif
+
+PLATFORM_CC_OPTS += -D__GLASGOW_HASKELL__=$(ProjectVersionInt)
+
+HC_BOOT_CC_OPTS = $(PLATFORM_HC_BOOT_CC_OPTS)
+
+# -----------------------------------------------------------------------------
+# suffix rules for building a .o from a .hc file. The normal build system
+# should be able to take care of the rest.
+
+%.raw_s : %.hc
+ $(CC) -x c $< -o $@ -S -O $(HC_BOOT_CC_OPTS) -I. -I$(FPTOOLS_TOP_ABS)/ghc/includes -I$(FPTOOLS_TOP_ABS)/ghc/lib/std/cbits
+
+%.s : %.raw_s
+ $(GHC_MANGLER) $< $@ $(STOLEN_X86_REGS)
+
+%.o : %.s
+ $(CC) -c -o $@ $<
#
################################################################################
+# BootingFromHc - build GHC and the libraries from .hc files?
+BootingFromHc = @BootingFromHc@
+
# build the libs first if we're bootstrapping from .hc files
-ifeq "$(GhcWithHscBuiltViaC)" "YES"
+ifeq "$(BootingFromHc)" "YES"
AllProjects = glafp-utils hslibs ghc green-card happy hdirect hood nofib
else
AllProjects = glafp-utils ghc hslibs green-card happy hdirect hood nofib
# a pretty strong internal check
GhcHcOpts=-O -Rghc-timing
-# GhcWithHscBuiltViaC - build GHC compiler proper (\`hsc') from .hc files?
-GhcWithHscBuiltViaC=@BootingFromHc@
-
# Build a compiler that will build *unregisterised* libraries and
# binaries by default. Unregisterised code is supposed to compile and
# run without any support for architecture-specific assembly mangling,
# In addition to the normal sequential way, the default is to also build
# profiled prelude libraries.
# When booting from .hc files, turn this off.
-ifeq "$(GhcWithHscBuiltViaC)" "YES"
+ifeq "$(BootingFromHc)" "YES"
GhcLibWays=
else
GhcLibWays=p
GhcLibHcOpts=-O -Rghc-timing
# Win32 only: Enable the RTS and libraries to be built as DLLs
-# Don't split object files for libs if we're building DLLs
DLLized=@EnableWin32DLLs@
+
+# Don't split object files for libs if we're building DLLs, or booting from
+# .hc files.
+SplitObjs=YES
+
ifeq "$(DLLized)" "YES"
SplitObjs=NO
-else
-SplitObjs=YES
endif
-
+ifeq "$(BootingFromHc)" "YES"
+SplitObjs=NO
+endif
# Strip local symbols from libraries? This can make the libraries smaller,
# but makes debugging somewhat more difficult. Doesn't work with all ld's.
endif
endif
+# default C compiler flags
+SRC_CC_OPTS = -O
+
#-----------------------------------------------------------------------------
# GMP Library (version 2.0.x or above)
#
# (caveat: assuming no funny use of -hisuf and that
# file name and module name match)
-SRCS=$(wildcard *.lhs *.hs *.c *.lc *.prl *.lprl *.lit *.verb)
+SRCS=$(wildcard *.lhs *.hs *.c *.prl *.lprl *.lit *.verb)
HS_SRCS=$(filter %.lhs %.hs %.hc,$(sort $(SRCS) $(BOOT_SRCS)))
HS_OBJS=$(addsuffix .$(way_)o,$(basename $(HS_SRCS)))
HS_SS=$(addsuffix .$(way_)s,$(basename $(HS_SRCS)))
HS_IFACES=$(addsuffix .$(way_)hi,$(basename $(HS_SRCS)))
-C_SRCS=$(filter %.lc %.c,$(SRCS))
+C_SRCS=$(filter %.c,$(SRCS))
C_OBJS=$(addsuffix .$(way_)o,$(basename $(C_SRCS)))
# SCRIPT_SRCS: list of raw script files (in literate form)
# The default set of files for the dependency generators to work on
# is just their source equivalents.
#
+
+ifneq "$(BootingFromHc)" "YES"
MKDEPENDHS_SRCS=$(HS_SRCS)
+else
+MKDEPENDHS_SRCS=
+endif
+
MKDEPENDC_SRCS=$(C_SRCS)
#------------------------------------------------------------------
#
MOSTLY_CLEAN_FILES += $(HS_OBJS) $(C_OBJS)
CLEAN_FILES += $(HS_PROG) $(C_PROG) $(SCRIPT_PROG) $(SCRIPT_LINK) \
- $(PROG) $(LIBRARY) $(HS_IFACES) $(HS_HCS) $(HS_SS) \
+ $(PROG) $(LIBRARY) $(HS_IFACES) $(HS_SS) \
a.out
+# Don't clean the .hc files if we're bootstrapping
+ifneq "$(BootingFromHc)" "YES"
+CLEAN_FILES += $(HS_HCS)
+endif
+
DIST_CLEAN_FILES += .depend
MAINTAINER_CLEAN_FILES += $(BOOT_SRCS)
#-----------------------------------------------------------------------------
# Haskell Suffix Rules
+# Turn off all the Haskell suffix rules if we're booting from .hc
+# files. The file bootstrap.mk contains alternative suffix rules in
+# this case.
+ifneq "$(BootingFromHc)" "YES"
+
%.$(way_)o : %.hs
$(HC_PRE_OPTS)
$(HC) $(HC_OPTS) -c $< -o $@ -osuf $(subst .,,$(suffix $@))
else exit 0 ; \
fi
+endif # BootingViaC
+
#-----------------------------------------------------------------------------
# Happy Suffix Rules
#
%.html : %.sgml
@$(RM) $@
+# $(PERL) $(COLLATEINDEX) -N -o index.sgml
+# $(JADE) -t sgml -V html-index -d $(SGMLSTYLESHEET) -c $(DOCBOOK_CATALOG) $<
+# $(PERL) $(COLLATEINDEX) -N -o index.sgml
$(SGML2HTML) $(SGML2HTML_OPTS) $<
%.html : %.tex
#----------------------------------------
-# Libraries/archives
+# Building HsLibs libraries.
+
+ifneq "$(HSLIB)" ""
ifeq "$(IS_CBITS_LIB)" "YES"
_cbits := _cbits
endif
-ifneq "$(HSLIB)" ""
LIBRARY = libHS$(HSLIB)$(_cbits)$(_way).a
GHCI_LIBRARY = HS$(HSLIB)$(_cbits)$(_way).o
+
+ifneq "$(IS_CBITS_LIB)" "YES"
+WAYS=$(GhcLibWays)
+endif
+
ifeq "$(LIBOBJS)" ""
- ifneq "$(IS_CBITS_LIB)" "YES"
- LIBOBJS = $(HS_OBJS)
- else
+ ifeq "$(IS_CBITS_LIB)" "YES"
LIBOBJS = $(C_OBJS)
+ else
+ LIBOBJS = $(HS_OBJS)
endif
endif
-ifneq "$(IS_CBITS_LIB)" ""
-CC = $(HC)
+
+ifeq "$(IS_CBITS_LIB)" "YES"
override datadir:=$(libdir)/includes
INSTALL_DATAS += Hs$(shell perl -e 'print ucfirst "$(HSLIB)"').h
SRC_CC_OPTS += -I$(GHC_INCLUDE_DIR) -I$(GHC_RUNTIME_DIR)
endif
-endif
+
+endif # HSLIB
+
+#----------------------------------------
+# Libraries/archives
ifneq "$(LIBRARY)" ""
all :: $(LIBRARY)