freebsd-dev/usr.bin/awk/Makefile
Simon J. Gerraty 8fe4f8f7a7 Fix building host tools for host
Several makefile depend on tools built for host.
At least when using DIRDEPS_BUILD we can build these for the
pseudo machine "host" to facilitate building on older host versions.

Ideally we would build these tools in their own directories to avoid
building more than needed.

For now, setting an appropriate default for BTOOLSPATH will suffice

Reviewed by:	stevek
Sponsored by:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D39708
2023-04-20 10:05:43 -07:00

38 lines
727 B
Makefile

# $FreeBSD$
.include <src.opts.mk>
AWKSRC= ${SRCTOP}/contrib/one-true-awk
.PATH: ${AWKSRC}
PROG= awk
SRCS= awkgram.y b.c lex.c lib.c main.c parse.c proctab.c run.c tran.c awkgram.tab.h
CFLAGS+= -DHAS_ISBLANK -I. -I${AWKSRC} -DFOPEN_MAX=64
WARNS?= 1
LIBADD= m
LINKS= ${BINDIR}/awk ${BINDIR}/nawk
MLINKS= awk.1 nawk.1
CLEANFILES= maketab proctab.c awkgram.tab.h
awkgram.tab.h: awkgram.h
ln -sf ${.ALLSRC:M*.h} ${.TARGET}
proctab.c: maketab awkgram.tab.h
${BTOOLSPATH:U.}/maketab awkgram.tab.h > proctab.c
.if ${MACHINE} == "host" || ${MK_DIRDEPS_BUILD} == "no"
DEPENDOBJS+= maketab
build-tools: maketab
maketab: awkgram.tab.h ${BUILD_TOOLS_META}
.endif
HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests
.include <bsd.prog.mk>