/* This is the Jmakefile for the library stuff. This stuff is all written in (Glasgow-extended) Haskell. Everything here *must* be compiled w/ the Glasgow Haskell compiler. (Hence the use of $(GHC), rather than $(HC) [the latter is your "standard" Haskell compiler -- whatever you've configured]). If you use EXTRA_HC_OPTS on the command line (which you shouldn't, strictly speaking), it will probably work -- it is pinned onto GHC_OPTS, just for fun. */ /**************************************************************** * * * Jmakefile preamble-y things * * * ****************************************************************/ #define IHaveSubdirs #if IncludeTestDirsInBuild == YES #define __ghc_lib_tests_dir tests #else #define __ghc_lib_tests_dir /* nothing */ #endif SUBDIRS = cbits __ghc_lib_tests_dir #define NoDocsTargetForSubdirs #define NoInstallDocsTargetForSubdirs #define NoDependTargetForSubdirs GhcDriverNeededHere(depend all) EtagsNeededHere(tags) /**************************************************************** * * * options used for compiling/etc. things * * * ****************************************************************/ /* The driver will give warnings if -split-objs, but that's cool... */ GHC_OPTS=-recomp -cpp \ -dcore-lint \ -irequired \ -fusing-ghc-internals \ HcMaxHeapFlag $(EXTRA_HC_OPTS) PREL_OPTS=/*???-fcompiling-ghc-internals -fno-implicit-prelude*/ /* per-build options: shared with RTS */ #define rts_or_lib(r,l) l #include "../mkworld/GHC_OPTS" /* this is just friendliness to "hstags" */ HSTAGS_OPTS=-fglasgow-exts /***************************************************************/ /**************************************************************** * * * what it is we are compiling; * * these are long and tedious lists, but c'est la guerre * * * ****************************************************************/ BASIC_HS = \ prelude/Prelude.hs \ prelude/GHCbase.hs \ prelude/GHCerr.hs \ prelude/GHCps.hs \ prelude/GHCio.hs \ prelude/GHCmain.hs \ prelude/PreludeGlaST.hs \ \ required/Array.hs \ required/Char.hs \ required/Complex.hs \ required/Directory.hs \ required/IO.hs \ required/Ix.hs \ required/List.hs \ required/Maybe.hs \ required/Monad.hs \ required/Ratio.hs \ required/System.hs \ \ concurrent/Channel.hs \ concurrent/ChannelVar.hs \ concurrent/Merge.hs \ concurrent/Parallel.hs \ concurrent/SampleVar.hs \ concurrent/Semaphore.hs \ concurrent/Concurrent.hs BASIC_HIs = $(BASIC_HS:.hs=.hi) BASIC_OBJS_DIRS = $(BASIC_HS:.hs=) /* easy way to make many many Make variables: */ WayThingVars(BASIC) /************************************************************************ * * * Macros for creating and installing libHS.a (in its many flavors). * * * *************************************************************************/ /**************************************************************** * * * Creating and installing... * * libHS_.a standard Prelude library * * * ****************************************************************/ /* make sure install's target dir is there */ #if DoInstallGHCSystem == YES MakeDirectories(install, $(INSTLIBDIR_GHC) $(INSTDATADIR_GHC)/imports) InstallDataTarget(MODULES,$(INSTDATADIR_GHC)/imports) #endif /* installing */ BasicEverything(libHS, $(INSTLIBDIR_GHC), $(INSTDATADIR_GHC)) /**************************************************************** * * * Creating the individual .hc files: * * * * For the just-vary-the-GC-thanks flavors, we only need to * * compile .hs->.hc once; then re-use the .hc file each time. * * * * For the profiling one (_p) and all the user-specified * * ones, we recompile the Haskell each time. * * * * NB: old (WDP 95/06) * ****************************************************************/ /* some "helpful" internal macros first... */ #if GhcWithHscBuiltViaC == YES && HaskellCompilerType == HC_USE_HC_FILES #define CompileWayishly__(hc,file,isuf,way,flags) @@\ clean :: @@\ $(RM) CAT3(file,way,.hc) #endif /* now use the macro: */ /* NB: the -Onots are only because -O would not go through on a reasonably-sized machine (i.e., one I have) */ CompileWayishly(GHC,prelude/Prelude,hs,/*-split-objs Prelude*/ -iprelude -fglasgow-exts -fcompiling-ghc-internals Prelude -fno-implicit-prelude '-#include"cbits/stgio.h"' -H18m -Onot) CompileWayishly(GHC,prelude/GHCbase,hs,/*-split-objs GHCbase*/ -iprelude -fglasgow-exts -fcompiling-ghc-internals GHCbase '-#include"cbits/stgio.h"' -H12m -monly-2-regs -Onot) CompileWayishly(GHC,prelude/GHCerr,hs, /*-split-objs GHCerr*/ -iprelude -fglasgow-exts -fcompiling-ghc-internals GHCerr -H12m -Onot) CompileWayishly(GHC,prelude/GHCps,hs, /*-split-objs GHCps*/ -iprelude -fglasgow-exts '-#include"cbits/stgio.h"' -monly-3-regs -Onot) CompileWayishly(GHC,prelude/GHCio,hs, /*-split-objs GHCio*/ -iprelude -fglasgow-exts '-#include"cbits/stgio.h"' -Onot) CompileWayishly(GHC,prelude/GHCmain,hs,-iprelude -fglasgow-exts) CompileWayishly(GHC,prelude/PreludeGlaST,hs,-iprelude -fglasgow-exts) CompileWayishly(GHC,required/Array,hs, /*-split-objs Array*/ -fglasgow-exts -iprelude -Onot) CompileWayishly(GHC,required/Char,hs, /*-split-objs Char*/) CompileWayishly(GHC,required/Complex,hs,/*-split-objs Complex*/) CompileWayishly(GHC,required/Directory,hs,/*-split-objs Directory*/ -fglasgow-exts '-#include"cbits/stgio.h"' -monly-3-regs) CompileWayishly(GHC,required/IO,hs,/*-split-objs IO*/ -fglasgow-exts '-#include"cbits/stgio.h"') CompileWayishly(GHC,required/Ix,hs, /*-split-objs Ix*/ -fglasgow-exts) CompileWayishly(GHC,required/List,hs, /*-split-objs List*/) CompileWayishly(GHC,required/Maybe,hs, /*-split-objs Maybe*/) CompileWayishly(GHC,required/Monad,hs, /*-split-objs Monad*/) CompileWayishly(GHC,required/Ratio,hs, /*-split-objs Ratio*/) CompileWayishly(GHC,required/System,hs,/*-split-objs System*/ -fglasgow-exts '-#include"cbits/stgio.h"') CompileWayishly(GHC,concurrent/Channel,hs,) CompileWayishly(GHC,concurrent/ChannelVar,hs,) CompileWayishly(GHC,concurrent/Merge,hs,-iconcurrent) CompileWayishly(GHC,concurrent/Parallel,hs,-fglasgow-exts) CompileWayishly(GHC,concurrent/SampleVar,hs,) CompileWayishly(GHC,concurrent/Semaphore,hs,) CompileWayishly(GHC,concurrent/Concurrent,hs,-iconcurrent) /**************************************************************** * * * misc "make" targets -- depend, clean, tags * * * ****************************************************************/ /* this is a BAD idea! ExtraStuffToClean( $(SRCS_C) ) without the .hc files, the distrib cannot boot itself */ ExtraStuffToBeVeryClean( $(SRCS_C) ) ExtraStuffToBeVeryClean( $(STD_VERY_CLEAN) ) ClearTagsFile() /* Ugly but OK? [WDP 94/09] */ HsTagsTarget( */[A-Z]*.*hs ) HSTAGS_OPTS=-cpp -fglasgow-exts /* should be *LAST* */ #if HaskellCompilerType != HC_USE_HC_FILES /* otherwise, the dependencies jeopardize our .hc files -- which are all we have! */ MAIN_INCLUDE_DIR = $(TOP_PWD)/$(CURRENT_DIR)/$(GHC_INCLUDES) MKDEPENDHS_OPTS= -o .hc -I$(MAIN_INCLUDE_DIR) HaskellDependTarget( $(BASIC_HS_PREL) ) #endif