[project @ 1996-04-07 15:41:24 by partain]
[ghc-hetmet.git] / ghc / compiler / Jmakefile
1 /* preliminaries */
2
3 /* (only subdir is the test suite) */
4
5 #if IncludeTestDirsInBuild == YES
6 # define IHaveSubdirs
7
8 # define __ghc_compiler_tests_dir tests
9 #else
10 # define __ghc_compiler_tests_dir /* nothing */
11 #endif
12 SUBDIRS = __ghc_compiler_tests_dir
13 #undef __ghc_compiler_tests_dir
14
15 #define NoAllTargetForSubdirs
16 #define NoDocsTargetForSubdirs
17 #define NoInstallDocsTargetForSubdirs
18 #define NoDependTargetForSubdirs
19 #define NoInstallTargetForSubdirs
20 #define NoTagTargetForSubdirs
21
22 /* Suffix rules: we do not use them much at all in GHC.
23    We need some magic stuff (from suffixes-GEN.ljm) for
24    the parser files.
25 */
26 SuffixRules_flexish()
27 SuffixRule_c_o()
28 LitSuffixRule(.lprl,.prl) /* for makeSymbolList.prl */
29
30 /* assume ALL source is in subdirectories one level below
31    they don't have Jmakefiles; this Jmakefile controls everything
32 */
33
34 SUBDIR_LIST = \ /* here they are, colon separated (for mkdependHS) */
35 utils:basicTypes:types:hsSyn:prelude:envs:rename:typecheck:deSugar:coreSyn:specialise:simplCore:stranal:stgSyn:simplStg:codeGen:nativeGen:absCSyn:main:reader:profiling:deforest:parser
36
37 #ifdef MainIncludeDir
38 MAIN_INCLUDE_DIR=MainIncludeDir
39 #else
40 MAIN_INCLUDE_DIR=$(TOP_PWD)/$(CURRENT_DIR)/$(GHC_INCLUDES)
41 #endif
42
43 /* helps to find GhcConstants.h in codeGen/CgCompInfo.lhs */
44 #ifdef CompInfoDir
45 COMPINFO_DIR=CompInfoDir
46 #else
47 COMPINFO_DIR=$(TOP_PWD)/$(CURRENT_DIR)/codeGen
48 #endif
49 /* nativeGen, elsewhere */
50 #ifdef NativeGenDir
51 NATIVEGEN_DIR=NativeGenDir
52 #else
53 NATIVEGEN_DIR=$(TOP_PWD)/$(CURRENT_DIR)/nativeGen
54 #endif
55
56 /* in order-of-passes order, utility modules at the end */
57
58 #define READERSRCS_HS   \
59 parser/U_constr.hs      \
60 parser/U_binding.hs     \
61 parser/U_pbinding.hs    \
62 parser/U_entidt.hs      \
63 parser/U_list.hs        \
64 parser/U_literal.hs     \
65 parser/U_maybe.hs       \
66 parser/U_either.hs      \
67 parser/U_qid.hs         \
68 parser/U_tree.hs        \
69 parser/U_ttype.hs
70
71 #define hsp_library libhsp.a
72
73 #define READERSRCS_LHS  \
74 parser/UgenUtil.lhs     \
75 parser/UgenAll.lhs      \
76 reader/ReadPrefix.lhs   \
77 \
78 reader/PrefixSyn.lhs    \
79 reader/PrefixToHs.lhs   \
80 reader/RdrHsSyn.lhs     \
81 \
82 hsSyn/HsBinds.lhs  /* abstract Haskell syntax */ \
83 hsSyn/HsCore.lhs \
84 hsSyn/HsDecls.lhs \
85 hsSyn/HsExpr.lhs \
86 hsSyn/HsImpExp.lhs \
87 hsSyn/HsLit.lhs \
88 hsSyn/HsMatches.lhs \
89 hsSyn/HsPat.lhs \
90 hsSyn/HsPragmas.lhs \
91 hsSyn/HsTypes.lhs \
92 hsSyn/HsSyn.lhs
93
94 #define NOT_SO_BASICSRCS_LHS    \
95 basicTypes/FieldLabel.lhs       \
96 basicTypes/Id.lhs               \
97 basicTypes/IdInfo.lhs           \
98 basicTypes/IdUtils.lhs          \
99 basicTypes/Literal.lhs          \
100 basicTypes/Name.lhs             \
101 basicTypes/PprEnv.lhs           \
102 basicTypes/PragmaInfo.lhs       \
103 basicTypes/SrcLoc.lhs           \
104 basicTypes/UniqSupply.lhs       \
105 basicTypes/Unique.lhs           \
106 \
107 types/Class.lhs                 \
108 types/Kind.lhs                  \
109 types/PprType.lhs               \
110 types/TyCon.lhs                 \
111 types/TyVar.lhs                 \
112 types/Usage.lhs                 \
113 types/Type.lhs                  \
114 \
115 specialise/SpecEnv.lhs
116
117
118 #define RENAMERSRCS_LHS \
119 rename/RnHsSyn.lhs \
120 rename/RnMonad.lhs \
121 rename/Rename.lhs \
122 rename/RnNames.lhs \
123 rename/RnSource.lhs \
124 rename/RnBinds.lhs \
125 rename/RnExpr.lhs \
126 rename/RnIfaces.lhs \
127 rename/RnUtils.lhs
128
129 #define TCSRCS_LHS \
130 typecheck/TcHsSyn.lhs \
131 typecheck/GenSpecEtc.lhs \
132 typecheck/Inst.lhs      \
133 typecheck/TcBinds.lhs \
134 typecheck/TcClassDcl.lhs \
135 typecheck/TcDefaults.lhs \
136 typecheck/TcDeriv.lhs \
137 typecheck/TcExpr.lhs \
138 typecheck/TcGenDeriv.lhs \
139 typecheck/TcGRHSs.lhs \
140 typecheck/TcIfaceSig.lhs \
141 typecheck/TcInstDcls.lhs \
142 typecheck/TcInstUtil.lhs \
143 typecheck/TcMatches.lhs \
144 typecheck/TcModule.lhs \
145 typecheck/TcMonad.lhs \
146 typecheck/TcEnv.lhs \
147 typecheck/TcKind.lhs \
148 typecheck/TcType.lhs \
149 typecheck/TcMonoType.lhs \
150 typecheck/TcPat.lhs \
151 typecheck/TcSimplify.lhs \
152 typecheck/TcTyClsDecls.lhs \
153 typecheck/TcTyDecls.lhs \
154 typecheck/Typecheck.lhs \
155 typecheck/Unify.lhs
156
157 /*
158 typecheck/TcPragmas.lhs \
159 */
160
161 #define DSSRCS_LHS \
162 deSugar/Desugar.lhs \
163 deSugar/Match.lhs \
164 deSugar/MatchCon.lhs \
165 deSugar/MatchLit.lhs \
166 deSugar/DsBinds.lhs \
167 deSugar/DsCCall.lhs \
168 deSugar/DsExpr.lhs \
169 deSugar/DsGRHSs.lhs \
170 deSugar/DsHsSyn.lhs \
171 deSugar/DsListComp.lhs \
172 deSugar/DsMonad.lhs \
173 deSugar/DsUtils.lhs \
174 \
175 coreSyn/CoreLift.lhs \
176 coreSyn/CoreLint.lhs
177
178 #if GhcWithDeforester != YES
179 #define __omit_deforester_flag -DOMIT_DEFORESTER=1
180 #define DEFORESTER_SRCS_LHS /*none*/
181 #else
182 #define __omit_deforester_flag /*nope*/
183 #define DEFORESTER_SRCS_LHS \
184 deforest/DefSyn.lhs \
185 deforest/Core2Def.lhs \
186 deforest/Def2Core.lhs \
187 deforest/Deforest.lhs \
188 deforest/DefUtils.lhs \
189 deforest/DefExpr.lhs \
190 deforest/Cyclic.lhs \
191 deforest/TreelessForm.lhs
192 #endif /* GhcWithDeforester */
193
194 #define SIMPL_SRCS_LHS \
195 coreSyn/AnnCoreSyn.lhs \
196 coreSyn/FreeVars.lhs \
197 \
198 specialise/Specialise.lhs \
199 specialise/SpecUtils.lhs \
200 \
201 simplCore/SimplCase.lhs \
202 simplCore/SimplEnv.lhs \
203 simplCore/SimplMonad.lhs \
204 simplCore/SimplPgm.lhs \
205 simplCore/SimplUtils.lhs \
206 simplCore/SimplVar.lhs \
207 simplCore/Simplify.lhs \
208 \
209 simplCore/LiberateCase.lhs \
210 \
211 simplCore/ConFold.lhs \
212 simplCore/FloatIn.lhs \
213 simplCore/FloatOut.lhs \
214 simplCore/SAT.lhs \
215 simplCore/SATMonad.lhs \
216 simplCore/SetLevels.lhs \
217 simplCore/SimplCore.lhs \
218 simplCore/OccurAnal.lhs \
219 simplCore/FoldrBuildWW.lhs \
220 simplCore/AnalFBWW.lhs \
221 \
222 stranal/StrictAnal.lhs \
223 stranal/SaLib.lhs \
224 stranal/SaAbsInt.lhs \
225 stranal/WwLib.lhs \
226 stranal/WorkWrap.lhs \
227 \
228 profiling/SCCauto.lhs DEFORESTER_SRCS_LHS
229
230 #define STG_SRCS_LHS \
231 stgSyn/CoreToStg.lhs \
232 stgSyn/StgSyn.lhs \
233 stgSyn/StgUtils.lhs \
234 stgSyn/StgLint.lhs \
235 profiling/SCCfinal.lhs \
236 \
237 simplStg/SatStgRhs.lhs \
238 simplStg/LambdaLift.lhs \
239 simplStg/StgVarInfo.lhs \
240 simplStg/UpdAnal.lhs \
241 simplStg/StgStats.lhs \
242 simplStg/StgSATMonad.lhs \
243 simplStg/StgSAT.lhs \
244 simplStg/SimplStg.lhs
245
246 #define BACKSRCS_LHS \
247 absCSyn/AbsCUtils.lhs \
248 absCSyn/AbsCSyn.lhs \
249 absCSyn/CLabel.lhs \
250 absCSyn/Costs.lhs \
251 absCSyn/HeapOffs.lhs \
252 absCSyn/PprAbsC.lhs \
253 \
254 codeGen/CodeGen.lhs \
255 codeGen/ClosureInfo.lhs \
256 codeGen/SMRep.lhs \
257 codeGen/CgConTbls.lhs \
258 codeGen/CgMonad.lhs \
259 codeGen/CgUsages.lhs \
260 codeGen/CgHeapery.lhs \
261 codeGen/CgStackery.lhs \
262 codeGen/CgExpr.lhs \
263 codeGen/CgCase.lhs \
264 codeGen/CgLetNoEscape.lhs \
265 codeGen/CgTailCall.lhs \
266 codeGen/CgClosure.lhs \
267 codeGen/CgCon.lhs \
268 codeGen/CgRetConv.lhs \
269 codeGen/CgBindery.lhs \
270 codeGen/CgUpdate.lhs
271
272 #if GhcWithNativeCodeGen == NO || GhcWithHscBuiltViaC == YES
273     /* if building via C, we *assume* that it is the
274        distributed C files, which do not have a native-code
275        generator in them
276     */
277 # define __omit_ncg_maybe -DOMIT_NATIVE_CODEGEN=1
278 # define NATIVEGEN_SRCS_LHS /*none*/
279 #else
280 # define __omit_ncg_maybe /*none*/
281
282 # define NATIVEGEN_SRCS_LHS \
283 nativeGen/AbsCStixGen.lhs \
284 nativeGen/AsmCodeGen.lhs \
285 nativeGen/AsmRegAlloc.lhs \
286 nativeGen/MachCode.lhs \
287 nativeGen/MachMisc.lhs \
288 nativeGen/MachRegs.lhs \
289 nativeGen/PprMach.lhs \
290 nativeGen/RegAllocInfo.lhs \
291 nativeGen/Stix.lhs \
292 nativeGen/StixInfo.lhs \
293 nativeGen/StixInteger.lhs \
294 nativeGen/StixPrim.lhs \
295 nativeGen/StixMacro.lhs
296 #endif
297
298 #define UTILSRCS_LHS \
299 utils/Argv.lhs \
300 utils/Bag.lhs \
301 utils/BitSet.lhs \
302 utils/CharSeq.lhs \
303 utils/Digraph.lhs \
304 utils/FiniteMap.lhs \
305 utils/ListSetOps.lhs \
306 utils/MatchEnv.lhs \
307 utils/Maybes.lhs \
308 utils/OrdList.lhs \
309 utils/Outputable.lhs \
310 utils/PprStyle.lhs \
311 utils/Pretty.lhs \
312 utils/SST.lhs \
313 utils/UniqFM.lhs \
314 utils/UniqSet.lhs \
315 utils/Unpretty.lhs \
316 utils/Util.lhs
317
318 #define MAIN_SRCS_LHS \
319 main/MainMonad.lhs \
320 main/CmdLineOpts.lhs \
321 main/ErrUtils.lhs \
322 main/Main.lhs
323
324 /* 
325 main/MkIface.lhs \
326 */
327
328 #define VBASICSRCS_LHS \
329 prelude/PrelMods.lhs \
330 prelude/PrimRep.lhs \
331 prelude/PrimOp.lhs \
332 prelude/TysPrim.lhs \
333 prelude/TysWiredIn.lhs \
334 prelude/PrelVals.lhs \
335 prelude/PrelInfo.lhs \
336 \
337 absCSyn/CStrings.lhs \
338 codeGen/CgCompInfo.lhs \
339 coreSyn/CoreSyn.lhs \
340 coreSyn/CoreUnfold.lhs \
341 coreSyn/CoreUtils.lhs \
342 coreSyn/PprCore.lhs \
343 profiling/CostCentre.lhs \
344 simplCore/BinderInfo.lhs \
345 simplCore/MagicUFs.lhs
346
347 ALLSRCS_HS = READERSRCS_HS
348 ALLSRCS_LHS = /* all pieces of the compiler */ \
349 VBASICSRCS_LHS          \
350 NOT_SO_BASICSRCS_LHS    \
351 UTILSRCS_LHS            \
352 MAIN_SRCS_LHS           \
353 READERSRCS_LHS          \
354 RENAMERSRCS_LHS         \
355 TCSRCS_LHS              \
356 DSSRCS_LHS              \
357 SIMPL_SRCS_LHS          \
358 STG_SRCS_LHS            \
359 BACKSRCS_LHS NATIVEGEN_SRCS_LHS
360
361 /*
362 \
363 */
364 /* NB: all the ones that may be empty (e.g., NATIVEGEN_SRCS_LHS)
365         need to be on the last line.
366 */
367
368 /* should't use these fancy `make' things, really */
369 ALLHCS =$(ALLSRCS_LHS:.lhs=.hc) $(ALLSRCS_HS:.hs=.hc)
370 ALLOBJS=$(ALLSRCS_LHS:.lhs=.o)  $(ALLSRCS_HS:.hs=.o)
371 ALLINTS=$(ALLSRCS_LHS:.lhs=.hi) $(ALLSRCS_HS:.hs=.hi)
372
373 .PRECIOUS: $(ALLINTS)
374
375 #if GhcWithHscDebug == YES
376 # define use_DDEBUG -DDEBUG
377 #else
378 # define use_DDEBUG /*nothing*/
379 #endif
380
381 #if GhcWithHscOptimised == YES
382 #define __version_sensitive_flags -DUSE_ATTACK_PRAGMAS -fshow-pragma-name-errs -fomit-reexported-instances -fshow-import-specs
383 #else
384 #define __version_sensitive_flags -fomit-reexported-instances
385 #endif
386
387 /* avoid use of AllProjectsHcOpts; then put in HcMaxHeapFlag "by hand" */
388 #undef  AllProjectsHcOpts
389 #define AllProjectsHcOpts /**/
390
391 HC_OPTS = -cpp HcMaxHeapFlag -fhaskell-1.3 -fglasgow-exts -DCOMPILING_GHC \
392         -fomit-derived-read \
393         -I. -i$(SUBDIR_LIST) \
394         use_DDEBUG __version_sensitive_flags __omit_ncg_maybe __omit_deforester_flag
395
396 #undef __version_sensitive_flags
397 #undef __omit_ncg_maybe
398 #undef __omit_deforester_flag
399
400 #if GhcWithHscBuiltViaC == YES /* not using a Haskell compiler */
401
402 hcs:: $(ALLHCS)
403
404 # if HaskellCompilerType == HC_USE_HC_FILES
405 HC = $(GHC) /* uses the driver herein */
406 # endif
407
408 #endif /* using .hc files */
409
410 /*
411     -DCOMPILING_GHC
412         Used when compiling GHC.  Some GHC utility modules are
413         *also* part of the GHC library.  There are a few bits
414         of those modules that only apply to GHC itself and
415         should not be in the library stuff.  We use this
416         CPP thing to isolate those bits.
417 */
418
419 BuildPgmFromHaskellModules(hsc,$(ALLOBJS) parser/hsclink.o parser/hschooks.o,,libhsp.a)
420
421 #if DoInstallGHCSystem == YES
422 MakeDirectories(install, $(INSTLIBDIR_GHC))
423 InstallBinaryTarget(hsc,$(INSTLIBDIR_GHC))
424 #endif
425
426 /* set up for going either to .hc or to .o files */
427 #if GhcWithHscBuiltViaC == YES
428
429 /*OLD:SuffixRule_hc_o() */
430
431 # if HaskellCompilerType == HC_USE_HC_FILES
432     /* if we do not, we never try to compile .lhs files;
433         we *blast* the macro we would normally use (HACK) (WDP 94/12)
434      */
435
436 #  undef HaskellCompileWithSpecifiedFlags
437 #  define HaskellCompileWithSpecifiedFlags(module,isuf,osuf,flags)      @@\
438 module.osuf : module.isuf                                               \
439 _body_HaskellCompileWithSpecifiedFlags(module.isuf,module.osuf,module,isuf,flags)
440
441 #  define compile(module,isuf,extra_flags) \
442 HaskellCompileWithExtraFlags(module,hc,o,-c,extra_flags)
443
444 #  define compile_rec(module,isuf,extra_flags) \
445 HaskellCompileWithExtraFlags_Recursive(module,hc,o,-c,extra_flags)
446
447 # else /* we do! */
448
449 #  define compile(module,isuf,extra_flags) \
450 HaskellCompileWithExtraFlags(module,isuf,hc,-C,extra_flags)
451
452 #  define compile_rec(module,isuf,extra_flags) \
453 HaskellCompileWithExtraFlags_Recursive(module,isuf,hc,-C,extra_flags)
454
455 # endif /* ... == HC_USE_HC_FILES */
456
457 #else /* ! booting from C */
458
459 # define compile(module,isuf,extra_flags) \
460 HaskellCompileWithExtraFlags(module,isuf,o,-c,extra_flags)
461
462 # define compile_rec(module,isuf,extra_flags) \
463 HaskellCompileWithExtraFlags_Recursive(module,isuf,o,-c,extra_flags)
464
465 #endif /* ! booting from C */
466
467 #define if_ghc(x) x
468 #if GhcBuilderVersion >= 26
469 #  define if_ghc26(x) x
470 #else
471 #  define if_ghc26(x) /*nothing*/
472 #endif
473
474 /* OK, here we go: */
475
476 utils/Ubiq.hi : utils/Ubiq.lhi
477         $(GHC_UNLIT) utils/Ubiq.lhi utils/Ubiq.hi
478
479 absCSyn/AbsCLoop.hi : absCSyn/AbsCLoop.lhi
480         $(GHC_UNLIT) absCSyn/AbsCLoop.lhi absCSyn/AbsCLoop.hi
481 basicTypes/IdLoop.hi : basicTypes/IdLoop.lhi
482         $(GHC_UNLIT) basicTypes/IdLoop.lhi basicTypes/IdLoop.hi
483 codeGen/CgLoop1.hi : codeGen/CgLoop1.lhi
484         $(GHC_UNLIT) codeGen/CgLoop1.lhi codeGen/CgLoop1.hi
485 codeGen/CgLoop2.hi : codeGen/CgLoop2.lhi
486         $(GHC_UNLIT) codeGen/CgLoop2.lhi codeGen/CgLoop2.hi
487 deSugar/DsLoop.hi : deSugar/DsLoop.lhi
488         $(GHC_UNLIT) deSugar/DsLoop.lhi deSugar/DsLoop.hi
489 hsSyn/HsLoop.hi : hsSyn/HsLoop.lhi
490         $(GHC_UNLIT) hsSyn/HsLoop.lhi hsSyn/HsLoop.hi
491 nativeGen/NcgLoop.hi : nativeGen/NcgLoop.lhi
492         $(GHC_UNLIT) nativeGen/NcgLoop.lhi nativeGen/NcgLoop.hi
493 prelude/PrelLoop.hi : prelude/PrelLoop.lhi
494         $(GHC_UNLIT) prelude/PrelLoop.lhi prelude/PrelLoop.hi
495 rename/RnLoop.hi : rename/RnLoop.lhi
496         $(GHC_UNLIT) rename/RnLoop.lhi rename/RnLoop.hi
497 simplCore/SmplLoop.hi : simplCore/SmplLoop.lhi
498         $(GHC_UNLIT) simplCore/SmplLoop.lhi simplCore/SmplLoop.hi
499 typecheck/TcMLoop.hi : typecheck/TcMLoop.lhi
500         $(GHC_UNLIT) typecheck/TcMLoop.lhi typecheck/TcMLoop.hi
501 typecheck/TcLoop.hi : typecheck/TcLoop.lhi
502         $(GHC_UNLIT) typecheck/TcLoop.lhi typecheck/TcLoop.hi
503 types/TyLoop.hi : types/TyLoop.lhi
504         $(GHC_UNLIT) types/TyLoop.lhi types/TyLoop.hi
505
506 compile(absCSyn/AbsCUtils,lhs,)
507 compile(absCSyn/CStrings,lhs,)
508 compile(absCSyn/CLabel,lhs,)
509 compile(absCSyn/Costs,lhs,)
510 compile(absCSyn/HeapOffs,lhs,)
511 compile(absCSyn/PprAbsC,lhs,)
512 compile(absCSyn/AbsCSyn,lhs,if_ghc(-fno-omit-reexported-instances))
513
514 compile(hsSyn/HsBinds,lhs,)
515 compile(hsSyn/HsCore,lhs,)
516 compile(hsSyn/HsDecls,lhs,)
517 compile(hsSyn/HsExpr,lhs,)
518 compile(hsSyn/HsImpExp,lhs,)
519 compile(hsSyn/HsLit,lhs,)
520 compile(hsSyn/HsMatches,lhs,)
521 compile(hsSyn/HsPat,lhs,)
522 compile(hsSyn/HsPragmas,lhs,)
523 compile(hsSyn/HsTypes,lhs,)
524 compile(hsSyn/HsSyn,lhs,if_ghc(-fno-omit-reexported-instances))
525
526 compile(basicTypes/FieldLabel,lhs,)
527 compile(basicTypes/Id,lhs,)
528 compile(basicTypes/IdInfo,lhs,-K2m)
529 compile(basicTypes/IdUtils,lhs,)
530 compile(basicTypes/Literal,lhs,)
531 compile(basicTypes/Name,lhs,)
532 compile(basicTypes/PprEnv,lhs,)
533 compile(basicTypes/PragmaInfo,lhs,)
534 compile(basicTypes/SrcLoc,lhs,)
535 compile(basicTypes/UniqSupply,lhs,)
536 compile(basicTypes/Unique,lhs,)
537
538 compile(codeGen/CgBindery,lhs,)
539 compile(codeGen/CgCase,lhs,)
540 compile(codeGen/CgClosure,lhs,)
541 compile(codeGen/CgCompInfo,lhs,-I$(COMPINFO_DIR))
542 compile(codeGen/CgCon,lhs,)
543 compile(codeGen/CgConTbls,lhs,)
544 compile(codeGen/CgExpr,lhs,)
545 compile(codeGen/CgHeapery,lhs,)
546 compile(codeGen/CgLetNoEscape,lhs,)
547 compile(codeGen/CgMonad,lhs,)
548 compile(codeGen/CgRetConv,lhs,)
549 compile(codeGen/CgStackery,lhs,)
550 compile(codeGen/CgTailCall,lhs,)
551 compile(codeGen/CgUpdate,lhs,)
552 compile(codeGen/CgUsages,lhs,)
553 compile(codeGen/ClosureInfo,lhs,)
554 compile(codeGen/CodeGen,lhs,)
555 compile(codeGen/SMRep,lhs,)
556
557 compile(coreSyn/AnnCoreSyn,lhs,if_ghc(-fno-omit-reexported-instances))
558 compile(coreSyn/CoreUtils,lhs,)
559 compile(coreSyn/CoreLift,lhs,)
560 compile(coreSyn/CoreLint,lhs,)
561 compile(coreSyn/CoreSyn,lhs,)
562 compile(coreSyn/PprCore,lhs,)
563 compile(coreSyn/CoreUnfold,lhs,)
564 compile(coreSyn/FreeVars,lhs,)
565
566 compile(deSugar/Desugar,lhs,)
567 compile(deSugar/DsBinds,lhs,)
568 compile(deSugar/DsCCall,lhs,)
569 compile(deSugar/DsExpr,lhs,)
570 compile(deSugar/DsGRHSs,lhs,)
571 compile(deSugar/DsHsSyn,lhs,)
572 compile(deSugar/DsListComp,lhs,)
573 compile(deSugar/DsMonad,lhs,)
574 compile(deSugar/DsUtils,lhs,)
575 compile(deSugar/Match,lhs,)
576 compile(deSugar/MatchCon,lhs,)
577 compile(deSugar/MatchLit,lhs,)
578
579 compile(main/CmdLineOpts,lhs,if_ghc(-fvia-C))
580 compile(main/ErrUtils,lhs,)
581 compile(main/Main,lhs,if_ghc(-fvia-C))
582 compile(main/MainMonad,lhs,)
583 compile(main/MkIface,lhs,)
584
585 #if GhcWithNativeCodeGen == YES
586 compile(nativeGen/AbsCStixGen,lhs,)
587 compile(nativeGen/AsmCodeGen,lhs,-I$(COMPINFO_DIR))
588 compile(nativeGen/AsmRegAlloc,lhs,-I$(COMPINFO_DIR))
589 compile(nativeGen/MachCode,lhs,)
590 compile(nativeGen/MachMisc,lhs,)
591 compile(nativeGen/MachRegs,lhs,)
592 compile(nativeGen/PprMach,lhs,)
593 compile(nativeGen/RegAllocInfo,lhs,)
594 compile(nativeGen/Stix,lhs,)
595 compile(nativeGen/StixInfo,lhs,-I$(NATIVEGEN_DIR))
596 compile(nativeGen/StixInteger,lhs,)
597 compile(nativeGen/StixMacro,lhs,-I$(NATIVEGEN_DIR))
598 compile(nativeGen/StixPrim,lhs,)
599 #endif
600
601 compile(prelude/PrelInfo,lhs,)
602 compile(prelude/PrelMods,lhs,)
603 compile(prelude/PrelVals,lhs,)
604 compile(prelude/PrimRep,lhs,-I$(COMPINFO_DIR))
605 compile(prelude/PrimOp,lhs,-K3m -H10m)
606 compile(prelude/TysPrim,lhs,)
607 compile(prelude/TysWiredIn,lhs,)
608
609 compile(profiling/SCCauto,lhs,)
610 compile(profiling/SCCfinal,lhs,)
611 compile(profiling/CostCentre,lhs,)
612
613 compile(reader/PrefixSyn,lhs,)
614 compile(reader/PrefixToHs,lhs,)
615 compile(reader/ReadPrefix,lhs,if_ghc(-fvia-C -I$(COMPINFO_DIR) -Iparser '-#include"hspincl.h"'))
616 compile(reader/RdrHsSyn,lhs,)
617
618 compile(rename/RnHsSyn,lhs,)
619 compile(rename/RnMonad,lhs,)
620 compile(rename/Rename,lhs,)
621 compile(rename/RnNames,lhs,)
622 compile(rename/RnSource,lhs,)
623 compile(rename/RnBinds,lhs,)
624 compile(rename/RnExpr,lhs,)
625 compile(rename/RnIfaces,lhs,)
626 compile(rename/RnUtils,lhs,)
627
628 compile(simplCore/BinderInfo,lhs,)
629 compile(simplCore/ConFold,lhs,)
630 compile(simplCore/FloatIn,lhs,)
631 compile(simplCore/FloatOut,lhs,)
632 compile(simplCore/LiberateCase,lhs,)
633 compile(simplCore/MagicUFs,lhs,)
634 compile(simplCore/OccurAnal,lhs,)
635
636 compile(simplCore/AnalFBWW,lhs,)
637 compile(simplCore/FoldrBuildWW,lhs,)
638
639 compile(simplCore/SAT,lhs,)
640 compile(simplCore/SATMonad,lhs,)
641 compile(simplCore/SetLevels,lhs,)
642 compile(simplCore/SimplCase,lhs,)
643 compile(simplCore/SimplCore,lhs,)
644 compile(simplCore/SimplEnv,lhs,)
645 compile(simplCore/SimplMonad,lhs,)
646 compile(simplCore/SimplPgm,lhs,)
647 compile(simplCore/SimplUtils,lhs,)
648 compile(simplCore/SimplVar,lhs,)
649 compile(simplCore/Simplify,lhs,)
650
651 compile(simplStg/SatStgRhs,lhs,)
652 compile(simplStg/LambdaLift,lhs,)
653 compile(simplStg/StgVarInfo,lhs,)
654 compile(simplStg/UpdAnal,lhs,)
655 compile(simplStg/StgStats,lhs,)
656 compile(simplStg/StgSATMonad,lhs,)
657 compile(simplStg/StgSAT,lhs,)
658 compile(simplStg/SimplStg,lhs,)
659
660 #if GhcWithDeforester == YES
661 compile(deforest/Core2Def,lhs,)
662 compile(deforest/Cyclic,lhs,)
663 compile(deforest/Def2Core,lhs,)
664 compile(deforest/DefExpr,lhs,)
665 compile(deforest/DefSyn,lhs,)
666 compile(deforest/DefUtils,lhs,)
667 compile(deforest/Deforest,lhs,)
668 compile(deforest/TreelessForm,lhs,)
669 #endif
670
671 compile(specialise/Specialise,lhs,)
672 compile(specialise/SpecEnv,lhs,)
673 compile(specialise/SpecUtils,lhs,)
674
675 compile(stgSyn/CoreToStg,lhs,)
676 compile(stgSyn/StgUtils,lhs,)
677 compile(stgSyn/StgLint,lhs,)
678 compile(stgSyn/StgSyn,lhs,if_ghc(-fno-omit-reexported-instances))
679
680 compile(stranal/SaAbsInt,lhs,)
681 compile(stranal/SaLib,lhs,)
682 compile(stranal/StrictAnal,lhs,)
683 compile(stranal/WorkWrap,lhs,)
684 compile(stranal/WwLib,lhs,)
685
686 compile(typecheck/GenSpecEtc,lhs,)
687 compile(typecheck/Inst,lhs,)
688 compile(typecheck/TcHsSyn,lhs,)
689 compile(typecheck/TcBinds,lhs,)
690 compile(typecheck/TcClassDcl,lhs,)
691 compile(typecheck/TcDefaults,lhs,)
692 compile(typecheck/TcDeriv,lhs,)
693 compile(typecheck/TcExpr,lhs,)
694 compile(typecheck/TcGRHSs,lhs,)
695 compile(typecheck/TcGenDeriv,lhs,)
696 compile(typecheck/TcIfaceSig,lhs,)
697 compile(typecheck/TcInstDcls,lhs,)
698 compile(typecheck/TcInstUtil,lhs,)
699 compile(typecheck/TcMatches,lhs,)
700 compile(typecheck/TcModule,lhs,)
701 compile(typecheck/TcMonad,lhs,)
702 compile(typecheck/TcKind,lhs,)
703 compile(typecheck/TcType,lhs,)
704 compile(typecheck/TcEnv,lhs,)
705 compile(typecheck/TcMonoType,lhs,)
706 compile(typecheck/TcPat,lhs,)
707 compile(typecheck/TcPragmas,lhs,)
708 compile(typecheck/TcSimplify,lhs,)
709 compile(typecheck/TcTyClsDecls,lhs,)
710 compile(typecheck/TcTyDecls,lhs,)
711 compile(typecheck/Typecheck,lhs,)
712 compile(typecheck/Unify,lhs,)
713
714 compile(types/Class,lhs,)
715 compile(types/Kind,lhs,)
716 compile(types/PprType,lhs,)
717 compile(types/TyCon,lhs,)
718 compile(types/TyVar,lhs,)
719 compile(types/Usage,lhs,)
720 compile(types/Type,lhs,)
721
722 compile(utils/Argv,lhs,if_ghc(-fvia-C))
723 compile(utils/Bag,lhs,)
724 compile(utils/BitSet,lhs,if_ghc26(-monly-4-regs))
725 compile(utils/CharSeq,lhs,if_ghc(-fvia-C)) /* uses stg_putc */
726 compile(utils/Digraph,lhs,)
727 compile(utils/FiniteMap,lhs,)
728 compile(utils/ListSetOps,lhs,)
729 compile(utils/Maybes,lhs,)
730 compile(utils/OrdList,lhs,)
731 compile(utils/Outputable,lhs,)
732 compile(utils/PprStyle,lhs,)
733 compile(utils/Pretty,lhs,)
734 compile(utils/SST,lhs,if_ghc(-fvia-C))
735 compile(utils/UniqFM,lhs,)
736 compile(utils/UniqSet,lhs,)
737 compile(utils/Unpretty,lhs,)
738 compile(utils/MatchEnv,lhs,)
739 compile(utils/Util,lhs,)
740
741 /* for convenience in cross-compiling */
742 objs:: $(ALLOBJS)
743
744 /* *** parser ************************************************* */
745
746 YACC_OPTS = -d
747 CC_OPTS = -Iparser -I. -I$(COMPINFO_DIR) -DUGEN_DEBUG=1 /*-DHSP_DEBUG=1*/ -g
748
749 /* add to these on the command line with, e.g., EXTRA_YACC_OPTS=-v */
750
751 XCOMM D_DEBUG = -DDEBUG
752
753 CPP_DEFINES = $(D_DEBUG)
754
755 HSP_SRCS_C =    parser/constr.c         \
756                 parser/binding.c        \
757                 parser/pbinding.c       \
758                 parser/entidt.c         \
759                 parser/hslexer.c        \
760                 parser/hsparser.tab.c   \
761                 parser/id.c             \
762                 parser/import_dirlist.c \
763                 parser/infix.c          \
764                 parser/list.c           \
765                 parser/literal.c        \
766                 parser/maybe.c          \
767                 parser/either.c         \
768                 parser/qid.c            \
769                 parser/syntax.c         \
770                 parser/tree.c           \
771                 parser/ttype.c          \
772                 parser/type2context.c   \
773                 parser/util.c
774
775 HSP_OBJS_O =    parser/constr.o         \
776                 parser/binding.o        \
777                 parser/pbinding.o       \
778                 parser/entidt.o         \
779                 parser/hslexer.o        \
780                 parser/hsparser.tab.o   \
781                 parser/id.o             \
782                 parser/import_dirlist.o \
783                 parser/infix.o          \
784                 parser/list.o           \
785                 parser/literal.o        \
786                 parser/maybe.o          \
787                 parser/either.o         \
788                 parser/qid.o            \
789                 parser/syntax.o         \
790                 parser/tree.o           \
791                 parser/ttype.o          \
792                 parser/type2context.o   \
793                 parser/util.o
794
795 /* this is for etags */
796 REAL_HSP_SRCS_C = parser/main.c         \
797                 parser/hschooks.c       \
798                 parser/hsclink.c        \
799                 parser/id.c             \
800                 parser/util.c           \
801                 parser/syntax.c         \
802                 parser/type2context.c   \
803                 parser/import_dirlist.c \
804                 parser/infix.c          \
805                 parser/printtree.c
806
807 UgenNeededHere(all depend)
808
809 /* Most hsp files are in libhsp.a, so we can either make
810    a standalone parser, or incorporate the files into
811    the hsc compiler directly (WDP 94/10)
812 */
813 NormalLibraryTarget(hsp,$(HSP_OBJS_O))
814
815 /* We need the hsp program for hstags to work! */
816 BuildPgmFromCFiles(hsp,parser/printtree.o parser/main.o,,libhsp.a)
817
818 #if DoInstallGHCSystem == YES
819 MakeDirectories(install, $(INSTLIBDIR_GHC))
820 InstallBinaryTarget(hsp,$(INSTLIBDIR_GHC))
821 #endif /* DoInstall... */
822
823 YaccRunWithExpectMsg(parser/hsparser,14,0)
824
825 UgenTarget(parser/constr)
826 UgenTarget(parser/binding)
827 UgenTarget(parser/pbinding)
828 UgenTarget(parser/entidt)
829 UgenTarget(parser/list)
830 UgenTarget(parser/literal)
831 UgenTarget(parser/maybe)
832 UgenTarget(parser/either)
833 UgenTarget(parser/qid)
834 UgenTarget(parser/tree)
835 UgenTarget(parser/ttype)
836
837 UGENS_C = parser/constr.c       \
838         parser/binding.c        \
839         parser/pbinding.c       \
840         parser/entidt.c         \
841         parser/literal.c        \
842         parser/list.c           \
843         parser/maybe.c          \
844         parser/either.c         \
845         parser/qid.c            \
846         parser/tree.c           \
847         parser/ttype.c
848
849 /* Putting the -#include"hspincl.h" option into the
850    PARSER_HS_OPTS line really does not work (it depends
851    on the 'make' that you use).
852 */
853 PARSER_HS_OPTS = if_ghc(-fvia-C -I$(COMPINFO_DIR) -Iparser)
854
855 compile(parser/UgenAll,lhs,if_ghc(-fvia-C))
856 compile(parser/UgenUtil,lhs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
857 compile(parser/U_constr,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
858 compile(parser/U_binding,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
859 compile(parser/U_pbinding,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
860 compile(parser/U_entidt,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
861 compile(parser/U_list,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
862 compile(parser/U_literal,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
863 compile(parser/U_maybe,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
864 compile(parser/U_either,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
865 compile(parser/U_qid,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
866 compile(parser/U_tree,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
867 compile(parser/U_ttype,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
868
869 /* finished with local macros */
870 #undef compile
871 #undef compile_rec
872 #undef if_ghc
873
874 /* *** misc *************************************************** */
875
876 DEPSRCS = $(ALLSRCS_LHS) $(ALLSRCS_HS)
877
878 #if GhcWithHscBuiltViaC == NO
879 MKDEPENDHS_OPTS= -I$(MAIN_INCLUDE_DIR) -I$(COMPINFO_DIR) -x HsVersions.h
880 #else /* booting from .hc */
881 MKDEPENDHS_OPTS= -o .hc -I$(MAIN_INCLUDE_DIR) -I$(COMPINFO_DIR)  -x HsVersions.h
882 #endif /* booting from .hc files */
883
884 #if HaskellCompilerType != HC_USE_HC_FILES
885     /* otherwise, the dependencies jeopardize our .hc files --
886         which are all we have! */
887 HaskellDependTarget( $(DEPSRCS) )
888 #endif
889
890 ExtraStuffToClean( $(ALLOBJS) $(HSP_OBJS_O) )
891 #if GhcWithHscBuiltViaC == YES
892 ExtraStuffToClean( $(ALLHCS) )
893 #endif
894 ExtraStuffToBeVeryClean( $(STD_VERY_CLEAN) )
895
896 ClearTagsFile()
897 HsTagsTarget( $(ALLSRCS_LHS) )
898 HSTAGS_OPTS = $(HC_OPTS) -I$(MAIN_INCLUDE_DIR)
899
900 /* count the number of lines in the source files */
901 count_lines ::
902         ./count_lines $(ALLSRCS_LHS) $(ALLSRCS_HS)
903
904 /* accumulate similar info about the sizes of object files */
905 count_bytes ::
906         ./count_bytes $(ALLSRCS_LHS) $(ALLSRCS_HS)