From owner-svn-src-all@freebsd.org Sun Nov 13 00:11:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDB68C3EC8E; Sun, 13 Nov 2016 00:11:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8200D1082; Sun, 13 Nov 2016 00:11:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAD0BCFo094248; Sun, 13 Nov 2016 00:11:12 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAD0BCP4094246; Sun, 13 Nov 2016 00:11:12 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201611130011.uAD0BCP4094246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 13 Nov 2016 00:11:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308602 - head/lib/libsysdecode X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Nov 2016 00:11:14 -0000 Author: bdrewery Date: Sun Nov 13 00:11:12 2016 New Revision: 308602 URL: https://svnweb.freebsd.org/changeset/base/308602 Log: Generate and use a proper .depend file for tables.h. Reported by: jhb MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libsysdecode/Makefile head/lib/libsysdecode/mktables Modified: head/lib/libsysdecode/Makefile ============================================================================== --- head/lib/libsysdecode/Makefile Sun Nov 13 00:11:09 2016 (r308601) +++ head/lib/libsysdecode/Makefile Sun Nov 13 00:11:12 2016 (r308602) @@ -110,8 +110,9 @@ CFLAGS.gcc.ioctl.c+= -Wno-unused CFLAGS.gcc+= ${CFLAGS.gcc.${.IMPSRC}} +DEPENDOBJS+= tables.h tables.h: mktables - sh ${.CURDIR}/mktables ${DESTDIR}${INCLUDEDIR} > ${.TARGET} + sh ${.CURDIR}/mktables ${DESTDIR}${INCLUDEDIR} ${.TARGET} ioctl.c: mkioctls env MACHINE=${MACHINE} CPP="${CPP}" \ Modified: head/lib/libsysdecode/mktables ============================================================================== --- head/lib/libsysdecode/mktables Sun Nov 13 00:11:09 2016 (r308601) +++ head/lib/libsysdecode/mktables Sun Nov 13 00:11:12 2016 (r308602) @@ -37,11 +37,16 @@ LC_ALL=C; export LC_ALL if [ -z "$1" ] then - echo "usage: sh $0 include-dir" + echo "usage: sh $0 include-dir [output-file]" exit 1 fi include_dir=$1 +if [ -n "$2" ]; then + output_file="$2" + exec > "$output_file" +fi +all_headers= # # Generate a table C #definitions. The including file can define the # TABLE_NAME(n), TABLE_ENTRY(x), and TABLE_END macros to define what @@ -60,6 +65,7 @@ gen_table() else filter="egrep -v" fi + all_headers="${all_headers:+${all_headers} }${file}" cat <<_EOF_ TABLE_START(${name}) _EOF_ @@ -142,3 +148,12 @@ gen_table "sigcode" "SI_[A-Z]+[[ gen_table "umtxcvwaitflags" "CVWAIT_[A-Z_]+[[:space:]]+0x[0-9]+" "sys/umtx.h" gen_table "umtxrwlockflags" "URWLOCK_PREFER_READER[[:space:]]+0x[0-9]+" "sys/umtx.h" gen_table "caprights" "CAP_[A-Z_]+[[:space:]]+CAPRIGHT\([0-9],[[:space:]]+0x[0-9]{16}ULL\)" "sys/capsicum.h" + +# Generate a .depend file for our output file +if [ -n "$output_file" ]; then + echo "$output_file: \\" > ".depend.$output_file" + echo "$all_headers" | tr ' ' '\n' | sort -u | + sed -e "s,^, $include_dir/," -e 's,$, \\,' >> \ + ".depend.$output_file" + echo >> ".depend.$output_file" +fi