summaryrefslogtreecommitdiff
path: root/ghc/lib/Jmakefile
blob: 1eb1578e7a38293b2397a5cd477d9257826f2219 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
/* This is the Jmakefile for the library stuff.
   This stuff is all written in (Glasgow-extended) Haskell.

Things are organised into exactly one level of subdirs.

At the moment, there are a few such subdirs:

	glaExts		-- Glasgow I/O stuff
	prelude		-- std prelude stuff

We create one library, libHS.a, with all this stuff in it; note, we
make 94 diff flavors of this one library.... sigh

(We also build several more "normal" libraries here:

	hbc	    -- support various HBC library thingies
	ghc	    -- extra GHC-supported libraries
	contrib	    -- contributed things, incl off the net
	haskell-1.3 -- Haskell 1.3 libraries
	...
)

You should probably read the "Prelude and what the compiler knows
about it" document before wading in too deeply....

For a particular dir/mFoo.hs src file, you'll see many
dir/mFoo/mFoo__<number>.o object files.

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					*
*								*
****************************************************************/


#if IncludeTestDirsInBuild == YES
#define IHaveSubdirs
#define __ghc_lib_tests_dir tests
#else
#define __ghc_lib_tests_dir /* nothing */
#endif

SUBDIRS = __ghc_lib_tests_dir

/* only subdir is the (empty :-() test suite */
#define NoAllTargetForSubdirs
#define NoDocsTargetForSubdirs
#define NoInstallTargetForSubdirs
#define NoInstallDocsTargetForSubdirs
#define NoDependTargetForSubdirs
#define NoTagTargetForSubdirs

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=-iprelude:glaExts -dcore-lint \
	-fshow-pragma-name-errs -fshow-import-specs \
	-optP-genSPECS0 -cpp -fglasgow-exts \
	-DUSE_FOLDR_BUILD -D__OVERLAPPING_INSTANCES__ \
	HcMaxHeapFlag $(EXTRA_HC_OPTS)

/* For the "Prelude" bits: mostly we do not want it to pick
    up interface information from anywhere except *here*.

   -fomit-reexported-instances: we occasionally override
	this (e.g., on PreludeHi.hs, to create Prelude.hi)
*/
PREL_OPTS=-prelude -fno-implicit-prelude -fomit-reexported-instances

/* 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	*
*								*
****************************************************************/

/* the actual source bits */
BASIC_LHS = \
\
glaExts/PreludeErrIO.lhs	\
glaExts/PreludePrimIO.lhs	\
glaExts/PreludeGlaST.lhs	\
glaExts/PreludeDialogueIO.lhs	\
glaExts/MainIO.lhs   		\
glaExts/MainIO13.lhs		\
glaExts/Stdio.lhs		\
glaExts/ByteOps.lhs		\
\
prelude/PreludeIO.lhs		\
prelude/PreludeIOError.lhs	\
prelude/PreludeMonadicIO.lhs	\
prelude/PreludeReadTextIO.lhs	\
prelude/PreludeStdIO.lhs	\
prelude/PreludeWriteTextIO.lhs	\
\
prelude/PS.lhs			\
\
prelude/Concurrent.lhs		\
prelude/ChannelVar.lhs		\
prelude/Channel.lhs		\
prelude/Semaphore.lhs		\
prelude/Merge.lhs		\
prelude/SampleVar.lhs		\
\
prelude/Parallel.lhs		\
\
glaExts/PreludeGlaMisc.lhs	/* interface */

BASIC_HS_PREL =			\
prelude/TysBasic.hs		\
prelude/TyArray.hs		\
prelude/TyBool.hs		\
prelude/TyComplex.hs		\
prelude/TyIO.hs			\
prelude/TyRatio.hs		\
\
prelude/IArray.hs		\
prelude/IBool.hs		\
prelude/IChar.hs		\
prelude/IComplex.hs		\
prelude/IDouble.hs		\
prelude/IFloat.hs		\
prelude/IInt.hs			\
prelude/IInteger.hs		\
prelude/IList.hs		\
prelude/IRatio.hs		\
prelude/ITup0.hs		\
prelude/ITup2.hs		\
prelude/ITup3.hs		\
prelude/ITup4.hs		\
prelude/ITup5.hs		\
\
prelude/Cls.hs			\
\
prelude/Builtin.hs		\
prelude/Core.hs			\
prelude/IO.hs			\
prelude/List.hs			\
prelude/Prel.hs			\
prelude/Text.hs 		\
prelude/FoldrBuild.hs		\
\
prelude/PrelCoreHi.hs /* interface */ \
prelude/PreludeHi.hs  /* interface */ \
\
prelude/PrelCore13.hs /* interface */ \
prelude/Prel13.hs     /* interface */

#if MakeDoesNestedMacros != YES

/* make is brain-dead: use the file created below (w/ a good make) */
#include "Jmake.inc1"

#else /* good make */

print_file_lists : print_file_list1 print_file_list2 print_file_list3 print_file_list4 print_file_list5

#define SrcThingVars(blob)			@@\
CAT2(blob,_HC_norm) = $(CAT2(blob,_HS):.hs=.hc)	@@\
CAT2(blob,_HC_p)    = $(CAT2(blob,_HS):.hs=_p.hc)	@@\
CAT2(blob,_HC_t)    = $(CAT2(blob,_HS):.hs=_t.hc)	@@\
CAT2(blob,_HC_u)    = $(CAT2(blob,_HS):.hs=_u.hc)	@@\
CAT2(blob,_HC_mc)   = $(CAT2(blob,_HS):.hs=_mc.hc)	@@\
CAT2(blob,_HC_mr)   = $(CAT2(blob,_HS):.hs=_mr.hc)	@@\
CAT2(blob,_HC_mt)   = $(CAT2(blob,_HS):.hs=_mt.hc)	@@\
CAT2(blob,_HC_mp)   = $(CAT2(blob,_HS):.hs=_mp.hc)	@@\
CAT2(blob,_HC_mg)   = $(CAT2(blob,_HS):.hs=_mg.hc)	@@\
CAT2(blob,_HC_2s)   = $(CAT2(blob,_HS):.hs=_2s.hc)	@@\
CAT2(blob,_HC_1s)   = $(CAT2(blob,_HS):.hs=_1s.hc)	@@\
CAT2(blob,_HC_du)   = $(CAT2(blob,_HS):.hs=_du.hc)	@@\
CAT2(blob,_HC_a)    = $(CAT2(blob,_HS):.hs=_a.hc)	@@\
CAT2(blob,_HC_b)    = $(CAT2(blob,_HS):.hs=_b.hc)	@@\
CAT2(blob,_HC_c)    = $(CAT2(blob,_HS):.hs=_c.hc)	@@\
CAT2(blob,_HC_d)    = $(CAT2(blob,_HS):.hs=_d.hc)	@@\
CAT2(blob,_HC_e)    = $(CAT2(blob,_HS):.hs=_e.hc)	@@\
CAT2(blob,_HC_f)    = $(CAT2(blob,_HS):.hs=_f.hc)	@@\
CAT2(blob,_HC_g)    = $(CAT2(blob,_HS):.hs=_g.hc)	@@\
CAT2(blob,_HC_h)    = $(CAT2(blob,_HS):.hs=_h.hc)	@@\
CAT2(blob,_HC_i)    = $(CAT2(blob,_HS):.hs=_i.hc)	@@\
CAT2(blob,_HC_j)    = $(CAT2(blob,_HS):.hs=_j.hc)	@@\
CAT2(blob,_HC_k)    = $(CAT2(blob,_HS):.hs=_k.hc)	@@\
CAT2(blob,_HC_l)    = $(CAT2(blob,_HS):.hs=_l.hc)	@@\
CAT2(blob,_HC_m)    = $(CAT2(blob,_HS):.hs=_m.hc)	@@\
CAT2(blob,_HC_n)    = $(CAT2(blob,_HS):.hs=_n.hc)	@@\
CAT2(blob,_HC_o)    = $(CAT2(blob,_HS):.hs=_o.hc)	@@\
							@@\
CAT2(blob,_DEP_norm) = $(CAT2(blob,_HC_norm):.hc=.o)	@@\
CAT2(blob,_DEP_p)   = $(CAT2(blob,_HC_p):.hc=.o)	@@\
CAT2(blob,_DEP_t)   = $(CAT2(blob,_HC_t):.hc=.o)	@@\
CAT2(blob,_DEP_u)   = $(CAT2(blob,_HC_u):.hc=.o)	@@\
CAT2(blob,_DEP_mc)  = $(CAT2(blob,_HC_mc):.hc=.o)	@@\
CAT2(blob,_DEP_mr)  = $(CAT2(blob,_HC_mr):.hc=.o)	@@\
CAT2(blob,_DEP_mt)  = $(CAT2(blob,_HC_mt):.hc=.o)	@@\
CAT2(blob,_DEP_mp)  = $(CAT2(blob,_HC_mp):.hc=.o)	@@\
CAT2(blob,_DEP_mg)  = $(CAT2(blob,_HC_mg):.hc=.o)	@@\
CAT2(blob,_DEP_2s)  = $(CAT2(blob,_HC_2s):.hc=.o)	@@\
CAT2(blob,_DEP_1s)  = $(CAT2(blob,_HC_1s):.hc=.o)	@@\
CAT2(blob,_DEP_du)  = $(CAT2(blob,_HC_du):.hc=.o)	@@\
CAT2(blob,_DEP_a)   = $(CAT2(blob,_HC_a):.hc=.o)	@@\
CAT2(blob,_DEP_b)   = $(CAT2(blob,_HC_b):.hc=.o)	@@\
CAT2(blob,_DEP_c)   = $(CAT2(blob,_HC_c):.hc=.o)	@@\
CAT2(blob,_DEP_d)   = $(CAT2(blob,_HC_d):.hc=.o)	@@\
CAT2(blob,_DEP_e)   = $(CAT2(blob,_HC_e):.hc=.o)	@@\
CAT2(blob,_DEP_f)   = $(CAT2(blob,_HC_f):.hc=.o)	@@\
CAT2(blob,_DEP_g)   = $(CAT2(blob,_HC_g):.hc=.o)	@@\
CAT2(blob,_DEP_h)   = $(CAT2(blob,_HC_h):.hc=.o)	@@\
CAT2(blob,_DEP_i)   = $(CAT2(blob,_HC_i):.hc=.o)	@@\
CAT2(blob,_DEP_j)   = $(CAT2(blob,_HC_j):.hc=.o)	@@\
CAT2(blob,_DEP_k)   = $(CAT2(blob,_HC_k):.hc=.o)	@@\
CAT2(blob,_DEP_l)   = $(CAT2(blob,_HC_l):.hc=.o)	@@\
CAT2(blob,_DEP_m)   = $(CAT2(blob,_HC_m):.hc=.o)	@@\
CAT2(blob,_DEP_n)   = $(CAT2(blob,_HC_n):.hc=.o)	@@\
CAT2(blob,_DEP_o)   = $(CAT2(blob,_HC_o):.hc=.o)	@@\
							@@\
