Inweb provides a system for generating makefiles, that is, build instructions to be used by the Unix utility make, much like its system for generating README Files. The command inweb make-makefile works almost exactly like inweb make-readme, and once again generates a makefile from a script:

$ inweb make-makefile smorgasbord
smorgasbord/smorgasbord.mkscript -> smorgasbord/smorgasbord.mk

A new switch, -platform X, allows the platform (i.e. operating system) being targeted to be changed: by default, this is whatever Inweb is running on, but with -platform windows, Inweb on MacOS can cosplay.

As for README scripts, the braces { and } are significant, and all of the same rules apply: {set ...} can create variables, {repeat ...} can provide loops, {define ...} can create new macros. In addition, the following make-related macros are available:

For example, here's a minimal script capable of incrementally tangling and recompiling a C program:

{platform-settings}

{identity-settings}

$(ME)/Tangled/$(MYNAME): {dependent-files}
	$(call make-me)

.PHONY: force
force:
	$(call make-me)

define make-me
	$(INWEB) tangle $(ME)
	{compile from: $(ME)/Tangled/$(MYNAME).c   to:   $(ME)/Tangled/$(MYNAME).o}
	{link from:    $(ME)/Tangled/$(MYNAME).o   to:   $(ME)/Tangled/$(MYNAME)$(EXEEXTENSION)}
endef

Note that the macros {compile ...} and {link ...} are defined in the platform settings, as is EXEEXTENSION (it's .exe on Windows and blank on most other platforms), whereas ME and MYNAME are set in the identity settings.

Conveniences for Inform

The main Inform repository's makefile is especially convoluted because of the very large number of webs in it, which fall into several different categories. Inweb provides a couple of macros to help manage that.