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 \
45 -irequired:glaExts:ghc \
46 HcMaxHeapFlag $(EXTRA_HC_OPTS)
48 EXTRA_MKDEPENDHS_OPTS = -irequired:prelude:ghc:hbc:glaExts:concurrent
52 /* per-build options: shared with RTS */
53 #define rts_or_lib(r,l) l
54 #include "../mkworld/GHC_OPTS"
56 /* this is just friendliness to "hstags" */
57 HSTAGS_OPTS=-fglasgow-exts
59 /***************************************************************/
61 /****************************************************************
63 * what it is we are compiling; *
64 * these are long and tedious lists, but c'est la guerre *
66 ****************************************************************/
69 required/Prelude.lhs \
72 required/Complex.lhs \
73 required/Directory.lhs \
97 glaExts/PackedString.lhs \
99 # Leave out concurrency for now
102 # concurrent/Channel.lhs \
103 # concurrent/ChannelVar.lhs \
104 # concurrent/Merge.lhs \
105 # concurrent/Parallel.lhs \
106 # concurrent/SampleVar.lhs \
107 # concurrent/Semaphore.lhs \
108 # concurrent/Concurrent.lhs
110 BASIC_HIs = $(BASIC_HS:.lhs=.hi)
112 BASIC_OBJS_DIRS = $(BASIC_HS:.lhs=)
114 /* easy way to make many many Make variables: */
117 /************************************************************************
119 * Macros for creating and installing libHS<x>.a (in its many flavors). *
121 *************************************************************************/
123 /****************************************************************
125 * Creating and installing... *
126 * libHS_<tag>.a standard Prelude library *
128 ****************************************************************/
130 /* make sure install's target dir is there */
131 #if DoInstallGHCSystem == YES
132 MakeDirectories(install, $(INSTLIBDIR_GHC) $(INSTDATADIR_GHC)/imports)
134 InstallDataTarget(MODULES,$(INSTDATADIR_GHC)/imports)
135 #endif /* installing */
137 BasicEverything(libHS, $(INSTLIBDIR_GHC), $(INSTDATADIR_GHC))
139 /****************************************************************
141 * Creating the individual .hc files: *
143 * For the just-vary-the-GC-thanks flavors, we only need to *
144 * compile .hs->.hc once; then re-use the .hc file each time. *
146 * For the profiling one (_p) and all the user-specified *
147 * ones, we recompile the Haskell each time. *
149 * NB: old (WDP 95/06) *
150 ****************************************************************/
152 /* some "helpful" internal macros first... */
154 #if GhcWithHscBuiltViaC == YES && HaskellCompilerType == HC_USE_HC_FILES
155 #define CompileWayishly__(hc,file,isuf,way,flags) @@\
157 $(RM) CAT3(file,way,.hc)
160 /* now use the macro: */
162 /* NB: the -Onots are only because -O would not go through on
163 a reasonably-sized machine (i.e., one I have)
167 CompileWayishly(GHC,required/Prelude,lhs, /*-split-objs Prelude*/ -fglasgow-exts)
168 CompileWayishly(GHC,required/Array,lhs, /*-split-objs Array*/ -fglasgow-exts)
169 CompileWayishly(GHC,required/Char,lhs, /*-split-objs Char*/)
170 CompileWayishly(GHC,required/Complex,lhs, /*-split-objs Complex*/)
171 CompileWayishly(GHC,required/Ix,lhs, /*-split-objs Ix*/ -fglasgow-exts)
172 CompileWayishly(GHC,required/List,lhs, /*-split-objs List*/)
173 CompileWayishly(GHC,required/Maybe,lhs, /*-split-objs Maybe*/)
174 CompileWayishly(GHC,required/Monad,lhs, /*-split-objs Monad*/)
175 CompileWayishly(GHC,required/Ratio,lhs, /*-split-objs Ratio*/)
177 CompileWayishly(GHC,required/Directory,lhs, /*-split-objs Directory*/ -fglasgow-exts \
178 '-#include"cbits/stgio.h"' -monly-3-regs)
179 CompileWayishly(GHC,required/IO,lhs, /*-split-objs IO*/ -fglasgow-exts \
180 '-#include"cbits/stgio.h"')
181 CompileWayishly(GHC,required/System,lhs, /*-split-objs System*/ -fglasgow-exts \
182 '-#include"cbits/stgio.h"')
185 CompileWayishly(GHC,ghc/ConcBase,lhs, /*-split-objs ConcBase*/ -fglasgow-exts)
186 CompileWayishly(GHC,ghc/PrelBase,lhs, /*-split-objs PrelBase*/ -fglasgow-exts)
187 CompileWayishly(GHC,ghc/STBase,lhs, /*-split-objs STBase*/ -fglasgow-exts)
188 CompileWayishly(GHC,ghc/IOBase,lhs, /*-split-objs IOBase*/ -fglasgow-exts)
189 CompileWayishly(GHC,ghc/ArrBase,lhs, /*-split-objs ArrBase*/ -fglasgow-exts)
190 CompileWayishly(GHC,ghc/PrelRead,lhs, /*-split-objs PrelRead*/ -fglasgow-exts)
191 CompileWayishly(GHC,ghc/PrelList,lhs, /*-split-objs PrelList*/)
192 CompileWayishly(GHC,ghc/PrelNum,lhs, /*-split-objs PrelNum*/ -fglasgow-exts)
193 CompileWayishly(GHC,ghc/PrelTup,lhs, /*-split-objs PrelTup*/)
194 CompileWayishly(GHC,ghc/PrelIO,lhs, /*-split-objs PrelIO*/ -fglasgow-exts)
195 CompileWayishly(GHC,ghc/IOHandle,lhs, /*-split-objs IOHandle*/ -fglasgow-exts)
196 CompileWayishly(GHC,ghc/GHCerr,lhs, /*-split-objs GHCerr*/ -fglasgow-exts)
197 CompileWayishly(GHC,ghc/GHCmain,lhs, /*-split-objs GHCmain*/ -fglasgow-exts)
199 CompileWayishly(GHC,glaExts/Foreign,lhs, /*-split-objs Foreign*/ -fglasgow-exts)
200 CompileWayishly(GHC,glaExts/ST,lhs, /*-split-objs ST*/ -fglasgow-exts)
201 CompileWayishly(GHC,glaExts/PackedString,lhs, /*-split-objs PackedString*/ -fglasgow-exts)
204 CompileWayishly(GHC,concurrent/Channel,lhs,)
205 CompileWayishly(GHC,concurrent/ChannelVar,lhs,)
206 CompileWayishly(GHC,concurrent/Merge,lhs,-iconcurrent)
207 CompileWayishly(GHC,concurrent/Parallel,lhs,-fglasgow-exts)
208 CompileWayishly(GHC,concurrent/SampleVar,lhs,)
209 CompileWayishly(GHC,concurrent/Semaphore,lhs,)
210 CompileWayishly(GHC,concurrent/Concurrent,lhs,-iconcurrent)
212 /****************************************************************
214 * misc "make" targets -- depend, clean, tags *
216 ****************************************************************/
218 hc-files : $(BASIC_HS:.lhs=.hc)
220 /* this is a BAD idea!
221 ExtraStuffToClean( $(SRCS_C) )
222 without the .hc files, the distrib cannot boot itself
224 ExtraStuffToBeVeryClean( $(SRCS_C) )
225 ExtraStuffToBeVeryClean( $(STD_VERY_CLEAN) )
228 /* Ugly but OK? [WDP 94/09] */
229 HsTagsTarget( */[A-Z]*.*hs )
230 HSTAGS_OPTS=-cpp -fglasgow-exts
232 /* should be *LAST* */
233 #if HaskellCompilerType != HC_USE_HC_FILES
234 /* otherwise, the dependencies jeopardize our .hc files --
235 which are all we have! */
236 MAIN_INCLUDE_DIR = $(TOP_PWD)/$(CURRENT_DIR)/$(GHC_INCLUDES)
266 -o hc -I$(MAIN_INCLUDE_DIR)
268 HaskellDependTarget( $(BASIC_HS) )