2 # Build a bootstrap version of m4 (needed in order to build libelf and lex)
3 .PATH: ${SRCTOP}/usr.bin/m4 ${.CURDIR}
5 # Avoid using lex or yacc to generate sources
6 LEX:=/this/should/not/be/used
8 tokenizer.c: bootstrap_m4_tokenizer
11 # This target is used as a marker in usr.bin/m4/Makefile to not add the
12 # lex and yacc includes. Therefore we must define it before including
14 bootstrap_m4_tokenizer: inittokenizer.c
15 .for _f in tokenizer.c
16 @cmp -s ${.CURDIR}/init${_f} ${_f} || { \
17 echo "Bootstrapping ${_f}" ; \
18 ${CP} ${.CURDIR}/init${_f} ${_f} ; \
23 .include "${SRCTOP}/usr.bin/m4/Makefile"
26 (cd ${SRCTOP}/usr.bin/m4 && lex -t ${SRCTOP}/usr.bin/m4/tokenizer.l) | grep -v '#line' > inittokenizer.c