Makefile for inform 10.x

Guys, I made a thing! I mean - I really don’t know what I’m doing here, but I was reading @HanonO’s tutorial, and then I figured - why not put this in a Makefile. So I did. And much to my surprise, it works!

Mostly as a reminder to self just how I did this, I wrote down everything, and put those notes and the Makefile on github.

I hope somebody finds it useful, and if it doesn’t work or I’m otherwise doing something the wrong way, please let me know.

The actual Makefile is like this:

# This is a Makefile for Inform 10.x project, on Mac.
# INFORM_HOME is where you clone inform, intest and inweb.
INFORM_HOME=~/Documents/private/inform10

# OUTPUT is how you want to name your output file, minus extension.
OUTPUT="My Project"

.DEFAULT_GOAL := blorb

uuid:
	uuidgen | tr -d '\n'> uuid.txt

inform6: 
	${INFORM_HOME}/inform/inform7/Tangled/inform7 -no-progress -project .

glulx: inform6
	${INFORM_HOME}/inform/inform6/Tangled/inform6 -E2wSDG ./Build/auto.inf ./Build/output.ulx

blorb: glulx
	${INFORM_HOME}/inform/inblorb/Tangled/inblorb ./Release.blurb ./Build/output.gblorb
	cp ./Build/output.gblorb ./Release/${OUTPUT}.gblorb

play: blorb
	glulxe ./Release/${OUTPUT}.gblorb

clean:
	@rm -rf Release
	@rm -rf Build
	@rm -rf Index
	@rm -f Metadata.iFiction
	@rm -f Release.blurb
	@rm -f manifest.plist
8 Likes

So, speaking as a technical ignoramus, what does this do, and how can it be used?

[Just for the record, this tutorial is by someone named “Hanno” whom is not me although autocorrect begs to differ…]

3 Likes

Oh! Sorry for the mixup!

1 Like

It’s meant to simplify the workflow for writing stories with the new Inform 10.1.0 release, which doesn’t yet work in the Inform IDE. That means you have to compile it from the command line - typing in the commands in this file.

With the Makefile,.you just put that file in your project, edit your story.ni file in any text editor, and all you need to type in the terminal is make.

It may even be possible to use the makefile from within other tools, like vscode, so you don’t actually need to type anything at all, but I haven’t tried that.

2 Likes

there’s very few edits needed for porting it to Linux (the major one is a prudent changing the rm -rf in a more wise sequence of rm < dir >/< whatever ought to be deleted in a cleaning >)

I’ll test it in a lab now… EDIT: works as expected, no edits, aside my inform 10 setup (esp. OMIT_UNUSED_ROUTINES) and the prudent approach to cleansing.

I can give a pair of suggestion: adding all: for people accustomed to standard unix makefiles, and even, for OMIT_UNUSED_ROUTINES, a z8:

(I confirm, Inform 7 v.10 with OMIT_UNUSED_ROUTINES equals a punyinform for Inform 7, in z8 format, with ~184 Kbytes available, enough for punyinform-sized IF works.)

Best regards from Italy,
dott. Piergiorgio.

2 Likes

Not just effective, also very well documented on your Github page! Nice work!