Warning: this is an htmlized version!
The original is across this link,
and the conversion rules are here.
# (find-angg "vtutil/")
# (find-angg "vtutil/vtutil.lua" "e_scripts")


VTUTIL	 =   lua inc.lua vtutil.lua
DLVTUTIL = dllua inc.lua vtutil.lua
TRLATINTO850 = tr `cat table_latin` `cat table_850`
TR850TOLATIN = tr `cat table_850` `cat table_latin`

# Files that can be generated automatically
#
PIOFONTXSO = pio_fontx.so
GENERATEDFONTS = \
  850.8			\
  850.8.matrix		\
  850.8.psf		\
  latin.8		\
  latin.8.matrix	\
  latin.8.psf		\
  math850.8		\
  math850.8.matrix	\
  math850.8.psf		\
  mathlatin.8		\
  mathlatin.8.matrix	\
  mathlatin.8.psf
ETC = \
  table_latin		\
  table_850		\
  composes_latin	\
  composes_850		\
  mathlatin.map		\
  math850.map

all: $(PIOFONTXSO) $(GENERATEDFONTS) $(ETC)
	# Now you can run the setfont/loadkeys targets

clean:
	rm -fv $(PIOFONTXSO) $(GENERATEDFONTS) $(ETC)

makefonts $(GENERATEDFONTS):
	$(DLVTUTIL) mathchars.lua \
	  -e 'font850=loadfont("ega1.8")' makefonts_8.lua

pio_fontx.so:
	gcc -Wall -shared -I$(HOME)/include -o pio_fontx.so pio_fontx.c

%.setfont: % $(PIOFONTXSO)
	$(DLVTUTIL) -e 'setfont(loadfont("$*"))'

table_latin:
	$(DLVTUTIL) -e 'writefile("table_latin", highglyphs_latin)'
table_850:
	$(DLVTUTIL) -e 'writefile("table_850", highglyphs_850)'
composes_latin:
	$(DLVTUTIL) mathchars.lua \
	  -e 'writefile("$@", makecomposes(math_cchars, math_ckeyps))'
composes_850: composes_latin table_latin table_850
	$(TRLATINTO850) < $< > $@


# The "setfont" targets
#
850:       850.8.setfont
latin:     latin.8.setfont
math850:   math850.8.setfont
mathlatin: mathlatin.8.setfont

16:        ega0.16.setfont


# The "loadkeys" targets.
# This is a mess and will work only for keyboards with the US layout.
# (find-fline "/usr/share/keymaps/i386/qwerty/")
# Our "defkeymap" is not very standard, but anyway.
# (find-fline "~/MTA/latinmath.map")
# (find-fline "~/vtutil/defkeymap.map")
#
mathlatin.map: defkeymap.map composes_latin
	cat defkeymap.map composes_latin > $@
math850.map: defkeymap.map composes_latin table_latin table_850
	cat defkeymap.map composes_latin | $(TRLATINTO850) > $@
#
%.loadkeys: %.map
	loadkeys -q $<
#
math850.setall: math850 math850.loadkeys
mathlatin.setall: mathlatin mathlatin.loadkeys



# About making the .tar.gz
#
LUAFILES = inc.lua vtutil.lua mathchars.lua makefonts_8.lua
BASEFONTS = ega0.8 ega1.8 ega0.16 ega1.16
OTHERTGZFILES = README Makefile pio_fontx.c defkeymap.map editing-font.png
VERSION = 0.01
TARGZ = vtutil-$(VERSION).tar.gz

.tar.gz $(TARGZ):
	tar -cvzf $(TARGZ) $(OTHERTGZFILES) $(LUAFILES) $(BASEFONTS)