#Makefile for the V (SUN) version of Knuth's METAFONT program
#Prelimary version
.SUFFIXES: .b .c .p .s .u
OBJS=mf.b mfscreen.b mfprims.b mfbreak.b emul.b
#include ../../buildprefix

# Procedure:
# build mf.m68k (takes a \long/ time: more than a vax-750 cpu-hour)
# build pool.lib (so mf.pool is installed for the next step)
# build plain.base (must be run under V)
# build install

mf.m68k: $(OBJS)
	pc68 -r -v$(Xx)V -o mf.m68k $(OBJS) -lVgraphics

mf.p: mf.web mf.pc68
#This step also generates mf.pool
	tangle mf.web mf.pc68
.p.b:
	pc68 -c $*.p
emul.b: emul.s
	pc68 -c emul.s
.c.b:
	cc68 -c -v$(Xx)V $*.c

plain.base: mf.m68k plain.mf vsun.mf
	@echo "[This make only works under V; Must make pool.lib first!]"
	mf "& \input plain;input vsun;dump"
pool.lib:
	$(NETINSTALL) -p mf.pool $(VSYS)/run/mf

# The standard clean command leaves mf.p and mf.pool around so
# people without tangle can at least recompile.
clean:
	rm -f *.BAK *.CKP mf .emacs* *.b
cleanall: clean
	rm -f mf.p mf.pool

install: mf.m68k
	$(NETINSTALL) -p "mf.m68k" $(VSYS)/bin
	$(NETINSTALL) -p "mf.pool plain.base" $(VSYS)/run/mf
