Page MenuHomeFreeBSD

libsysdecode: automate tables.h dependency generation
AbandonedPublic

Authored by emaste on Jul 25 2019, 4:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Mar 22, 6:27 AM
Unknown Object (File)
Jan 5 2024, 12:05 PM
Unknown Object (File)
Jan 5 2024, 12:05 PM
Unknown Object (File)
Jan 5 2024, 12:05 PM
Unknown Object (File)
Jan 5 2024, 11:53 AM
Unknown Object (File)
Dec 20 2023, 3:29 AM
Unknown Object (File)
Nov 7 2023, 11:56 PM
Unknown Object (File)
Sep 16 2023, 3:35 AM
Subscribers

Details

Summary

Add a -d option to mktables to emit the dependency list, and invoke it from the Makefile to add the result (with the include directory prepended) to the tables.h dependency list.

PR: 238828

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

emaste added inline comments.
lib/libsysdecode/Makefile
127–130

@bdrewery does this need to be wrapped in a .if !defined(_SKIP_BUILD)?

imp added inline comments.
lib/libsysdecode/Makefile
127–130

I think it does, but I'm far from certain.

lib/libsysdecode/Makefile
127–130

It should only be a perf issue if not there I think, but some testing (to the extent that I understand this part of the build system) suggests it works with a _SKIP_BUILD test here.

Wrap in .if !defined(_SKIP_BUILD)

lib/libsysdecode/Makefile
127–130

Yes please. _SKIP_BUILD is for some treewalks that are not building anything so don't need to know dependencies.

Having said that I don't see this this change is needed. There's already a .depend file here for this exact thing. rS308602 was the start of that.

This already has .depend file support. Why is this needed?

~/git/freebsd2/lib/libsysdecode # less obj/.depend.tables.h.tmp
tables.h.tmp: \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/aio.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/netgraph/bluetooth/include/ng_btsocket.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/netinet/in.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/netinet/sctp.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/netinet/sctp_uio.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/netinet/tcp.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/netinet/udp.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/netinet/udplite.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/netinet6/in6.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/nfs/nfssvc.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/sched.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/sys/acl.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/sys/capsicum.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/sys/event.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/sys/extattr.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/sys/fcntl.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/sys/linker.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/sys/mman.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/sys/mount.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/sys/procctl.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/sys/ptrace.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/sys/reboot.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/sys/resource.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/sys/rtprio.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/sys/shm.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/sys/signal.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/sys/socket.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/sys/stat.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/sys/thr.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/sys/umtx.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/sys/unistd.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/sys/wait.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/ufs/ufs/quota.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/vm/vm.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/vm/vm_param.h \
        /scratch/obj/root/git/freebsd2/amd64.amd64/tmp/usr/include/x86/sysarch.h \
This revision now requires changes to proceed.Aug 16 2019, 7:43 PM

The hacks to using tables.h.tmp is probably what broke my work.

Something like this is probably needed instead

~/git/freebsd2/lib/libsysdecode # git diff
diff --git lib/libsysdecode/Makefile lib/libsysdecode/Makefile
index 2be244a6da46..9edfe067063c 100644
--- lib/libsysdecode/Makefile
+++ lib/libsysdecode/Makefile
@@ -127,7 +127,8 @@ incdir=${SYSROOT:U${DESTDIR}}${INCLUDEDIR}
 tables.h: mktables ${incdir}/netinet/in.h ${incdir}/netinet/tcp.h \
     ${incdir}/netinet6/in6.h
        sh ${.CURDIR}/mktables ${incdir} ${.TARGET}.tmp && \
-           mv -f ${.TARGET}.tmp ${.TARGET}
+           mv -f ${.TARGET}.tmp ${.TARGET} && \
+           mv -f .depend.${.TARGET}.tmp .depend.${.TARGET}

And the tables.h.tmp: needs to be tables.h: in the depend file.

Really just stop the .tmp nonsense somehow.