CAT2(blob,_HIs_p)   = $(CAT2(blob,_HIs):.hi=_p.hi)	@@\
CAT2(blob,_HIs_t)   = $(CAT2(blob,_HIs):.hi=_t.hi)	@@\
CAT2(blob,_HIs_u)   = $(CAT2(blob,_HIs):.hi=_u.hi)	@@\
CAT2(blob,_HIs_mc)  = $(CAT2(blob,_HIs):.hi=_mc.hi)	@@\
CAT2(blob,_HIs_mr)  = $(CAT2(blob,_HIs):.hi=_mr.hi)	@@\
CAT2(blob,_HIs_mt)  = $(CAT2(blob,_HIs):.hi=_mt.hi)	@@\
CAT2(blob,_HIs_mp)  = $(CAT2(blob,_HIs):.hi=_mp.hi)	@@\
CAT2(blob,_HIs_mg)  = $(CAT2(blob,_HIs):.hi=_mg.hi)	@@\
CAT2(blob,_HIs_2s)  = $(CAT2(blob,_HIs):.hi=_2s.hi)	@@\
CAT2(blob,_HIs_1s)  = $(CAT2(blob,_HIs):.hi=_1s.hi)	@@\
CAT2(blob,_HIs_du)  = $(CAT2(blob,_HIs):.hi=_du.hi)	@@\
CAT2(blob,_HIs_a)   = $(CAT2(blob,_HIs):.hi=_a.hi)	@@\
CAT2(blob,_HIs_b)   = $(CAT2(blob,_HIs):.hi=_b.hi)	@@\
CAT2(blob,_HIs_c)   = $(CAT2(blob,_HIs):.hi=_c.hi)	@@\
CAT2(blob,_HIs_d)   = $(CAT2(blob,_HIs):.hi=_d.hi)	@@\
CAT2(blob,_HIs_e)   = $(CAT2(blob,_HIs):.hi=_e.hi)	@@\
CAT2(blob,_HIs_f)   = $(CAT2(blob,_HIs):.hi=_f.hi)	@@\
CAT2(blob,_HIs_g)   = $(CAT2(blob,_HIs):.hi=_g.hi)	@@\
CAT2(blob,_HIs_h)   = $(CAT2(blob,_HIs):.hi=_h.hi)	@@\
CAT2(blob,_HIs_i)   = $(CAT2(blob,_HIs):.hi=_i.hi)	@@\
CAT2(blob,_HIs_j)   = $(CAT2(blob,_HIs):.hi=_j.hi)	@@\
CAT2(blob,_HIs_k)   = $(CAT2(blob,_HIs):.hi=_k.hi)	@@\
CAT2(blob,_HIs_l)   = $(CAT2(blob,_HIs):.hi=_l.hi)	@@\
CAT2(blob,_HIs_m)   = $(CAT2(blob,_HIs):.hi=_m.hi)	@@\
CAT2(blob,_HIs_n)   = $(CAT2(blob,_HIs):.hi=_n.hi)	@@\
CAT2(blob,_HIs_o)   = $(CAT2(blob,_HIs):.hi=_o.hi)


#define PrintFileStuff(blob,outf) \
	@echo 'IfGhcBuild_normal(' CAT2(blob,_HC_norm)  = $(CAT2(blob,_HC_norm))  ')' >> outf @@\
	@echo 'IfGhcBuild_normal(' CAT2(blob,_DEP_norm) = $(CAT2(blob,_DEP_norm)) ')' >> outf @@\
	@echo 'IfGhcBuild_p('  CAT2(blob,_HC_p)  = $(CAT2(blob,_HC_p))  ')' >> outf @@\
	@echo 'IfGhcBuild_t('  CAT2(blob,_HC_t)  = $(CAT2(blob,_HC_t))  ')' >> outf @@\
	@echo 'IfGhcBuild_u('  CAT2(blob,_HC_u)  = $(CAT2(blob,_HC_u))  ')' >> outf @@\
	@echo 'IfGhcBuild_mc(' CAT2(blob,_HC_mc) = $(CAT2(blob,_HC_mc)) ')' >> outf @@\
	@echo 'IfGhcBuild_mr(' CAT2(blob,_HC_mr) = $(CAT2(blob,_HC_mr)) ')' >> outf @@\
	@echo 'IfGhcBuild_mt(' CAT2(blob,_HC_mt) = $(CAT2(blob,_HC_mt)) ')' >> outf @@\
	@echo 'IfGhcBuild_mp(' CAT2(blob,_HC_mp) = $(CAT2(blob,_HC_mp)) ')' >> outf @@\
	@echo 'IfGhcBuild_mg(' CAT2(blob,_HC_mg) = $(CAT2(blob,_HC_mg)) ')' >> outf @@\
	@echo 'IfGhcBuild_2s(' CAT2(blob,_HC_2s) = $(CAT2(blob,_HC_2s)) ')' >> outf @@\
	@echo 'IfGhcBuild_1s(' CAT2(blob,_HC_1s) = $(CAT2(blob,_HC_1s)) ')' >> outf @@\
	@echo 'IfGhcBuild_du(' CAT2(blob,_HC_du) = $(CAT2(blob,_HC_du)) ')' >> outf @@\
	@echo 'IfGhcBuild_a('  CAT2(blob,_HC_a)  = $(CAT2(blob,_HC_a))  ')' >> outf @@\
	@echo 'IfGhcBuild_b('  CAT2(blob,_HC_b)  = $(CAT2(blob,_HC_b))  ')' >> outf @@\
	@echo 'IfGhcBuild_c('  CAT2(blob,_HC_c)  = $(CAT2(blob,_HC_c))  ')' >> outf @@\
	@echo 'IfGhcBuild_d('  CAT2(blob,_HC_d)  = $(CAT2(blob,_HC_d))  ')' >> outf @@\
	@echo 'IfGhcBuild_e('  CAT2(blob,_HC_e)  = $(CAT2(blob,_HC_e))  ')' >> outf @@\
	@echo 'IfGhcBuild_f('  CAT2(blob,_HC_f)  = $(CAT2(blob,_HC_f))  ')' >> outf @@\
	@echo 'IfGhcBuild_g('  CAT2(blob,_HC_g)  = $(CAT2(blob,_HC_g))  ')' >> outf @@\
	@echo 'IfGhcBuild_h('  CAT2(blob,_HC_h)  = $(CAT2(blob,_HC_h))  ')' >> outf @@\
	@echo 'IfGhcBuild_i('  CAT2(blob,_HC_i)  = $(CAT2(blob,_HC_i))  ')' >> outf @@\
	@echo 'IfGhcBuild_j('  CAT2(blob,_HC_j)  = $(CAT2(blob,_HC_j))  ')' >> outf @@\
	@echo 'IfGhcBuild_k('  CAT2(blob,_HC_k)  = $(CAT2(blob,_HC_k))  ')' >> outf @@\
	@echo 'IfGhcBuild_l('  CAT2(blob,_HC_l)  = $(CAT2(blob,_HC_l))  ')' >> outf @@\
	@echo 'IfGhcBuild_m('  CAT2(blob,_HC_m)  = $(CAT2(blob,_HC_m))  ')' >> outf @@\
	@echo 'IfGhcBuild_n('  CAT2(blob,_HC_n)  = $(CAT2(blob,_HC_n))  ')' >> outf @@\
	@echo 'IfGhcBuild_o('  CAT2(blob,_HC_o)  = $(CAT2(blob,_HC_o))  ')' >> outf @@\
	@echo 'IfGhcBuild_p('  CAT2(blob,_DEP_p)  = $(CAT2(blob,_DEP_p))  ')' >> outf @@\
	@echo 'IfGhcBuild_t('  CAT2(blob,_DEP_t)  = $(CAT2(blob,_DEP_t))  ')' >> outf @@\
	@echo 'IfGhcBuild_u('  CAT2(blob,_DEP_u)  = $(CAT2(blob,_DEP_u))  ')' >> outf @@\
	@echo 'IfGhcBuild_mc(' CAT2(blob,_DEP_mc) = $(CAT2(blob,_DEP_mc)) ')' >> outf @@\
	@echo 'IfGhcBuild_mr(' CAT2(blob,_DEP_mr) = $(CAT2(blob,_DEP_mr)) ')' >> outf @@\
	@echo 'IfGhcBuild_mt(' CAT2(blob,_DEP_mt) = $(CAT2(blob,_DEP_mt)) ')' >> outf @@\
	@echo 'IfGhcBuild_mp(' CAT2(blob,_DEP_mp) = $(CAT2(blob,_DEP_mp)) ')' >> outf @@\
	@echo 'IfGhcBuild_mg(' CAT2(blob,_DEP_mg) = $(CAT2(blob,_DEP_mg)) ')' >> outf @@\
	@echo 'IfGhcBuild_2s(' CAT2(blob,_DEP_2s) = $(CAT2(blob,_DEP_2s)) ')' >> outf @@\
	@echo 'IfGhcBuild_1s(' CAT2(blob,_DEP_1s) = $(CAT2(blob,_DEP_1s)) ')' >> outf @@\
	@echo 'IfGhcBuild_du(' CAT2(blob,_DEP_du) = $(CAT2(blob,_DEP_du)) ')' >> outf @@\
	@echo 'IfGhcBuild_a('  CAT2(blob,_DEP_a)  = $(CAT2(blob,_DEP_a))  ')' >> outf @@\
	@echo 'IfGhcBuild_b('  CAT2(blob,_DEP_b)  = $(CAT2(blob,_DEP_b))  ')' >> outf @@\
	@echo 'IfGhcBuild_c('  CAT2(blob,_DEP_c)  = $(CAT2(blob,_DEP_c))  ')' >> outf @@\
	@echo 'IfGhcBuild_d('  CAT2(blob,_DEP_d)  = $(CAT2(blob,_DEP_d))  ')' >> outf @@\
	@echo 'IfGhcBuild_e('  CAT2(blob,_DEP_e)  = $(CAT2(blob,_DEP_e))  ')' >> outf @@\
	@echo 'IfGhcBuild_f('  CAT2(blob,_DEP_f)  = $(CAT2(blob,_DEP_f))  ')' >> outf @@\
	@echo 'IfGhcBuild_g('  CAT2(blob,_DEP_g)  = $(CAT2(blob,_DEP_g))  ')' >> outf @@\
	@echo 'IfGhcBuild_h('  CAT2(blob,_DEP_h)  = $(CAT2(blob,_DEP_h))  ')' >> outf @@\
	@echo 'IfGhcBuild_i('  CAT2(blob,_DEP_i)  = $(CAT2(blob,_DEP_i))  ')' >> outf @@\
	@echo 'IfGhcBuild_j('  CAT2(blob,_DEP_j)  = $(CAT2(blob,_DEP_j))  ')' >> outf @@\
	@echo 'IfGhcBuild_k('  CAT2(blob,_DEP_k)  = $(CAT2(blob,_DEP_k))  ')' >> outf @@\
	@echo 'IfGhcBuild_l('  CAT2(blob,_DEP_l)  = $(CAT2(blob,_DEP_l))  ')' >> outf @@\
	@echo 'IfGhcBuild_m('  CAT2(blob,_DEP_m)  = $(CAT2(blob,_DEP_m))  ')' >> outf @@\
	@echo 'IfGhcBuild_n('  CAT2(blob,_DEP_n)  = $(CAT2(blob,_DEP_n))  ')' >> outf @@\
	@echo 'IfGhcBuild_o('  CAT2(blob,_DEP_o)  = $(CAT2(blob,_DEP_o))  ')' >> outf @@\
	@echo 'IfGhcBuild_p('  CAT2(blob,_HIs_p)  = $(CAT2(blob,_HIs_p))  ')' >> outf @@\
	@echo 'IfGhcBuild_t('  CAT2(blob,_HIs_t)  = $(CAT2(blob,_HIs_t))  ')' >> outf @@\
	@echo 'IfGhcBuild_u('  CAT2(blob,_HIs_u)  = $(CAT2(blob,_HIs_u))  ')' >> outf @@\
	@echo 'IfGhcBuild_mc(' CAT2(blob,_HIs_mc) = $(CAT2(blob,_HIs_mc)) ')' >> outf @@\
	@echo 'IfGhcBuild_mr(' CAT2(blob,_HIs_mr) = $(CAT2(blob,_HIs_mr)) ')' >> outf @@\
	@echo 'IfGhcBuild_mt(' CAT2(blob,_HIs_mt) = $(CAT2(blob,_HIs_mt)) ')' >> outf @@\
	@echo 'IfGhcBuild_mp(' CAT2(blob,_HIs_mp) = $(CAT2(blob,_HIs_mp)) ')' >> outf @@\
	@echo 'IfGhcBuild_mg(' CAT2(blob,_HIs_mg) = $(CAT2(blob,_HIs_mg)) ')' >> outf @@\
	@echo 'IfGhcBuild_2s(' CAT2(blob,_HIs_2s) = $(CAT2(blob,_HIs_2s)) ')' >> outf @@\
	@echo 'IfGhcBuild_1s(' CAT2(blob,_HIs_1s) = $(CAT2(blob,_HIs_1s)) ')' >> outf @@\
	@echo 'IfGhcBuild_du(' CAT2(blob,_HIs_du) = $(CAT2(blob,_HIs_du)) ')' >> outf @@\
	@echo 'IfGhcBuild_a('  CAT2(blob,_HIs_a)  = $(CAT2(blob,_HIs_a))  ')' >> outf @@\
	@echo 'IfGhcBuild_b('  CAT2(blob,_HIs_b)  = $(CAT2(blob,_HIs_b))  ')' >> outf @@\
	@echo 'IfGhcBuild_c('  CAT2(blob,_HIs_c)  = $(CAT2(blob,_HIs_c))  ')' >> outf @@\
	@echo 'IfGhcBuild_d('  CAT2(blob,_HIs_d)  = $(CAT2(blob,_HIs_d))  ')' >> outf @@\
	@echo 'IfGhcBuild_e('  CAT2(blob,_HIs_e)  = $(CAT2(blob,_HIs_e))  ')' >> outf @@\
	@echo 'IfGhcBuild_f('  CAT2(blob,_HIs_f)  = $(CAT2(blob,_HIs_f))  ')' >> outf @@\
	@echo 'IfGhcBuild_g('  CAT2(blob,_HIs_g)  = $(CAT2(blob,_HIs_g))  ')' >> outf @@\
	@echo 'IfGhcBuild_h('  CAT2(blob,_HIs_h)  = $(CAT2(blob,_HIs_h))  ')' >> outf @@\
	@echo 'IfGhcBuild_i('  CAT2(blob,_HIs_i)  = $(CAT2(blob,_HIs_i))  ')' >> outf @@\
	@echo 'IfGhcBuild_j('  CAT2(blob,_HIs_j)  = $(CAT2(blob,_HIs_j))  ')' >> outf @@\
	@echo 'IfGhcBuild_k('  CAT2(blob,_HIs_k)  = $(CAT2(blob,_HIs_k))  ')' >> outf @@\
	@echo 'IfGhcBuild_l('  CAT2(blob,_HIs_l)  = $(CAT2(blob,_HIs_l))  ')' >> outf @@\
	@echo 'IfGhcBuild_m('  CAT2(blob,_HIs_m)  = $(CAT2(blob,_HIs_m))  ')' >> outf @@\
	@echo 'IfGhcBuild_n('  CAT2(blob,_HIs_n)  = $(CAT2(blob,_HIs_n))  ')' >> outf @@\
	@echo 'IfGhcBuild_o('  CAT2(blob,_HIs_o)  = $(CAT2(blob,_HIs_o))  ')' >> outf

