summaryrefslogtreecommitdiff
path: root/web/glasgow/lit2x-0.16/mkworld/utils-GEN.jm
blob: 46e2d3c97a9ec4338187251b214464b5f8cf7b0a (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
# line 25 "utils-GEN.ljm"
#ifndef ArCmd
#if HasSysVishArAndRanlib == YES
#define ArCmd ar clqs
#else
#define ArCmd ar clq
#endif
#endif
AR = ArCmd
# line 36 "utils-GEN.ljm"
#ifndef ArchCmd
#define ArchCmd arch
#endif
ARCH_CMD = ArchCmd

#ifndef MachCmd
#define MachCmd mach
#endif
MACH_CMD = MachCmd

#ifndef AsCmd
#define AsCmd as
#endif
AS = AsCmd

#ifndef WhatGccIsCalled /* version 2.n, please */
#define WhatGccIsCalled gcc
#endif

#ifndef CcCmd
#if (HaveGcc == YES) && (UseGcc == YES)
#define CcCmd WhatGccIsCalled
#else
#define CcCmd cc
#endif /* ! HaveGcc etc */
#endif /* CcCmd */
CC = CcCmd

#ifndef CompressCmd
#define CompressCmd compress
#endif
COMPRESS = CompressCmd

#ifndef CpCmd
#define CpCmd cp
#endif
CP = CpCmd

#ifndef CppCmd
#define CppCmd /lib/cpp
#endif
#ifndef PreProcessCmd
#define PreProcessCmd CcCmd -E
#endif
CPP           = CppCmd $(GLUED_CPP_INCLUDES) $(GLUED_CPP_DEFINES)        /* simple filters */
PREPROCESSCMD = PreProcessCmd $(GLUED_CPP_INCLUDES) $(GLUED_CPP_DEFINES) /* preferred; mdep */

#ifndef InstallCmd
#define InstallCmd install
#endif /* InstallCmd */
INSTALL = InstallCmd
#ifndef InstallingByDefault
#define InstallingByDefault 0
#endif
INSTALLING = InstallingByDefault

#ifndef LexCmd
#ifdef UseFlexForLexCmd
#define LexCmd  flex
#else
#define LexCmd  lex
#endif
#endif
#ifndef FlexCmd
#define FlexCmd flex -s
#endif
LEX     = LexCmd
FLEX    = FlexCmd $(EXTRA_FLEX_FLAGS) /* this is asking for it... */

/* the installed Haskell compiler */
#ifndef HaskellCompileCmd
#define HaskellCompileCmd hc
#endif
HC = HaskellCompileCmd

#ifndef LaTeXCmd
#define LaTeXCmd        latex
#endif
LATEX = LaTeXCmd
/* see also the LaTeX-wrapper script, LTX, in AllProjects */

#ifndef LdCmd
#define LdCmd ld
#endif
LD = LdCmd

#ifndef LintCmd
#define LintCmd lint
#endif
LINT = LintCmd

#ifndef LnCmd
#define LnCmd ln -s
#endif /* LnCmd */
LN = LnCmd

#ifndef MakeCmd
#define MakeCmd make
#endif
/* this might be useful at some point ... */
#ifndef MakeCmdIsGnuMake
#define MakeCmdIsGnuMake NO
#endif
MAKE = MakeCmd

#ifndef MvCmd
#define MvCmd mv
#endif
MV = MvCmd

#ifndef NroffCmd
#define NroffCmd        nroff
#endif
#ifndef ManMacros
#define ManMacros       -man
#endif
#ifndef MsMacros
#define MsMacros        -ms
#endif
NROFF = NroffCmd
MANMACROS = ManMacros
MSMACROS = MsMacros

#ifndef PerlCmd
#define PerlCmd /usr/bin/perl
#endif
PERL = PerlCmd

#ifndef PicCmd
#define PicCmd  pic
#endif
PIC = PicCmd

#ifndef PrinterCmd
#define PrinterCmd      lpr
#endif
PRINTER = PrinterCmd

#ifndef RanlibCmd
#if HasSysVishArAndRanlib == YES
#define RanlibCmd /bin/true /* does nothing */
#else
#define RanlibCmd ranlib
#endif
#endif
RANLIB = RanlibCmd

#ifndef RmCmd
#define RmCmd rm -f
#endif
RM = RmCmd
/* a project may want to override CLEAN_CMD */

/* see the comment about not having #*, under CleanTarget rule in Jmake.rules */
/* ToDo: what about bbl files? */
#ifndef FilesToClean
#define FilesToClean *.CKP *.ln *.BAK *.bak *.o core a.out errs ,* *.a .emacs_* tags TAGS \
        *.ind *.ilg *.idx *.idx-prev *.aux *.aux-prev *.dvi *.log *.toc *.lot *.lof \
        *.blg *.info *.itxi *.itex *.cb
#endif
/* you can override this in various ways... */
/* Real Men (TM) will have the following in their veryclean stuff:
        Makefile
        .??*~ *~ (emacs backup files)
        *.tex *.texi
        *.lex.c *.yacc.c [however this should be done...]
        *.orig *.rej (patch droppings)
*/
#ifndef ExtraFilesToBeVeryClean
#define ExtraFilesToBeVeryClean .??*~ *~ *.orig *.rej
#endif
CLEAN_CMD      = $(RM) FilesToClean
STD_VERY_CLEAN = ExtraFilesToBeVeryClean

#ifndef SoelimCmd
#ifndef UseSoelim
#define SoelimCmd       cat             /* fake it */
#else
#if defined(UseInstalledUtils)
#define SoelimCmd       soelim
#else
#define SoelimCmd       $(SOELIMSRC)/soelim
#endif /* UseInstalledUtils */
#endif /* UseSoelim */
#endif /* SoelimCmd */
SOELIM = SoelimCmd

#ifndef CTagsCmd
#define CTagsCmd $(ETAGS)
#endif
CTAGS = CTagsCmd

#ifndef StripCmd
#define StripCmd strip
#endif
STRIP = StripCmd

#ifndef TblCmd
#define TblCmd  tbl
#endif
TBL = TblCmd

#ifndef TeXCmd
#define TeXCmd  tex
#endif
TEX = TeXCmd

#ifndef TgrindCmd
#define TgrindCmd       tgrind
#endif
/* the program that really does the tgrind'ing */
#ifndef TgrindHelperCmd
#define TgrindHelperCmd /usr/local/lib/tgrind/tfontedpr
#endif
TGRIND = TgrindCmd
TGRIND_HELPER = TgrindHelperCmd

#ifndef TibCmd
#define TibCmd  tib     /* you could define this to "cat" if you don't have "tib"... */
#endif                  /* (I didn't say it would be pretty...) */
TIB = TibCmd

#ifndef TimeCmd
#define TimeCmd time
#endif
TIME = TimeCmd

#ifndef TroffCmd
#define TroffCmd        troff
#endif
TROFF = TroffCmd

#ifndef YaccCmd
#define YaccCmd yacc
#endif
YACC = YaccCmd

/* Note on the <pgm>NeededHere rules: they don't really check that
 * the program elsewhere in the sources is really up-to-date;
 * they really just arrange to go build it if it doesn't exist at all.
 * This is usually good enough.
 */

/* general idea behind these things (__* is an internal macro) ... */

#ifndef __SomeUtilNeededHere
#if defined(UseInstalledUtils)
#define __SomeUtilNeededHere(target,neededthing,neededthingsrcdir,neededthingmaketarg) /**/
#else
#define __SomeUtilNeededHere(target,neededthing,neededthingsrcdir,neededthingmaketarg) @@\
                                                                        @@\
target:: neededthing                                                    @@\
                                                                        @@\
neededthing:                                                            @@\
        @echo "checking $@ over in" neededthingsrcdir "first..."; \     @@\
        cd neededthingsrcdir; $(MAKE) neededthingmaketarg; \            @@\
        echo "okay, continuing in $(CURRENT_DIR)"
#endif /* ! UseInstalledUtils */
#endif /* __SomeUtilNeededHere */

/*# ------------------------------------------------  */
/*# OTHER GENERALLY-USEFUL UTILS (w/ source provided) */

#ifndef UseInstalledUtils
UTILSRC   = $(TOP)/grasp-utils
SCRIPTSRC = $(UTILSRC)/scripts
#endif

/*# Configuration stuff (jmake, its friends and templates) */

#ifndef JmkmfCmd
#if     defined(UseInstalledUtils)
#define JmkmfCmd jmkmf
#else
#define JmkmfCmd jmkmf_used_only_with_installed_utils
#endif
#endif

#ifndef JrestoredepsCmd
#if     defined(UseInstalledUtils)
#define JrestoredepsCmd jrestoredeps
#else
#define JrestoredepsCmd $(JMAKESRC)/jrestoredeps
#endif
#endif

#ifndef JmakeCmd
#if     defined(UseInstalledUtils)
#define JmakeCmd jmake
#else
#define JmakeCmd $(JMAKESRC)/jmake
#endif
#endif
/*
 * JmakeNeededHere -- generate rules to compile jmake if its source is
 * within this project's source tree.
 *
 * [doesn't quite fit std pattern in __SomeUtilNeededHere]
 */
#ifndef JmakeNeededHere
#if defined(UseInstalledUtils)
#define JmakeNeededHere(target) /**/
#else
#define JmakeNeededHere(target)                                          @@\
target:: $(JMAKE)                                                       @@\
                                                                        @@\
$(JMAKE):                                                               @@\
        @(cd $(JMAKESRC); if [ -f Makefile ]; then \                    @@\
        echo "checking $@ in $(JMAKESRC) first..."; $(MAKE) all; else \ @@\
        echo "bootstrapping $@ from Makefile.BOOT in $(JMAKESRC) first..."; \    @@\
        $(MAKE) -f Makefile.BOOT BOOTSTRAPCFLAGS=$(BOOTSTRAPCFLAGS); fi; \       @@\
        echo "okay, continuing in $(CURRENT_DIR)")
#endif /* ! UseInstalledUtils */
#endif /* JmakeNeededHere */

JMKMF         = JmkmfCmd
JRESTOREDEPS  = JrestoredepsCmd
JMAKE         = JmakeCmd

/* the project config dir is assumed to be relative to $(TOP) */

#if defined(UseInstalledUtils)
#if defined(HaveProjectMkworldDir)
JMAKE_CMD = $(JMKMF) -P $(PROJECTLABEL) -S $(SETUPLABEL) -C $(PROJ_MKWORLD_DIR) - $(BOOTSTRAPCFLAGS) $(JMAKEFLAGS)
#else
JMAKE_CMD = $(JMKMF) -P $(PROJECTLABEL) -S $(SETUPLABEL) - $(BOOTSTRAPCFLAGS) $(JMAKEFLAGS)
#endif /* !HaveProjectMkworldDir */

#else /* ! using installed jmake */
JMAKESRC = $(TOP)/mkworld

#if ProjectIsNone == YES
#define ProjectJmFiles  /*nothing*/
#define SetupJmFiles    /*nothing*/
#else /* have a project... */
#define ProjectJmFiles \
        $(PROJ_MKWORLD_DIR)/site-$(PROJECTLABEL).jm \
        $(PROJ_MKWORLD_DIR)/only4-$(PROJECTLABEL).jm \
        $(PROJ_MKWORLD_DIR)/suffixes-$(PROJECTLABEL).jm \
        $(PROJ_MKWORLD_DIR)/macros-$(PROJECTLABEL).jm \
        $(PROJ_MKWORLD_DIR)/utils-$(PROJECTLABEL).jm \
        $(PROJ_MKWORLD_DIR)/install-$(PROJECTLABEL).jm

#if SetupIsStd == YES
#define SetupJmFiles    /*nothing*/
#else /* have project & a setup... */
#define SetupJmFiles \
        $(PROJ_MKWORLD_DIR)/site-$(PROJECTLABEL)-$(SETUPLABEL).jm \
        $(PROJ_MKWORLD_DIR)/only4-$(PROJECTLABEL)-$(SETUPLABEL).jm \
        $(PROJ_MKWORLD_DIR)/suffixes-$(PROJECTLABEL)-$(SETUPLABEL).jm \
        $(PROJ_MKWORLD_DIR)/macros-$(PROJECTLABEL)-$(SETUPLABEL).jm \
        $(PROJ_MKWORLD_DIR)/utils-$(PROJECTLABEL)-$(SETUPLABEL).jm \
        $(PROJ_MKWORLD_DIR)/install-$(PROJECTLABEL)-$(SETUPLABEL).jm
#endif
#endif
MYJCONFIGFILES = $(JMAKESRC)/TEMPLATE.jm \
                 $(JMAKESRC)/plat-TRIGGERS.jm \
                 $(JMAKESRC)/PlatformFile \
                 $(JMAKESRC)/plat-DEF.jm \
                 $(JMAKESRC)/site.jm \
                 $(JMAKESRC)/site-DEF.jm \
                 $(JMAKESRC)/suffixes-GEN.jm \
                 $(JMAKESRC)/macros-GEN.jm \
                 $(JMAKESRC)/utils-GEN.jm \
                 $(JMAKESRC)/install-GEN.jm ProjectJmFiles SetupJmFiles

#if defined(HaveProjectMkworldDir)
JMAKE_CMD = $(NEWTOP)$(JMAKE) -P $(PROJECTLABEL) -S $(SETUPLABEL) -C $(NEWTOP)$(PROJ_MKWORLD_DIR) -I$(NEWTOP)$(JMAKESRC) $(BOOTSTRAPCFLAGS) $(JMAKEFLAGS)
#else
JMAKE_CMD = $(NEWTOP)$(JMAKE) -P $(PROJECTLABEL) -S $(SETUPLABEL) -I$(NEWTOP)$(JMAKESRC) $(BOOTSTRAPCFLAGS) $(JMAKEFLAGS)
#endif /* ! HaveProjectMkworldDir */
#endif /* ! using installed jmake */


/*#   GNU info system [hacked] */

#ifndef InfoCmd
#if     defined(UseInstalledUtils)
#define InfoCmd info
#else
#define InfoCmd $(INFOSRC)/info
#endif
#endif
#ifndef MakeinfoCmd
#if     defined(UseInstalledUtils)
#define MakeinfoCmd makeinfo
#else
#define MakeinfoCmd $(INFOSRC)/makeinfo
#endif
#endif
#ifndef PostMakeinfoCmd
#if     defined(UseInstalledUtils)
#define PostMakeinfoCmd postmakeinfo
#else
#define PostMakeinfoCmd $(INFOSRC)/postmakeinfo
#endif
#endif
#ifndef InfoStuffNeededHere
#if defined(UseInstalledUtils)
#define InfoStuffNeededHere(target) /**/
#else
#define InfoStuffNeededHere(target) \
__SomeUtilNeededHere(target,$(INFO) $(MAKEINFO) $(POSTMAKEINFO),$(INFOSRC),all)
#endif /* ! UseInstalledUtils */
#endif /* InfoStuffNeededHere */
INFO         = InfoCmd /* who _knows_ where these might be ... */
MAKEINFO     = MakeinfoCmd
POSTMAKEINFO = PostMakeinfoCmd
#ifndef UseInstalledUtils
INFOSRC      = $(LITSRC)/info-utils
#endif

/*#   literate programming system */
#ifndef Lit2PgmCmd
#if     defined(UseInstalledUtils)
#define Lit2PgmCmd lit2pgm
#else
#define Lit2PgmCmd $(LITSRC)/lit2pgm
#endif
#endif
#ifndef Lit2TexiCmd
#if     defined(UseInstalledUtils)
#define Lit2TexiCmd lit2texi
#else
#define Lit2TexiCmd $(LITSRC)/lit2texi
#endif
#endif
#ifndef Lit2LaTeXCmd
#if     defined(UseInstalledUtils)
#define Lit2LaTeXCmd lit2latex
#else
#define Lit2LaTeXCmd $(LITSRC)/lit2latex
#endif
#endif
#ifndef MkDependLitCmd
#if     defined(UseInstalledUtils)
#define MkDependLitCmd mkdependlit
#else
#define MkDependLitCmd $(LITSRC)/mkdependlit
#endif
#endif
#ifndef Lit2ChangeLogCmd
#if     defined(UseInstalledUtils)
#define Lit2ChangeLogCmd lit2changelog
#else
#define Lit2ChangeLogCmd $(LITSRC)/lit2changelog
#endif
#endif

/* NB: this *NeededHere rule offers LIMITED guarantee that
    the literate-programming stuff is up-to-date when used
*/
#ifndef LitStuffNeededHere
#if defined(UseInstalledUtils)
#define LitStuffNeededHere(target) /**/
#else
#define LitStuffNeededHere(target) \
                                                                        @@\
target:: $(LITSRC)/lit2pgm $(LITSRC)/lit2texi $(LITSRC)/lit2latex $(LITSRC)/mkdependlit $(LITSRC)/lit2changelog $(LITSRC)/lit-deatify @@\
                                                                        @@\
$(LITSRC)/lit2pgm $(LITSRC)/lit2texi $(LITSRC)/lit2latex $(LITSRC)/mkdependlit $(LITSRC)/lit2changelog $(LITSRC)/lit-deatify: @@\
        @(cd $(LITSRC); if [ -f lit2pgm ]; then \                       @@\
        echo "checking $@ in $(LITSRC) first..."; $(MAKE) all; else \   @@\
        echo "bootstrapping $@ with ./lit2pgm.BOOT in $(LITSRC) first..."; \      @@\
        $(MAKE) LIT2PGM="./lit2pgm.BOOT -Alit2pgm" lit-deatify all; fi; \ @@\
        echo "okay, continuing in $(CURRENT_DIR)")
#endif /* ! UseInstalledUtils */
#endif /* LitStuffNeededHere */

LIT2PGM = Lit2PgmCmd
/* sometimes, we _must_ use the installed version of lit2pgm,
 * e.g., for building lit2pgm itself
 */
LIT2TEXI      = Lit2TexiCmd
LIT2LATEX     = Lit2LaTeXCmd
MKDEPENDLIT   = MkDependLitCmd
LIT2CHANGELOG = Lit2ChangeLogCmd
#ifndef UseInstalledUtils
LITSRC        = $(TOP)/literate
#endif

/*#   mkdepend scripts for various languages */
/*#    ["mkdependlit" is under literate programming stuff above]       */

/* for these MkDepend things, we use the scripts only [for now] */

#ifndef MkDependCSrc
#define MkDependCSrc $(SCRIPTSRC)
#endif
#ifndef MkDependCCmd
#if     defined(UseInstalledUtils)
#define MkDependCCmd mkdependC
#else
#define MkDependCCmd $(MKDEPENDCSRC)/mkdependC
#endif  /* ! installed */
#endif  /* MkDependCCmd */

/*
        MkdependCNeededHere -- generate rules to build the mkdependC program
        if its source is within this project's source tree.

        [kind of a weird one, for now at least]
*/
#ifndef MkDependCNeededHere
#if defined(UseInstalledUtils)
#define MkDependCNeededHere(target) /**/
#else
#define MkDependCNeededHere(target) \
__SomeUtilNeededHere(target,$(MKDEPENDC),$(MKDEPENDCSRC),mkdependC)
#endif /* UseInstalledUtils */
#endif /* MkDependCNeededHere */
MKDEPENDC = MkDependCCmd
#ifndef UseInstalledUtils
MKDEPENDCSRC = MkDependCSrc
#endif

#ifndef MkDependHSCmd /* this is the default; hope you have it! */
#define MkDependHSCmd mkdependHS
#endif
#ifndef MkDependHSNeededHere /* ditto */
#define MkDependHSNeededHere(targets) /*no such thing*/
#endif
MKDEPENDHS = MkDependHSCmd

/* mkdependlit is with the literate stuff above */

/* tags utilities */

#ifndef PerlTagsSrc
#define PerlTagsSrc $(SCRIPTSRC)
#endif
#if     defined(UseInstalledUtils)
#define PerlTagsCmd perltags
#else
#define PerlTagsCmd $(PERLTAGSSRC)/perltags
#endif

#ifndef PerlTagsNeededHere
#if defined(UseInstalledUtils)
#define PerlTagsNeededHere(target) /**/
#else
#define PerlTagsNeededHere(target) \
__SomeUtilNeededHere(target,$(PERLTAGS),$(PERLTAGSSRC),perltags)
#endif /* UseInstalledUtils */
#endif /* PerlTagsNeededHere */
PERLTAGS = PerlTagsCmd
#ifndef UseInstalledUtils
PERLTAGSSRC = PerlTagsSrc
#endif

/*#   misc utilities */

#ifndef FastmakeCmd
#if     defined(UseInstalledUtils)
#define FastmakeCmd fastmake
#else
#define FastmakeCmd $(FASTMAKESRC)/fastmake
#endif
#endif
#ifndef FastmakeNeededHere
#if defined(UseInstalledUtils)
#define FastmakeNeededHere(target) /**/
#else
#define FastmakeNeededHere(target) \
__SomeUtilNeededHere(target,$(FASTMAKE),$(FASTMAKESRC),fastmake)
#endif /* ! UseInstalledUtils */
#endif /* FastmakeNeededHere */
FASTMAKE = FastmakeCmd
#ifndef UseInstalledUtils
FASTMAKESRC = $(SCRIPTSRC)
#endif

#ifndef LtxCmd
#if     defined(UseInstalledUtils)
#define LtxCmd ltx
#else
#define LtxCmd $(LTXSRC)/ltx
#endif
#endif
#ifndef LtxNeededHere
#if defined(UseInstalledUtils)
#define LtxNeededHere(target) /**/
#else
#define LtxNeededHere(target) \
__SomeUtilNeededHere(target,$(LTX),$(LTXSRC),ltx)
#endif /* ! UseInstalledUtils */
#endif /* LtxNeededHere */
LTX = LtxCmd /* a LaTeX-wrapper script */
#ifndef UseInstalledUtils
LTXSRC = $(SCRIPTSRC)
#endif

#ifndef MkdirHierCmd
#if     defined(UseInstalledUtils)
#define MkdirHierCmd mkdirhier
#else
#define MkdirHierCmd $(MKDIRHIERSRC)/mkdirhier
#endif
#endif
#ifndef MkdirHierNeededHere
#if defined(UseInstalledUtils)
#define MkdirHierNeededHere(target) /**/
#else
#define MkdirHierNeededHere(target) \
__SomeUtilNeededHere(target,$(MKDIRHIER),$(MKDIRHIERSRC),mkdirhier)
#endif /* ! UseInstalledUtils */
#endif /* MkdirHierNeededHere */
MKDIRHIER = MkdirHierCmd
#ifndef UseInstalledUtils
MKDIRHIERSRC = $(SCRIPTSRC)
#endif

/* Simon Marlow says: Lndir is sometimes dubious; if you
   have GNU cp, define "LndirCmd" to: cp -Rsv
*/
#ifndef LndirCmd
#if     defined(UseInstalledUtils)
#define LndirCmd lndir
#else
#define LndirCmd $(LNDIRSRC)/lndir
#endif
#endif
#ifndef LndirNeededHere
#if defined(UseInstalledUtils)
#define LndirNeededHere(target) /**/
#else
#define LndirNeededHere(target) \
__SomeUtilNeededHere(target,$(LNDIR),$(LNDIRSRC),lndir)
#endif /* ! UseInstalledUtils */
#endif /* LndirNeededHere */
LNDIR = LndirCmd
#ifndef UseInstalledUtils
LNDIRSRC = $(SCRIPTSRC)
#endif

#ifndef MsubCmd
#if     defined(UseInstalledUtils)
#define MsubCmd msub
#else
#define MsubCmd $(MSUBSRC)/msub
#endif /* ! installed */
#endif /* MsubCmd */
/*      MsubNeededHere - generate rules to build the msub program
        if its source is within this project's source tree.  This rule
        should be included manually once in each Jmakefile that generates
        targets with msub.  (Ideally it would be invoked automatically from
        within each msub-target-generating rule, but then you have a million
        sets of these rules in the Makefile.  Ugh.  This could be avoided if
        there were some way for a rule to void itself after being invoked
        once.)
*/
#ifndef MsubNeededHere
#if defined(UseInstalledUtils)
#define MsubNeededHere(target) /**/
#else
#define MsubNeededHere(target) \
__SomeUtilNeededHere(target,$(MSUB),$(MSUBSRC),msub)
#endif /* ! UseInstalledUtils */
#endif /* MsubNeededHere */
MSUB = MsubCmd
#ifndef UseInstalledUtils
MSUBSRC = $(UTILSRC)/msub
#endif

#ifndef EtagsCmd
#if     defined(UseInstalledUtils)
#define EtagsCmd etags
#else
#define EtagsCmd $(ETAGSSRC)/etags
#endif /* ! installed */
#endif /* EtagsCmd */
#ifndef EtagsNeededHere
#if defined(UseInstalledUtils)
#define EtagsNeededHere(target) /**/
#else
#define EtagsNeededHere(target) \
__SomeUtilNeededHere(target,$(ETAGS),$(ETAGSSRC),etags)
#endif /* ! UseInstalledUtils */
#endif /* EtagsNeededHere */
ETAGS = EtagsCmd
#ifndef UseInstalledUtils
ETAGSSRC = $(UTILSRC)/etags
#endif

#ifndef VerbatimCmd
#if     defined(UseInstalledUtils)
#define VerbatimCmd verbatim
#else
#define VerbatimCmd $(VERBATIMSRC)/verbatim
#endif /* ! installed */
#endif /* VerbatimCmd */
#ifndef VerbatimNeededHere
#if defined(UseInstalledUtils)
#define VerbatimNeededHere(target) /**/
#else
#define VerbatimNeededHere(target) \
__SomeUtilNeededHere(target,$(VERBATIM),$(VERBATIMSRC),verbatim)
#endif /* ! UseInstalledUtils */
#endif /* VerbatimNeededHere */
VERBATIM = VerbatimCmd
#ifndef UseInstalledUtils
VERBATIMSRC = $(UTILSRC)/verbatim
#endif

#ifndef RunStdTestCmd
#if     defined(UseInstalledUtils)
#define RunStdTestCmd runstdtest
#else
#define RunStdTestCmd $(RUNSTDTESTSRC)/runstdtest
#endif
#endif
#ifndef RunStdTestNeededHere
#if defined(UseInstalledUtils)
#define RunStdTestNeededHere(target) /**/
#else
#define RunStdTestNeededHere(target) \
__SomeUtilNeededHere(target,$(RUNSTDTEST),$(RUNSTDTESTSRC),runstdtest)
#endif /* ! UseInstalledUtils */
#endif /* RunStdTestNeededHere */
RUNSTDTEST = RunStdTestCmd
#ifndef UseInstalledUtils
RUNSTDTESTSRC = $(SCRIPTSRC)
#endif
# line 768 "utils-GEN.ljm"
/* for the whole nasty business of flags for programs,
    some naming conventions are worth remembering; for program <foo>:

    <foo>FLAGS              what is actually passed to <foo>; usually
                            built from pieces below

    ALLPROJ_<foo>_<things>  <things> needed for _all_ runs of <foo>;
                            probably set in one of the AllProject*
                            config files.
    PLAT_<foo>_<things>     <things> (options, defines, etc.) needed for
                            all runs of <foo> *on this platform*;
                            probably set in <platform>.cf.
    PROJ_<foo>_<things>     <things> needed for all runs of <foo>
                            related to this project; probably set in
                            one of the Project-* config files.
    <foo>_<things>          <things> needed for runs of <foo> in this
                            directory; set in its Jmakefile.
    EXTRA_<foo>_<things>    name reserved for adding <things> from the
                            command line.
    GLUED_<foo>_<things>    all the above, glued together; not for
                            human use.

    <foo>_OPTS              the usual name for options
    <foo>_DEFINES           CPP #defines
    <foo>_INCLUDES          CPP #includes
    <foo>_IMPORTS           Haskell "import"s

   As a contrived example, the "makeinfo" program is usually called
   with the $(MAKEINFOFLAGS), which would likely be put together as...
   
    ALLPROJ_MAKEINFO_OPTS       =
    PLAT_MAKEINFO_OPTS          =
    PROJ_MAKEINFO_OPTS          =
    MAKEINFO_OPTS               =
    EXTRA_MAKEINFO_OPTS         =
    GLUED_MAKEINFO_OPTS         =
    MAKEINFOFLAGS = $(GLUED_MAKEINFO_OPTS)

   and used as...

    $(MAKEINFO) $(MAKEINFOFLAGS) ...

   The related CPP names are as you would expect: e.g.,
   ProjectMakeinfoOpts for PROJ_MAKEINFO_OPTS, ...

   For systems of interacting programs (e.g., cpp, cc, lint, as, and ld),
   things can be [considerably] messier.

*/

/* CPP definitions for CPP #includes; -I must be explicit */

/* I have not separated use of CPP w/ CC vs standalone... */

#ifndef AllProjectsCppIncludes
#define AllProjectsCppIncludes  /*none*/
#endif
#ifndef PlatformCppIncludes
#define PlatformCppIncludes     /*none*/
#endif
#ifndef ProjectCppIncludes
#define ProjectCppIncludes      /*none*/
#endif
#ifndef SetupCppIncludes
#define SetupCppIncludes      /*none*/
#endif
GenerateOptionsMakeVars(CPP,INCLUDES,AllProjectsCppIncludes,PlatformCppIncludes,ProjectCppIncludes,SetupCppIncludes)

/* CPP definitions for #defines */

#ifndef AllProjectsCppDefines
#define AllProjectsCppDefines   /*none*/
#endif
#ifndef PlatformCppDefines
#define PlatformCppDefines /**/
#endif /* PlatformCppDefines */
#ifndef ProjectCppDefines
#define ProjectCppDefines       /*none*/
#endif
#ifndef SetupCppDefines
#define SetupCppDefines       /*none*/
#endif
GenerateOptionsMakeVars(CPP,DEFINES,AllProjectsCppDefines,PlatformCppDefines,ProjectCppDefines,SetupCppDefines)

/*# C-compiler (and cpp ... and lint) options */

#ifndef AllProjectsCcOpts
#define AllProjectsCcOpts /*none*/
#endif
#ifndef PlatformCcOpts
#define PlatformCcOpts /*none*/
#endif
#ifndef ProjectCcOpts
#define ProjectCcOpts /*none*/
#endif
#ifndef SetupCcOpts
#define SetupCcOpts /*none*/
#endif
GenerateOptionsMakeVars(CC,OPTS,AllProjectsCcOpts,PlatformCcOpts,ProjectCcOpts,SetupCcOpts)

CFLAGS = $(GLUED_CPP_INCLUDES) $(GLUED_CPP_DEFINES) $(GLUED_CC_OPTS)

/*# Haskell compiler (and cpp ... and lint) options */

#ifndef AllProjectsHcOpts
#define AllProjectsHcOpts /*none*/
#endif
#ifndef PlatformHcOpts
#define PlatformHcOpts /*none*/
#endif
#ifndef ProjectHcOpts
#define ProjectHcOpts /*none*/
#endif
#ifndef SetupHcOpts
#define SetupHcOpts /*none*/
#endif
GenerateOptionsMakeVars(HC,OPTS,AllProjectsHcOpts,PlatformHcOpts,ProjectHcOpts,SetupHcOpts)

#ifndef AllProjectsHcImports
#define AllProjectsHcImports  /*none*/
#endif
#ifndef PlatformHcImports
#define PlatformHcImports     /*none*/
#endif
#ifndef ProjectHcImports
#define ProjectHcImports      /*none*/
#endif
#ifndef SetupHcImports
#define SetupHcImports      /*none*/
#endif
GenerateOptionsMakeVars(HC,IMPORTS,AllProjectsHcImports,PlatformHcImports,ProjectHcImports,SetupHcImports)
HCFLAGS = $(GLUED_HC_IMPORTS) $(GLUED_CPP_DEFINES) $(GLUED_HC_OPTS)

/*# linker options */

#ifndef AllProjectsLdOpts
#define AllProjectsLdOpts /*none*//* -X -r "combine" flags (?) */
#endif
#ifndef PlatformLdOpts
#define PlatformLdOpts /*none*/
#endif
#ifndef ProjectLdOpts
#define ProjectLdOpts /*none*/
#endif
#ifndef SetupLdOpts
#define SetupLdOpts /*none*/
#endif
#ifndef AllProjectsLdLibraries
#define AllProjectsLdLibraries /*none*/
#endif
#ifndef PlatformLdLibraries
#define PlatformLdLibraries /*none*/
#endif
#ifndef ProjectLdLibraries
#define ProjectLdLibraries /*none*/
#endif
#ifndef SetupLdLibraries
#define SetupLdLibraries /*none*/
#endif
GenerateOptionsMakeVars(LD,OPTS,AllProjectsLdOpts,PlatformLdOpts,ProjectLdOpts,SetupLdOpts)
GenerateOptionsMakeVars(LD,LIBRARIES,AllProjectsLdLibraries,PlatformLdLibraries,ProjectLdLibraries,SetupLdLibraries)
LDOPTIONS = $(GLUED_LD_OPTS) /* ToDo: and the libraries ? */

/* lint stuff not tidied up yet */

#ifndef LintLibFlag
#define LintLibFlag -C
#endif
#ifndef LintOpts
#define LintOpts -axz
#endif
LINTLIBFLAG = LintLibFlag
LINTOPTS = LintOpts
LINTFLAGS = $(LINTOPTS) -DLINT $(GLUED_CPP_INCLUDES) $(GLUED_CPP_DEFINES)

/*# literate-stuff options */

/* some options are common (general) to all lit2* pgms; others specific */

#ifndef AllProjectsGenLitOpts
#define AllProjectsGenLitOpts /*none*/
#endif
#ifndef PlatformGenLitOpts
#define PlatformGenLitOpts /*none*/
#endif
#ifndef ProjectGenLitOpts
#define ProjectGenLitOpts /*none*/
#endif
#ifndef SetupGenLitOpts
#define SetupGenLitOpts /*none*/
#endif
GenerateOptionsMakeVars(GENLIT,OPTS,AllProjectsGenLitOpts,PlatformGenLitOpts,ProjectGenLitOpts,SetupGenLitOpts)

#ifndef AllProjectsLit2pgmOpts
#define AllProjectsLit2pgmOpts /*none*/
#endif
#ifndef PlatformLit2pgmOpts
#define PlatformLit2pgmOpts /*none*/
#endif
#ifndef ProjectLit2pgmOpts
#define ProjectLit2pgmOpts /*none*/
#endif
#ifndef SetupLit2pgmOpts
#define SetupLit2pgmOpts /*none*/
#endif
GenerateOptionsMakeVars(LIT2PGM,OPTS,AllProjectsLit2pgmOpts,PlatformLit2pgmOpts,ProjectLit2pgmOpts,SetupLit2pgmOpts)
#ifndef AllProjectsLit2texiOpts
#define AllProjectsLit2texiOpts /*none*/
#endif
#ifndef PlatformLit2texiOpts
#define PlatformLit2texiOpts /*none*/
#endif
#ifndef ProjectLit2texiOpts
#define ProjectLit2texiOpts /*none*/
#endif
#ifndef SetupLit2texiOpts
#define SetupLit2texiOpts /*none*/
#endif
GenerateOptionsMakeVars(LIT2TEXI,OPTS,AllProjectsLit2texiOpts,PlatformLit2texiOpts,ProjectLit2texiOpts,SetupLit2texiOpts)
#ifndef AllProjectsLit2latexOpts
#define AllProjectsLit2latexOpts /*none*/
#endif
#ifndef PlatformLit2latexOpts
#define PlatformLit2latexOpts /*none*/
#endif
#ifndef ProjectLit2latexOpts
#define ProjectLit2latexOpts /*none*/
#endif
#ifndef SetupLit2latexOpts
#define SetupLit2latexOpts /*none*/
#endif
GenerateOptionsMakeVars(LIT2LATEX,OPTS,AllProjectsLit2latexOpts,PlatformLit2latexOpts,ProjectLit2latexOpts,SetupLit2latexOpts)
#ifndef AllProjectsLit2changelogOpts
#define AllProjectsLit2changelogOpts /*none*/
#endif
#ifndef PlatformLit2changelogOpts
#define PlatformLit2changelogOpts /*none*/
#endif
#ifndef ProjectLit2changelogOpts
#define ProjectLit2changelogOpts /*none*/
#endif
#ifndef SetupLit2changelogOpts
#define SetupLit2changelogOpts /*none*/
#endif
GenerateOptionsMakeVars(LIT2CHANGELOG,OPTS,AllProjectsLit2changelogOpts,PlatformLit2changelogOpts,ProjectLit2changelogOpts,SetupLit2changelogOpts)
#ifndef AllProjectsMkDependLitOpts
#define AllProjectsMkDependLitOpts /*none*/
#endif
#ifndef PlatformMkDependLitOpts
#define PlatformMkDependLitOpts /*none*/
#endif
#ifndef ProjectMkDependLitOpts
#define ProjectMkDependLitOpts /*none*/
#endif
#ifndef SetupMkDependLitOpts
#define SetupMkDependLitOpts /*none*/
#endif
GenerateOptionsMakeVars(MKDEPENDLIT,OPTS,AllProjectsMkDependLitOpts,PlatformMkDependLitOpts,ProjectMkDependLitOpts,SetupMkDependLitOpts)

LIT2PGMFLAGS            = $(GLUED_GENLIT_OPTS) $(GLUED_LIT2PGM_OPTS)
LIT2TEXIFLAGS           = $(GLUED_GENLIT_OPTS) $(GLUED_LIT2TEXI_OPTS)
LIT2LATEXFLAGS          = $(GLUED_GENLIT_OPTS) $(GLUED_LIT2LATEX_OPTS)
LIT2CHANGELOGFLAGS      = $(GLUED_GENLIT_OPTS) $(GLUED_LIT2CHANGELOG_OPTS)
MKDEPENDLITFLAGS        = $(GLUED_GENLIT_OPTS) $(GLUED_MKDEPENDLIT_OPTS)

/* same for other MkDepend things */

#ifndef AllProjectsMkDependCOpts
#define AllProjectsMkDependCOpts /*none*/
#endif
#ifndef PlatformMkDependCOpts
#define PlatformMkDependCOpts /*none*/
#endif
#ifndef ProjectMkDependCOpts
#define ProjectMkDependCOpts /*none*/
#endif
#ifndef SetupMkDependCOpts
#define SetupMkDependCOpts /*none*/
#endif
GenerateOptionsMakeVars(MKDEPENDC,OPTS,AllProjectsMkDependCOpts,PlatformMkDependCOpts,ProjectMkDependCOpts,SetupMkDependCOpts)
MKDEPENDCFLAGS        = $(GLUED_MKDEPENDC_OPTS)

#ifndef AllProjectsMkDependHSOpts
#define AllProjectsMkDependHSOpts /*none*/
#endif
#ifndef PlatformMkDependHSOpts
#define PlatformMkDependHSOpts /*none*/
#endif
#ifndef ProjectMkDependHSOpts
#define ProjectMkDependHSOpts /*none*/
#endif
#ifndef SetupMkDependHSOpts
#define SetupMkDependHSOpts /*none*/
#endif
GenerateOptionsMakeVars(MKDEPENDHS,OPTS,AllProjectsMkDependHSOpts,PlatformMkDependHSOpts,ProjectMkDependHSOpts,SetupMkDependHSOpts)
MKDEPENDHSFLAGS        = $(GLUED_MKDEPENDHS_OPTS)

/* same for tags stuff */

#ifndef AllProjectsCTagsOpts
#define AllProjectsCTagsOpts -e -w /* emacs-style; no warnings */
#endif
#ifndef PlatformCTagsOpts
#define PlatformCTagsOpts /*none*/
#endif
#ifndef ProjectCTagsOpts
#define ProjectCTagsOpts /*none*/
#endif
#ifndef SetupCTagsOpts
#define SetupCTagsOpts /*none*/
#endif
GenerateOptionsMakeVars(CTAGS,OPTS,AllProjectsCTagsOpts,PlatformCTagsOpts,ProjectCTagsOpts,SetupCTagsOpts)
CTAGSFLAGS        = $(GLUED_CTAGS_OPTS)

#ifndef AllProjectsPerlTagsOpts
#define AllProjectsPerlTagsOpts /*none*/
#endif
#ifndef PlatformPerlTagsOpts
#define PlatformPerlTagsOpts /*none*/
#endif
#ifndef ProjectPerlTagsOpts
#define ProjectPerlTagsOpts /*none*/
#endif
#ifndef SetupPerlTagsOpts
#define SetupPerlTagsOpts /*none*/
#endif
GenerateOptionsMakeVars(PERLTAGS,OPTS,AllProjectsPerlTagsOpts,PlatformPerlTagsOpts,ProjectPerlTagsOpts,SetupPerlTagsOpts)
PERLTAGSFLAGS        = $(GLUED_PERLTAGS_OPTS)

/* and for "runstdtest" */

#ifndef AllProjectsRunStdTestOpts
#define AllProjectsRunStdTestOpts /*none*/
#endif
#ifndef PlatformRunStdTestOpts
#define PlatformRunStdTestOpts /*none*/
#endif
#ifndef ProjectRunStdTestOpts
#define ProjectRunStdTestOpts /*none*/
#endif
#ifndef SetupRunStdTestOpts
#define SetupRunStdTestOpts /*none*/
#endif
GenerateOptionsMakeVars(RUNSTDTEST,OPTS,AllProjectsRunStdTestOpts,PlatformRunStdTestOpts,ProjectRunStdTestOpts,SetupRunStdTestOpts)
RUNSTDTEST_FLAGS = $(GLUED_RUNSTDTEST_OPTS)

/* CPP definitions for #defines */

#ifndef AllProjectsJmakeDefines
#define AllProjectsJmakeDefines   /*none*/
#endif
#ifndef PlatformJmakeDefines
#define PlatformJmakeDefines /**/
#endif /* PlatformJmakeDefines */
#ifndef ProjectJmakeDefines
#define ProjectJmakeDefines       /*none*/
#endif
#ifndef SetupJmakeDefines
#define SetupJmakeDefines       /*none*/
#endif
GenerateOptionsMakeVars(JMAKE,DEFINES,AllProjectsJmakeDefines,PlatformJmakeDefines,ProjectJmakeDefines,SetupJmakeDefines)
JMAKEFLAGS = $(GLUED_JMAKE_DEFINES)