awk(1): Separate hostprog.
authorzrj <rimvydas.jasinskas@gmail.com>
Wed, 25 Apr 2018 16:20:06 +0000 (19:20 +0300)
committerzrj <zrj@dragonflybsd.org>
Wed, 25 Apr 2018 18:19:11 +0000 (21:19 +0300)
usr.bin/awk/Makefile
usr.bin/awk/Makefile.inc [new file with mode: 0644]
usr.bin/awk/awk/Makefile [copied from usr.bin/awk/Makefile with 55% similarity]
usr.bin/awk/maketab/Makefile [new file with mode: 0644]

index 1dae848..fb01418 100644 (file)
@@ -1,28 +1,3 @@
-# $FreeBSD: src/usr.bin/awk/Makefile,v 1.9.2.1 2002/06/21 20:12:08 obrien Exp $
-# $DragonFly: src/usr.bin/awk/Makefile,v 1.12 2007/08/27 16:50:51 pavalos Exp $
-
-AWKSRC=        ${.CURDIR}/../../contrib/awk
-.PATH: ${AWKSRC}
-
-PROG=  awk
-SRCS=  awkgram.y b.c lex.c lib.c main.c parse.c proctab.c run.c tran.c ytab.h
-WARNS?=        2
-
-CFLAGS+= -I. -I${AWKSRC} -DHAS_ISBLANK
-
-DPADD= ${LIBM}
-LDADD= -lm
-
-CLEANFILES= maketab proctab.c ytab.h maketab.nx
-
-ytab.h: awkgram.h
-       ${LN} -sf ${.ALLSRC} ${.TARGET}
-
-proctab.c: maketab.nx
-       ./maketab.nx > proctab.c
-
-build-tools: maketab.nx
-
-maketab.nx: ytab.h ${AWKSRC}/maketab.c
-
-.include <bsd.prog.mk>
+SUBDIR=                maketab
+SUBDIR+=       awk
+.include <bsd.subdir.mk>
diff --git a/usr.bin/awk/Makefile.inc b/usr.bin/awk/Makefile.inc
new file mode 100644 (file)
index 0000000..01b5f23
--- /dev/null
@@ -0,0 +1 @@
+.include "../Makefile.inc"
similarity index 55%
copy from usr.bin/awk/Makefile
copy to usr.bin/awk/awk/Makefile
index 1dae848..ae13008 100644 (file)
@@ -1,7 +1,6 @@
 # $FreeBSD: src/usr.bin/awk/Makefile,v 1.9.2.1 2002/06/21 20:12:08 obrien Exp $
-# $DragonFly: src/usr.bin/awk/Makefile,v 1.12 2007/08/27 16:50:51 pavalos Exp $
 
-AWKSRC=        ${.CURDIR}/../../contrib/awk
+AWKSRC=        ${.CURDIR}/../../../contrib/awk
 .PATH: ${AWKSRC}
 
 PROG=  awk
@@ -13,16 +12,12 @@ CFLAGS+= -I. -I${AWKSRC} -DHAS_ISBLANK
 DPADD= ${LIBM}
 LDADD= -lm
 
-CLEANFILES= maketab proctab.c ytab.h maketab.nx
+CLEANFILES= proctab.c ytab.h
 
 ytab.h: awkgram.h
        ${LN} -sf ${.ALLSRC} ${.TARGET}
 
-proctab.c: maketab.nx
-       ./maketab.nx > proctab.c
-
-build-tools: maketab.nx
-
-maketab.nx: ytab.h ${AWKSRC}/maketab.c
+proctab.c: ytab.h ${AWKSRC}/maketab.c
+       ${.OBJDIR}/../maketab/maketab.nx > ${.OBJDIR}/proctab.c
 
 .include <bsd.prog.mk>
diff --git a/usr.bin/awk/maketab/Makefile b/usr.bin/awk/maketab/Makefile
new file mode 100644 (file)
index 0000000..112eafb
--- /dev/null
@@ -0,0 +1,21 @@
+AWKSRC= ${.CURDIR}/../../../contrib/awk
+.PATH: ${AWKSRC}
+
+PROG=  maketab
+SRCS=  maketab.c ytab.h
+
+CFLAGS+= -I. -I${AWKSRC} -DHAS_ISBLANK
+
+y.tab.h: awkgram.c awkgram.y
+
+ytab.h: y.tab.h
+       ${LN} -sf ${.ALLSRC} ${.TARGET}
+
+WARNS= 2
+
+CLEANFILES+=   ytab.h y.tab.h awkgram.c
+
+# this setup is used in place, it is not installed anywhere
+install:
+
+.include <bsd.hostprog.mk>