BASIC_HS	= $(BASIC_LHS:.lhs=.hs) $(BASIC_HS_PREL)
BASIC_OBJS_DIRS	= $(BASIC_HS:.hs=)

SrcThingVars(BASIC)

print_file_list1 :
	$(RM) Jmake.inc1
	@echo making Jmake.inc1 ...
	@echo '/* Machine-generated file: do not edit! */' > Jmake.inc1
	@echo BASIC_HS = $(BASIC_HS) >> Jmake.inc1
	@echo BASIC_OBJS_DIRS = $(BASIC_OBJS_DIRS) >> Jmake.inc1
	PrintFileStuff(BASIC,Jmake.inc1)

#endif /* good make */

/* ------------------------------------------*/
/* same stuff, for Haskell 1.3 library */
ONE3_LHS = 		\
	haskell-1.3/LibSystem.lhs   \
	haskell-1.3/LibCPUTime.lhs  \
	haskell-1.3/LibDirectory.lhs \
	haskell-1.3/LibTime.lhs	\
	haskell-1.3/LibPosix.lhs \
	haskell-1.3/LibPosixDB.lhs \
	haskell-1.3/LibPosixErr.lhs \
	haskell-1.3/LibPosixFiles.lhs \
	haskell-1.3/LibPosixIO.lhs \
	haskell-1.3/LibPosixProcEnv.lhs \
	haskell-1.3/LibPosixProcPrim.lhs \
	haskell-1.3/LibPosixTTY.lhs \
	haskell-1.3/LibPosixUtil.lhs

#if MakeDoesNestedMacros != YES
/* make is brain-dead: use file produced below (w/ a good make) */
#include "Jmake.inc2"

#else /* good make */

ONE3_HS	= $(ONE3_LHS:.lhs=.hs)
ONE3_OBJS_DIRS	= $(ONE3_HS:.hs=)

SrcThingVars(ONE3)

print_file_list2 :
	$(RM) Jmake.inc2
	@echo making Jmake.inc2 ...
	@echo '/* Machine-generated file: do not edit! */' > Jmake.inc2
	@echo ONE3_HS = $(ONE3_HS) >> Jmake.inc2
	@echo ONE3_OBJS_DIRS = $(ONE3_OBJS_DIRS) >> Jmake.inc2
	PrintFileStuff(ONE3,Jmake.inc2)

#endif /* good make */

/* ------------------------------------------*/
/* same stuff, for GHC utilities library */

#if GhcWithReadline != YES
# define __readline_lhs /*none*/
# define __readline_hi  /*none*/
#else
# define __readline_lhs		\
	ghc/Readline.lhs
# define __readline_hi		\
	ghc/Readline.hi
#endif

#if GhcWithSockets != YES
# define __sockets_lhs /*none*/
# define __sockets_hi  /*none*/
#else
# define __sockets_lhs		\
	ghc/Socket.lhs		\
	ghc/SocketPrim.lhs	\
	ghc/BSD.lhs		\
	ghc/CError.lhs
# define __sockets_hi		\
	ghc/Socket.hi		\
	ghc/SocketPrim.hi	\
	ghc/BSD.hi
#endif

GHCLIB_LHS =			\
	ghc/Bag.lhs		\
	ghc/BitSet.lhs		\
	ghc/CharSeq.lhs		\
	ghc/FiniteMap.lhs	\
	ghc/ListSetOps.lhs	\
	ghc/Maybes.lhs		\
	ghc/PackedString.lhs	\
	ghc/Regex.lhs		\
	ghc/MatchPS.lhs		\
	ghc/Pretty.lhs		\
	ghc/Set.lhs		\
	ghc/Util.lhs __readline_lhs __sockets_lhs

#if MakeDoesNestedMacros != YES
/* make is brain-dead: use the file produced below */
#include "Jmake.inc3"

#else /* good make */

GHCLIB_HS	 = $(GHCLIB_LHS:.lhs=.hs)
GHCLIB_OBJS_DIRS = $(GHCLIB_HS:.hs=)

