1 /* This is the Jmakefile for the library stuff.
2 This stuff is all written in (Glasgow-extended) Haskell.
4 Everything here *must* be compiled w/ the Glasgow Haskell compiler.
5 (Hence the use of $(GHC), rather than $(HC) [the latter is your "standard"
6 Haskell compiler -- whatever you've configured]).
8 If you use EXTRA_HC_OPTS on the command line (which you shouldn't,
9 strictly speaking), it will probably work -- it is pinned onto
10 GHC_OPTS, just for fun.
13 /****************************************************************
15 * Jmakefile preamble-y things *
17 ****************************************************************/
21 #if IncludeTestDirsInBuild == YES
22 #define __ghc_lib_tests_dir tests
24 #define __ghc_lib_tests_dir /* nothing */
27 SUBDIRS = cbits __ghc_lib_tests_dir
29 #define NoDocsTargetForSubdirs
30 #define NoInstallDocsTargetForSubdirs
31 #define NoDependTargetForSubdirs
33 GhcDriverNeededHere(depend all)
36 /****************************************************************
38 * options used for compiling/etc. things *
40 ****************************************************************/
42 /* The driver will give warnings if -split-objs, but that's cool... */
43 GHC_OPTS=-recomp -cpp \
46 -fusing-ghc-internals \
47 HcMaxHeapFlag $(EXTRA_HC_OPTS)
49 EXTRA_MKDEPENDHS_OPTS = -irequired:prelude:ghc:hbc:glaExts:concurrent
52 PREL_OPTS=/*???-fcompiling-ghc-internals -fno-implicit-prelude*/
54 /* per-build options: shared with RTS */
55 #define rts_or_lib(r,l) l
56 #include "../mkworld/GHC_OPTS"
58 /* this is just friendliness to "hstags" */
59 HSTAGS_OPTS=-fglasgow-exts
61 /***************************************************************/
63 /****************************************************************
65 * what it is we are compiling; *
66 * these are long and tedious lists, but c'est la guerre *
68 ****************************************************************/
77 prelude/PreludeGlaST.hs \
82 required/Directory.hs \
91 concurrent/Channel.hs \
92 concurrent/ChannelVar.hs \
94 concurrent/Parallel.hs \
95 concurrent/SampleVar.hs \
96 concurrent/Semaphore.hs \
97 concurrent/Concurrent.hs
99 BASIC_HIs = $(BASIC_HS:.hs=.hi)
101 BASIC_OBJS_DIRS = $(BASIC_HS:.hs=)
103 /* easy way to make many many Make variables: */
106 /************************************************************************
108 * Macros for creating and installing libHS<x>.a (in its many flavors). *
110 *************************************************************************/
112 /****************************************************************
114 * Creating and installing... *
115 * libHS_<tag>.a standard Prelude library *
117 ****************************************************************/
119 /* make sure install's target dir is there */
120 #if DoInstallGHCSystem == YES
121 MakeDirectories(install, $(INSTLIBDIR_GHC) $(INSTDATADIR_GHC)/imports)
123 InstallDataTarget(MODULES,$(INSTDATADIR_GHC)/imports)
124 #endif /* installing */
126 BasicEverything(libHS, $(INSTLIBDIR_GHC), $(INSTDATADIR_GHC))
128 /****************************************************************
130 * Creating the individual .hc files: *
132 * For the just-vary-the-GC-thanks flavors, we only need to *
133 * compile .hs->.hc once; then re-use the .hc file each time. *
135 * For the profiling one (_p) and all the user-specified *
136 * ones, we recompile the Haskell each time. *
138 * NB: old (WDP 95/06) *
139 ****************************************************************/
141 /* some "helpful" internal macros first... */
143 #if GhcWithHscBuiltViaC == YES && HaskellCompilerType == HC_USE_HC_FILES
144 #define CompileWayishly__(hc,file,isuf,way,flags) @@\
146 $(RM) CAT3(file,way,.hc)
149 /* now use the macro: */
151 /* NB: the -Onots are only because -O would not go through on
152 a reasonably-sized machine (i.e., one I have)
154 CompileWayishly(GHC,prelude/Prelude,hs,/*-split-objs Prelude*/ -iprelude -fglasgow-exts -fcompiling-ghc-internals Prelude -fno-implicit-prelude '-#include"cbits/stgio.h"' -H18m -Onot)
155 CompileWayishly(GHC,prelude/GHCbase,hs,/*-split-objs GHCbase*/ -iprelude -fglasgow-exts -fcompiling-ghc-internals GHCbase '-#include"cbits/stgio.h"' -H12m -monly-2-regs -Onot)
156 CompileWayishly(GHC,prelude/GHCerr,hs, /*-split-objs GHCerr*/ -iprelude -fglasgow-exts -fcompiling-ghc-internals GHCerr -H12m -Onot)
157 CompileWayishly(GHC,prelude/GHCps,hs, /*-split-objs GHCps*/ -iprelude -fglasgow-exts '-#include"cbits/stgio.h"' -monly-3-regs -Onot)
158 CompileWayishly(GHC,prelude/GHCio,hs, /*-split-objs GHCio*/ -iprelude -fglasgow-exts '-#include"cbits/stgio.h"' -Onot)
159 CompileWayishly(GHC,prelude/GHCmain,hs,-iprelude -fglasgow-exts)
160 CompileWayishly(GHC,prelude/PreludeGlaST,hs,-iprelude -fglasgow-exts)
162 CompileWayishly(GHC,required/Array,hs, /*-split-objs Array*/ -fglasgow-exts -iprelude -Onot)
163 CompileWayishly(GHC,required/Char,hs, /*-split-objs Char*/)
164 CompileWayishly(GHC,required/Complex,hs,/*-split-objs Complex*/)
165 CompileWayishly(GHC,required/Directory,hs,/*-split-objs Directory*/ -fglasgow-exts '-#include"cbits/stgio.h"' -monly-3-regs)
166 CompileWayishly(GHC,required/IO,hs,/*-split-objs IO*/ -fglasgow-exts '-#include"cbits/stgio.h"')
167 CompileWayishly(GHC,required/Ix,hs, /*-split-objs Ix*/ -fglasgow-exts)
168 CompileWayishly(GHC,required/List,hs, /*-split-objs List*/)
169 CompileWayishly(GHC,required/Maybe,hs, /*-split-objs Maybe*/)
170 CompileWayishly(GHC,required/Monad,hs, /*-split-objs Monad*/)
171 CompileWayishly(GHC,required/Ratio,hs, /*-split-objs Ratio*/)
172 CompileWayishly(GHC,required/System,hs,/*-split-objs System*/ -fglasgow-exts '-#include"cbits/stgio.h"')
174 CompileWayishly(GHC,concurrent/Channel,hs,)
175 CompileWayishly(GHC,concurrent/ChannelVar,hs,)
176 CompileWayishly(GHC,concurrent/Merge,hs,-iconcurrent)
177 CompileWayishly(GHC,concurrent/Parallel,hs,-fglasgow-exts)
178 CompileWayishly(GHC,concurrent/SampleVar,hs,)
179 CompileWayishly(GHC,concurrent/Semaphore,hs,)
180 CompileWayishly(GHC,concurrent/Concurrent,hs,-iconcurrent)
182 /****************************************************************
184 * misc "make" targets -- depend, clean, tags *
186 ****************************************************************/
188 /* this is a BAD idea!
189 ExtraStuffToClean( $(SRCS_C) )
190 without the .hc files, the distrib cannot boot itself
192 ExtraStuffToBeVeryClean( $(SRCS_C) )
193 ExtraStuffToBeVeryClean( $(STD_VERY_CLEAN) )
196 /* Ugly but OK? [WDP 94/09] */
197 HsTagsTarget( */[A-Z]*.*hs )
198 HSTAGS_OPTS=-cpp -fglasgow-exts
200 /* should be *LAST* */
201 #if HaskellCompilerType != HC_USE_HC_FILES
202 /* otherwise, the dependencies jeopardize our .hc files --
203 which are all we have! */
204 MAIN_INCLUDE_DIR = $(TOP_PWD)/$(CURRENT_DIR)/$(GHC_INCLUDES)
233 -o hc -I$(MAIN_INCLUDE_DIR)
235 HaskellDependTarget( $(BASIC_HS) )