Kill MFILES and find things automatically. It turned out to be only
lightly used. Find the proper .m file when we depend on *_if.[ch] in the srcs line, with seat-belts for false positive matches. This uses make's path mechanism. A further refinement would be to calculate this once, and then pass the resulting _MPATH to modules submakes. Differential Revision: https://reviews.freebsd.org/D2327
This commit is contained in:
parent
e2a78b0008
commit
12f05b8446
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=285068
@ -28,9 +28,6 @@
|
||||
#
|
||||
# KMODUNLOAD Command to unload a kernel module [/sbin/kldunload]
|
||||
#
|
||||
# MFILES Optionally a list of interfaces used by the module.
|
||||
# This file contains a default list of interfaces.
|
||||
#
|
||||
# PROG The name of the kernel module to build.
|
||||
# If not supplied, ${KMOD}.ko is used.
|
||||
#
|
||||
@ -72,7 +69,7 @@ OBJCOPY?= objcopy
|
||||
.include <bsd.compiler.mk>
|
||||
.include "config.mk"
|
||||
|
||||
.SUFFIXES: .out .o .c .cc .cxx .C .y .l .s .S
|
||||
.SUFFIXES: .out .o .c .cc .cxx .C .y .l .s .S .m
|
||||
|
||||
# amd64 and mips use direct linking for kmod, all others use shared binaries
|
||||
.if ${MACHINE_CPUARCH} != amd64 && ${MACHINE_CPUARCH} != mips
|
||||
@ -339,37 +336,6 @@ ${_src}:
|
||||
# Respect configuration-specific C flags.
|
||||
CFLAGS+= ${CONF_CFLAGS}
|
||||
|
||||
MFILES?= dev/acpica/acpi_if.m dev/acpi_support/acpi_wmi_if.m \
|
||||
dev/agp/agp_if.m dev/ata/ata_if.m dev/eisa/eisa_if.m \
|
||||
dev/fb/fb_if.m dev/gpio/gpio_if.m dev/gpio/gpiobus_if.m \
|
||||
dev/iicbus/iicbb_if.m dev/iicbus/iicbus_if.m \
|
||||
dev/mbox/mbox_if.m dev/mmc/mmcbr_if.m dev/mmc/mmcbus_if.m \
|
||||
dev/mii/miibus_if.m dev/mvs/mvs_if.m dev/ofw/ofw_bus_if.m \
|
||||
dev/pccard/card_if.m dev/pccard/power_if.m dev/pci/pci_if.m \
|
||||
dev/pci/pci_iov_if.m dev/pci/pcib_if.m dev/ppbus/ppbus_if.m \
|
||||
dev/sdhci/sdhci_if.m dev/smbus/smbus_if.m dev/spibus/spibus_if.m \
|
||||
dev/sound/pci/hda/hdac_if.m \
|
||||
dev/sound/pcm/ac97_if.m dev/sound/pcm/channel_if.m \
|
||||
dev/sound/pcm/feeder_if.m dev/sound/pcm/mixer_if.m \
|
||||
dev/sound/midi/mpu_if.m dev/sound/midi/mpufoi_if.m \
|
||||
dev/sound/midi/synth_if.m dev/usb/usb_if.m isa/isa_if.m \
|
||||
kern/bus_if.m kern/clock_if.m \
|
||||
kern/cpufreq_if.m kern/device_if.m kern/serdev_if.m \
|
||||
libkern/iconv_converter_if.m opencrypto/cryptodev_if.m \
|
||||
pc98/pc98/canbus_if.m dev/etherswitch/mdio_if.m
|
||||
|
||||
.for _srcsrc in ${MFILES}
|
||||
.for _ext in c h
|
||||
.for _src in ${SRCS:M${_srcsrc:T:R}.${_ext}}
|
||||
CLEANFILES+= ${_src}
|
||||
.if !target(${_src})
|
||||
${_src}: ${SYSDIR}/tools/makeobjops.awk ${SYSDIR}/${_srcsrc}
|
||||
${AWK} -f ${SYSDIR}/tools/makeobjops.awk ${SYSDIR}/${_srcsrc} -${_ext}
|
||||
.endif
|
||||
.endfor # _src
|
||||
.endfor # _ext
|
||||
.endfor # _srcsrc
|
||||
|
||||
.if !empty(SRCS:Mvnode_if.c)
|
||||
CLEANFILES+= vnode_if.c
|
||||
vnode_if.c: ${SYSDIR}/tools/vnode_if.awk ${SYSDIR}/kern/vnode_if.src
|
||||
@ -388,6 +354,21 @@ vnode_if_typedef.h:
|
||||
${AWK} -f ${SYSDIR}/tools/vnode_if.awk ${SYSDIR}/kern/vnode_if.src -q
|
||||
.endif
|
||||
|
||||
# Build _if.[ch] from _if.m, and clean them when we're done.
|
||||
__MPATH!=find ${SYSDIR:tA}/ -name \*_if.m
|
||||
_MPATH=${__MPATH:H:O:u}
|
||||
.PATH.m: ${_MPATH}
|
||||
.for _s in ${SRCS:M*_if.[ch]}
|
||||
.if eixsts(${_s:R}.m})
|
||||
CLEANFILES+= ${_s}
|
||||
.endif
|
||||
.endfor # _s
|
||||
.m.c: ${SYSDIR}/tools/makeobjops.awk
|
||||
${AWK} -f ${SYSDIR}/tools/makeobjops.awk ${.IMPSRC} -c
|
||||
|
||||
.m.h: ${SYSDIR}/tools/makeobjops.awk
|
||||
${AWK} -f ${SYSDIR}/tools/makeobjops.awk ${.IMPSRC} -h
|
||||
|
||||
.for _i in mii pccard
|
||||
.if !empty(SRCS:M${_i}devs.h)
|
||||
CLEANFILES+= ${_i}devs.h
|
||||
|
@ -19,7 +19,6 @@ SRCS+= agp_apple.c
|
||||
.endif
|
||||
SRCS+= device_if.h bus_if.h agp_if.h pci_if.h
|
||||
SRCS+= opt_agp.h
|
||||
MFILES= kern/device_if.m kern/bus_if.m dev/agp/agp_if.m dev/pci/pci_if.m
|
||||
|
||||
EXPORT_SYMS= agp_find_device \
|
||||
agp_state \
|
||||
|
@ -7,6 +7,4 @@ SRCS= g_part_apm.c
|
||||
|
||||
SRCS+= bus_if.h device_if.h g_part_if.h
|
||||
|
||||
MFILES= kern/bus_if.m kern/device_if.m geom/part/g_part_if.m
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
|
@ -7,6 +7,4 @@ SRCS= g_part_bsd.c geom_bsd_enc.c
|
||||
|
||||
SRCS+= bus_if.h device_if.h g_part_if.h
|
||||
|
||||
MFILES= kern/bus_if.m kern/device_if.m geom/part/g_part_if.m
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
|
@ -7,6 +7,4 @@ SRCS= g_part_bsd64.c
|
||||
|
||||
SRCS+= bus_if.h device_if.h g_part_if.h
|
||||
|
||||
MFILES= kern/bus_if.m kern/device_if.m geom/part/g_part_if.m
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
|
@ -8,6 +8,4 @@ SRCS= g_part_ebr.c
|
||||
SRCS+= bus_if.h device_if.h g_part_if.h
|
||||
SRCS+= opt_geom.h
|
||||
|
||||
MFILES= kern/bus_if.m kern/device_if.m geom/part/g_part_if.m
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
|
@ -7,6 +7,4 @@ SRCS= g_part_gpt.c
|
||||
|
||||
SRCS+= bus_if.h device_if.h g_part_if.h
|
||||
|
||||
MFILES= kern/bus_if.m kern/device_if.m geom/part/g_part_if.m
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
|
@ -7,6 +7,4 @@ SRCS= g_part_ldm.c
|
||||
|
||||
SRCS+= bus_if.h device_if.h g_part_if.h
|
||||
|
||||
MFILES= kern/bus_if.m kern/device_if.m geom/part/g_part_if.m
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
|
@ -7,6 +7,4 @@ SRCS= g_part_mbr.c
|
||||
|
||||
SRCS+= bus_if.h device_if.h g_part_if.h
|
||||
|
||||
MFILES= kern/bus_if.m kern/device_if.m geom/part/g_part_if.m
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
|
@ -7,6 +7,4 @@ SRCS= g_part_pc98.c
|
||||
|
||||
SRCS+= bus_if.h device_if.h g_part_if.h
|
||||
|
||||
MFILES= kern/bus_if.m kern/device_if.m geom/part/g_part_if.m
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
|
@ -7,6 +7,4 @@ SRCS= g_part_vtoc8.c
|
||||
|
||||
SRCS+= bus_if.h device_if.h g_part_if.h
|
||||
|
||||
MFILES= kern/bus_if.m kern/device_if.m geom/part/g_part_if.m
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
|
@ -13,7 +13,4 @@ SRCS+= md_ddf.c md_intel.c md_jmicron.c md_nvidia.c md_promise.c md_sii.c
|
||||
|
||||
SRCS+= tr_concat.c tr_raid0.c tr_raid1.c tr_raid1e.c tr_raid5.c
|
||||
|
||||
MFILES= kern/bus_if.m kern/device_if.m
|
||||
MFILES+= geom/raid/g_raid_md_if.m geom/raid/g_raid_tr_if.m
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
|
@ -36,7 +36,6 @@ SRCS+= rpcsec_gss.c \
|
||||
svc_rpcsec_gss.c
|
||||
|
||||
SRCS+= kgss_if.h kgss_if.c
|
||||
MFILES= kgssapi/kgss_if.m
|
||||
|
||||
SRCS+= gssd.h gssd_xdr.c gssd_clnt.c
|
||||
CLEANFILES= gssd.h gssd_xdr.c gssd_clnt.c
|
||||
|
@ -12,7 +12,6 @@ SRCS= krb5_mech.c \
|
||||
opt_inet6.h
|
||||
|
||||
SRCS+= kgss_if.h gssd.h
|
||||
MFILES= kgssapi/kgss_if.m
|
||||
CLEANFILES= gssd.h
|
||||
|
||||
S= ${.CURDIR}/../..
|
||||
|
@ -5,6 +5,4 @@
|
||||
KMOD= ksyms
|
||||
SRCS= ksyms.c linker_if.h
|
||||
|
||||
MFILES= kern/linker_if.m
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
|
@ -6,7 +6,6 @@ KMOD= libiconv
|
||||
SRCS= iconv.c iconv_ucs.c iconv_xlat.c iconv_xlat16.c
|
||||
SRCS+= iconv.h
|
||||
SRCS+= iconv_converter_if.c iconv_converter_if.h
|
||||
MFILES= libkern/iconv_converter_if.m
|
||||
|
||||
EXPORT_SYMS= iconv_add \
|
||||
iconv_open \
|
||||
|
@ -5,6 +5,4 @@
|
||||
KMOD= mvs
|
||||
SRCS= mvs.c mvs_pci.c mvs.h mvs_if.c mvs_if.h device_if.h bus_if.h pci_if.h opt_cam.h
|
||||
|
||||
MFILES= kern/bus_if.m kern/device_if.m dev/pci/pci_if.m dev/mvs/mvs_if.m
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
|
@ -7,7 +7,4 @@ SRCS= nand.c nand_bbt.c nand_cdev.c nand_generic.c nand_geom.c \
|
||||
nand_id.c nandbus.c nandbus_if.c nand_if.c nfc_if.c \
|
||||
nand_if.h device_if.h bus_if.h nfc_if.h nandbus_if.h
|
||||
|
||||
MFILES= kern/bus_if.m kern/device_if.m dev/nand/nfc_if.m \
|
||||
dev/nand/nand_if.m dev/nand/nandbus_if.m
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
|
@ -5,7 +5,5 @@
|
||||
KMOD= nandsim
|
||||
SRCS= nandsim.c nandsim_chip.c nandsim_swap.c nandsim_ctrl.c nandsim_log.c\
|
||||
bus_if.h device_if.h vnode_if.h nfc_if.h nand_if.h
|
||||
MFILES= kern/bus_if.m kern/device_if.m\
|
||||
dev/nand/nfc_if.m dev/nand/nand_if.m
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
|
@ -15,10 +15,4 @@ SRCS+= \
|
||||
isa_if.h \
|
||||
pci_if.h
|
||||
|
||||
MFILES= \
|
||||
dev/pci/pci_if.m \
|
||||
isa/isa_if.m \
|
||||
kern/bus_if.m \
|
||||
kern/device_if.m
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
|
@ -8,7 +8,4 @@ SRCS= puc.c puc_cfg.c puc_pci.c puc_pccard.c pucdata.c
|
||||
SRCS+= bus_if.h device_if.h serdev_if.c serdev_if.h \
|
||||
card_if.h pci_if.h
|
||||
|
||||
MFILES= kern/bus_if.m kern/device_if.m kern/serdev_if.m \
|
||||
dev/pccard/card_if.m dev/pci/pci_if.m
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
|
@ -14,7 +14,4 @@ SRCS= ${scc_bfe} scc_core.c scc_if.c scc_if.h \
|
||||
scc_dev_sab82532.c scc_dev_z8530.c
|
||||
SRCS+= bus_if.h device_if.h ofw_bus_if.h serdev_if.c serdev_if.h
|
||||
|
||||
MFILES= dev/ofw/ofw_bus_if.m dev/scc/scc_if.m \
|
||||
kern/bus_if.m kern/device_if.m kern/serdev_if.m
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
|
@ -36,8 +36,4 @@ SRCS+= bus_if.h card_if.h device_if.h isa_if.h ${ofw_bus_if} pci_if.h \
|
||||
power_if.h pccarddevs.h serdev_if.h
|
||||
SRCS+= opt_platform.h
|
||||
|
||||
MFILES= dev/pccard/card_if.m dev/pccard/power_if.m dev/pci/pci_if.m \
|
||||
dev/ofw/ofw_bus_if.m dev/uart/uart_if.m isa/isa_if.m kern/bus_if.m \
|
||||
kern/device_if.m kern/serdev_if.m
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
|
@ -30,7 +30,4 @@ SRCS= virtio_balloon.c
|
||||
SRCS+= virtio_bus_if.h virtio_if.h
|
||||
SRCS+= bus_if.h device_if.h
|
||||
|
||||
MFILES= kern/bus_if.m kern/device_if.m \
|
||||
dev/virtio/virtio_bus_if.m dev/virtio/virtio_if.m
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
|
@ -30,7 +30,4 @@ SRCS= virtio_blk.c
|
||||
SRCS+= virtio_bus_if.h virtio_if.h
|
||||
SRCS+= bus_if.h device_if.h
|
||||
|
||||
MFILES= kern/bus_if.m kern/device_if.m \
|
||||
dev/virtio/virtio_bus_if.m dev/virtio/virtio_if.m
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
|
@ -30,7 +30,4 @@ SRCS= virtio_console.c
|
||||
SRCS+= virtio_bus_if.h virtio_if.h
|
||||
SRCS+= bus_if.h device_if.h
|
||||
|
||||
MFILES= kern/bus_if.m kern/device_if.m \
|
||||
dev/virtio/virtio_bus_if.m dev/virtio/virtio_if.m
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
|
@ -31,7 +31,4 @@ SRCS+= virtio_bus_if.h virtio_if.h
|
||||
SRCS+= bus_if.h device_if.h
|
||||
SRCS+= opt_inet.h opt_inet6.h
|
||||
|
||||
MFILES= kern/bus_if.m kern/device_if.m \
|
||||
dev/virtio/virtio_bus_if.m dev/virtio/virtio_if.m
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
|
@ -30,7 +30,4 @@ SRCS= virtio_pci.c
|
||||
SRCS+= virtio_bus_if.h virtio_if.h
|
||||
SRCS+= bus_if.h device_if.h pci_if.h
|
||||
|
||||
MFILES= kern/bus_if.m kern/device_if.m dev/pci/pci_if.m \
|
||||
dev/virtio/virtio_bus_if.m dev/virtio/virtio_if.m
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
|
@ -30,7 +30,4 @@ SRCS= virtio_random.c
|
||||
SRCS+= virtio_bus_if.h virtio_if.h
|
||||
SRCS+= bus_if.h device_if.h
|
||||
|
||||
MFILES= kern/bus_if.m kern/device_if.m \
|
||||
dev/virtio/virtio_bus_if.m dev/virtio/virtio_if.m
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
|
@ -30,7 +30,4 @@ SRCS= virtio_scsi.c
|
||||
SRCS+= virtio_bus_if.h virtio_if.h
|
||||
SRCS+= bus_if.h device_if.h opt_scsi.h opt_cam.h
|
||||
|
||||
MFILES= kern/bus_if.m kern/device_if.m \
|
||||
dev/virtio/virtio_bus_if.m dev/virtio/virtio_if.m
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
|
@ -32,7 +32,4 @@ SRCS+= virtio_bus_if.c virtio_bus_if.h
|
||||
SRCS+= virtio_if.c virtio_if.h
|
||||
SRCS+= bus_if.h device_if.h
|
||||
|
||||
MFILES= kern/bus_if.m kern/device_if.m \
|
||||
dev/virtio/virtio_bus_if.m dev/virtio/virtio_if.m
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
|
Loading…
Reference in New Issue
Block a user