SrcThingVars(GHCLIB)

print_file_list3 :
	$(RM) Jmake.inc3
	@echo making Jmake.inc3 ...
	@echo '/* Machine-generated file: do not edit! */' > Jmake.inc3
	@echo GHCLIB_HS = $(GHCLIB_HS) >> Jmake.inc3
	@echo GHCLIB_OBJS_DIRS = $(GHCLIB_OBJS_DIRS) >> Jmake.inc3
	PrintFileStuff(GHCLIB,Jmake.inc3)

#endif /* good make */

/* ------------------------------------------*/
/* same stuff, for HBC-compatibility library */
HBCLIB_HS = 		\
	hbc/Algebra.hs	\
	hbc/Hash.hs	\
	hbc/ListUtil.hs	\
	hbc/Miranda.hs	\
	hbc/NameSupply.hs \
	hbc/Number.hs	\
	hbc/Parse.hs	\
	hbc/Pretty.hs	\
	hbc/Printf.hs	\
	hbc/QSort.hs	\
	hbc/Random.hs	\
	hbc/SimpleLex.hs \
	hbc/Time.hs	\
	hbc/Trace.hs	\
	hbc/Native.hs	\
	hbc/Word.hs

#if MakeDoesNestedMacros != YES
/* make is brain-dead: use file produced below (w/ a good make) */
#include "Jmake.inc4"

#else /* good make */

HBCLIB_OBJS_DIRS = $(HBCLIB_HS:.hs=)

SrcThingVars(HBCLIB)

print_file_list4 :
	$(RM) Jmake.inc4
	@echo making Jmake.inc4 ...
	@echo '/* Machine-generated file: do not edit! */' > Jmake.inc4
	@echo HBCLIB_HS = $(HBCLIB_HS) >> Jmake.inc4
	@echo HBCLIB_OBJS_DIRS = $(HBCLIB_OBJS_DIRS) >> Jmake.inc4
	PrintFileStuff(HBCLIB,Jmake.inc4)

#endif /* good make */

#if MakeDoesNestedMacros == YES

/* ---- occasionally convenient make targets ---- */
IfGhcBuild_normal(hcs :: $(BASIC_HC_norm) $(ONE3_HC_norm) $(GHCLIB_HC_norm) $(HBCLIB_HC_norm))
IfGhcBuild_p(hcs_p   :: $(BASIC_HC_p)  $(ONE3_HC_p)  $(GHCLIB_HC_p)  $(HBCLIB_HC_p))
IfGhcBuild_t(hcs_t   :: $(BASIC_HC_t)  $(ONE3_HC_t)  $(GHCLIB_HC_t)  $(HBCLIB_HC_t))
IfGhcBuild_u(hcs_u   :: $(BASIC_HC_u)  $(ONE3_HC_u)  $(GHCLIB_HC_u)  $(HBCLIB_HC_u))
IfGhcBuild_mc(hcs_mc :: $(BASIC_HC_mc) $(ONE3_HC_mc) $(GHCLIB_HC_mc) $(HBCLIB_HC_mc))
IfGhcBuild_mr(hcs_mr :: $(BASIC_HC_mr) $(ONE3_HC_mr) $(GHCLIB_HC_mr) $(HBCLIB_HC_mr))
IfGhcBuild_mt(hcs_mt :: $(BASIC_HC_mt) $(ONE3_HC_mt) $(GHCLIB_HC_mt) $(HBCLIB_HC_mt))
IfGhcBuild_mp(hcs_mp :: $(BASIC_HC_mp) $(ONE3_HC_mp) $(GHCLIB_HC_mp) $(HBCLIB_HC_mp))
IfGhcBuild_mg(hcs_mg :: $(BASIC_HC_mg) $(ONE3_HC_mg) $(GHCLIB_HC_mg) $(HBCLIB_HC_mg))
IfGhcBuild_2s(hcs_2s :: $(BASIC_HC_2s) $(ONE3_HC_2s) $(GHCLIB_HC_2s) $(HBCLIB_HC_2s))
IfGhcBuild_1s(hcs_1s :: $(BASIC_HC_1s) $(ONE3_HC_1s) $(GHCLIB_HC_1s) $(HBCLIB_HC_1s))
IfGhcBuild_du(hcs_du :: $(BASIC_HC_du) $(ONE3_HC_du) $(GHCLIB_HC_du) $(HBCLIB_HC_du))
IfGhcBuild_a(hcs_a   :: $(BASIC_HC_a)  $(ONE3_HC_a)  $(GHCLIB_HC_a)  $(HBCLIB_HC_a))
IfGhcBuild_b(hcs_b   :: $(BASIC_HC_b)  $(ONE3_HC_b)  $(GHCLIB_HC_b)  $(HBCLIB_HC_b))
IfGhcBuild_c(hcs_c   :: $(BASIC_HC_c)  $(ONE3_HC_c)  $(GHCLIB_HC_c)  $(HBCLIB_HC_c))
IfGhcBuild_d(hcs_d   :: $(BASIC_HC_d)  $(ONE3_HC_d)  $(GHCLIB_HC_d)  $(HBCLIB_HC_d))
IfGhcBuild_e(hcs_e   :: $(BASIC_HC_e)  $(ONE3_HC_e)  $(GHCLIB_HC_e)  $(HBCLIB_HC_e))
IfGhcBuild_f(hcs_f   :: $(BASIC_HC_f)  $(ONE3_HC_f)  $(GHCLIB_HC_f)  $(HBCLIB_HC_f))
IfGhcBuild_g(hcs_g   :: $(BASIC_HC_g)  $(ONE3_HC_g)  $(GHCLIB_HC_g)  $(HBCLIB_HC_g))
IfGhcBuild_h(hcs_h   :: $(BASIC_HC_h)  $(ONE3_HC_h)  $(GHCLIB_HC_h)  $(HBCLIB_HC_h))
IfGhcBuild_i(hcs_i   :: $(BASIC_HC_i)  $(ONE3_HC_i)  $(GHCLIB_HC_i)  $(HBCLIB_HC_i))
IfGhcBuild_j(hcs_j   :: $(BASIC_HC_j)  $(ONE3_HC_j)  $(GHCLIB_HC_j)  $(HBCLIB_HC_j))
IfGhcBuild_k(hcs_k   :: $(BASIC_HC_k)  $(ONE3_HC_k)  $(GHCLIB_HC_k)  $(HBCLIB_HC_k))
IfGhcBuild_l(hcs_l   :: $(BASIC_HC_l)  $(ONE3_HC_l)  $(GHCLIB_HC_l)  $(HBCLIB_HC_l))
IfGhcBuild_m(hcs_m   :: $(BASIC_HC_m)  $(ONE3_HC_m)  $(GHCLIB_HC_m)  $(HBCLIB_HC_m))
IfGhcBuild_n(hcs_n   :: $(BASIC_HC_n)  $(ONE3_HC_n)  $(GHCLIB_HC_n)  $(HBCLIB_HC_n))
IfGhcBuild_o(hcs_o   :: $(BASIC_HC_o)  $(ONE3_HC_o)  $(GHCLIB_HC_o)  $(HBCLIB_HC_o))

IfGhcBuild_normal(libs:: libHS.a    libHS13.a    libHSghc.a    libHShbc.a)
IfGhcBuild_p(libs_p   :: libHS_p.a  libHS13_p.a  libHSghc_p.a  libHShbc_p.a)
IfGhcBuild_t(libs_t   :: libHS_t.a  libHS13_t.a  libHSghc_t.a  libHShbc_t.a)
IfGhcBuild_t(libs_u   :: libHS_u.a  libHS13_u.a  libHSghc_u.a  libHShbc_u.a)
IfGhcBuild_mc(libs_mc :: libHS_mc.a libHS13_mc.a libHSghc_mc.a libHShbc_mc.a)
IfGhcBuild_mr(libs_mr :: libHS_mr.a libHS13_mr.a libHSghc_mr.a libHShbc_mr.a)
IfGhcBuild_mt(libs_mt :: libHS_mt.a libHS13_mt.a libHSghc_mt.a libHShbc_mt.a)
IfGhcBuild_mp(libs_mp :: libHS_mp.a libHS13_mp.a libHSghc_mp.a libHShbc_mp.a)
IfGhcBuild_mg(libs_mg :: libHS_mg.a libHS13_mg.a libHSghc_mg.a libHShbc_mg.a)
IfGhcBuild_2s(libs_2s :: libHS_2s.a libHS13_2s.a libHSghc_2s.a libHShbc_2s.a)
IfGhcBuild_1s(libs_1s :: libHS_1s.a libHS13_1s.a libHSghc_1s.a libHShbc_1s.a)
IfGhcBuild_du(libs_du :: libHS_du.a libHS13_du.a libHSghc_du.a libHShbc_du.a)
IfGhcBuild_a(libs_a   :: libHS_a.a  libHS13_a.a  libHSghc_a.a  libHShbc_a.a)
IfGhcBuild_b(libs_b   :: libHS_b.a  libHS13_b.a  libHSghc_b.a  libHShbc_b.a)
IfGhcBuild_c(libs_c   :: libHS_c.a  libHS13_c.a  libHSghc_c.a  libHShbc_c.a)
IfGhcBuild_d(libs_d   :: libHS_d.a  libHS13_d.a  libHSghc_d.a  libHShbc_d.a)
IfGhcBuild_e(libs_e   :: libHS_e.a  libHS13_e.a  libHSghc_e.a  libHShbc_e.a)
IfGhcBuild_f(libs_f   :: libHS_f.a  libHS13_f.a  libHSghc_f.a  libHShbc_f.a)
IfGhcBuild_g(libs_g   :: libHS_g.a  libHS13_g.a  libHSghc_g.a  libHShbc_g.a)
IfGhcBuild_h(libs_h   :: libHS_h.a  libHS13_h.a  libHSghc_h.a  libHShbc_h.a)
IfGhcBuild_i(libs_i   :: libHS_i.a  libHS13_i.a  libHSghc_i.a  libHShbc_i.a)
IfGhcBuild_j(libs_j   :: libHS_j.a  libHS13_j.a  libHSghc_j.a  libHShbc_j.a)
IfGhcBuild_k(libs_k   :: libHS_k.a  libHS13_k.a  libHSghc_k.a  libHShbc_k.a)
IfGhcBuild_l(libs_l   :: libHS_l.a  libHS13_l.a  libHSghc_l.a  libHShbc_l.a)
IfGhcBuild_m(libs_m   :: libHS_m.a  libHS13_m.a  libHSghc_m.a  libHShbc_m.a)
IfGhcBuild_n(libs_n   :: libHS_n.a  libHS13_n.a  libHSghc_n.a  libHShbc_n.a)
IfGhcBuild_o(libs_o   :: libHS_o.a  libHS13_o.a  libHSghc_o.a  libHShbc_o.a)

