Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/ipf de-lint makefiles:



details:   https://anonhg.NetBSD.org/src/rev/bd51c78ecb96
branches:  trunk
changeset: 565093:bd51c78ecb96
user:      lukem <lukem%NetBSD.org@localhost>
date:      Mon Mar 29 04:39:59 2004 +0000

description:
de-lint makefiles:
* fix -j N parallel build issues
* support MAKEVERBOSE
* move NOxxx= to before <bsd.own.mk>
* remove unnecessary -ll (except for ipsend)
* remove unnecessary CPPFLAGS
* only build libipf.a (we don't need libipf_p.a or libipf_pic.a)
* fix dependencies upon libipf.a

(more could be done, but that requires fixing dist/ipf/*)

diffstat:

 usr.sbin/ipf/Makefile.inc      |   5 +-
 usr.sbin/ipf/ipf/Makefile      |  21 +++++++-----
 usr.sbin/ipf/ipfstat/Makefile  |   8 ++--
 usr.sbin/ipf/ipftest/Makefile  |  66 ++++++++++++++++++++++++++---------------
 usr.sbin/ipf/ipmon/Makefile    |  21 +++++++-----
 usr.sbin/ipf/ipnat/Makefile    |  23 ++++++++-----
 usr.sbin/ipf/ippool/Makefile   |  23 ++++++++-----
 usr.sbin/ipf/ipresend/Makefile |   5 +--
 usr.sbin/ipf/ipsend/Makefile   |  17 ++++++----
 usr.sbin/ipf/iptest/Makefile   |   4 +-
 usr.sbin/ipf/libipf/Makefile   |  10 +++---
 11 files changed, 117 insertions(+), 86 deletions(-)

diffs (truncated from 466 to 300 lines):

diff -r eef79ff95008 -r bd51c78ecb96 usr.sbin/ipf/Makefile.inc
--- a/usr.sbin/ipf/Makefile.inc Mon Mar 29 04:14:03 2004 +0000
+++ b/usr.sbin/ipf/Makefile.inc Mon Mar 29 04:39:59 2004 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.inc,v 1.11 2004/03/28 09:01:27 martti Exp $
+#      $NetBSD: Makefile.inc,v 1.12 2004/03/29 04:39:59 lukem Exp $
 
 .include <bsd.own.mk>
 
@@ -9,7 +9,8 @@
 CPPFLAGS+=     -DSTATETOP -D__UIO_EXPOSE
 
 IPFOBJDIR!=    cd $(.CURDIR)/../libipf && ${PRINTOBJDIR}
-LDFLAGS+=      -L${IPFOBJDIR}
+DPADD+=                ${IPFOBJDIR}/libipf.a
+LDADD+=                -L${IPFOBJDIR} -lipf
 
 CLEANFILES+=   y.tab.c y.tab.h
 
diff -r eef79ff95008 -r bd51c78ecb96 usr.sbin/ipf/ipf/Makefile
--- a/usr.sbin/ipf/ipf/Makefile Mon Mar 29 04:14:03 2004 +0000
+++ b/usr.sbin/ipf/ipf/Makefile Mon Mar 29 04:39:59 2004 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.17 2004/03/29 02:30:08 jmc Exp $
+#      $NetBSD: Makefile,v 1.18 2004/03/29 04:40:00 lukem Exp $
 
 .include <bsd.own.mk>          # for MKDYNAMICROOT definition
 
@@ -6,29 +6,32 @@
 SRCS=          ipf.c ipfcomp.c ipf_y.c ipf_l.c
 MAN=           ipf.8 ipf.4 ipf.5 ipl.4
 MLINKS=                ipl.4 ipfilter.4 ipf.5 ipf.conf.5 ipf.5 ipf6.conf.5
-DPADD+=                ${LIBL}
-LDADD+=                -ll -lipf
 
 CLEANFILES+=   ipf_y.c ipf_y.h
 CLEANFILES+=   ipf_l.c ipf_l.h
 
-ipf_y.c ipf_y.h: ipf_y.y ipf_l.h
+ipf_y.c: ipf_y.y ipf_l.h
+       ${_MKTARGET_CREATE}
        ${YACC} -d ${NETBSDSRCDIR}/dist/ipf/tools/ipf_y.y
        sed -e 's/yy/ipf_yy/g' \
            -e 's/"ipf_y.y"/"..\/tools\/ipf_y.y"/' \
-               y.tab.c > ipf_y.c
+               y.tab.c > ${.TARGET}
        sed -e 's/yy/ipf_yy/g' \
-               y.tab.h > ipf_y.h
+               y.tab.h > ${.TARGET:.c=.h}
+
+ipf_y.h: ipf_y.c
 
 ipf_l.c: lexer.c ipf_l.h ipf_y.h
+       ${_MKTARGET_CREATE}
        sed -e 's/yy/ipf_yy/g' \
             -e 's/y.tab.h/ipf_y.h/' \
             -e 's/lexer.h/ipf_l.h/' \
-               ${NETBSDSRCDIR}/dist/ipf/tools/lexer.c > ipf_l.c
+               ${NETBSDSRCDIR}/dist/ipf/tools/lexer.c > ${.TARGET}
 
-ipf_l.h: lexer.c
+ipf_l.h: lexer.h
+       ${_MKTARGET_CREATE}
        sed -e 's/yy/ipf_yy/g' \
-               ${NETBSDSRCDIR}/dist/ipf/tools/lexer.h > ipf_l.h
+           ${.ALLSRC} > ${.TARGET}
 
 BINDIR=                /sbin
 .if (${MKDYNAMICROOT} == "no")
diff -r eef79ff95008 -r bd51c78ecb96 usr.sbin/ipf/ipfstat/Makefile
--- a/usr.sbin/ipf/ipfstat/Makefile     Mon Mar 29 04:14:03 2004 +0000
+++ b/usr.sbin/ipf/ipfstat/Makefile     Mon Mar 29 04:39:59 2004 +0000
@@ -1,11 +1,11 @@
-#      $NetBSD: Makefile,v 1.16 2004/03/28 09:01:27 martti Exp $
+#      $NetBSD: Makefile,v 1.17 2004/03/29 04:40:01 lukem Exp $
+
+NOGCCERROR=    # defined
 
 PROG=          ipfstat
 SRCS=          ipfstat.c
 MAN=           ipfstat.8
 DPADD+=        ${LIBCURSES} ${LIBKVM}
-LDADD+=        -lcurses -lkvm -lipf
-
-NOGCCERROR=    # defined
+LDADD+=        -lcurses -lkvm
 
 .include <bsd.prog.mk>
diff -r eef79ff95008 -r bd51c78ecb96 usr.sbin/ipf/ipftest/Makefile
--- a/usr.sbin/ipf/ipftest/Makefile     Mon Mar 29 04:14:03 2004 +0000
+++ b/usr.sbin/ipf/ipftest/Makefile     Mon Mar 29 04:39:59 2004 +0000
@@ -1,4 +1,6 @@
-#      $NetBSD: Makefile,v 1.24 2004/03/29 02:30:08 jmc Exp $
+#      $NetBSD: Makefile,v 1.25 2004/03/29 04:40:02 lukem Exp $
+
+NOGCCERROR=    # defined
 
 .include <bsd.own.mk>
 
@@ -9,77 +11,91 @@
                ip_fil.c ip_log.c ippool_y.c ippool_l.c ipf_y.c \
                ipf_l.c ipnat_y.c ipnat_l.c md5.c radix.c bpf_filter.c
 MAN=           ipftest.1
-DPADD+=                ${LIBL}
-LDADD+=                -ll -lipf
 
 CPPFLAGS+=     -DIPFILTER_LOG -DIPFILTER_COMPILED -DIPFILTER_LOOKUP \
                -DIPFILTER_SCAN -DIPFILTER_SYNC -DIPFILTER_CKSUM
 
 .PATH:         ${NETBSDSRCDIR}/sys/netinet
 
-NOGCCERROR=    # defined
-
 CLEANFILES+=   ipf_y.c ipf_y.h
 CLEANFILES+=   ipf_l.c ipf_l.h
+CLEANFILES+=   ipf.tab.c ipf.tab.h
 CLEANFILES+=   ipnat_y.c ipnat_y.h
 CLEANFILES+=   ipnat_l.c ipnat_l.h
+CLEANFILES+=   ipnat.tab.c ipnat.tab.h
 CLEANFILES+=   ippool_y.c ippool_y.h
 CLEANFILES+=   ippool_l.c ippool_l.h
+CLEANFILES+=   ippool.tab.c ippool.tab.h
 
-ipnat_y.c ipnat_y.h: ipnat_y.y ipnat_l.h
-       ${YACC} -d ${NETBSDSRCDIR}/dist/ipf/tools/ipnat_y.y
+ipnat_y.c: ipnat_y.y ipnat_l.h
+       ${_MKTARGET_CREATE}
+       ${YACC} -b ipnat -d ${NETBSDSRCDIR}/dist/ipf/tools/ipnat_y.y
        sed -e 's/yy/ipnat_yy/g' \
            -e 's/y.tab.c/ipnat_y.c/' \
            -e s/\"ipnat_y.y\"/\"..\\/tools\\/ipnat_y.y\"/ \
-               y.tab.c > ipnat_y.c
+               ipnat.tab.c > ${.TARGET}
        sed -e 's/yy/ipnat_yy/g' \
            -e 's/y.tab.h/ipnat_y.h/' \
-               y.tab.h > ipnat_y.h
+               ipnat.tab.h > ${.TARGET:.c=.h}
+
+ipnat_y.h: ipnat_y.c
 
 ipnat_l.c: lexer.c ipnat_l.h ipnat_y.h
+       ${_MKTARGET_CREATE}
        sed -e 's/yy/ipnat_yy/g' \
            -e 's/y.tab.h/ipnat_y.h/' \
            -e 's/lexer.h/ipnat_l.h/' \
-               ${NETBSDSRCDIR}/dist/ipf/tools/lexer.c > ipnat_l.c
+               ${NETBSDSRCDIR}/dist/ipf/tools/lexer.c > ${.TARGET}
 
-ipnat_l.h: lexer.c
+ipnat_l.h: lexer.h
+       ${_MKTARGET_CREATE}
        sed -e 's/yy/ipnat_yy/g' \
-               ${NETBSDSRCDIR}/dist/ipf/tools/lexer.h > ipnat_l.h
+           ${.ALLSRC} > ${.TARGET}
 
-ippool_y.c ippool_y.h: ippool_y.y ippool_l.h
-       ${YACC} -d ${NETBSDSRCDIR}/dist/ipf/tools/ippool_y.y
+ippool_y.c: ippool_y.y ippool_l.h
+       ${_MKTARGET_CREATE}
+       ${YACC} -b ippool -d ${NETBSDSRCDIR}/dist/ipf/tools/ippool_y.y
        sed -e 's/yy/ippool_yy/g' \
            -e 's/"ippool_y.y"/"..\/tools\/ippool_y.y"/' \
-               y.tab.c > ippool_y.c
+               ippool.tab.c > ${.TARGET}
        sed -e 's/yy/ippool_yy/g' \
-               y.tab.h > ippool_y.h
+               ippool.tab.h > ${.TARGET:.c=.h}
+
+ippool_y.h: ippool_y.c
 
 ippool_l.c: lexer.c ippool_l.h ippool_y.h
+       ${_MKTARGET_CREATE}
        sed -e 's/yy/ippool_yy/g' \
            -e 's/y.tab.h/ippool_y.h/' \
            -e 's/lexer.h/ippool_l.h/' \
-               ${NETBSDSRCDIR}/dist/ipf/tools/lexer.c > ippool_l.c
+               ${NETBSDSRCDIR}/dist/ipf/tools/lexer.c > ${.TARGET}
 
 ippool_l.h: lexer.h
+       ${_MKTARGET_CREATE}
        sed -e 's/yy/ippool_yy/g' \
-               ${NETBSDSRCDIR}/dist/ipf/tools/lexer.h > ippool_l.h
+           ${.ALLSRC} > ${.TARGET}
 
-ipf_y.c ipf_y.h: ipf_y.y ipf_l.h
-       ${YACC} -d ${NETBSDSRCDIR}/dist/ipf/tools/ipf_y.y
+ipf_y.c: ipf_y.y ipf_l.h
+       ${_MKTARGET_CREATE}
+       ${YACC} -b ipf -d ${NETBSDSRCDIR}/dist/ipf/tools/ipf_y.y
        sed -e 's/yy/ipf_yy/g' \
            -e 's/"ipf_y.y"/"..\/tools\/ipf_y.y"/' \
-               y.tab.c > ipf_y.c
+               ipf.tab.c > ${.TARGET}
        sed -e 's/yy/ipf_yy/g' \
-               y.tab.h > ipf_y.h
+               ipf.tab.h > ${.TARGET:.c=.h}
+
+ipf_y.h: ipf_y.c
 
 ipf_l.c: lexer.c ipf_l.h ipf_y.h
+       ${_MKTARGET_CREATE}
        sed -e 's/yy/ipf_yy/g' \
             -e 's/y.tab.h/ipf_y.h/' \
             -e 's/lexer.h/ipf_l.h/' \
-               ${NETBSDSRCDIR}/dist/ipf/tools/lexer.c > ipf_l.c
+               ${NETBSDSRCDIR}/dist/ipf/tools/lexer.c > ${.TARGET}
 
-ipf_l.h: lexer.c
+ipf_l.h: lexer.h
+       ${_MKTARGET_CREATE}
        sed -e 's/yy/ipf_yy/g' \
-               ${NETBSDSRCDIR}/dist/ipf/tools/lexer.h > ipf_l.h
+           ${.ALLSRC} > ${.TARGET}
 
 .include <bsd.prog.mk>
diff -r eef79ff95008 -r bd51c78ecb96 usr.sbin/ipf/ipmon/Makefile
--- a/usr.sbin/ipf/ipmon/Makefile       Mon Mar 29 04:14:03 2004 +0000
+++ b/usr.sbin/ipf/ipmon/Makefile       Mon Mar 29 04:39:59 2004 +0000
@@ -1,32 +1,35 @@
-#      $NetBSD: Makefile,v 1.17 2004/03/29 02:30:08 jmc Exp $
+#      $NetBSD: Makefile,v 1.18 2004/03/29 04:40:03 lukem Exp $
 
 PROG=          ipmon
 SRCS=          ipmon.c ipmon_y.c ipmon_l.c
 MAN=           ipmon.8
-DPADD+=                ${LIBL}
-LDADD+=                -ll -lipf
 
 CPPFLAGS+=     -DLOGFAC=LOG_LOCAL0
 
 CLEANFILES+=   ipmon_y.c ipmon_y.h
 CLEANFILES+=   ipmon_l.c ipmon_l.h
 
-ipmon_y.c ipmon_y.h: ipmon_y.y ipmon_l.h
+ipmon_y.c: ipmon_y.y ipmon_l.h
+       ${_MKTARGET_CREATE}
        ${YACC} -d ${NETBSDSRCDIR}/dist/ipf/tools/ipmon_y.y
        sed -e 's/yy/ipmon_yy/g' \
            -e 's/"ipmon_y.y"/"..\/tools\/ipmon_y.y"/' \
-               y.tab.c > ipmon_y.c
+               y.tab.c > ${.TARGET}
        sed -e 's/yy/ipmon_yy/g' \
-               y.tab.h > ipmon_y.h
+               y.tab.h > ${.TARGET:.c=.h}
+
+ipmon_y.h: ipmon_y.c
 
 ipmon_l.c: lexer.c ipmon_l.h ipmon_y.h
+       ${_MKTARGET_CREATE}
        sed -e 's/yy/ipmon_yy/g' \
             -e 's/y.tab.h/ipmon_y.h/' \
             -e 's/lexer.h/ipmon_l.h/' \
-               ${NETBSDSRCDIR}/dist/ipf/tools/lexer.c > ipmon_l.c
+               ${NETBSDSRCDIR}/dist/ipf/tools/lexer.c > ${.TARGET}
 
-ipmon_l.h: lexer.c
+ipmon_l.h: lexer.h
+       ${_MKTARGET_CREATE}
        sed -e 's/yy/ipmon_yy/g' \
-               ${NETBSDSRCDIR}/dist/ipf/tools/lexer.h > ipmon_l.h
+           ${.ALLSRC} > ${.TARGET}
 
 .include <bsd.prog.mk>
diff -r eef79ff95008 -r bd51c78ecb96 usr.sbin/ipf/ipnat/Makefile
--- a/usr.sbin/ipf/ipnat/Makefile       Mon Mar 29 04:14:03 2004 +0000
+++ b/usr.sbin/ipf/ipnat/Makefile       Mon Mar 29 04:39:59 2004 +0000
@@ -1,33 +1,38 @@
-#      $NetBSD: Makefile,v 1.19 2004/03/29 02:30:09 jmc Exp $
+#      $NetBSD: Makefile,v 1.20 2004/03/29 04:40:03 lukem Exp $
 
 PROG=          ipnat
 SRCS=          ipnat.c ipnat_y.c ipnat_l.c
 MAN=           ipnat.8 ipnat.4 ipnat.5
 MLINKS=                ipnat.5 ipnat.conf.5
-DPADD+=                ${LIBKVM} ${LIBL}
-LDADD+=                -lkvm -ll -lipf
+DPADD+=                ${LIBKVM}
+LDADD+=                -lkvm
 
 CLEANFILES+=   ipnat_y.c ipnat_y.h
 CLEANFILES+=   ipnat_l.c ipnat_l.h
 
-ipnat_y.c ipnat_y.h: ipnat_y.y ipnat_l.h
+ipnat_y.c: ipnat_y.y ipnat_l.h
+       ${_MKTARGET_CREATE}
        ${YACC} -d ${NETBSDSRCDIR}/dist/ipf/tools/ipnat_y.y
        sed -e 's/yy/ipnat_yy/g' \
            -e 's/y.tab.c/ipnat_y.c/' \
            -e s/\"ipnat_y.y\"/\"..\\/tools\\/ipnat_y.y\"/ \
-               y.tab.c > ipnat_y.c
+               y.tab.c > ${.TARGET}
        sed -e 's/yy/ipnat_yy/g' \
            -e 's/y.tab.h/ipnat_y.h/' \
-               y.tab.h > ipnat_y.h
+               y.tab.h > ${.TARGET:.c=.h}
+
+ipnat_y.h: ipnat_y.c
 
 ipnat_l.c: lexer.c ipnat_l.h ipnat_y.h
+       ${_MKTARGET_CREATE}



Home | Main Index | Thread Index | Old Index