diff options
author | bde <bde@FreeBSD.org> | 1999-11-28 17:52:40 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1999-11-28 17:52:40 +0000 |
commit | b4f2600d8eb5a83d345f756030cb2cf8f8ec5e77 (patch) | |
tree | 8242d85525f148340eec7c05d2c2029ee6898ff8 /share/mk | |
parent | c08e8bdab034508e671d6fb41eb590407fb70fad (diff) | |
download | FreeBSD-src-b4f2600d8eb5a83d345f756030cb2cf8f8ec5e77.zip FreeBSD-src-b4f2600d8eb5a83d345f756030cb2cf8f8ec5e77.tar.gz |
Build and clean device interface files (foo_if.[ch]) and empty options
files (opt_*.h) automatically (if they are in ${SRCS}).
Clean vnode_if.[ch] automatically (if one of them is in ${SRCS}, not just
if VFS_KLD is defined).
There are some complications to avoid using the "@" symlink before it
is built.
Diffstat (limited to 'share/mk')
-rw-r--r-- | share/mk/bsd.kmod.mk | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/share/mk/bsd.kmod.mk b/share/mk/bsd.kmod.mk index 4ec6184..62d755d 100644 --- a/share/mk/bsd.kmod.mk +++ b/share/mk/bsd.kmod.mk @@ -111,7 +111,6 @@ CFLAGS+= -I${DESTDIR}/usr/include .if defined(VFS_KLD) SRCS+= vnode_if.h -CLEANFILES+= vnode_if.h vnode_if.c .endif .if ${OBJFORMAT} == elf @@ -261,9 +260,39 @@ KERN= ${.CURDIR}/../../kern KERN= ${.CURDIR}/../../sys/kern .endif -.ORDER: vnode_if.c vnode_if.h -vnode_if.c vnode_if.h: ${KERN}/vnode_if.sh ${KERN}/vnode_if.src - sh ${KERN}/vnode_if.sh ${KERN}/vnode_if.src +.for _src in ${SRCS:Mopt_*.h} +CLEANFILES+= ${_src} +.if !target(${_src}) +${_src}: + touch ${.TARGET} +.endif +.endfor + +.for _srcsrc in kern/bus_if.m kern/device_if.m dev/iicbus/iicbb_if.m \ + dev/iicbus/iicbus_if.m isa/isa_if.m dev/mii/miibus_if.m pci/pci_if.m \ + dev/smbus/smbus_if.m dev/usb/usb_if.m +.for _ext in c h +.for _src in ${SRCS:M${_srcsrc:T:R}.${_ext}} +CLEANFILES+= ${_src} +.if !target(${_src}) +${_src}: @ +.if exists(@) +${_src}: @/kern/makedevops.pl @/${_srcsrc} +.endif + perl @/kern/makedevops.pl -${_ext} @/${_srcsrc} +.endif +.endfor # _src +.endfor # _ext +.endfor # _srcsrc + +.if ${SRCS:Mvnode_if.[ch]} != "" +CLEANFILES+= vnode_if.c vnode_if.h +vnode_if.c vnode_if.h: @ +.if exists(@) +vnode_if.c vnode_if.h: @/kern/vnode_if.sh @/kern/vnode_if.src +.endif + sh @/kern/vnode_if.sh @/kern/vnode_if.src +.endif regress: |