/* maybe for GNU make only? */
.PHONY :: hcs hcs_p hcs_t hcs_mg hcs_mr hcs_mt hcs_mp hcs_mg hcs_a hcs_b hcs_c hcs_d hcs_e hcs_f hcs_g hcs_h hcs_i hcs_j hcs_k hcs_l hcs_m hcs_n hcs_o

#endif /* reasonable make */

GHCLIB_HIs = you-really-need-to-define-GHCLIB_HIs
    /* use print_file_lists */

/* lists of *.hi files, for installation; i.e., the user
   will be able to say (e.g.,) "import PreludePrimIO" and it will work.
   (but "import ITup5" will not)

   PreludeNull_.hi is tickled by "hstags".
*/
BASIC_HIs   = prelude/Prelude.hi 		\
	      prelude/PreludeCore.hi 		\
	      prelude/Prel13.hi 		\
	      prelude/PrelCore13.hi 		\
	      prelude/PreludeNull_.hi		\
    	      glaExts/PreludeGlaST.hi		\
	      glaExts/PreludeGlaMisc.hi		\
	      prelude/Concurrent.hi		\
	      prelude/Parallel.hi

GHCLIB_HIs  = ghc/Bag.hi			\
	      ghc/BitSet.hi			\
	      ghc/CharSeq.hi			\
	      ghc/FiniteMap.hi			\
	      ghc/ListSetOps.hi			\
	      ghc/Maybes.hi			\
	      ghc/PackedString.hi		\
	      ghc/Regex.hi			\
	      ghc/MatchPS.hi			\
	      ghc/Pretty.hi			\
	      ghc/Set.hi			\
	      ghc/Util.hi __readline_hi __sockets_hi

ONE3_HIs    = haskell-1.3/LibSystem.hi		\
	      haskell-1.3/LibCPUTime.hi		\
	      haskell-1.3/LibDirectory.hi	\
	      haskell-1.3/LibTime.hi		\
	      haskell-1.3/LibPosix.hi

HBCLIB_HIs    = hbc/Algebra.hi			\
	      hbc/Hash.hi			\
	      hbc/ListUtil.hi			\
	      hbc/Miranda.hi			\
	      hbc/Native.hi			\
	      hbc/NameSupply.hi			\
	      hbc/Number.hi			\
	      hbc/Parse.hi			\
	      hbc/Pretty.hi			\
	      hbc/Printf.hi			\
	      hbc/QSort.hi			\
	      hbc/Random.hi			\
	      hbc/SimpleLex.hi			\
	      hbc/Time.hi			\
	      hbc/Trace.hi			\
	      hbc/Word.hi

/************************************************************************
*									*
* Macros for creating and installing libHS<x>.a (in its many flavors).	*
*									*
*************************************************************************/

#ifndef SpecialGhcLibraryTarget
#define SpecialGhcLibraryTarget(lib,tag,objs_DEP,objs_DIR,find_pat) @@\
AllTarget(CAT3(lib,tag,.a))					@@\
CAT3(lib,tag,.a):: objs_DEP					@@\
	$(RM) $@						@@\
	$(AR) $@ 						@@\
	TMPDIR=$(TMPDIR); export TMPDIR;			\
	find objs_DIR -name find_pat -print | xargs ar q $@	@@\
	$(RANLIB) CAT3(lib,tag,.a)				@@\
clean  ::							@@\
	$(RM) CAT3(lib,tag,.a)
#endif /* SpecialGhcLibraryTarget */

#ifndef SpecialGhcLibInstallTarget
#if DoInstallGHCSystem == YES
#define SpecialGhcLibInstallTarget(lib,tag)			@@\
install :: CAT3(lib,tag,.a)					@@\
	$(INSTALL) $(INSTLIBFLAGS) CAT3(lib,tag,.a)		\
		$(INSTLIBDIR_GHC)/CAT3(lib,tag,.a)		@@\
	$(RANLIB) $(INSTLIBDIR_GHC)/CAT3(lib,tag,.a)
#else  /* ! DoInstallGhc... */
#define SpecialGhcLibInstallTarget(lib,tag) /*nothing*/
#endif /* ! DoInstallGhc... */
#endif /* SpecialGhcLibInstallTarget */

/* build/install all the diff libs for a particular build */

#define BigHisTarget(targeti,basei,ghci,hbci,one3i)		@@\
targeti ::							@@\
InstallTarget(targeti)						@@\
InstallMultNonExecTargets(targeti,basei,$(INSTDATADIR_GHC)/imports) @@\
InstallMultNonExecTargets(targeti,ghci, $(INSTDATADIR_GHC)/imports/ghc) @@\
InstallMultNonExecTargets(targeti,hbci, $(INSTDATADIR_GHC)/imports/hbc) @@\
InstallMultNonExecTargets(targeti,one3i,$(INSTDATADIR_GHC)/imports/haskell-1.3)

#define BigLibsTarget(tag,glob,base,ghc,hbc,one3)			@@\
SpecialGhcLibraryTarget(libHS,tag,base,$(BASIC_OBJS_DIRS),glob)		@@\
SpecialGhcLibInstallTarget(libHS,tag)					@@\
SpecialGhcLibraryTarget(libHSghc,tag,ghc,$(GHCLIB_OBJS_DIRS),glob)	@@\
SpecialGhcLibInstallTarget(libHSghc,tag)				@@\
SpecialGhcLibraryTarget(libHShbc,tag,hbc,$(HBCLIB_OBJS_DIRS),glob)	@@\
SpecialGhcLibInstallTarget(libHShbc,tag)				@@\
SpecialGhcLibraryTarget(libHS13,tag,one3,$(ONE3_OBJS_DIRS),glob)	@@\
SpecialGhcLibInstallTarget(libHS13,tag)

/* build *everything* -- monster macro from hell */
#define BigBuildTarget(tag,glob,targeti,base,basei,ghc,ghci,hbc,hbci,one3,one3i) \
BigLibsTarget(tag,glob,base,ghc,hbc,one3)			@@\
BigHisTarget(targeti,basei,ghci,hbci,one3i)


/****************************************************************
*								*
* Creating and installing...					*
*	libHS_<tag>.a		standard Prelude library	*
*	libHShbc_<tag>.a	HBC-compatibility lib		*
*	libHSghc_<tag>.a	GHC utilities lib		*
*       libHS13_<tag>.a         Haskell 1.3 lib                 *
*								*
****************************************************************/

/* make sure install's target dir is there */
#if DoInstallGHCSystem == YES
MakeDirectories(install, $(INSTLIBDIR_GHC) 		\
			 $(INSTDATADIR_GHC)/imports	\
			 $(INSTDATADIR_GHC)/imports/ghc \
			 $(INSTDATADIR_GHC)/imports/hbc \
                         $(INSTDATADIR_GHC)/imports/haskell-1.3)

basic_his :: /* nothing */
InstallTarget(basic_his)
InstallMultNonExecTargets(basic_his, $(BASIC_HIs),  $(INSTDATADIR_GHC)/imports)
InstallMultNonExecTargets(basic_his, $(HBCLIB_HIs), $(INSTDATADIR_GHC)/imports/hbc)
InstallMultNonExecTargets(basic_his, $(ONE3_HIs),   $(INSTDATADIR_GHC)/imports/haskell-1.3)
InstallMultNonExecTargets(basic_his, $(GHCLIB_HIs), $(INSTDATADIR_GHC)/imports/ghc)
#endif /* installing */

IfGhcBuild_normal(BigBuildTarget(,'*_.o',basic_his \
, $(BASIC_DEP_norm),  $(BASIC_HIs)		\
, $(GHCLIB_DEP_norm), $(GHCLIB_HIs)		\
, $(HBCLIB_DEP_norm), $(HBCLIB_HIs)		\
, $(ONE3_DEP_norm),   $(ONE3_HIs)		\
))

IfGhcBuild_p(BigBuildTarget(_p,'*_p.o',his_p	\
, $(BASIC_DEP_p),  $(BASIC_HIs_p)		\
, $(GHCLIB_DEP_p), $(GHCLIB_HIs_p)		\
, $(HBCLIB_DEP_p), $(HBCLIB_HIs_p)		\
, $(ONE3_DEP_p),   $(ONE3_HIs_p)		\
))

IfGhcBuild_t(BigBuildTarget(_t,'*_t.o',his_t	\
, $(BASIC_DEP_t),  $(BASIC_HIs_t)		\
, $(GHCLIB_DEP_t), $(GHCLIB_HIs_t)		\
, $(HBCLIB_DEP_t), $(HBCLIB_HIs_t)		\
, $(ONE3_DEP_t),   $(ONE3_HIs_t)		\
))

IfGhcBuild_u(BigBuildTarget(,'*_u.o',his_u	\
, $(BASIC_DEP_u),  $(BASIC_HIs_u)		\
, $(GHCLIB_DEP_u), $(GHCLIB_HIs_u)		\
, $(HBCLIB_DEP_u), $(HBCLIB_HIs_u)		\
, $(ONE3_DEP_u),   $(ONE3_HIs_u)		\
))

IfGhcBuild_mc(BigBuildTarget(_mc,'*_mc.o',his_mc \
, $(BASIC_DEP_mc),  $(BASIC_HIs_mc)		\
, $(GHCLIB_DEP_mc), $(GHCLIB_HIs_mc)		\
, $(HBCLIB_DEP_mc), $(HBCLIB_HIs_mc)		\
, $(ONE3_DEP_mc),   $(ONE3_HIs_mc)		\
))

