1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-05-20 09:58:47 +03:00
inform7/inform7/inform7.mkscript
2022-04-23 23:45:47 +01:00

86 lines
2.4 KiB
Plaintext

# This is "inform7.mkscript", a script used to generate the makefile "inform7.mk"
# used to build the tool "inform7". Do not edit "inform7.mk" directly. Instead,
# edit this script, and then rebuild "inform7.mk" with the command:
# ../inweb/Tangled/inweb inform7 -makefile inform7/inform7.mk
# (Or simply type "make makers" to make all of the subsidiary makefiles inside the
# inform repository, including this one.)
# 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", _not_ its subdirectory "inform/inform7". So it
# should usually be invoked as e.g. "make -f inform7/inform7.mk".
# -----------------------------------------------------------------------------
{platform-settings}
{identity-settings}
BLORBLIB = $(ME)/Tests/Assistants/blorblib
INTER = inter/Tangled/inter
.PHONY: all
all: executable preform
.PHONY: executable
executable: $(ME)/Tangled/$(MYNAME)
.PHONY: preform
preform: $(ME)/Tangled/Syntax.preform
# Making the program:
$(ME)/Tangled/$(MYNAME): {dependent-files}
$(call make-me)
$(ME)/TangledSyntax.preform:
$(call make-me)
.PHONY: force
force:
$(call make-me)
define make-me
$(INWEB) $(ME) -import-from modules -tangle
{compile from: $(ME)/Tangled/$(ME).c to: $(ME)/Tangled/$(ME).o}
{link from: $(ME)/Tangled/$(ME).o to: $(ME)/Tangled/$(ME)$(EXEEXTENSION)}
endef
# Testing the program:
.PHONY: test
test:
$(INTEST) -from $(ME) all
# Cleaning up:
.PHONY: clean
clean:
$(call clean-up)
.PHONY: purge
purge:
$(call clean-up)
rm -f $(ME)/Tangled/$(ME)
define clean-up
rm -f $(ME)/Tangled/*.o
rm -f $(ME)/Tangled/*.c
rm -f $(ME)/Tangled/*.h
rm -f $(ME)/Tests/Test\ Cases/_Results_Actual/*.txt
rm -f $(ME)/Tests/Test\ Extensions/_Results_Actual/*.txt
rm -f $(ME)/Tests/Test\ Index/_Results_Actual/*.txt
rm -f $(ME)/Tests/Test\ Maps/_Results_Actual/*.txt
rm -f $(ME)/Tests/Test\ Problems/_Results_Actual/*.txt
rm -f Documentation/Examples/_Results_Actual/*.txt
endef