sometimes it feels like they are making it complicated on purpose...

awk.lx.c, awk.g.2001.y and awk.g.2001.c were generated manually from the info in the Makefile.mk
The yacc used was byacc but it might also work with the heirloom devtools yacc.

Plan9 lex does not work and flex got broken??? need to check/rebuild it...
Heirloom devtools lex works.
lex awk.lx.l
mv lex.yy.c awk.lx.c

maketab generated by

mkmk -o maketab -B -I. -I../include -I/sys/include/ape/heirloom -D_POSIX_SOURCE -D_SUSV2_SOURCE -DIN_MAKETAB maketab.c > mkfile.maketab
y.tab.h needed to be generated by byacc -b
y.tab.h needed <inttypes.h>

./maketab > 

mkmk -o nawk -S -B -a -I../include -I/sys/include/ape/heirloom -D_POSIX_SOURCE -D_SUSV2_SOURCE -D_BSD_EXTENSION -DSU3 -x awk.g.y -x awk.g.2001.y -x awk.lx.l -x maketab.c > mkfile

DEPENDENCIES:

Heirloom libuxre must be rebuilt with a proper wchar library (like libutf8) to work. Otherwise linking errors occur at this stage.