-
Notifications
You must be signed in to change notification settings - Fork 91
Expand file tree
/
Copy pathinform.mkscript
More file actions
953 lines (752 loc) · 41.1 KB
/
inform.mkscript
File metadata and controls
953 lines (752 loc) · 41.1 KB
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
# This is "inform.mkscript", a script used to generate the makefile "makefile"
# at the root of the "inform" repository. This isn't for making any single
# executable, but for orchestrating build-like operations across the whole
# suite of tools included in that repository, so a lot of what it does is to
# run make recursively on subsidiary makefiles belonging to the individual tools.
# Do not edit "inform/makefile" directly. Instead, edit this script, and then
# rebuild "inform/makefile" with the command:
# ../inweb/Tangled/inweb make-makefile -script scripts/inform.mkscript -to makefile
# (Note that typing "make makers" will remake all of the subsidiary makefiles
# inside the repository from their scripts, but _not_ this one: we don't want
# to have a makefile editing itself.)
# See the inweb manual for documentation on the *.mkscript file format, i.e.,
# the format in which this file is written. But it is essentially just a makefile
# with a number of special macro and loop features whose syntax involves braces
# { ... }, so anywhere that you see braces, you're looking at something special
# to *.mkscript; anything else is straightforward make syntax.
# -----------------------------------------------------------------------------
# Note that the resulting makefile expects to be used with the current working
# directory set to "inform". It should then usually be invoked with just "make".
# -----------------------------------------------------------------------------
# Platform (operating system) dependencies
# -----------------------------------------------------------------------------
# This tells Inweb to incorporate settings for your platform (macos, windows,
# linux, etc.), as set when Inweb was installed.
{platform-settings}
# There is, however, another piece of platform dependency. We want a makefile
# which is capable of "integrating" the Inform toolchain and other resources
# into a UI app (say, the MacOS "Inform.app"), which basically means copying
# a lot of files into place in some hierarchy somewhere. Those hierarchies
# have different locations and naming conventions on the different platforms;
# and the inform repository should not be the place to set those.
# So, then, each platform provides its own "make-integration-settings.mk" file,
# which - if used - should be placed in the directory just outside "inform".
# This is all optional, and command-line users need not have such a file:
# note that the make syntax "-include" means "load this file if it exists but
# continue without any errors if it does not".
# If the file does exist, it will define the symbol INTEGRATION, and make a
# set of other definitions as well, which we will make use of below.
-include ../make-integration-settings.mk
# Note that if you are an app-maker wanting to make a release build of your
# app, always "make" first, and then "make forceintegration". (This ensures
# all resources are copied from the repository into your app, and doesn't
# try to do anything clever about working out the minimum necessary copy.)
# -----------------------------------------------------------------------------
# Where to find webs in this repository
# -----------------------------------------------------------------------------
# The makefile needs to deal with many "literate programs" at various places
# in the repository. A sort of roster of these, called a "colony file", is here:
COLONY = colony.inweb
# We will also make use of two webs outside the inform repository, from our
# sidekick projects intest and inweb, which must both also be installed in order
# to test and build inform:
INTEST = ../intest/Tangled/intest
INTESTX = ../intest/Tangled/intest
INTESTWEB = ../intest
INWEB = ../inweb/Tangled/inweb
INWEBX = ../inweb/Tangled/inweb
INWEBWEB = ../inweb
# But the inform repository creates many other webs itself, and those can be
# divided into three: tools (executable code), modules (used to make tools),
# and miscellaneous webs (making something other than executable code). These
# are collectively called "components" below, and we now declare them all,
# beginning with the modules.
{component type: module symbol: WORDS webname: words path: services/words-module set: modules}
{component type: module symbol: SYNTAX webname: syntax path: services/syntax-module set: modules}
{component type: module symbol: HTML webname: html path: services/html-module set: modules}
{component type: module symbol: ARCH webname: arch path: services/arch-module set: modules}
{component type: module symbol: INFLECTIONS webname: inflections path: services/inflections-module set: modules}
{component type: module symbol: LEXICON webname: lexicon path: services/lexicon-module set: modules}
{component type: module symbol: LINGUISTICS webname: linguistics path: services/linguistics-module set: modules}
{component type: module symbol: PROBLEMS webname: problems path: services/problems-module set: modules}
{component type: module symbol: KINDS webname: kinds path: services/kinds-module set: modules}
{component type: module symbol: CALCULUS webname: calculus path: services/calculus-module set: modules}
{component type: module symbol: CORE webname: core path: inform7/core-module set: modules}
{component type: module symbol: ASSERTIONS webname: assertions path: inform7/assertions-module set: modules}
{component type: module symbol: KNOWLEDGE webname: knowledge path: inform7/knowledge-module set: modules}
{component type: module symbol: IMPERATIVE webname: imperative path: inform7/imperative-module set: modules}
{component type: module symbol: RUNTIME webname: runtime path: inform7/runtime-module set: modules}
{component type: module symbol: VALUES webname: values path: inform7/values-module set: modules}
{component type: module symbol: IF webname: if path: inform7/if-module set: modules}
{component type: module symbol: MULTIMEDIA webname: multimedia path: inform7/multimedia-module set: modules}
{component type: module symbol: BYTECODE webname: bytecode path: inter/bytecode-module set: modules}
{component type: module symbol: BUILDING webname: building path: inter/building-module set: modules}
{component type: module symbol: PIPELINE webname: pipeline path: inter/pipeline-module set: modules}
{component type: module symbol: FINAL webname: final path: inter/final-module set: modules}
{component type: module symbol: INDEX webname: index path: inter/index-module set: modules}
{component type: module symbol: SUPERVISOR webname: supervisor path: inbuild/supervisor-module set: modules}
# Next the tools. Note that to each symbol (say, NAME) the following will write
# makefile variable definitions of NAMEWEB, its location; NAMEMAKER, the make
# file for the tool; and NAMEX, the actual executable which will be compiled.
# There are two sets here: the "ctools" are the compiler tools, all made from the
# same inform7 code-base but in different ways; the "otools" are other tools.
{component type: tool symbol: INBLORB webname: inblorb path: inblorb set: otools}
{component type: tool symbol: INFORM7 webname: inform7 path: inform7 set: ctools}
{component type: tool symbol: INPOLICY webname: inpolicy path: inpolicy set: otools}
{component type: tool symbol: INBUILD webname: inbuild path: inbuild set: ctools}
{component type: tool symbol: INTER webname: inter path: inter set: ctools}
# Because Inform 6 is not a web, we have to give it special treatment, and define
# its executable location INFORM6X manually. (The directory holding it will be
# called INFORM6WEB for consistency, even though it is not actually a web.)
INFORM6X = inform6/Tangled/inform6
INFORM6WEB = inform6
# The "utools" set of executables provides unit testing for modules:
{component type: tool symbol: SYNTAXTEST webname: syntax-test path: services/syntax-test set: utools}
{component type: tool symbol: WORDSTEST webname: words-test path: services/words-test set: utools}
{component type: tool symbol: ARCHTEST webname: arch-test path: services/arch-test set: utools}
{component type: tool symbol: INFLECTIONSTEST webname: inflections-test path: services/inflections-test set: utools}
{component type: tool symbol: LINGUISTICSTEST webname: linguistics-test path: services/linguistics-test set: utools}
{component type: tool symbol: KINDSTEST webname: kinds-test path: services/kinds-test set: utools}
{component type: tool symbol: CALCULUSTEST webname: calculus-test path: services/calculus-test set: utools}
{component type: tool symbol: PROBLEMSTEST webname: problems-test path: services/problems-test set: utools}
{component type: tool symbol: BUILDINGTEST webname: building-test path: inter/building-test set: utools}
# Then there are webs which make programs other than C executables: kits of Inter
# code and Inform 7 extensions.
{component type: web symbol: BASICINFORMKIT webname: BasicInformKit path: inform7/Internal/Extensions/Graham Nelson/Basic Inform.i7xd/Materials/Inter/BasicInformKit set: kits}
{component type: web symbol: ARCHITECTURE16KIT webname: Architecture16Kit path: inform7/Internal/Extensions/Graham Nelson/Basic Inform.i7xd/Materials/Inter/Architecture16Kit set: kits}
{component type: web symbol: ARCHITECTURE32KIT webname: Architecture32Kit path: inform7/Internal/Extensions/Graham Nelson/Basic Inform.i7xd/Materials/Inter/Architecture32Kit set: kits}
{component type: web symbol: WORLDMODELKIT webname: WorldModelKit path: inform7/Internal/Extensions/Graham Nelson/Standard Rules.i7xd/Materials/Inter/WorldModelKit set: kits}
{component type: web symbol: COMMANDPARSERKIT webname: CommandParserKit path: inform7/Internal/Extensions/Graham Nelson/Standard Rules.i7xd/Materials/Inter/CommandParserKit set: kits}
{component type: web symbol: ENGLISHLANGUAGEKIT webname: EnglishLanguageKit path: inform7/Internal/Extensions/Graham Nelson/English Language.i7xd/Materials/Inter/EnglishLanguageKit set: kits}
{component type: web symbol: DIALOGUEKIT webname: DialogueKit path: inform7/Internal/Extensions/Graham Nelson/Standard Rules.i7xd/Materials/Inter/DialogueKit set: kits}
{component type: web symbol: STANDARDRULES webname: standard_rules path: inform7/Internal/Extensions/Graham Nelson/Standard Rules.i7xd/Source set: extensions}
{component type: web symbol: BASICINFORM webname: basic_inform path: inform7/Internal/Extensions/Graham Nelson/Basic Inform.i7xd/Source set: extensions}
# -----------------------------------------------------------------------------
# Targets "all" and "force"
# -----------------------------------------------------------------------------
# "make all", the default target, incrementally makes the tools; "make force"
# makes everything, disregarding all timestamps on files. Note that neither
# one of these performs a "make integration", to push the results of our efforts
# into a surrounding GUI app (if it is present) - that must be done (if desired)
# by "make integration" explicitly.
# Note the use of .WAIT to ensure order during parallel builds.
# This is necessary because localintegration depends on the preform grammar
# generated when building inform7.
.PHONY: all
all: tools kits .WAIT localintegration
.PHONY: force
force: forcetools forcekits .WAIT localintegration
# -----------------------------------------------------------------------------
# Target "localintegration"
# -----------------------------------------------------------------------------
# This is not the same thing as integration into a GUI app. It means taking the
# side-files tangled from the Inform 7 code base out of the inform7 web and
# into the places elsewhere in the repository where they are actually needed:
ENGLISHPATH = $(INFORM7WEB)/Internal/Extensions/Graham\ Nelson/English\ Language.i7xd/Materials/Languages/English
SENGLISHPATH = $(INFORM7WEB)/Internal/Extensions/Graham Nelson/English Language.i7xd/Materials/Languages/English
.PHONY: localintegration
localintegration: \
$(ENGLISHPATH)/Syntax.preform \
$(INFORM7WEB)/Internal/Miscellany/inform7_clib.h \
$(INFORM7WEB)/Internal/Miscellany/inform7_clib.c
# When tangled, the inform7 web most importantly makes inform7.c, of course,
# but it makes three side files as well: Syntax.preform, a grammar file, and
# a small C library used when compiling Inform projects to C.
$(ENGLISHPATH)/Syntax.preform: $(INFORM7WEB)/Tangled/Syntax.preform
cp -f "$(INFORM7WEB)/Tangled/Syntax.preform" "$(SENGLISHPATH)/Syntax.preform"
$(INFORM7WEB)/Internal/Miscellany/inform7_clib.h: $(INFORM7WEB)/Tangled/inform7_clib.h
cp -f "$(INFORM7WEB)/Tangled/inform7_clib.h" "$(INFORM7WEB)/Internal/Miscellany/inform7_clib.h"
$(INFORM7WEB)/Internal/Miscellany/inform7_clib.c: $(INFORM7WEB)/Tangled/inform7_clib.c
cp -f "$(INFORM7WEB)/Tangled/inform7_clib.c" "$(INFORM7WEB)/Internal/Miscellany/inform7_clib.c"
# It is in fact sufficient to tangle just the inter subset of inform7 to make
# the two C-library files: of course they then need to be copied into the inform7 directory.
# Note the use of the phony intermediate tangleintersubset target to ensure that
# the tangle is only run once even when both files are needed.
.PHONY: tangleintersubset
tangleintersubset: inter/final-module/Chapter\ 5/*.w
$(INWEBX) tangle $(INTERWEB)
$(INFORM7WEB)/Tangled/inform7_clib.h: tangleintersubset
cp -f "$(INTERWEB)/Tangled/inform7_clib.h" "$(INFORM7WEB)/Tangled/inform7_clib.h"
$(INFORM7WEB)/Tangled/inform7_clib.c: tangleintersubset
cp -f "$(INTERWEB)/Tangled/inform7_clib.c" "$(INFORM7WEB)/Tangled/inform7_clib.c"
# -----------------------------------------------------------------------------
# Target "makers"
# -----------------------------------------------------------------------------
# Each individual tool has its own makefile, stored inside its individual web.
# "make makers" runs through each tool in turn and creates them from their
# respective makescripts. The one makefile we don't make is this one: it really
# doesn't seem safe for a makefile to run a command which overwrites itself.
# Note that {components type: tool}...{end-components} iterates through all the
# components given the type "tool" above.
.PHONY: makers
makers:
{components type: tool}
$(INWEBX) make-makefile $({SYMBOL}WEB) -to $({SYMBOL}MAKER)
{end-components}
$(INWEBX) make-makefile -to $(INFORM6WEB)/inform6.mk -script $(INFORM6WEB)/inform6.mkscript
$(INWEBX) make-makefile -to retrospective/makefile -script retrospective/retrospective.mkscript
# -----------------------------------------------------------------------------
# Target "gitignores"
# -----------------------------------------------------------------------------
# Each individual web needs its own .gitignore file, and this makes them. No
# overwriting issues time, so we do include the .gitignore at the root of the
# inform repository.
.PHONY: gitignores
gitignores:
$(INWEBX) make-gitignore .gitignore -script scripts/inform.giscript
{components type: tool}
$(INWEBX) $({SYMBOL}WEB) -gitignore $({SYMBOL}WEB)/.gitignore
{end-components}
$(INWEBX) make-gitignore $(INFORM6WEB)/.gitignore -script $(INFORM6WEB)/inform6.giscript
# -----------------------------------------------------------------------------
# Target "versions"
# -----------------------------------------------------------------------------
# Asks the tools their current version numbers.
.PHONY: versions
versions:
{components type: tool}
$({SYMBOL}X) -version
{end-components}
$(INFORM6X) -V
# -----------------------------------------------------------------------------
# Targets "kits" and "forcekits"
# -----------------------------------------------------------------------------
# These are easier because Inbuild already performs a make-like service on
# directories of kits; that saves a great deal of messy make code here.
# We do depend on $(INBUILDX) and $(INTERX) to avoid errors during parallel builds
.PHONY: kits
kits: $(INBUILDX) $(INTERX)
$(INBUILDX) -build -contents-of $(INFORM7WEB)/Internal/Extensions/Graham\ Nelson/Standard\ Rules.i7xd/Materials/Inter
$(INBUILDX) -build -contents-of $(INFORM7WEB)/Internal/Extensions/Graham\ Nelson/Basic\ Inform.i7xd/Materials/Inter
$(INBUILDX) -build -contents-of $(INFORM7WEB)/Internal/Extensions/Graham\ Nelson/English\ Language.i7xd/Materials/Inter
.PHONY: forcekits
forcekits: force_$(INBUILDX) force_$(INTERX)
$(INBUILDX) -rebuild -contents-of $(INFORM7WEB)/Internal/Extensions/Graham\ Nelson/Standard\ Rules.i7xd/Materials/Inter
$(INBUILDX) -rebuild -contents-of $(INFORM7WEB)/Internal/Extensions/Graham\ Nelson/Basic\ Inform.i7xd/Materials/Inter
$(INBUILDX) -rebuild -contents-of $(INFORM7WEB)/Internal/Extensions/Graham\ Nelson/English\ Language.i7xd/Materials/Inter
# -----------------------------------------------------------------------------
# Target "tools"
# -----------------------------------------------------------------------------
# "make tools" builds all of the tools incrementally, i.e., only as necessary.
# Note the use of repeat to make a list: $(INBLORBX) $(INBUILDX) ..., etc.
.PHONY: tools
tools: {components type: tool}$({SYMBOL}X) {end-components}$(INFORM6X)
{components type: tool}
$({SYMBOL}X): {dependent-files tool-and-modules: {SYMBOL}}
$(MAKE) -f $({SYMBOL}MAKER)
{end-components}
# As ever, Inform 6 needs special handling:
$(INFORM6X): $(INFORM6WEB)/Inform6/*.c
$(MAKE) -f $(INFORM6WEB)/inform6.mk
# -----------------------------------------------------------------------------
# Target "forcetools"
# -----------------------------------------------------------------------------
# Similarly, but the targets are called force_$(INBLORBX), force_$(INBUILDX) etc.
# This could be done with a single target, since nothing is incremental here,
# but using multiple targets improves parallel building.
.PHONY: forcetools
forcetools: {components type: tool}force_$({SYMBOL}X) {end-components}force_$(INFORM6X)
{components type: tool}
.PHONY: force_$({SYMBOL}X)
force_$({SYMBOL}X):
$(MAKE) -f $({SYMBOL}MAKER) force
{end-components}
# As ever, Inform 6 needs special handling:
.PHONY: force_$(INFORM6X)
force_$(INFORM6X):
$(MAKE) -f $(INFORM6WEB)/inform6.mk force
# -----------------------------------------------------------------------------
# Target "retrospective"
# -----------------------------------------------------------------------------
# "make retrospective" builds the back catalogue of old releases, but delegates
# all the work to a makefile there:
.PHONY: retrospective
retrospective:
$(MAKE) -f retrospective/makefile
# -----------------------------------------------------------------------------
# Target "check"
# -----------------------------------------------------------------------------
# "make check" invites the make file for every tool to run its own tests.
# I6 must come first, because that guarantees the Z and Glulx interpreters
# are safely built before we need them (as we will in order to test I7).
# -----------------------------------------------------------------------------
.PHONY: check
check:
$(MAKE) -f $(INFORM6WEB)/inform6.mk test
$(INPOLICYX) -silence -check-problems
{components type: tool}
$(MAKE) -f $({SYMBOL}MAKER) test
{end-components}
# -----------------------------------------------------------------------------
# Target "commit"
# -----------------------------------------------------------------------------
# "make commit" should be used only by the Benevolent Overlord of Inform.
# It updates the build code and commits to the repository.
# -----------------------------------------------------------------------------
{define: update-readme}
$(INWEBX) make-readme -to README.md -script scripts/inform.rmscript
{end-define}
.PHONY: commit
commit:
$(INWEBX) advance-build build.txt
$(INPOLICYX) -sync-kit-versions
$(INPOLICYX) -sync-extension-versions
{update-readme}
git commit -a
# -----------------------------------------------------------------------------
# Target "pages"
# -----------------------------------------------------------------------------
# "make pages" refreshes the GitHub Pages content in the docs folder.
# -----------------------------------------------------------------------------
.PHONY: pages
pages: readmepage icon diagnostics diagrams navigationpages \
{components type: tool}{SYMBOL}PAGES {end-components} \
{components type: module}{SYMBOL}PAGES {end-components} \
{components type: web}{SYMBOL}PAGES {end-components}
.PHONY: forcepages
forcepages: readmepage icon diagnostics diagrams forcenavigationpages \
{components type: tool}{SYMBOL}FORCEPAGES {end-components} \
{components type: module}{SYMBOL}FORCEPAGES {end-components} \
{components type: web}{SYMBOL}FORCEPAGES {end-components}
# -----------------------------------------------------------------------------
# Just one lonely icon file!
.PHONY: icon
icon:
mkdir -p docs
mkdir -p docs/docs-assets
cp -f docs-src/Inform.png docs/docs-assets
# -----------------------------------------------------------------------------
# See the "make commit" target above.
.PHONY: readmepage
readmepage:
{update-readme}
# -----------------------------------------------------------------------------
# A number of diagrams in the woven form of our webs are automatically created,
# so that they will always be correct to the current state of Inform. The following
# copies them into place in the relevant Figures folders; or, in the case of -help
# listings of command-line settings, creates them in place.
{define: copy-diagram file: FILE into: WEB}
cp -f {FILE} $({WEB})/Figures
{end-define}
{define: update-reference-card for: TOOL}
$({TOOL}X) -help >$({TOOL}WEB)/Figures/help.txt
{end-define}
.PHONY: diagrams
diagrams:
{copy-diagram file: $(LINGUISTICSTESTWEB)/Tests/Test\ Diagrams/_Results_Ideal/*.txt into: LINGUISTICSWEB}
{copy-diagram file: $(LINGUISTICSTESTWEB)/Tests/vocabulary.txt into: LINGUISTICSWEB}
{copy-diagram file: $(INFORM7WEB)/Tests/Test\ Internals/Refine--I.txt into: ASSERTIONSWEB}
{copy-diagram file: $(KINDSTESTWEB)/Tests/Test\ Cases/_Results_Ideal/*.txt into: KINDSWEB}
{copy-diagram file: $(CALCULUSTESTWEB)/Tests/Test\ Cases/_Results_Ideal/*.txt into: CALCULUSWEB}
{copy-diagram file: $(INFORM7WEB)/Internal/Pipelines/compile.interpipeline into: INTERWEB}
{copy-diagram file: $(INFORM7WEB)/Internal/Pipelines/compile.interpipeline into: PIPELINEWEB}
{copy-diagram file: $(INFORM7WEB)/Internal/Pipelines/assimilate.interpipeline into: PIPELINEWEB}
{copy-diagram file: $(INFORM7WEB)/Internal/Pipelines/link.interpipeline into: PIPELINEWEB}
{copy-diagram file: $(INFORM7WEB)/Internal/Pipelines/optimise.interpipeline into: PIPELINEWEB}
{copy-diagram file: $(INFORM7WEB)/Internal/Pipelines/build-kit.interpipeline into: PIPELINEWEB}
{components type: tool set: ctools}
{update-reference-card for: {SYMBOL}}
{end-components}
{components type: tool set: otools}
{update-reference-card for: {SYMBOL}}
{end-components}
# -----------------------------------------------------------------------------
# "Diagnostics" are files produced by inform7 to measure its own performance when
# running in a special mode, as it does when intest runs the test GenerateDiagnostics.
# We need first to run that test; then the diagnostics files will all be in the
# $(INFORM7WEB)/Figures directory; but in some cases that is not where we want them, so
# we need to move those on to their proper homes.
{define: copy-download file: FILE into: WEB}
cp -f {FILE} $({WEB})/Downloads
{end-define}
.PHONY: diagnostics
diagnostics:
$(INTESTX) inform7 GenerateDiagnostics
{copy-download file: $(INFORM7WEB)/Figures/excerpts-diagnostics.txt into: INFORM7WEB}
rm -f $(INFORM7WEB)/Figures/syntax-diagnostics.txt
{copy-download file: $(INFORM7WEB)/Figures/preform-diagnostics.txt into: INFORM7WEB}
rm -f $(INFORM7WEB)/Figures/preform-diagnostics.txt
{copy-diagram file: $(INFORM7WEB)/Figures/excerpts-diagnostics.txt into: LEXICONWEB}
rm -f $(INFORM7WEB)/Figures/excerpts-diagnostics.txt
{copy-diagram file: $(INFORM7WEB)/Figures/stock-diagnostics.txt into: LINGUISTICSWEB}
rm -f $(INFORM7WEB)/Figures/stock-diagnostics.txt
# -----------------------------------------------------------------------------
# These are the special pages at the top of the mini-website, which act as
# navigation points into the interior. They are each little one-file webs in
# their own right, designed just for weaving, not tangling.
# Annoyingly, we can't put overview into this list, because it weaves to a
# file called index.html, not overview.html; and we can't rename overview as
# "index" because that would be a name clash with the "index" module of I7,
# which is already a web in the colony file.
{set name: NAVIGATIONPAGES value: structure, extensions, kits, services, inform6, inbuildn, inform7n, intern, inblorbn, inpolicyn, secrets}
{define: weave-one page: PAGE}
$(INWEBX) weave -colony $(COLONY) -member {PAGE}
{end-define}
.PHONY: navigationpages
navigationpages: docs/index.html {repeat with: PAGE in: {NAVIGATIONPAGES}}docs/{PAGE}.html {end-repeat}
docs/index.html: docs-src/index.inweb
{weave-one page: overview}
{repeat with: PAGE in: {NAVIGATIONPAGES}}
docs/{PAGE}.html: docs-src/{PAGE}.inweb
{weave-one page: {PAGE}}
{end-repeat}
.PHONY: forcenavigationpages
forcenavigationpages:
rm -f docs/*.html
{weave-one page: overview}
{repeat with: PAGE in: {NAVIGATIONPAGES}}
{weave-one page: {PAGE}}
{end-repeat}
# -----------------------------------------------------------------------------
# Now we have to weave each of the webs for the many component parts. For the
# the web SYMBOL, the following defines two phony targets, SYMBOLPAGES and
# SYMBOLFORCEPAGES. The first weaves the web only if the source has changed
# since the last time; the second weaves it regardless.
{define: weave-target component: SYMBOL}
.PHONY: {SYMBOL}PAGES
{SYMBOL}PAGES: docs/$({SYMBOL}LEAF)/index.html
docs/$({SYMBOL}LEAF)/index.html: {dependent-files tool: {SYMBOL}}
rm -f docs/$({SYMBOL}LEAF)/*.html
$(INWEBX) weave -colony $(COLONY) -member $({SYMBOL}LEAF)
.PHONY: {SYMBOL}FORCEPAGES
{SYMBOL}FORCEPAGES:
rm -f docs/$({SYMBOL}LEAF)/*.html
$(INWEBX) weave -colony $(COLONY) -member $({SYMBOL}LEAF)
{end-define}
{define: weave-module-target component: SYMBOL}
.PHONY: {SYMBOL}PAGES
{SYMBOL}PAGES: docs/$({SYMBOL}LEAF)/index.html
docs/$({SYMBOL}LEAF)/index.html: {dependent-files module: {SYMBOL}}
rm -f docs/$({SYMBOL}LEAF)/*.html
$(INWEBX) weave -colony $(COLONY) -member $({SYMBOL}LEAF)
.PHONY: {SYMBOL}FORCEPAGES
{SYMBOL}FORCEPAGES:
rm -f docs/$({SYMBOL}LEAF)/*.html
$(INWEBX) weave -colony $(COLONY) -member $({SYMBOL}LEAF)
{end-define}
# And using that:
{components type: tool}
{weave-target component: {SYMBOL}}
{end-components}
{components type: module}
{weave-module-target component: {SYMBOL}}
{end-components}
{components type: web}
{weave-target component: {SYMBOL}}
{end-components}
# -----------------------------------------------------------------------------
# Targets "clean" and "purge"
# -----------------------------------------------------------------------------
# "make clean" removes some inessential files from the Inform source hierarchy;
# "make purge" also removes binaries
# -----------------------------------------------------------------------------
{define: ask-each-tool-makefile to: TARGET}
{components type: tool}
$(MAKE) -f $({SYMBOL}MAKER) {TARGET}
{end-components}
$(MAKE) -f $(INFORM6WEB)/inform6.mk {TARGET}
{end-define}
.PHONY: clean
clean:
{ask-each-tool-makefile to: clean}
.PHONY: purge
purge:
{ask-each-tool-makefile to: purge}
# =============================================================================
# From here on, everything is to do with integration: that is, with copying files
# from the inform repository (after all is built) into a GUI app. Command-line
# hackers will therefore not use these make targets.
{set name: IMAGESETLIST value: bg_images, doc_images, map_icons, outcome_images, scene_icons}
{define: transfer-images}
mkdir -p $(BUILTINHTML)
cp -f resources/Imagery/app_images/Welcome*Background.png $(BUILTINHTML)
cp -f resources/Imagery/app_images/Welcome*Banner.png $(BUILTINHTML)
{repeat with: SET in: {IMAGESETLIST}}
mkdir -p $(BUILTINHTML)/{SET}
rm -f $(BUILTINHTML)/{SET}/*
cp -f resources/Imagery/{SET}/[A-Za-z]*.* $(BUILTINHTML)/{SET}
{end-repeat}
{end-define}
# The next part of the file is inside "ifdef BUILTINCOMPS ... endif", which tests
# whether functional parts of the built core distribution should be copied into
# the app. If BUILTINCOMPS is defined, then BUILTINHTML should be defined too;
# but it is also legal to define just ADVICEHTML, BUILTINHTML and BUILTINHTMLINNER
ifdef BUILTINCOMPS
# -----------------------------------------------------------------------------
# Targets "integration" and "forceintegration"
# -----------------------------------------------------------------------------
.PHONY: integration
integration: \
transfertools \
transferpreform \
transferindext \
transferkits \
transferinternals \
transferdocumentation \
transferoutcomepages
.PHONY: forceintegration
forceintegration: \
forcetransfertools \
forcetransferpreform \
forcetransferindext \
forcetransferkits \
forcetransferextensions \
forcetransferinwebresources \
forcetransferimages \
forcetransferotherinternals \
forcetransferdocumentation \
forcetransferoutcomepages \
forcetransfertemplates \
forcetransferdelia
# -----------------------------------------------------------------------------
# Copying part of the Inform toolchain into the app
# The UI apps do not contain all of the intools: for example, they do not need
# inpolicy, which is run only at the command line. They do have these:
{set name: TOOLSINAPPS value: INBLORB, INFORM6, INFORM7, INTEST, INBUILD}
# The make-integration-settings.mk file is expected to have defined the symbols
# INBLORBNAME, INFORM6NAME, etc., as the leafnames these executables should be
# given when they are copied into the app: so, for example, if they want to call
# the "inform7" compiler by its old name, "ni", they can do so with INFORM7NAME = ni,
# and similarly if they want to call "inblorb" by its old name "cblorb".
# make-integration-settings.mk must also have set BUILTINCOMPS to the path for
# the built-in compiler tools.
{define: transfer-tool name: SYMBOL}
mkdir -p $(BUILTINCOMPS)
cp -f $({SYMBOL}X) $(BUILTINCOMPS)/$({SYMBOL}NAME)
{end-define}
.PHONY: transfertools
transfertools: {repeat with: SYMBOL in: {TOOLSINAPPS}}$(BUILTINCOMPS)/$({SYMBOL}NAME) {end-repeat}
{repeat with: SYMBOL in: {TOOLSINAPPS}}
$(BUILTINCOMPS)/$({SYMBOL}NAME): $({SYMBOL}X)
{transfer-tool name: {SYMBOL}}
{end-repeat}
.PHONY: forcetransfertools
forcetransfertools:
{repeat with: SYMBOL in: {TOOLSINAPPS}}
{transfer-tool name: {SYMBOL}}
{end-repeat}
# -----------------------------------------------------------------------------
# Copying the main English-language Preform definition file into the app
.PHONY: transferpreform
transferpreform: forcetransferpreform
INTERNALENGLISHPATH = $(INTERNAL)/Extensions/Graham\ Nelson/English\ Language.i7xd/Materials/Languages/English
SINTERNALENGLISHPATH = $(INTERNAL)/Extensions/Graham Nelson/English Language.i7xd/Materials/Languages/English
.PHONY: forcetransferpreform
forcetransferpreform:
mkdir -p "$(SINTERNALENGLISHPATH)"
cp -f "$(INFORM7WEB)/Tangled/Syntax.preform" "$(SINTERNALENGLISHPATH)/Syntax.preform"
# -----------------------------------------------------------------------------
# Copying the indexing structure and localisation files into the app
.PHONY: transferindext
transferindext: forcetransferindext
.PHONY: forcetransferindext
forcetransferindext:
mkdir -p "$(INTERNAL)/Miscellany"
cp -f "$(INFORM7WEB)/Internal/Miscellany/Standard.indext" "$(INTERNAL)/Miscellany/Standard.indext"
cp -f "$(INFORM7WEB)/Internal/Miscellany/Basic.indext" "$(INTERNAL)/Miscellany/Basic.indext"
mkdir -p "$(SINTERNALENGLISHPATH)"
cp -f "$(SENGLISHPATH)/Index.txt" "$(SINTERNALENGLISHPATH)/Index.txt"
# -----------------------------------------------------------------------------
# Copying kits (and Inter pipelines) into the app
# This is easy, because Inbuild provides a convenient sync facility. Note that
# make-integration-settings.mk is expected to have defined INTERNAL as the
# directory of resources inside itself which will be supplied to its copy of
# inform7 on the command line with the -internal switch.
.PHONY: transferkits
transferkits: forcetransferkits
.PHONY: forcetransferkits
forcetransferkits:
$(INBUILDX) -no-versions-in-filenames -sync-to $(INTERNAL) -contents-of $(INFORM7WEB)/Internal/Inter
$(INBUILDX) -no-versions-in-filenames -sync-to $(INTERNAL) -contents-of $(INFORM7WEB)/Internal/Pipelines
# -----------------------------------------------------------------------------
# Copying extensions into the app
# And also the documentation cross-referencing file, since that cross-references
# the Standard Rules and Basic Inform.
{define: transfer-extensions}
mkdir -p $(INTERNAL)
mkdir -p "$(INTERNAL)/Extensions/Graham Nelson"
rm -rf $(INTERNAL)/Extensions/Graham\ Nelson/*
cp -R -f $(INFORM7WEB)/Internal/Extensions $(INTERNAL)/Extensions/..
mkdir -p "$(INTERNAL)/HTML"
cp -f $(INFORM7WEB)/Internal/HTML/xrefs.txt "$(INTERNAL)/HTML"
{end-define}
.PHONY: forcetransferextensions
forcetransferextensions:
{transfer-extensions}
# -----------------------------------------------------------------------------
# Copying literate programming resources into the app
{define: transfer-inwebresources}
mkdir -p "$(INTERNAL)/Inweb"
cp -R -f $(INFORM7WEB)/Internal/Inweb $(INTERNAL)/Inweb/..
{end-define}
.PHONY: forcetransferinwebresources
forcetransferinwebresources:
{transfer-inwebresources}
# -----------------------------------------------------------------------------
# Copying website templates into the app
{set name: TEMPLATENAMES value: Standard, Classic, Parchment, Quixe}
{define: transfer-templates}
mkdir -p "$(INTERNAL)/Templates"
{repeat with: INTERPRETER in: {TEMPLATENAMES}}
mkdir -p "$(INTERNAL)/Templates/{INTERPRETER}"
rm -f $(INTERNAL)/Templates/{INTERPRETER}/*
{end-repeat}
cp -R -f $(INFORM7WEB)/Internal/Templates $(INTERNAL)/Templates/..
{end-define}
.PHONY: forcetransfertemplates
forcetransfertemplates:
{transfer-templates}
{define: transfer-other-internals}
mkdir -p "$(INTERNAL)/Miscellany"
rm -f $(INTERNAL)/Miscellany/*
cp -R -f $(INFORM7WEB)/Internal/Miscellany $(INTERNAL)/Miscellany/..
mkdir -p "$(INTERNAL)/HTML"
rm -f $(INTERNAL)/HTML/*
cp -R -f $(INFORM7WEB)/Internal/HTML $(INTERNAL)/HTML/..
{end-define}
.PHONY: forcetransferotherinternals
forcetransferotherinternals:
{transfer-other-internals}
{define: transfer-delia}
mkdir -p "$(INTERNAL)/Delia"
rm -f $(INTERNAL)/Delia/*
cp -R -f $(INFORM7WEB)/Internal/Delia $(INTERNAL)/Delia/..
{end-define}
.PHONY: forcetransferdelia
forcetransferdelia:
{transfer-delia}
# -----------------------------------------------------------------------------
# Incrementally copying the internal tree
# This is super-awkward and probably should be dropped in favour of rsync, but
# it's only used by "make integration", not by "make forceintegration". It aims
# to copy only what has changed, out of the extensions, languages, templates,
# images and miscellany files.
# Basically we use the timestamps on these two files to see whether a sync
# is now needed. (If it is, INTERNALEXEMPLUMFROM will be copied to INTERNALEXEMPLUM
# in the process.)
INTERNALEXEMPLUM = $(INTERNAL)/Miscellany/Cover.jpg
INTERNALEXEMPLUMFROM = $(INFORM7WEB)/Internal/Miscellany/Cover.jpg
.PHONY: transferinternals
transferinternals: $(INTERNALEXEMPLUM)
$(INTERNALEXEMPLUMFROM):
$(INTERNALEXEMPLUM)
$(INTERNALEXEMPLUM): \
$(INFORM7WEB)/Internal/Extensions/Graham\ Nelson/[A-Za-z]* \
$(INFORM7WEB)/Internal/Templates/*/*.* \
$(INFORM7WEB)/Internal/HTML/[A-Za-z]*.* \
$(INFORM7WEB)/Internal/Delia/[A-Za-z]*.* \
{repeat with: INTERPRETER in: {TEMPLATENAMES}}
$(INFORM7WEB)/Internal/Templates/{INTERPRETER}/[A-Za-z]*.* \
{end-repeat}
{repeat with: SET in: {IMAGESETLIST}}
resources/Imagery/{SET}/[A-Za-z]*.* \
{end-repeat}
resources/Imagery/app_images/[A-Za-z]*.* \
$(INFORM7WEB)/Internal/Miscellany/[A-Za-z]*.*
touch $(INTERNALEXEMPLUMFROM)
{transfer-extensions}
{transfer-inwebresources}
{transfer-templates}
{transfer-other-internals}
{transfer-images}
{transfer-delia}
# =============================================================================
# End of the block which is used only if make-integration-settings.mk defines
# BUILTINCOMPS
endif
# =============================================================================
ifdef BUILTINHTML
# (alternative passage to the above, for use only if BUILTINCOMPS is not provided)
ifndef BUILTINCOMPS
# -----------------------------------------------------------------------------
# Targets "integration" and "forceintegration"
# -----------------------------------------------------------------------------
.PHONY: integration
integration: \
transferimages \
transferdocumentation \
transferoutcomepages
.PHONY: forceintegration
forceintegration: \
forcetransferimages \
forcetransferdocumentation \
forcetransferoutcomepages
# -----------------------------------------------------------------------------
# Incrementally copying the images
# A simplified version of the above.
IMAGEEXEMPLUM = $(BUILTINHTML)/doc_images/index.png
IMAGEEXEMPLUMFROM = resources/Imagery/doc_images/index.png
.PHONY: transferimages
transferimages: $(IMAGEEXEMPLUM)
$(IMAGEEXEMPLUMFROM):
$(IMAGEEXEMPLUM)
$(IMAGEEXEMPLUM): \
{repeat with: SET in: {IMAGESETLIST}}
resources/Imagery/{SET}/[A-Za-z]*.* \
{end-repeat}
resources/Imagery/app_images/[A-Za-z]*.*
touch $(IMAGEEXEMPLUMFROM)
{transfer-images}
# (end of the alternative passage if BUILTINCOMPS is not provided)
endif
# -----------------------------------------------------------------------------
# Copying images into the app
.PHONY: forcetransferimages
forcetransferimages:
{transfer-images}
# -----------------------------------------------------------------------------
# Typesetting documentation to HTML inside the app, using inbuild
# Note that make-integration-settings.mk is expected to define BUILTINHTMLINNER as
# the directory which will hold the text pages of the mini-website formed by the
# in-app manuals. That may or may not be the same as BUILTINHTML.
{define: compile-inapp-advice}
ifdef ADVICEHTML
mkdir -p $(ADVICEHTML)
$(INBUILDX) -preprocess-html-to $(ADVICEHTML) -preprocess-app $(HTMLPLATFORM) -preprocess-html resources/Documentation/Advice/AdviceCredits.html
$(INBUILDX) -preprocess-html-to $(ADVICEHTML) -preprocess-app $(HTMLPLATFORM) -preprocess-html resources/Documentation/Advice/AdviceKeyboardShortcuts.html
$(INBUILDX) -preprocess-html-to $(ADVICEHTML) -preprocess-app $(HTMLPLATFORM) -preprocess-html resources/Documentation/Advice/AdviceMaterialsFolder.html
$(INBUILDX) -preprocess-html-to $(ADVICEHTML) -preprocess-app $(HTMLPLATFORM) -preprocess-html resources/Documentation/Advice/AdviceNewToInform.html
$(INBUILDX) -preprocess-html-to $(ADVICEHTML) -preprocess-app $(HTMLPLATFORM) -preprocess-html resources/Documentation/Advice/AdviceUpgrading.html
$(INBUILDX) -preprocess-html-to $(ADVICEHTML) -preprocess-app $(HTMLPLATFORM) -preprocess-html resources/Documentation/Advice/TestingTemplate.html
cp -f 'resources/Documentation/Advice/MaterialsDiagram.png' $(ADVICEHTML)
endif
{end-define}
.PHONY: forcetransferadvice
forcetransferadvice:
{compile-inapp-advice}
{define: compile-inapp-documentation}
mkdir -p $(BUILTINHTMLINNER)
$(INBUILDX) -document-set resources/Documentation -document-to $(BUILTINHTMLINNER)
ifneq "$(BUILTINHTMLINNER)" "$(BUILTINHTML)"
cp -f $(BUILTINHTMLINNER)/xrefs.txt $(BUILTINHTML)
endif
ifneq "$(BUILTINHTMLINNER)" "inform7/Internal/HTML"
cp -f $(BUILTINHTMLINNER)/xrefs.txt inform7/Internal/HTML
endif
{end-define}
.PHONY: transferdocumentation
transferdocumentation: $(BUILTINHTMLINNER)/index.html
$(BUILTINHTMLINNER)/index.html: resources/Documentation/*.txt resources/Documentation/*.md resources/Documentation/Examples/*.txt
{compile-inapp-advice}
{compile-inapp-documentation}
.PHONY: forcetransferdocumentation
forcetransferdocumentation:
{compile-inapp-advice}
{compile-inapp-documentation}
# -----------------------------------------------------------------------------
# Typesetting the HTML pages used to display run-time problem messages
{define: make-inapp-outcome-pages}
$(INBUILDX) -markdown-from-dir resources/Outcome\ Pages -markdown-to-dir $(BUILTINHTMLINNER) -markdown-variation RTP
{end-define}
RTPEXEMPLUM = $(BUILTINHTMLINNER)/RTP_P1.html
.PHONY: transferoutcomepages
transferoutcomepages: $(RTPEXEMPLUM)
$(RTPEXEMPLUM): resources/Outcome*Pages/roster.txt resources/Outcome*Pages/*.md
{make-inapp-outcome-pages}
.PHONY: forcetransferoutcomepages
forcetransferoutcomepages:
{make-inapp-outcome-pages}
# =============================================================================
# End of the block which is used only if make-integration-settings.mk defines
# BUILTINHTML
endif