Index: lib/libsysdecode/Makefile =================================================================== --- lib/libsysdecode/Makefile +++ lib/libsysdecode/Makefile @@ -124,8 +124,10 @@ DEPENDOBJS+= tables.h incdir=${SYSROOT:U${DESTDIR}}${INCLUDEDIR} -tables.h: mktables ${incdir}/netinet/in.h ${incdir}/netinet/tcp.h \ - ${incdir}/netinet6/in6.h +.if !defined(_SKIP_BUILD) +tblhdrs!=sh ${.CURDIR}/mktables -d ${incdir} | sort -u +.endif +tables.h: mktables ${tblhdrs:S?^?${incdir}/?} sh ${.CURDIR}/mktables ${incdir} ${.TARGET}.tmp && \ mv -f ${.TARGET}.tmp ${.TARGET} Index: lib/libsysdecode/mktables =================================================================== --- lib/libsysdecode/mktables +++ lib/libsysdecode/mktables @@ -37,9 +37,13 @@ if [ -z "$1" ] then - echo "usage: sh $0 include-dir [output-file]" + echo "usage: sh $0 [-d] include-dir [output-file]" exit 1 fi +if [ $1 = "-d" ]; then + emit_deps=1 + shift +fi include_dir=$1 if [ -n "$2" ]; then output_file="$2" @@ -60,6 +64,11 @@ file=$3 excl=$4 + if [ -n "$emit_deps" ]; then + echo $file + return + fi + if [ -z "$excl" ]; then filter="cat" else @@ -84,10 +93,12 @@ _EOF_ } -cat <<_EOF_ +if [ -z "$emit_deps" ]; then + cat <<_EOF_ /* This file is auto-generated. */ _EOF_ +fi gen_table "accessmode" "[A-Z]_OK[[:space:]]+0?x?[0-9A-Fa-f]+" "sys/unistd.h" gen_table "acltype" "ACL_TYPE_[A-Z4_]+[[:space:]]+0x[0-9]+" "sys/acl.h"