1#	$NetBSD: Makefile,v 1.3 2024/08/18 14:10:43 christos Exp $
2
3WARNS?= 4
4CWARNFLAGS.clang+=	-Wno-self-assign
5
6.include <bsd.own.mk>
7
8BINDIR?= /usr/bin
9DIST=	${.CURDIR}/../../dist
10.PATH:	${DIST}
11
12PROG=	awk
13SRCS=	awkgram.y b.c lex.c lib.c main.c parse.c proctab.c run.c tran.c
14CPPFLAGS+=	-I${DIST} -I. -DHAS_ISBLANK
15LDADD+=	-lm
16.if !defined(HOSTPROG)
17DPADD+=	${LIBM}
18.endif
19YHEADER=	yes
20CWARNFLAGS+=	-Wno-pointer-sign
21COPTS.run.c+=	-Wno-format-nonliteral
22COPTS.tran.c+=	-Wno-format-nonliteral
23
24# info file originally from GNU awk 3.1.3, adjusted for nawk slightly
25.PATH:	${NETBSDSRCDIR}/external/gpl2/gawk/dist
26TEXINFO=        awk.info
27
28# During the tools build (from src/tools/awk/Makefile),
29# src/tools/Makefile.host changes .CURDIR back and forth between
30# src/tools/awk and src/usr.bin/awk.  For some unknown reason, including
31# bsd.info.mk here leads to the obj dir being created at the wrong time,
32# while .CURDIR is src/usr.bin/awk.  Work around the problem by not
33# including bsd.info.mk when MKINFO=no.
34.if ${MKINFO} != "no"
35.include <bsd.info.mk>
36.endif
37
38.include <bsd.prog.mk>
39