IfGhcBuild_mr(BigBuildTarget(_mr,'*_mr.o',his_mr \
, $(BASIC_DEP_mr),  $(BASIC_HIs_mr)		\
, $(GHCLIB_DEP_mr), $(GHCLIB_HIs_mr)		\
, $(HBCLIB_DEP_mr), $(HBCLIB_HIs_mr)		\
, $(ONE3_DEP_mr),   $(ONE3_HIs_mr)		\
))

IfGhcBuild_mt(BigBuildTarget(_mr,'*_mt.o',his_mt \
, $(BASIC_DEP_mt),  $(BASIC_HIs_mt)		\
, $(GHCLIB_DEP_mt), $(GHCLIB_HIs_mt)		\
, $(HBCLIB_DEP_mt), $(HBCLIB_HIs_mt)		\
, $(ONE3_DEP_mt),   $(ONE3_HIs_mt)		\
))

IfGhcBuild_mp(BigBuildTarget(_mp,'*_mp.o',his_mp \
, $(BASIC_DEP_mp),  $(BASIC_HIs_mp)		\
, $(GHCLIB_DEP_mp), $(GHCLIB_HIs_mp)		\
, $(HBCLIB_DEP_mp), $(HBCLIB_HIs_mp)		\
, $(ONE3_DEP_mp),   $(ONE3_HIs_mp)		\
))

IfGhcBuild_mg(BigBuildTarget(_mg,'*_mg.o',his_mg \
, $(BASIC_DEP_mg),  $(BASIC_HIs_mg)		\
, $(GHCLIB_DEP_mg), $(GHCLIB_HIs_mg)		\
, $(HBCLIB_DEP_mg), $(HBCLIB_HIs_mg)		\
, $(ONE3_DEP_mg),   $(ONE3_HIs_mg)		\
))

/* these GC ones do not *really* need separate .hi files,
   but it really makes life easier to do it this way
*/
IfGhcBuild_2s(BigBuildTarget(_2s,'*_2s.o',his_2s \
, $(BASIC_DEP_2s),  $(BASIC_HIs_2s)		\
, $(GHCLIB_DEP_2s), $(GHCLIB_HIs_2s)		\
, $(HBCLIB_DEP_2s), $(HBCLIB_HIs_2s)		\
, $(ONE3_DEP_2s),   $(ONE3_HIs_2s)		\
))

IfGhcBuild_1s(BigBuildTarget(_1s,'*_1s.o',his_1s \
, $(BASIC_DEP_1s),  $(BASIC_HIs_1s)		\
, $(GHCLIB_DEP_1s), $(GHCLIB_HIs_1s)		\
, $(HBCLIB_DEP_1s), $(HBCLIB_HIs_1s)		\
, $(ONE3_DEP_1s),   $(ONE3_HIs_1s)		\
))

IfGhcBuild_du(BigBuildTarget(_du,'*_du.o',his_du \
, $(BASIC_DEP_du),  $(BASIC_HIs_du)		\
, $(GHCLIB_DEP_du), $(GHCLIB_HIs_du)		\
, $(HBCLIB_DEP_du), $(HBCLIB_HIs_du)		\
, $(ONE3_DEP_du),   $(ONE3_HIs_du)		\
))

/* user ways -- yeeps! */

IfGhcBuild_a(BigBuildTarget(_a,'*_a.o',his_a	\
, $(BASIC_DEP_a),  $(BASIC_HIs_a)		\
, $(GHCLIB_DEP_a), $(GHCLIB_HIs_a)		\
, $(HBCLIB_DEP_a), $(HBCLIB_HIs_a)		\
, $(ONE3_DEP_a),   $(ONE3_HIs_a)		\
))

IfGhcBuild_b(BigBuildTarget(_b,'*_b.o',his_b	\
, $(BASIC_DEP_b),  $(BASIC_HIs_b)		\
, $(GHCLIB_DEP_b), $(GHCLIB_HIs_b)		\
, $(HBCLIB_DEP_b), $(HBCLIB_HIs_b)		\
, $(ONE3_DEP_b),   $(ONE3_HIs_b)		\
))

IfGhcBuild_c(BigBuildTarget(_c,'*_c.o',his_c	\
, $(BASIC_DEP_c),  $(BASIC_HIs_c)		\
, $(GHCLIB_DEP_c), $(GHCLIB_HIs_c)		\
, $(HBCLIB_DEP_c), $(HBCLIB_HIs_c)		\
, $(ONE3_DEP_c),   $(ONE3_HIs_c)		\
))

IfGhcBuild_d(BigBuildTarget(_d,'*_d.o',his_d	\
, $(BASIC_DEP_d),  $(BASIC_HIs_d)		\
, $(GHCLIB_DEP_d), $(GHCLIB_HIs_d)		\
, $(HBCLIB_DEP_d), $(HBCLIB_HIs_d)		\
, $(ONE3_DEP_d),   $(ONE3_HIs_d)		\
))

IfGhcBuild_e(BigBuildTarget(_e,'*_e.o',his_e	\
, $(BASIC_DEP_e),  $(BASIC_HIs_e)		\
, $(GHCLIB_DEP_e), $(GHCLIB_HIs_e)		\
, $(HBCLIB_DEP_e), $(HBCLIB_HIs_e)		\
, $(ONE3_DEP_e),   $(ONE3_HIs_e)		\
))

IfGhcBuild_f(BigBuildTarget(_f,'*_f.o',his_f	\
, $(BASIC_DEP_f),  $(BASIC_HIs_f)		\
, $(GHCLIB_DEP_f), $(GHCLIB_HIs_f)		\
, $(HBCLIB_DEP_f), $(HBCLIB_HIs_f)		\
, $(ONE3_DEP_f),   $(ONE3_HIs_f)		\
))

IfGhcBuild_g(BigBuildTarget(_g,'*_g.o',his_g	\
, $(BASIC_DEP_g),  $(BASIC_HIs_g)		\
, $(GHCLIB_DEP_g), $(GHCLIB_HIs_g)		\
, $(HBCLIB_DEP_g), $(HBCLIB_HIs_g)		\
, $(ONE3_DEP_g),   $(ONE3_HIs_g)		\
))

IfGhcBuild_h(BigBuildTarget(_h,'*_h.o',his_h	\
, $(BASIC_DEP_h),  $(BASIC_HIs_h)		\
, $(GHCLIB_DEP_h), $(GHCLIB_HIs_h)		\
, $(HBCLIB_DEP_h), $(HBCLIB_HIs_h)		\
, $(ONE3_DEP_h),   $(ONE3_HIs_h)		\
))

IfGhcBuild_i(BigBuildTarget(_i,'*_i.o',his_i	\
, $(BASIC_DEP_i),  $(BASIC_HIs_i)		\
, $(GHCLIB_DEP_i), $(GHCLIB_HIs_i)		\
, $(HBCLIB_DEP_i), $(HBCLIB_HIs_i)		\
, $(ONE3_DEP_i),   $(ONE3_HIs_i)		\
))

IfGhcBuild_j(BigBuildTarget(_j,'*_j.o',his_j	\
, $(BASIC_DEP_j),  $(BASIC_HIs_j)		\
, $(GHCLIB_DEP_j), $(GHCLIB_HIs_j)		\
, $(HBCLIB_DEP_j), $(HBCLIB_HIs_j)		\
, $(ONE3_DEP_j),   $(ONE3_HIs_j)		\
))

IfGhcBuild_k(BigBuildTarget(_k,'*_k.o',his_k	\
, $(BASIC_DEP_k),  $(BASIC_HIs_k)		\
, $(GHCLIB_DEP_k), $(GHCLIB_HIs_k)		\
, $(HBCLIB_DEP_k), $(HBCLIB_HIs_k)		\
, $(ONE3_DEP_k),   $(ONE3_HIs_k)		\
))

IfGhcBuild_l(BigBuildTarget(_l,'*_l.o',his_l	\
, $(BASIC_DEP_l),  $(BASIC_HIs_l)		\
, $(GHCLIB_DEP_l), $(GHCLIB_HIs_l)		\
, $(HBCLIB_DEP_l), $(HBCLIB_HIs_l)		\
, $(ONE3_DEP_l),   $(ONE3_HIs_l)		\
))

IfGhcBuild_m(BigBuildTarget(_m,'*_m.o',his_m	\
, $(BASIC_DEP_m),  $(BASIC_HIs_m)		\
, $(GHCLIB_DEP_m), $(GHCLIB_HIs_m)		\
, $(HBCLIB_DEP_m), $(HBCLIB_HIs_m)		\
, $(ONE3_DEP_m),   $(ONE3_HIs_m)		\
))

IfGhcBuild_n(BigBuildTarget(_n,'*_n.o',his_n	\
, $(BASIC_DEP_n),  $(BASIC_HIs_n)		\
, $(GHCLIB_DEP_n), $(GHCLIB_HIs_n)		\
, $(HBCLIB_DEP_n), $(HBCLIB_HIs_n)		\
, $(ONE3_DEP_n),   $(ONE3_HIs_n)		\
))

IfGhcBuild_o(BigBuildTarget(_o,'*_o.o',his_o	\
, $(BASIC_DEP_o),  $(BASIC_HIs_o)		\
, $(GHCLIB_DEP_o), $(GHCLIB_HIs_o)		\
, $(HBCLIB_DEP_o), $(HBCLIB_HIs_o)		\
, $(ONE3_DEP_o),   $(ONE3_HIs_o)		\
))

/****************************************************************
*								*
* 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 CompilePreludishly__(file,isuf,way,flags)		@@\
clean  ::							@@\
	$(RM) CAT3(file,way,.hc)

#else /* normal case */
#define CompilePreludishly__(file,isuf,way,flags)		@@\
CAT3(file,way,.hc) : file.isuf					@@\
	$(RM) CAT3(file,way,.hc)				@@\
	$(GHC) -C $(GHCFLAGS) flags file.isuf -o CAT3(file,way,.hc) @@\
clean ::							@@\
	$(RM) CAT3(file,way,.hc)
#endif

#define ObjectifyPreludishly__(file,way,flags,osuff,find_pat)	@@\
CAT3(file,way,.o) : CAT3(file,way,.hc)				@@\
	$(RM) CAT3(file,way,.o)					@@\
	@if [ ! -d file ] ; then mkdir file ; else exit 0 ; fi	@@\
	@find file -name find_pat -print | xargs $(RM) __rm_food @@\
	$(GHC) -c $(GHCFLAGS) flags CAT3(file,way,.hc) -odir file -osuf osuff @@\
	touch CAT3(file,way,.o)					@@\
