1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-05-17 00:18:39 +03:00
inform7/scripts/inform.mkscript
2022-04-22 23:55:36 +01:00

867 lines
34 KiB
Plaintext

# 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 -prototype scripts/inform.mkscript -makefile 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-settings}
# The colony file for this collection of webs contains information about their
# paths, where they are woven to, and so on
COLONY = colony.txt
INTEST = ../intest/Tangled/intest
INTESTX = ../intest/Tangled/intest
INTESTWEB = ../intest
INWEB = ../inweb/Tangled/inweb
INWEBX = ../inweb/Tangled/inweb
INTERX = inter/Tangled/inter
INBUILDX = inbuild/Tangled/inbuild
# The "-" at the front here tells make to load this file if it exists, and
# continue otherwise. If it does exist, it will define the symbol INTEGRATION.
# That signals that the user wants to integrate the intools into the UI app;
# if it's not defined, the user is just playing with the intools in isolation.
# (Different versions of this file are needed on different operating systems.)
-include ../make-integration-settings.mk
# -----------------------------------------------------------------------------
# Most components of Inform are C programs written as literate-programming
# webs, making use of shared libraries of code called modules. We list them.
# Each module in turn is defined by a symbol name such as NAME, a tool name
# (usually the same but in lower case), and lastly a location relative to the
# root of the core Inform distribution.
# In the eventual makefile, the symbol NAMEWEB is defined as its location.
{component symbol: WORDS webname: words path: services/words-module set: modules category: module}
{component symbol: SYNTAX webname: syntax path: services/syntax-module set: modules category: module}
{component symbol: HTML webname: html path: services/html-module set: modules category: module}
{component symbol: ARCH webname: arch path: services/arch-module set: modules category: module}
{component symbol: INFLECTIONS webname: inflections path: services/inflections-module set: modules category: module}
{component symbol: LEXICON webname: lexicon path: services/lexicon-module set: modules category: module}
{component symbol: LINGUISTICS webname: linguistics path: services/linguistics-module set: modules category: module}
{component symbol: PROBLEMS webname: problems path: services/problems-module set: modules category: module}
{component symbol: KINDS webname: kinds path: services/kinds-module set: modules category: module}
{component symbol: CALCULUS webname: calculus path: services/calculus-module set: modules category: module}
{component symbol: CORE webname: core path: inform7/core-module set: modules category: module}
{component symbol: ASSERTIONS webname: assertions path: inform7/assertions-module set: modules category: module}
{component symbol: KNOWLEDGE webname: knowledge path: inform7/knowledge-module set: modules category: module}
{component symbol: IMPERATIVE webname: imperative path: inform7/imperative-module set: modules category: module}
{component symbol: RUNTIME webname: runtime path: inform7/runtime-module set: modules category: module}
{component symbol: VALUES webname: values path: inform7/values-module set: modules category: module}
{component symbol: IF webname: if path: inform7/if-module set: modules category: module}
{component symbol: MULTIMEDIA webname: multimedia path: inform7/multimedia-module set: modules category: module}
{component symbol: BYTECODE webname: bytecode path: inter/bytecode-module set: modules category: module}
{component symbol: BUILDING webname: building path: inter/building-module set: modules category: module}
{component symbol: PIPELINE webname: pipeline path: inter/pipeline-module set: modules category: module}
{component symbol: FINAL webname: final path: inter/final-module set: modules category: module}
{component symbol: INDEX webname: index path: inter/index-module set: modules category: module}
{component symbol: SUPERVISOR webname: supervisor path: inbuild/supervisor-module set: modules category: module}
# First, the tools we need to make, using the same declaration notation.
# In the eventual makefile, the symbol NAMEWEB is the location of NAME;
# the symbol NAMEMAKER is the individual make file for the tool; and
# the symbol NAMEX is the actual executable which the tool compiles into.
# After its declaration, we list all modules needed to compile the tool.
{component symbol: INBLORB webname: inblorb path: inblorb set: otools category: tool}
{component symbol: INDOC webname: indoc path: indoc set: otools category: tool}
{component symbol: INFORM7 webname: inform7 path: inform7 set: ctools category: tool}
{component symbol: INPOLICY webname: inpolicy path: inpolicy set: otools category: tool}
{component symbol: INRTPS webname: inrtps path: inrtps set: otools category: tool}
{component symbol: INBUILDTOOL webname: inbuild path: inbuild set: ctools category: tool}
{component symbol: INTERTOOL webname: inter path: inter set: ctools category: tool}
# Inform 6 is not a web, so we have to give it special treatment:
INFORM6X = inform6/Tangled/inform6
# While these are also executables, they only provide unit tests for modules:
{component symbol: SYNTAXTEST webname: syntax-test path: services/syntax-test set: utools category: tool}
{component symbol: WORDSTEST webname: words-test path: services/words-test set: utools category: tool}
{component symbol: ARCHTEST webname: arch-test path: services/arch-test set: utools category: tool}
{component symbol: INFLECTIONSTEST webname: inflections-test path: services/inflections-test set: utools category: tool}
{component symbol: LINGUISTICSTEST webname: linguistics-test path: services/linguistics-test set: utools category: tool}
{component symbol: KINDSTEST webname: kinds-test path: services/kinds-test set: utools category: tool}
{component symbol: CALCULUSTEST webname: calculus-test path: services/calculus-test set: utools category: tool}
{component symbol: PROBLEMSTEST webname: problems-test path: services/problems-test set: utools category: tool}
{component symbol: BUILDINGTEST webname: building-test path: inter/building-test set: utools category: tool}
# And here are other webs:
{component symbol: BASICINFORMKIT webname: BasicInformKit path: inform7/Internal/Inter/BasicInformKit set: kits category: web}
{component symbol: WORLDMODELKIT webname: WorldModelKit path: inform7/Internal/Inter/WorldModelKit set: kits category: web}
{component symbol: COMMANDPARSERKIT webname: CommandParserKit path: inform7/Internal/Inter/CommandParserKit set: kits category: web}
{component symbol: BASICINFORMEXTRASKIT webname: BasicInformExtrasKit path: inform7/Internal/Inter/BasicInformExtrasKit set: kits category: web}
{component symbol: ENGLISHLANGUAGEKIT webname: EnglishLanguageKit path: inform7/Internal/Inter/EnglishLanguageKit set: kits category: web}
{component symbol: STANDARDRULES webname: standard_rules path: inform7/extensions/standard_rules set: extensions category: web}
{component symbol: BASICINFORM webname: basic_inform path: inform7/extensions/basic_inform set: extensions category: web}
# -----------------------------------------------------------------------------
# Targets "all" and "force"
# -----------------------------------------------------------------------------
# "make all", the default target, incrementally makes the tools; "make force"
# makes everything, disregarding all timestamps on files.
.PHONY: all
all: tools kits srules localintegration
.PHONY: force
force: forcetools forcekits forcesrules localintegration
.PHONY: localintegration
localintegration: \
inform7/Internal/Languages/English/Syntax.preform \
inform7/Internal/Miscellany/inform7_clib.h \
inform7/Internal/Miscellany/inform7_clib.c
inform7/Internal/Languages/English/Syntax.preform: inform7/Tangled/Syntax.preform
cp -f 'inform7/Tangled/Syntax.preform' "inform7/Internal/Languages/English/Syntax.preform"
inform7/Internal/Miscellany/inform7_clib.h: inform7/Tangled/inform7_clib.h
cp -f 'inform7/Tangled/inform7_clib.h' "inform7/Internal/Miscellany/inform7_clib.h"
inform7/Internal/Miscellany/inform7_clib.c: inform7/Tangled/inform7_clib.c
cp -f 'inform7/Tangled/inform7_clib.c' "inform7/Internal/Miscellany/inform7_clib.c"
inform7/Tangled/inform7_clib.h: inter/final-module/Chapter\ 5/*.w
$(INWEBX) $(INTERTOOLWEB) -tangle
inform7/Tangled/inform7_clib.c: inter/final-module/Chapter\ 5/*.w
$(INWEBX) $(INTERTOOLWEB) -tangle
# (Of course those other four phony targets are yet to be defined.)
# -----------------------------------------------------------------------------
# Target "makers"
# -----------------------------------------------------------------------------
# Each individual tool has its own makefile, stored inside its individual web.
# "make makers" runs through each tool in turn and creates this makefile.
.PHONY: makers
makers:
{repeat over: tool}
$(INWEBX) $({NAME}WEB) -makefile $({NAME}MAKER)
{end-repeat}
$(INWEBX) -prototype inform6/inform6.mkscript -makefile inform6/inform6.mk
$(INWEBX) -prototype retrospective/retrospective.mkscript -makefile retrospective/makefile
# -----------------------------------------------------------------------------
# Target "gitignores"
# -----------------------------------------------------------------------------
# Each individual web needs its own .gitignore file, and this makes them.
.PHONY: gitignores
gitignores:
$(INWEBX) -prototype scripts/gitignorescript.txt -gitignore .gitignore
{repeat over: tool}
$(INWEBX) $({NAME}WEB) -gitignore $({NAME}WEB)/.gitignore
{end-repeat}
$(INWEBX) -prototype inform6/gitignorescript.txt -gitignore inform6/.gitignore
# -----------------------------------------------------------------------------
# Target "versions"
# -----------------------------------------------------------------------------
# Asks the tools their current version numbers.
.PHONY: versions
versions:
{repeat over: tool}
$({NAME}X) -version
{end-repeat}
$(INFORM6X) -V
# -----------------------------------------------------------------------------
# Targets "srules" and "forcesrules"
# -----------------------------------------------------------------------------
# The Standard Rules extension is generated from a web (though it is not a
# C program), and needs its own individual handling. "make srules" updates
# this if need be; "make forcesrules" updates it regardless.
SRULES = inform7/Internal/Extensions/Graham\ Nelson/Standard\ Rules.i7x
BINFORM = inform7/Internal/Extensions/Graham\ Nelson/Basic\ Inform.i7x
.PHONY: srules
srules: $(SRULES)
$(SRULES): inform7/extensions/standard_rules/Contents.w inform7/extensions/standard_rules/Sections/*.w inform7/extensions/basic_inform/Contents.w inform7/extensions/basic_inform/Sections/*.w
$(INWEBX) inform7/extensions/standard_rules -tangle-to $(SRULES)
$(INWEBX) inform7/extensions/basic_inform -tangle-to $(BINFORM)
.PHONY: forcesrules
forcesrules:
$(INWEBX) inform7/extensions/standard_rules -tangle-to $(SRULES)
$(INWEBX) inform7/extensions/basic_inform -tangle-to $(BINFORM)
# -----------------------------------------------------------------------------
# Targets "kits" and "forcekits"
# -----------------------------------------------------------------------------
# These are easy because Inbuild performs a make-like service on them; that
# saves a great deal of messy make code here.
.PHONY: kits
kits:
$(INBUILDX) -build -contents-of inform7/Internal/Inter
.PHONY: forcekits
forcekits:
$(INBUILDX) -rebuild -contents-of inform7/Internal/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) $(INDOCX) ..., etc.
.PHONY: tools
tools: {repeat over: tool}$({NAME}X) {end-repeat}$(INFORM6X)
{repeat over: tool}
$({NAME}X): {dependent-files tool-and-modules: {NAME}}
$(MAKE) -f $({NAME}MAKER)
{end-repeat}
# As ever, Inform 6 needs special handling:
$(INFORM6X): inform6/Inform6/*.c
$(MAKE) -f inform6/inform6.mk
# -----------------------------------------------------------------------------
# Target "retrospective"
# -----------------------------------------------------------------------------
# "make retrospective" builds the back catalogue of old releases of ni and
# cBlorb, in the retrospective/BBBB directories (where BBBB is the release
# build code)
.PHONY: retrospective
retrospective:
$(MAKE) -f retrospective/makefile
# -----------------------------------------------------------------------------
# Target "forcetools"
# -----------------------------------------------------------------------------
# Similarly, but with a single target, since nothing is incremental here.
.PHONY: forcetools
forcetools:
{repeat over: tool}
$(MAKE) -f $({NAME}MAKER) force
$(MAKE) -f inform6/inform6.mk force
{end-repeat}
# -----------------------------------------------------------------------------
# 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.
# -----------------------------------------------------------------------------
.PHONY: check
check:
$(MAKE) -f inform6/inform6.mk test
$(INPOLICYX) -silence -check-problems
{repeat over: tool}
$(MAKE) -f $({NAME}MAKER) test
{end-repeat}
# -----------------------------------------------------------------------------
# Target "tangle"
# -----------------------------------------------------------------------------
# "make tangle", probably not very useful, tangles each web in turn.
# -----------------------------------------------------------------------------
.PHONY: tangle
tangle:
$(call tangle-webs)
define tangle-webs
{repeat over: tool}
$(INWEBX) $({NAME}WEB) -tangle
{end-repeat}
endef
# -----------------------------------------------------------------------------
# Target "weave"
# -----------------------------------------------------------------------------
# "make weave" weaves each web in turn.
# -----------------------------------------------------------------------------
WEAVEOPTS = -weave sections
.PHONY: weave
weave:
$(call weave-webs)
define weave-webs
{repeat over: tool}
$(INWEBX) $({NAME}WEB) $(WEAVEOPTS)
{end-repeat}
endef
# -----------------------------------------------------------------------------
# Target "commit"
# -----------------------------------------------------------------------------
# "make commit" should be used only by the Benevolent Overlord of Inform.
# It updates the build code and commits to the repository.
# -----------------------------------------------------------------------------
.PHONY: commit
commit:
$(INWEBX) -advance-build-file build.txt
$(INWEBX) -prototype scripts/READMEscript.txt -write-me README.md
git commit -a
# -----------------------------------------------------------------------------
# Target "pages"
# -----------------------------------------------------------------------------
# "make pages" refreshes the GitHub Pages content in the docs folder.
# -----------------------------------------------------------------------------
.PHONY: pages
pages: diagnostics icon readmepage diagrams prepages {repeat over: tool}{NAME}PAGES {end-repeat}\
{repeat over: module}{NAME}MPAGES {end-repeat} morepages
.PHONY: icon
icon:
mkdir -p docs
mkdir -p docs/docs-assets
cp -f docs-src/Inform.png docs/docs-assets
.PHONY: forcepages
forcepages: diagnostics readmepage diagrams forceprepages {repeat over: tool}{NAME}FORCEPAGES {end-repeat}\
{repeat over: module}{NAME}FORCEMPAGES {end-repeat}forcemorepages
.PHONY: readmepage
readmepage:
$(INWEBX) -prototype scripts/READMEscript.txt -write-me README.md
.PHONY: diagrams
diagrams:
cp -f services/linguistics-test/Tests/Test\ Diagrams/_Results_Ideal/*.txt services/linguistics-module/Figures
cp -f services/linguistics-test/Tests/vocabulary.txt services/linguistics-module/Figures
cp -f inform7/Tests/Test\ Internals/_Results_Ideal/Refine*.txt inform7/assertions-module/Figures
cp -f services/kinds-test/Tests/Test\ Cases/_Results_Ideal/*.txt services/kinds-module/Figures
cp -f services/calculus-test/Tests/Test\ Cases/_Results_Ideal/*.txt services/calculus-module/Figures
cp -f inform7/Internal/Pipelines/compile.interpipeline inter/Figures
cp -f inform7/Internal/Pipelines/compile.interpipeline inter/pipeline-module/Figures
cp -f inform7/Internal/Pipelines/assimilate.interpipeline inter/pipeline-module/Figures
cp -f inform7/Internal/Pipelines/link.interpipeline inter/pipeline-module/Figures
cp -f inform7/Internal/Pipelines/optimise.interpipeline inter/pipeline-module/Figures
cp -f inform7/Internal/Pipelines/build-kit.interpipeline inter/pipeline-module/Figures
$(INBUILDX) -help >inbuild/Figures/help.txt
$(INFORM7X) -help >inform7/Figures/help.txt
$(INTERX) -help >inter/Figures/help.txt
{repeat over: tool set: ctools}
.PHONY: {NAME}PAGES
{NAME}PAGES: docs/$({NAME}LEAF)/index.html
docs/$({NAME}LEAF)/index.html: {dependent-files tool: {NAME}}
rm -f docs/$({NAME}LEAF)/*.html
$(INWEBX) -colony $(COLONY) -member $({NAME}LEAF) -weave
.PHONY: {NAME}FORCEPAGES
{NAME}FORCEPAGES:
rm -f docs/$({NAME}LEAF)/*.html
$(INWEBX) -colony $(COLONY) -member $({NAME}LEAF) -weave
{end-repeat}
{repeat over: tool set: otools}
.PHONY: {NAME}PAGES
{NAME}PAGES: docs/$({NAME}LEAF)/index.html
docs/$({NAME}LEAF)/index.html: {dependent-files tool: {NAME}}
rm -f docs/$({NAME}LEAF)/*.html
$(INWEBX) -colony $(COLONY) -member $({NAME}LEAF) -weave
.PHONY: {NAME}FORCEPAGES
{NAME}FORCEPAGES:
rm -f docs/$({NAME}LEAF)/*.html
$(INWEBX) -colony $(COLONY) -member $({NAME}LEAF) -weave
{end-repeat}
{repeat over: tool set: utools}
.PHONY: {NAME}PAGES
{NAME}PAGES: docs/$({NAME}LEAF)/index.html
docs/$({NAME}LEAF)/index.html: {dependent-files tool-and-modules: {NAME}}
rm -f docs/$({NAME}LEAF)/*.html
$(INWEBX) -colony $(COLONY) -member $({NAME}LEAF) -weave
.PHONY: {NAME}FORCEPAGES
{NAME}FORCEPAGES:
rm -f docs/$({NAME}LEAF)/*.html
$(INWEBX) -colony $(COLONY) -member $({NAME}LEAF) -weave
{end-repeat}
{repeat over: module}
.PHONY: {NAME}MPAGES
{NAME}MPAGES: docs/$({NAME}LEAF)-module/index.html
docs/$({NAME}LEAF)-module/index.html: {dependent-files module: {NAME}}
rm -f docs/$({NAME}LEAF)-module/*.html
$(INWEBX) -colony $(COLONY) -member $({NAME}LEAF) -weave
.PHONY: {NAME}FORCEMPAGES
{NAME}FORCEMPAGES:
rm -f docs/$({NAME}LEAF)-module/*.html
$(INWEBX) -colony $(COLONY) -member $({NAME}LEAF) -weave
{end-repeat}
.PHONY: prepages
prepages: docs/index.html docs/structure.html docs/extensions.html docs/kits.html docs/services.html docs/inform6.html docs/inbuildn.html docs/inform7n.html docs/intern.html docs/inblorbn.html docs/indocn.html docs/inrtpsn.html docs/inpolicyn.html docs/secrets.html
docs/index.html: docs-src/index.inweb docs-src/nav.html
$(INWEBX) -colony $(COLONY) -member overview -weave
docs/structure.html: docs-src/structure.inweb docs-src/nav.html
$(INWEBX) -colony $(COLONY) -member structure -weave
docs/inbuildn.html: docs-src/inbuildn.inweb docs-src/nav.html
$(INWEBX) -colony $(COLONY) -member inbuildn -weave
docs/inform7n.html: docs-src/inform7n.inweb docs-src/nav.html
$(INWEBX) -colony $(COLONY) -member inform7n -weave
docs/intern.html: docs-src/intern.inweb docs-src/nav.html
$(INWEBX) -colony $(COLONY) -member intern -weave
docs/inblorbn.html: docs-src/inblorbn.inweb docs-src/nav.html
$(INWEBX) -colony $(COLONY) -member inblorbn -weave
docs/indocn.html: docs-src/indocn.inweb docs-src/nav.html
$(INWEBX) -colony $(COLONY) -member indocn -weave
docs/inrtpsn.html: docs-src/inrtpsn.inweb docs-src/nav.html
$(INWEBX) -colony $(COLONY) -member inrtpsn -weave
docs/inpolicyn.html: docs-src/inpolicyn.inweb docs-src/nav.html
$(INWEBX) -colony $(COLONY) -member inpolicyn -weave
docs/services.html: docs-src/services.inweb docs-src/nav.html
$(INWEBX) -colony $(COLONY) -member services -weave
docs/inform6.html: docs-src/inform6.inweb docs-src/nav.html
$(INWEBX) -colony $(COLONY) -member inform6 -weave
docs/extensions.html: docs-src/extensions.inweb docs-src/nav.html
$(INWEBX) -colony $(COLONY) -member extensions -weave
docs/kits.html: docs-src/kits.inweb docs-src/nav.html
$(INWEBX) -colony $(COLONY) -member kits -weave
docs/secrets.html: docs-src/secrets.inweb docs-src/nav.html
$(INWEBX) -colony $(COLONY) -member secrets -weave
.PHONY: forceprepages
forceprepages:
rm -f docs/*.html
$(INWEBX) -colony $(COLONY) -member overview -weave
$(INWEBX) -colony $(COLONY) -member structure -weave
$(INWEBX) -colony $(COLONY) -member inbuildn -weave
$(INWEBX) -colony $(COLONY) -member inform7n -weave
$(INWEBX) -colony $(COLONY) -member intern -weave
$(INWEBX) -colony $(COLONY) -member inblorbn -weave
$(INWEBX) -colony $(COLONY) -member indocn -weave
$(INWEBX) -colony $(COLONY) -member inrtpsn -weave
$(INWEBX) -colony $(COLONY) -member inpolicyn -weave
$(INWEBX) -colony $(COLONY) -member services -weave
$(INWEBX) -colony $(COLONY) -member inform6 -weave
$(INWEBX) -colony $(COLONY) -member extensions -weave
$(INWEBX) -colony $(COLONY) -member kits -weave
$(INWEBX) -colony $(COLONY) -member secrets -weave
.PHONY: diagnostics
diagnostics:
$(INTESTX) inform7 GenerateDiagnostics-G
cp -f inform7/Figures/syntax-diagnostics.txt inform7/Downloads/syntax-diagnostics.txt
rm -f inform7/Figures/syntax-diagnostics.txt
cp -f inform7/Figures/preform-diagnostics.txt inform7/Downloads/preform-diagnostics.txt
rm -f inform7/Figures/preform-diagnostics.txt
cp -f inform7/Figures/excerpts-diagnostics.txt services/lexicon-module/Figures/excerpts-diagnostics.txt
rm -f inform7/Figures/excerpts-diagnostics.txt
cp -f inform7/Figures/stock-diagnostics.txt services/linguistics-module/Figures/stock-diagnostics.txt
rm -f inform7/Figures/stock-diagnostics.txt
.PHONY: morepages
morepages: {repeat over: web}docs/$({NAME}LEAF)/index.html {end-repeat}
{repeat over: web set: kits}
docs/$({NAME}LEAF)/index.html: {dependent-files tool: {NAME}}
rm -f docs/$({NAME}LEAF)/*.html
$(INWEBX) -colony $(COLONY) -member $({NAME}LEAF) -weave
{end-repeat}
{repeat over: web set: extensions}
docs/$({NAME}LEAF)/index.html: {dependent-files tool: {NAME}}
rm -f docs/$({NAME}LEAF)/*.html
$(INWEBX) -colony $(COLONY) -member $({NAME}LEAF) -weave
{end-repeat}
.PHONY: forcemorepages
forcemorepages:
{repeat over: web set: kits}
rm -f docs/$({NAME}LEAF)/*.html
$(INWEBX) -colony $(COLONY) -member $({NAME}LEAF) -weave
{end-repeat}
{repeat over: web set: extensions}
rm -f docs/$({NAME}LEAF)/*.html
$(INWEBX) -colony $(COLONY) -member $({NAME}LEAF) -weave
{end-repeat}
# -----------------------------------------------------------------------------
# Target "clean"
# -----------------------------------------------------------------------------
# "make clean" removes inessential files from the Inform source hierarchy
# -----------------------------------------------------------------------------
.PHONY: clean
clean:
$(call clean-up)
define clean-up
{repeat over: tool}
$(MAKE) -f $({NAME}MAKER) clean
{end-repeat}
$(MAKE) -f inform6/inform6.mk clean
endef
# -----------------------------------------------------------------------------
# Target "purge"
# -----------------------------------------------------------------------------
# "make purge" cleans, but also removes binaries
# -----------------------------------------------------------------------------
.PHONY: purge
purge:
$(call purge-up)
define purge-up
{repeat over: tool}
$(MAKE) -f $({NAME}MAKER) purge
{end-repeat}
$(MAKE) -f inform6/inform6.mk purge
endef
# -----------------------------------------------------------------------------
# Target "ebooks"
# -----------------------------------------------------------------------------
# "make ebooks" generates the two Inform ebook files in EPUB format.
# One combines the manuals Writing with Inform and The Inform Recipe Book into
# a single volume, while the other holds the collected change logs.
# -----------------------------------------------------------------------------
.PHONY: ebooks
ebooks:
$(call clean-ebooks)
$(INDOCX) -from resources/Documentation ebook
$(call clean-ebooks)
$(INDOCX) -from resources/Changes ebook
$(call clean-ebooks)
define clean-ebooks
rm -f resources/Documentation/Output/OEBPS/images/*
rm -f resources/Documentation/Output/OEBPS/*.*
rm -f resources/Documentation/Output/META-INF/container.xml
rm -f resources/Documentation/Output/mimetype
rm -f resources/Documentation/Output/*.*
rm -f resources/Changes/Output/OEBPS/images/*
rm -f resources/Changes/Output/OEBPS/*.*
rm -f resources/Changes/Output/META-INF/container.xml
rm -f resources/Changes/Output/mimetype
rm -f resources/Changes/Output/*.*
endef
# -----------------------------------------------------------------------------
# Targets "integration" and "forceintegration"
# -----------------------------------------------------------------------------
# This copies material into the user interface application.
# -----------------------------------------------------------------------------
ifdef BUILTINCOMPS
INTOOLSBUILTIN = \
$(BUILTINCOMPS)/$(INBLORBNAME) \
$(BUILTINCOMPS)/$(INFORM6NAME) \
$(BUILTINCOMPS)/$(INFORM7NAME) \
$(BUILTINCOMPS)/$(INTESTNAME)
SRULESINPLACE = $(INTERNAL)/Extensions/Graham\ Nelson/Standard\ Rules.i7x
BINFORMINPLACE = $(INTERNAL)/Extensions/Graham\ Nelson/Basic\ Inform.i7x
INTERNALEXEMPLUM = $(INTERNAL)/Miscellany/Cover.jpg
INTERNALEXEMPLUMFROM = inform7/Internal/Miscellany/Cover.jpg
IMAGESEXEMPLUM = $(BUILTINHTML)/doc_images/help.png
IMAGESEXEMPLUMFROM = resources/Imagery/doc_images/help.png
DOCEXEMPLUM = $(BUILTINHTMLINNER)/index.html
RTPEXEMPLUM = $(BUILTINHTMLINNER)/RTP_P1.html
.PHONY: integration
integration: \
$(INTOOLSBUILTIN) \
$(INTERNAL)/Languages/English/Syntax.preform \
$(INTERNAL)/Miscellany/Standard.indext \
$(INTERNAL)/Miscellany/Basic.indext \
$(INTERNAL)/Languages/English/Index.txt \
$(INTERNAL)/Languages/French/Index.txt \
$(SRULESINPLACE) \
$(BINFORMINPLACE) \
kitsintegration \
$(DOCEXEMPLUM) \
$(INTERNALEXEMPLUM) \
$(IMAGESEXEMPLUM) \
$(RTPEXEMPLUM)
.PHONY: kitsintegration
kitsintegration:
$(call transfer-kits)
.PHONY: forceintegration
forceintegration:
$(call transfer-intools)
$(call transfer-preform)
$(call transfer-standard-rules)
$(call transfer-kits)
$(call transfer-internal-tree)
$(call transfer-images)
$(call make-inapp-documentation)
$(call make-inapp-outcome-pages)
# (a) Copying necessary intools into the app
# Only the following intools are present in the UI app at run-time: inblorb,
# inform6, inform7, intest. All can have different names there.
$(BUILTINCOMPS)/$(INBLORBNAME): $(INBLORBX)
mkdir -p $(BUILTINCOMPS)
cp -f $(INBLORBX) $(BUILTINCOMPS)/$(INBLORBNAME)
$(BUILTINCOMPS)/$(INFORM6NAME): inform6/Tangled/inform6
$(MAKE) -f inform6/inform6.mk
mkdir -p $(BUILTINCOMPS)
cp -f $(INFORM6X) $(BUILTINCOMPS)/$(INFORM6NAME)
$(BUILTINCOMPS)/$(INFORM7NAME): $(INFORM7WEB)/Tangled/inform7
$(MAKE) -f $(INFORM7MAKER)
mkdir -p $(BUILTINCOMPS)
cp -f $(INFORM7X) $(BUILTINCOMPS)/$(INFORM7NAME)
$(BUILTINCOMPS)/intest: $(INTESTWEB)/Tangled/intest
cd ..; $(MAKE) -f intest/intest.mk; cd inform
mkdir -p $(BUILTINCOMPS)
cp -f $(INTESTWEB)/Tangled/intest $(BUILTINCOMPS)/intest
define transfer-intools
mkdir -p $(BUILTINCOMPS)
cp -f $(INBLORBX) $(BUILTINCOMPS)/$(INBLORBNAME)
cp -f $(INFORM6X) $(BUILTINCOMPS)/$(INFORM6NAME)
cp -f $(INFORM7X) $(BUILTINCOMPS)/$(INFORM7NAME)
cp -f $(INTESTX) $(BUILTINCOMPS)/intest
endef
# (b) Copying Preform definition and index things into the app
$(INTERNAL)/Languages/English/Syntax.preform: $(INFORM7WEB)/Tangled/Syntax.preform
$(call transfer-preform)
$(INFORM7WEB)/Tangled/Syntax.preform:
$(MAKE) -f $(INFORM7MAKER)
$(INTERNAL)/Miscellany/Standard.indext: inform7/Internal/Miscellany/Standard.indext
$(call transfer-preform)
$(INTERNAL)/Miscellany/Basic.indext: inform7/Internal/Miscellany/Basic.indext
$(call transfer-preform)
$(INTERNAL)/Languages/English/Index.txt: inform7/Internal/Languages/English/Index.txt
$(call transfer-preform)
$(INTERNAL)/Languages/French/Index.txt: inform7/Internal/Languages/French/Index.txt
$(call transfer-preform)
define transfer-preform
cp -f 'inform7/Tangled/Syntax.preform' "$(INTERNAL)/Languages/English/Syntax.preform"
cp -f 'inform7/Tangled/Syntax.preform' "inform7/Internal/Languages/English/Syntax.preform"
cp -f 'inform7/Internal/Miscellany/Standard.indext' "$(INTERNAL)/Miscellany/Standard.indext"
cp -f 'inform7/Internal/Miscellany/Basic.indext' "$(INTERNAL)/Miscellany/Basic.indext"
cp -f 'inform7/Internal/Languages/English/Index.txt' "$(INTERNAL)/Languages/English/Index.txt"
cp -f 'inform7/Internal/Languages/French/Index.txt' "$(INTERNAL)/Languages/French/Index.txt"
endef
# (c) Copying the Standard Rules into the app
$(SRULESINPLACE): $(SRULES)
$(call transfer-standard-rules)
define transfer-standard-rules
mkdir -p "$(INTERNAL)/Extensions/Graham Nelson"
cp $(SRULES) $(SRULESINPLACE)
$(call transfer-xefs)
endef
$(BINFORMINPLACE): $(BINFORM)
$(call transfer-basic-inform)
define transfer-basic-inform
mkdir -p "$(INTERNAL)/Extensions/Graham Nelson"
cp $(BINFORM) $(BINFORMINPLACE)
$(call transfer-xefs)
endef
define transfer-xefs
mkdir -p "$(INTERNAL)/HTML"
cp -f inform7/Internal/HTML/xrefs.txt "$(INTERNAL)/HTML"
endef
# (d) Copying kits and pipelines into the app
define transfer-kits
$(INBUILDX) -sync-to $(INTERNAL) -contents-of inform7/Internal/Inter
$(INBUILDX) -sync-to $(INTERNAL) -contents-of inform7/Internal/Pipelines
endef
# (e) Copying internal resources into the app
# The Internal tree also holds built-in extensions, web interpreters and so on.
# In effect, it's a repository in the UI app of non-executable resources:
$(INTERNALEXEMPLUM): \
inform7/Internal/Extensions/Eric\ Eve/[A-Za-z]* \
inform7/Internal/Extensions/Emily\ Short/[A-Za-z]* \
inform7/Internal/Extensions/Graham\ Nelson/[A-Za-z]* \
inform7/Internal/Miscellany/[A-Za-z]*.* \
inform7/Internal/HTML/[A-Za-z]*.* \
inform7/Internal/Templates/Parchment/[A-Za-z]*.* \
inform7/Internal/Templates/Quixe/[A-Za-z]*.* \
inform7/Internal/Templates/Classic/[A-Za-z]*.* \
inform7/Internal/Templates/Standard/[A-Za-z]*.*
$(call transfer-internal-tree)
define transfer-internal-tree
touch $(INTERNALEXEMPLUMFROM)
mkdir -p $(INTERNAL)
mkdir -p "$(INTERNAL)/Extensions/Eric Eve"
rm -f $(INTERNAL)/Extensions/Eric\ Eve/*
mkdir -p "$(INTERNAL)/Extensions/Emily Short"
rm -f $(INTERNAL)/Extensions/Emily\ Short/*
mkdir -p "$(INTERNAL)/Extensions/Graham Nelson"
rm -f $(INTERNAL)/Extensions/Graham\ Nelson/*
cp -R -f inform7/Internal/Extensions $(INTERNAL)/Extensions/..
mkdir -p "$(INTERNAL)/Languages"
mkdir -p "$(INTERNAL)/Languages/English"
mkdir -p "$(INTERNAL)/Languages/French"
mkdir -p "$(INTERNAL)/Languages/German"
mkdir -p "$(INTERNAL)/Languages/Italian"
mkdir -p "$(INTERNAL)/Languages/Spanish"
cp -R -f inform7/Internal/Languages $(INTERNAL)/Languages/..
mkdir -p "$(INTERNAL)/Templates"
mkdir -p "$(INTERNAL)/Templates/Standard"
rm -f $(INTERNAL)/Templates/Standard/*
mkdir -p "$(INTERNAL)/Templates/Classic"
rm -f $(INTERNAL)/Templates/Classic/*
mkdir -p "$(INTERNAL)/Templates/Parchment"
rm -f $(INTERNAL)/Templates/Parchment/*
mkdir -p "$(INTERNAL)/Templates/Quixe"
rm -f $(INTERNAL)/Templates/Quixe/*
cp -R -f inform7/Internal/Templates $(INTERNAL)/Templates/..
mkdir -p "$(INTERNAL)/Miscellany"
rm -f $(INTERNAL)/Miscellany/*
cp -R -f inform7/Internal/Miscellany $(INTERNAL)/Miscellany/..
mkdir -p "$(INTERNAL)/HTML"
rm -f $(INTERNAL)/HTML/*
cp -R -f inform7/Internal/HTML $(INTERNAL)/HTML/..
endef
# (f) Copying images into the app
$(IMAGESEXEMPLUM): \
resources/Imagery/app_images/[A-Za-z]*.* \
resources/Imagery/bg_images/[A-Za-z]*.* \
resources/Imagery/doc_images/[A-Za-z]*.* \
resources/Imagery/map_icons/[A-Za-z]*.* \
resources/Imagery/outcome_images/[A-Za-z]*.* \
resources/Imagery/scene_icons/[A-Za-z]*.*
$(call transfer-images)
define transfer-images
touch $(IMAGESEXEMPLUMFROM)
cp -f resources/Imagery/app_images/Welcome*Background.png $(BUILTINHTML)
mkdir -p $(BUILTINHTML)/bg_images
rm -f $(BUILTINHTML)/bg_images/*
cp -f resources/Imagery/bg_images/[A-Za-z]*.* $(BUILTINHTML)/bg_images
mkdir -p $(BUILTINHTML)/doc_images
rm -f $(BUILTINHTML)/doc_images/*
cp -f resources/Imagery/doc_images/[A-Za-z]*.* $(BUILTINHTML)/doc_images
mkdir -p $(BUILTINHTML)/map_icons
rm -f $(BUILTINHTML)/map_icons/*
cp -f resources/Imagery/map_icons/[A-Za-z]*.* $(BUILTINHTML)/map_icons
mkdir -p $(BUILTINHTML)/outcome_images
rm -f $(BUILTINHTML)/outcome_images/*
cp -f resources/Imagery/outcome_images/[A-Za-z]*.* $(BUILTINHTML)/outcome_images
mkdir -p $(BUILTINHTML)/scene_icons
rm -f $(BUILTINHTML)/scene_icons/*
cp -f resources/Imagery/scene_icons/[A-Za-z]*.* $(BUILTINHTML)/scene_icons
endef
# (g) Typesetting documentation to HTML inside the app
$(DOCEXEMPLUM): resources/Documentation/*.txt resources/Documentation/Examples/*.txt
$(call make-inapp-documentation)
define make-inapp-documentation
mkdir -p "$(INTERNAL)/Documentation"
mkdir -p $(BUILTINHTMLINNER)
$(INDOCX) -from resources/Documentation -xrefs 'inform7/Internal/HTML/xrefs.txt' $(INDOCOPTS)
endef
# (h) Typesetting the HTML pages used to display run-time problem messages
$(RTPEXEMPLUM): resources/Outcome*Pages/texts.txt resources/Outcome*Pages/*.html
$(call make-inapp-outcome-pages)
define make-inapp-outcome-pages
$(INRTPSX) resources/Outcome\ Pages $(BUILTINHTMLINNER) $(INRTPSOPTS)
cp -f resources/Outcome\ Pages/pl404.html $(BUILTINHTMLINNER)
endef
endif
# -----------------------------------------------------------------------------