]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - tools/build/bootstrap-m4/Makefile
Merge llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9
[FreeBSD/FreeBSD.git] / tools / build / bootstrap-m4 / Makefile
1
2 # Build a bootstrap version of m4 (needed in order to build libelf and lex)
3 .PATH: ${SRCTOP}/usr.bin/m4 ${.CURDIR}
4
5 # Avoid using lex or yacc to generate sources
6 LEX:=/this/should/not/be/used
7
8 tokenizer.c: bootstrap_m4_tokenizer
9         test -e ${.TARGET}
10
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
13 # the other Makefile.
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} ; \
19         }
20 .endfor
21
22 BINDIR= /usr/bin
23 .include "${SRCTOP}/usr.bin/m4/Makefile"
24
25 regen:
26         (cd ${SRCTOP}/usr.bin/m4 && lex -t ${SRCTOP}/usr.bin/m4/tokenizer.l) | grep -v '#line' > inittokenizer.c