clean ::							@@\
	$(RM) CAT3(file,way,.o)					@@\
	find file -name find_pat -print | xargs $(RM) __rm_food

#define DoHs(file,isuf,way,flags,osuf,find_pat)			\
CompilePreludishly__(file,isuf,way,flags)			@@\
ObjectifyPreludishly__(file,way,flags,osuf,find_pat)

/* here we go: (NB: do not make .hc files for _u [unregisterized]) */

#define CompilePreludishly(file,isuf,flags)			@@\
IfGhcBuild_normal(DoHs(file,isuf,,flags $(GHC_OPTS_norm),'_.o',   '*_.o'))	\
IfGhcBuild_p(DoHs(file,isuf,_p,   flags $(GHC_OPTS_p),   '_p.o',  '*_p.o'))	\
IfGhcBuild_t(DoHs(file,isuf,_t,   flags $(GHC_OPTS_t),   '_t.o',  '*_t.o'))	\
IfGhcBuild_mc(DoHs(file,isuf,_mc, flags $(GHC_OPTS_mc),  '_mc.o', '*_mc.o'))	\
IfGhcBuild_mr(DoHs(file,isuf,_mr, flags $(GHC_OPTS_mr),  '_mr.o', '*_mr.o'))	\
IfGhcBuild_mt(DoHs(file,isuf,_mt, flags $(GHC_OPTS_mt),  '_mt.o', '*_mt.o'))	\
IfGhcBuild_mp(DoHs(file,isuf,_mp, flags $(GHC_OPTS_mp),  '_mp.o', '*_mp.o'))	\
IfGhcBuild_mg(DoHs(file,isuf,_mg, flags $(GHC_OPTS_mg),  '_mg.o', '*_mg.o'))	\
IfGhcBuild_2s(DoHs(file,isuf,_2s, flags $(GHC_OPTS_2s),  '_2s.o', '*_2s.o'))	\
IfGhcBuild_1s(DoHs(file,isuf,_1s, flags $(GHC_OPTS_1s),  '_1s.o', '*_1s.o'))	\
IfGhcBuild_du(DoHs(file,isuf,_du, flags $(GHC_OPTS_du),  '_du.o', '*_du.o'))	\
IfGhcBuild_a(DoHs(file,isuf,_a,   flags $(GHC_OPTS_a),   '_a.o',  '*_a.o'))	\
IfGhcBuild_b(DoHs(file,isuf,_b,   flags $(GHC_OPTS_b),   '_b.o',  '*_b.o'))	\
IfGhcBuild_c(DoHs(file,isuf,_c,   flags $(GHC_OPTS_c),   '_c.o',  '*_c.o'))	\
IfGhcBuild_d(DoHs(file,isuf,_d,   flags $(GHC_OPTS_d),   '_d.o',  '*_d.o'))	\
IfGhcBuild_e(DoHs(file,isuf,_e,   flags $(GHC_OPTS_e),   '_e.o',  '*_e.o'))	\
IfGhcBuild_f(DoHs(file,isuf,_f,   flags $(GHC_OPTS_f),   '_f.o',  '*_f.o'))	\
IfGhcBuild_g(DoHs(file,isuf,_g,   flags $(GHC_OPTS_g),   '_g.o',  '*_g.o'))	\
IfGhcBuild_h(DoHs(file,isuf,_h,   flags $(GHC_OPTS_h),   '_h.o',  '*_h.o'))	\
IfGhcBuild_i(DoHs(file,isuf,_i,   flags $(GHC_OPTS_i),   '_i.o',  '*_i.o'))	\
IfGhcBuild_j(DoHs(file,isuf,_j,   flags $(GHC_OPTS_j),   '_j.o',  '*_j.o'))	\
IfGhcBuild_k(DoHs(file,isuf,_k,   flags $(GHC_OPTS_k),   '_k.o',  '*_k.o'))	\
IfGhcBuild_l(DoHs(file,isuf,_l,   flags $(GHC_OPTS_l),   '_l.o',  '*_l.o'))	\
IfGhcBuild_m(DoHs(file,isuf,_m,   flags $(GHC_OPTS_m),   '_m.o',  '*_m.o'))	\
IfGhcBuild_n(DoHs(file,isuf,_n,   flags $(GHC_OPTS_n),   '_n.o',  '*_n.o'))	\
IfGhcBuild_o(DoHs(file,isuf,_o,   flags $(GHC_OPTS_o),   '_o.o',  '*_o.o'))

/* now use the macro: */

CompilePreludishly(glaExts/PreludeGlaST,lhs,	$(PREL_OPTS) -split-objs ST -H16m -monly-4-regs -fno-omit-reexported-instances)
CompilePreludishly(glaExts/PreludePrimIO,lhs, $(PREL_OPTS) -split-objs PreludePrimIO)
CompilePreludishly(glaExts/PreludeErrIO,lhs,	$(PREL_OPTS) -split-objs ErrIO)
CompilePreludishly(glaExts/PreludeDialogueIO,lhs,$(PREL_OPTS) -split-objs DialogueIO)
CompilePreludishly(glaExts/MainIO,lhs,		$(PREL_OPTS) -split-objs MainIO)
CompilePreludishly(glaExts/MainIO13,lhs,	$(PREL_OPTS) -split-objs MainIO13 -ohi glaExts/MainIO13.hi)
CompilePreludishly(glaExts/Stdio,lhs,		$(PREL_OPTS) -split-objs Stdio)
CompilePreludishly(glaExts/ByteOps,lhs,		$(PREL_OPTS) -split-objs ByteOps)

CompilePreludishly(prelude/Concurrent,lhs,	-fhaskell-1.3 -split-objs Concurrent -ohi prelude/Concurrent.hi)
CompilePreludishly(prelude/ChannelVar,lhs,	-fhaskell-1.3 -split-objs ChannelVar -ohi prelude/ChannelVar.hi)
/* NB: do not split objs for Channel, because of purely-local things */
CompilePreludishly(prelude/Channel,lhs,		-fhaskell-1.3 -ohi prelude/Channel.hi)
CompilePreludishly(prelude/Semaphore,lhs,	-fhaskell-1.3 -split-objs Semaphore -ohi prelude/Semaphore.hi)
CompilePreludishly(prelude/Merge,lhs,		-fhaskell-1.3 -split-objs Merge -ohi prelude/Merge.hi)
CompilePreludishly(prelude/SampleVar,lhs,	-fhaskell-1.3 -split-objs SampleVar -ohi prelude/SampleVar.hi)

CompilePreludishly(prelude/Parallel,lhs,	-split-objs Parallel -ohi prelude/Parallel.hi)

CompilePreludishly(prelude/TysBasic,hs,	$(PREL_OPTS) -split-objs TysBasic -fmin-builtin-names -nohi)
CompilePreludishly(prelude/TyBool,hs,	$(PREL_OPTS) -split-objs TyBool -fhide-builtin-names -nohi)
CompilePreludishly(prelude/TyArray,hs,	$(PREL_OPTS) -split-objs TyArray -ohi prelude/TyArray.hi)
CompilePreludishly(prelude/TyComplex,hs,$(PREL_OPTS) -split-objs TyComplex -ohi prelude/TyComplex.hi)
CompilePreludishly(prelude/TyIO,hs,	$(PREL_OPTS) -split-objs TyIO -fmin-builtin-names -ohi prelude/TyIO.hi)
CompilePreludishly(prelude/TyRatio,hs,	$(PREL_OPTS) -split-objs TyRatio -fmin-builtin-names -nohi)

CompilePreludishly(prelude/IArray,hs,	$(PREL_OPTS) -split-objs IArray -H14m -ohi prelude/IArray.hi)
CompilePreludishly(prelude/IBool,hs,	$(PREL_OPTS) -split-objs IBool -ohi prelude/IBool.hi)
CompilePreludishly(prelude/IChar,hs,	$(PREL_OPTS) -split-objs IChar -ohi prelude/IChar.hi)
CompilePreludishly(prelude/IComplex,hs,	$(PREL_OPTS) -split-objs IComplex -H16m -ohi prelude/IComplex.hi)
CompilePreludishly(prelude/IDouble,hs,	$(PREL_OPTS) -split-objs IDouble -ohi prelude/IDouble.hi)
CompilePreludishly(prelude/IFloat,hs,	$(PREL_OPTS) -split-objs IFloat -ohi prelude/IFloat.hi)
CompilePreludishly(prelude/IInt,hs,	$(PREL_OPTS) -split-objs IInt -ohi prelude/IInt.hi -monly-4-regs)
CompilePreludishly(prelude/IInteger,hs,	$(PREL_OPTS) -split-objs IInteger -ohi prelude/IInteger.hi)
CompilePreludishly(prelude/IList,hs,	$(PREL_OPTS) -split-objs IList -ohi prelude/IList.hi)
CompilePreludishly(prelude/IRatio,hs,	$(PREL_OPTS) -split-objs IRatio -H16m -ohi prelude/IRatio.hi)
CompilePreludishly(prelude/ITup0,hs,	$(PREL_OPTS) -split-objs ITup0 -ohi prelude/ITup0.hi)
CompilePreludishly(prelude/ITup2,hs,	$(PREL_OPTS) -split-objs ITup2 -ohi prelude/ITup2.hi)
CompilePreludishly(prelude/ITup3,hs,	$(PREL_OPTS) -split-objs ITup3 -ohi prelude/ITup3.hi)
CompilePreludishly(prelude/ITup4,hs,	$(PREL_OPTS) -split-objs ITup4 -H16m -ohi prelude/ITup4.hi)
CompilePreludishly(prelude/ITup5,hs,	$(PREL_OPTS) -split-objs ITup5 -H24m -ohi prelude/ITup5.hi)
	
CompilePreludishly(prelude/Cls,hs,	$(PREL_OPTS) -split-objs Cls -H24m -fmin-builtin-names -ohi prelude/Cls.hi)

