1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-05-02 00:59:37 +03:00

Further work on makefiles

This commit is contained in:
Graham Nelson 2022-04-22 23:55:36 +01:00
parent bb1bb75578
commit f79f550d37
2 changed files with 154 additions and 156 deletions

View file

@ -36,13 +36,14 @@ retrospective/{BUILD}/ni:
# -----------------------------------------------------------------------------
{set name: SUPPORTED_BUILDS value: 6L02, 6L38, 6M62}
# -----------------------------------------------------------------------------
.PHONY: all
all: \
retrospective/6L02/cBlorb retrospective/6L02/ni \
retrospective/6L38/cBlorb retrospective/6L38/ni \
retrospective/6M62/cBlorb retrospective/6M62/ni
all: {repeat with: BUILD in: {SUPPORTED_BUILDS}}retrospective/{BUILD}/cBlorb retrospective/{BUILD}/ni {end-repeat}
{retro-targets build: 6L02}
{retro-targets build: 6L38}
{retro-targets build: 6M62}
{repeat with: BUILD in: {SUPPORTED_BUILDS}}
{retro-targets build: {BUILD}}
{end-repeat}

View file

@ -58,33 +58,33 @@ INBUILDX = inbuild/Tangled/inbuild
# root of the core Inform distribution.
# In the eventual makefile, the symbol NAMEWEB is defined as its location.
{module} WORDS words services/words-module modules
{module} SYNTAX syntax services/syntax-module modules
{module} HTML html services/html-module modules
{module} ARCH arch services/arch-module modules
{module} INFLECTIONS inflections services/inflections-module modules
{module} LEXICON lexicon services/lexicon-module modules
{module} LINGUISTICS linguistics services/linguistics-module modules
{module} PROBLEMS problems services/problems-module modules
{module} KINDS kinds services/kinds-module modules
{module} CALCULUS calculus services/calculus-module modules
{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}
{module} CORE core inform7/core-module modules
{module} ASSERTIONS assertions inform7/assertions-module modules
{module} KNOWLEDGE knowledge inform7/knowledge-module modules
{module} IMPERATIVE imperative inform7/imperative-module modules
{module} RUNTIME runtime inform7/runtime-module modules
{module} VALUES values inform7/values-module modules
{module} IF if inform7/if-module modules
{module} MULTIMEDIA multimedia inform7/multimedia-module modules
{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}
{module} BYTECODE bytecode inter/bytecode-module modules
{module} BUILDING building inter/building-module modules
{module} PIPELINE pipeline inter/pipeline-module modules
{module} FINAL final inter/final-module modules
{module} INDEX index inter/index-module modules
{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}
{module} SUPERVISOR supervisor inbuild/supervisor-module modules
{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;
@ -92,13 +92,13 @@ INBUILDX = inbuild/Tangled/inbuild
# the symbol NAMEX is the actual executable which the tool compiles into.
# After its declaration, we list all modules needed to compile the tool.
{tool} INBLORB inblorb inblorb otools
{tool} INDOC indoc indoc otools
{tool} INFORM7 inform7 inform7 ctools
{tool} INPOLICY inpolicy inpolicy otools
{tool} INRTPS inrtps inrtps otools
{tool} INBUILDTOOL inbuild inbuild ctools
{tool} INTERTOOL inter inter ctools
{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:
@ -106,26 +106,26 @@ INFORM6X = inform6/Tangled/inform6
# While these are also executables, they only provide unit tests for modules:
{tool} SYNTAXTEST syntax-test services/syntax-test utools
{tool} WORDSTEST words-test services/words-test utools
{tool} ARCHTEST arch-test services/arch-test utools
{tool} INFLECTIONSTEST inflections-test services/inflections-test utools
{tool} LINGUISTICSTEST linguistics-test services/linguistics-test utools
{tool} KINDSTEST kinds-test services/kinds-test utools
{tool} CALCULUSTEST calculus-test services/calculus-test utools
{tool} PROBLEMSTEST problems-test services/problems-test utools
{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}
{tool} BUILDINGTEST building-test inter/building-test utools
{component symbol: BUILDINGTEST webname: building-test path: inter/building-test set: utools category: tool}
# And here are other webs:
{web} BASICINFORMKIT BasicInformKit inform7/Internal/Inter/BasicInformKit kits
{web} WORLDMODELKIT WorldModelKit inform7/Internal/Inter/WorldModelKit kits
{web} COMMANDPARSERKIT CommandParserKit inform7/Internal/Inter/CommandParserKit kits
{web} BASICINFORMEXTRASKIT BasicInformExtrasKit inform7/Internal/Inter/BasicInformExtrasKit kits
{web} ENGLISHLANGUAGEKIT EnglishLanguageKit inform7/Internal/Inter/EnglishLanguageKit kits
{web} STANDARDRULES standard_rules inform7/extensions/standard_rules extensions
{web} BASICINFORM basic_inform inform7/extensions/basic_inform extensions
{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"
@ -167,15 +167,12 @@ inform7/Tangled/inform7_clib.c: inter/final-module/Chapter\ 5/*.w
# -----------------------------------------------------------------------------
# Each individual tool has its own makefile, stored inside its individual web.
# "make makers" runs through each tool in turn and creates this makefile.
# Note the repeat-tools-block feature: the line in the block is repeated once for each
# defined tool. Inside the block, an asterisk expands to the tool's symbol
# name: so for example, for inblorb, *WEB would become INBLORBWEB.
.PHONY: makers
makers:
{repeat-tools-block:all}
$(INWEBX) $(@WEB) -makefile $(@MAKER)
{end-block}
{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
@ -187,9 +184,9 @@ makers:
.PHONY: gitignores
gitignores:
$(INWEBX) -prototype scripts/gitignorescript.txt -gitignore .gitignore
{repeat-tools-block:all}
$(INWEBX) $(@WEB) -gitignore $(@WEB)/.gitignore
{end-block}
{repeat over: tool}
$(INWEBX) $({NAME}WEB) -gitignore $({NAME}WEB)/.gitignore
{end-repeat}
$(INWEBX) -prototype inform6/gitignorescript.txt -gitignore inform6/.gitignore
# -----------------------------------------------------------------------------
@ -199,9 +196,9 @@ gitignores:
.PHONY: versions
versions:
{repeat-tools-block:all}
$(@X) -version
{end-block}
{repeat over: tool}
$({NAME}X) -version
{end-repeat}
$(INFORM6X) -V
# -----------------------------------------------------------------------------
@ -247,13 +244,13 @@ forcekits:
# Note the use of repeat to make a list: $(INBLORBX) $(INDOCX) ..., etc.
.PHONY: tools
tools: {repeat-tools-span}$(@X){end-span} $(INFORM6X)
tools: {repeat over: tool}$({NAME}X) {end-repeat}$(INFORM6X)
{repeat-tools-block:all}
$(@X): {dependent-files-for-tool-and-modules}@
$(MAKE) -f $(@MAKER)
{repeat over: tool}
$({NAME}X): {dependent-files tool-and-modules: {NAME}}
$(MAKE) -f $({NAME}MAKER)
{end-block}
{end-repeat}
# As ever, Inform 6 needs special handling:
@ -278,10 +275,10 @@ retrospective:
.PHONY: forcetools
forcetools:
{repeat-tools-block:all}
$(MAKE) -f $(@MAKER) force
{repeat over: tool}
$(MAKE) -f $({NAME}MAKER) force
$(MAKE) -f inform6/inform6.mk force
{end-block}
{end-repeat}
# -----------------------------------------------------------------------------
# Target "check"
@ -295,9 +292,9 @@ forcetools:
check:
$(MAKE) -f inform6/inform6.mk test
$(INPOLICYX) -silence -check-problems
{repeat-tools-block:all}
$(MAKE) -f $(@MAKER) test
{end-block}
{repeat over: tool}
$(MAKE) -f $({NAME}MAKER) test
{end-repeat}
# -----------------------------------------------------------------------------
# Target "tangle"
@ -310,9 +307,9 @@ tangle:
$(call tangle-webs)
define tangle-webs
{repeat-tools-block:all}
$(INWEBX) $(@WEB) -tangle
{end-block}
{repeat over: tool}
$(INWEBX) $({NAME}WEB) -tangle
{end-repeat}
endef
# -----------------------------------------------------------------------------
@ -328,9 +325,9 @@ weave:
$(call weave-webs)
define weave-webs
{repeat-tools-block:all}
$(INWEBX) $(@WEB) $(WEAVEOPTS)
{end-block}
{repeat over: tool}
$(INWEBX) $({NAME}WEB) $(WEAVEOPTS)
{end-repeat}
endef
# -----------------------------------------------------------------------------
@ -353,8 +350,8 @@ commit:
# -----------------------------------------------------------------------------
.PHONY: pages
pages: diagnostics icon readmepage diagrams prepages {repeat-tools-span}@PAGES{end-span} \
{repeat-modules-span}@MPAGES{end-span} morepages
pages: diagnostics icon readmepage diagrams prepages {repeat over: tool}{NAME}PAGES {end-repeat}\
{repeat over: module}{NAME}MPAGES {end-repeat} morepages
.PHONY: icon
icon:
@ -363,8 +360,8 @@ icon:
cp -f docs-src/Inform.png docs/docs-assets
.PHONY: forcepages
forcepages: diagnostics readmepage diagrams forceprepages {repeat-tools-span}@FORCEPAGES{end-span} \
{repeat-modules-span}@FORCEMPAGES{end-span} forcemorepages
forcepages: diagnostics readmepage diagrams forceprepages {repeat over: tool}{NAME}FORCEPAGES {end-repeat}\
{repeat over: module}{NAME}FORCEMPAGES {end-repeat}forcemorepages
.PHONY: readmepage
readmepage:
@ -387,65 +384,65 @@ diagrams:
$(INFORM7X) -help >inform7/Figures/help.txt
$(INTERX) -help >inter/Figures/help.txt
{repeat-tools-block:ctools}
.PHONY: @PAGES
@PAGES: docs/$(@LEAF)/index.html
{repeat over: tool set: ctools}
.PHONY: {NAME}PAGES
{NAME}PAGES: docs/$({NAME}LEAF)/index.html
docs/$(@LEAF)/index.html: {dependent-files-for-tool-alone}@
rm -f docs/$(@LEAF)/*.html
$(INWEBX) -colony $(COLONY) -member $(@LEAF) -weave
docs/$({NAME}LEAF)/index.html: {dependent-files tool: {NAME}}
rm -f docs/$({NAME}LEAF)/*.html
$(INWEBX) -colony $(COLONY) -member $({NAME}LEAF) -weave
.PHONY: @FORCEPAGES
@FORCEPAGES:
rm -f docs/$(@LEAF)/*.html
$(INWEBX) -colony $(COLONY) -member $(@LEAF) -weave
.PHONY: {NAME}FORCEPAGES
{NAME}FORCEPAGES:
rm -f docs/$({NAME}LEAF)/*.html
$(INWEBX) -colony $(COLONY) -member $({NAME}LEAF) -weave
{end-block}
{end-repeat}
{repeat-tools-block:otools}
.PHONY: @PAGES
@PAGES: docs/$(@LEAF)/index.html
{repeat over: tool set: otools}
.PHONY: {NAME}PAGES
{NAME}PAGES: docs/$({NAME}LEAF)/index.html
docs/$(@LEAF)/index.html: {dependent-files-for-tool-alone}@
rm -f docs/$(@LEAF)/*.html
$(INWEBX) -colony $(COLONY) -member $(@LEAF) -weave
docs/$({NAME}LEAF)/index.html: {dependent-files tool: {NAME}}
rm -f docs/$({NAME}LEAF)/*.html
$(INWEBX) -colony $(COLONY) -member $({NAME}LEAF) -weave
.PHONY: @FORCEPAGES
@FORCEPAGES:
rm -f docs/$(@LEAF)/*.html
$(INWEBX) -colony $(COLONY) -member $(@LEAF) -weave
.PHONY: {NAME}FORCEPAGES
{NAME}FORCEPAGES:
rm -f docs/$({NAME}LEAF)/*.html
$(INWEBX) -colony $(COLONY) -member $({NAME}LEAF) -weave
{end-block}
{end-repeat}
{repeat-tools-block:utools}
.PHONY: @PAGES
@PAGES: docs/$(@LEAF)/index.html
{repeat over: tool set: utools}
.PHONY: {NAME}PAGES
{NAME}PAGES: docs/$({NAME}LEAF)/index.html
docs/$(@LEAF)/index.html: {dependent-files-for-tool-and-modules}@
rm -f docs/$(@LEAF)/*.html
$(INWEBX) -colony $(COLONY) -member $(@LEAF) -weave
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: @FORCEPAGES
@FORCEPAGES:
rm -f docs/$(@LEAF)/*.html
$(INWEBX) -colony $(COLONY) -member $(@LEAF) -weave
.PHONY: {NAME}FORCEPAGES
{NAME}FORCEPAGES:
rm -f docs/$({NAME}LEAF)/*.html
$(INWEBX) -colony $(COLONY) -member $({NAME}LEAF) -weave
{end-block}
{end-repeat}
{repeat-modules-block:all}
.PHONY: @MPAGES
@MPAGES: docs/$(@LEAF)-module/index.html
{repeat over: module}
.PHONY: {NAME}MPAGES
{NAME}MPAGES: docs/$({NAME}LEAF)-module/index.html
docs/$(@LEAF)-module/index.html: {dependent-files-for-module}@
rm -f docs/$(@LEAF)-module/*.html
$(INWEBX) -colony $(COLONY) -member $(@LEAF) -weave
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: @FORCEMPAGES
@FORCEMPAGES:
rm -f docs/$(@LEAF)-module/*.html
$(INWEBX) -colony $(COLONY) -member $(@LEAF) -weave
.PHONY: {NAME}FORCEMPAGES
{NAME}FORCEMPAGES:
rm -f docs/$({NAME}LEAF)-module/*.html
$(INWEBX) -colony $(COLONY) -member $({NAME}LEAF) -weave
{end-block}
{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
@ -523,33 +520,33 @@ diagnostics:
rm -f inform7/Figures/stock-diagnostics.txt
.PHONY: morepages
morepages: {repeat-webs-span}docs/$(@LEAF)/index.html{end-span}
morepages: {repeat over: web}docs/$({NAME}LEAF)/index.html {end-repeat}
{repeat-webs-block:kits}
{repeat over: web set: kits}
docs/$(@LEAF)/index.html: {dependent-files-for-tool-alone}@
rm -f docs/$(@LEAF)/*.html
$(INWEBX) -colony $(COLONY) -member $(@LEAF) -weave
docs/$({NAME}LEAF)/index.html: {dependent-files tool: {NAME}}
rm -f docs/$({NAME}LEAF)/*.html
$(INWEBX) -colony $(COLONY) -member $({NAME}LEAF) -weave
{end-block}
{repeat-webs-block:extensions}
{end-repeat}
{repeat over: web set: extensions}
docs/$(@LEAF)/index.html: {dependent-files-for-tool-alone}@
rm -f docs/$(@LEAF)/*.html
$(INWEBX) -colony $(COLONY) -member $(@LEAF) -weave
docs/$({NAME}LEAF)/index.html: {dependent-files tool: {NAME}}
rm -f docs/$({NAME}LEAF)/*.html
$(INWEBX) -colony $(COLONY) -member $({NAME}LEAF) -weave
{end-block}
{end-repeat}
.PHONY: forcemorepages
forcemorepages:
{repeat-webs-block:kits}
rm -f docs/$(@LEAF)/*.html
$(INWEBX) -colony $(COLONY) -member $(@LEAF) -weave
{end-block}
{repeat-webs-block:extensions}
rm -f docs/$(@LEAF)/*.html
$(INWEBX) -colony $(COLONY) -member $(@LEAF) -weave
{end-block}
{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"
@ -562,9 +559,9 @@ clean:
$(call clean-up)
define clean-up
{repeat-tools-block:all}
$(MAKE) -f $(@MAKER) clean
{end-block}
{repeat over: tool}
$(MAKE) -f $({NAME}MAKER) clean
{end-repeat}
$(MAKE) -f inform6/inform6.mk clean
endef
@ -579,9 +576,9 @@ purge:
$(call purge-up)
define purge-up
{repeat-tools-block:all}
$(MAKE) -f $(@MAKER) purge
{end-block}
{repeat over: tool}
$(MAKE) -f $({NAME}MAKER) purge
{end-repeat}
$(MAKE) -f inform6/inform6.mk purge
endef