CompilePreludishly(prelude/Builtin,hs,	$(PREL_OPTS) -split-objs Builtin -ohi prelude/Builtin.hi)
CompilePreludishly(prelude/Core,hs,	$(PREL_OPTS) -split-objs Core -ohi prelude/Core.hi)
CompilePreludishly(prelude/IO,hs,	$(PREL_OPTS) -split-objs IO -ohi prelude/IO.hi)
CompilePreludishly(prelude/List,hs,	$(PREL_OPTS) -split-objs List -H14m -ohi prelude/List.hi)
CompilePreludishly(prelude/PS,lhs,	$(PREL_OPTS) -split-objs PS -ohi prelude/PS.hi -monly-2-regs)
CompilePreludishly(prelude/Prel,hs,	$(PREL_OPTS) -split-objs Prel -H14m -ohi prelude/Prel.hi -monly-2-regs)
CompilePreludishly(prelude/Text,hs,	$(PREL_OPTS) -split-objs Text -H14m -ohi prelude/Text.hi -monly-4-regs)
CompilePreludishly(prelude/FoldrBuild,hs, $(PREL_OPTS) -split-objs FoldrBuild -nohi)

/* --- 1.3 I/O support --- */

CompilePreludishly(prelude/PreludeIOError,lhs,	$(PREL_OPTS) -split-objs IOError -ohi prelude/PreludeIOError.hi -fno-omit-reexported-instances -fomit-derived-read '-#include"stgio.h"')
CompilePreludishly(prelude/PreludeWriteTextIO,lhs,	$(PREL_OPTS) -split-objs WriteTextIO -ohi prelude/PreludeWriteTextIO.hi -fno-omit-reexported-instances '-#include"stgio.h"')
CompilePreludishly(prelude/PreludeStdIO,lhs,	$(PREL_OPTS) -split-objs StdIO -ohi prelude/PreludeStdIO.hi -fno-omit-reexported-instances '-#include"stgio.h"' -H14m)
CompilePreludishly(prelude/PreludeIO,lhs,	$(PREL_OPTS) -split-objs PIO -ohi prelude/PreludeIO.hi -fno-omit-reexported-instances '-#include"stgio.h"')
CompilePreludishly(prelude/PreludeMonadicIO,lhs,	$(PREL_OPTS) -split-objs MonadicIO -ohi prelude/PreludeMonadicIO.hi -fno-omit-reexported-instances '-#include"stgio.h"')
CompilePreludishly(prelude/PreludeReadTextIO,lhs,	$(PREL_OPTS) -split-objs ReadTextIO -ohi prelude/PreludeReadTextIO.hi -fno-omit-reexported-instances '-#include"stgio.h"')

/* --- Haskell 1.3 libraries --- */

CompilePreludishly(haskell-1.3/LibSystem,lhs,	  -fhaskell-1.3 -split-objs LibSystem '-#include"stgio.h"')
CompilePreludishly(haskell-1.3/LibCPUTime,lhs,    -fhaskell-1.3 -split-objs LibCPUTime '-#include"stgio.h"')
CompilePreludishly(haskell-1.3/LibDirectory,lhs,  -fhaskell-1.3 -split-objs LibDirectory '-#include"stgio.h"' -monly-3-regs)
CompilePreludishly(haskell-1.3/LibTime,lhs,       -fhaskell-1.3 -split-objs LibTime '-#include"stgio.h"' '-#include"timezone.h"' -H12m -monly-3-regs -optcO-DNON_POSIX_SOURCE)

CompilePreludishly(haskell-1.3/LibPosix,lhs,      -fhaskell-1.3 -split-objs LibPosix '-#include"stgio.h"' '-#include"libposix.h"')
CompilePreludishly(haskell-1.3/LibPosixDB,lhs,      -fhaskell-1.3 -split-objs LibPosixDB '-#include"stgio.h"' '-#include"libposix.h"')
CompilePreludishly(haskell-1.3/LibPosixErr,lhs,      -fhaskell-1.3 -split-objs LibPosixErr -H12m '-#include"stgio.h"' '-#include"libposix.h"')
CompilePreludishly(haskell-1.3/LibPosixFiles,lhs,      -fhaskell-1.3 -split-objs LibPosixFiles -H12m '-#include"stgio.h"' '-#include"libposix.h"')
CompilePreludishly(haskell-1.3/LibPosixIO,lhs,      -fhaskell-1.3 -split-objs LibPosixIO -H12m '-#include"stgio.h"' '-#include"libposix.h"' -monly-4-regs)
CompilePreludishly(haskell-1.3/LibPosixProcEnv,lhs,      -fhaskell-1.3 -split-objs LibPosixProcEnv -H12m '-#include"stgio.h"' '-#include"libposix.h"')
CompilePreludishly(haskell-1.3/LibPosixProcPrim,lhs,      -fhaskell-1.3 -split-objs LibPosixProcPrim -H16m '-#include"stgio.h"' '-#include"libposix.h"')
CompilePreludishly(haskell-1.3/LibPosixTTY,lhs,      -fhaskell-1.3 -split-objs LibPosixTTY -H12m '-#include"stgio.h"' '-#include"libposix.h"' -monly-2-regs)
CompilePreludishly(haskell-1.3/LibPosixUtil,lhs,      -fhaskell-1.3 -split-objs LibPosixUtil '-#include"stgio.h"' '-#include"libposix.h"' -monly-3-regs)

/* ------
   the next six create our main "Prelude" interface files;
   NOT to be used here.
   ------
*/
CompilePreludishly(glaExts/PreludeGlaMisc,lhs,	$(PREL_OPTS) -split-objs GlaMisc -ohi glaExts/PreludeGlaMisc.hi -monly-4-regs)

CompilePreludishly(prelude/PreludeHi,hs,$(PREL_OPTS) -split-objs Hi -ohi prelude/Prelude.hi -fno-omit-reexported-instances)
CompilePreludishly(prelude/PrelCoreHi,hs,$(PREL_OPTS) -split-objs CoreHi -ohi prelude/PreludeCore.hi -fno-omit-reexported-instances)

CompilePreludishly(prelude/Prel13,hs,$(PREL_OPTS) -iprelude:glaExts:haskell-1.3 -split-objs Hi13 -ohi prelude/Prel13.hi -fno-omit-reexported-instances)
CompilePreludishly(prelude/PrelCore13,hs,$(PREL_OPTS) -iprelude:glaExts:haskell-1.3 -split-objs Core13 -ohi prelude/PrelCore13.hi -fno-omit-reexported-instances)

/* --- GHC utilities library --- */

CompilePreludishly(ghc/Bag,lhs,		)
CompilePreludishly(ghc/BitSet,lhs,	-monly-4-regs)
CompilePreludishly(ghc/CharSeq,lhs,	)
CompilePreludishly(ghc/FiniteMap,lhs,	-ighc -fhaskell-1.3)
CompilePreludishly(ghc/ListSetOps,lhs,	)
CompilePreludishly(ghc/Maybes,lhs,	-fhaskell-1.3)
CompilePreludishly(ghc/PackedString,lhs,)
CompilePreludishly(ghc/Regex,lhs,	-fhaskell-1.3 '-#include"ghcRegex.h"')
CompilePreludishly(ghc/MatchPS,lhs,	-ighc -fhaskell-1.3)
CompilePreludishly(ghc/Pretty,lhs,	-ighc -fhaskell-1.3)
#if GhcWithReadline == YES
CompilePreludishly(ghc/Readline,lhs,	-ighc -fhaskell-1.3 '-#include"ghcReadline.h"')
#endif
#if GhcWithSockets == YES
CompilePreludishly(ghc/Socket,lhs,	-ighc -fhaskell-1.3)
CompilePreludishly(ghc/SocketPrim,lhs,	-ighc -fhaskell-1.3 -K2m -optcO-DNON_POSIX_SOURCE '-#include"ghcSockets.h"')
CompilePreludishly(ghc/BSD,lhs,		-ighc -fhaskell-1.3 -optcO-DNON_POSIX_SOURCE '-#include"ghcSockets.h"')
CompilePreludishly(ghc/CError,lhs,	-ighc -fhaskell-1.3 -K2m -fomit-derived-read)
#endif
CompilePreludishly(ghc/Set,lhs,		-ighc -fhaskell-1.3)
CompilePreludishly(ghc/Util,lhs,	-ighc -fhaskell-1.3)

/* --- HBC-compatibility library --- */

CompilePreludishly(hbc/Algebra,hs,)
CompilePreludishly(hbc/Hash,hs,		)
CompilePreludishly(hbc/ListUtil,hs,	-ihbc -fhaskell-1.3)
CompilePreludishly(hbc/Miranda,hs,	-ihbc)
CompilePreludishly(hbc/NameSupply,hs,	)
CompilePreludishly(hbc/Native,hs,	-ihbc -fhaskell-1.3)
CompilePreludishly(hbc/Number,hs,	)
CompilePreludishly(hbc/Parse,hs,	-ihbc -fhaskell-1.3)
CompilePreludishly(hbc/Polynomial,hs,	-ihbc) /* this code could not ever have worked */
CompilePreludishly(hbc/Pretty,hs,	)
CompilePreludishly(hbc/Printf,hs,	)
CompilePreludishly(hbc/QSort,hs,	)
CompilePreludishly(hbc/Random,hs,	-monly-4-regs)
CompilePreludishly(hbc/SimpleLex,hs,	)
CompilePreludishly(hbc/Time,hs,		)
CompilePreludishly(hbc/Trace,hs,	-fglasgow-exts)
CompilePreludishly(hbc/Word,hs,		-K2m -monly-4-regs)

/****************************************************************
*								*
* 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

/* pretty horrible */

/* we do the depend stuff in a semi-automated way:

	make depend		# to create basic dependendencies
	make print_file_lists	# to dup dependencies for various builds
	make Makefile		# to slurp in dup'd dependencies
 */

print_file_list5 :
	$(RM) Jmake.inc5
	@echo making Jmake.inc5 ...
	@echo '/* Machine-generated file: do not edit! */' > Jmake.inc5
	perl ./make_extra_deps >> Jmake.inc5

/* now include the extra dependencies so generated */
#include "Jmake.inc5"

/* 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 -iprelude:glaExts:ghc:hbc:haskell-1.3 -I$(MAIN_INCLUDE_DIR) 

HaskellDependTarget( $(BASIC_LHS) $(BASIC_HS_PREL) $(HBCLIB_HS) $(GHCLIB_LHS) $(ONE3_LHS) )
#endif