aboutsummaryrefslogtreecommitdiff
path: root/sys/modules
diff options
context:
space:
mode:
Diffstat (limited to 'sys/modules')
-rw-r--r--sys/modules/3dfx/Makefile11
-rw-r--r--sys/modules/3dfx_linux/Makefile7
-rw-r--r--sys/modules/Makefile916
-rw-r--r--sys/modules/Makefile.inc2
-rw-r--r--sys/modules/aac/Makefile17
-rw-r--r--sys/modules/aac/Makefile.inc2
-rw-r--r--sys/modules/aac/aac_linux/Makefile7
-rw-r--r--sys/modules/aacraid/Makefile20
-rw-r--r--sys/modules/aacraid/Makefile.inc2
-rw-r--r--sys/modules/aacraid/aacraid_linux/Makefile7
-rw-r--r--sys/modules/accf_data/Makefile7
-rw-r--r--sys/modules/accf_dns/Makefile7
-rw-r--r--sys/modules/accf_http/Makefile7
-rw-r--r--sys/modules/acl_nfs4/Makefile6
-rw-r--r--sys/modules/acl_posix1e/Makefile6
-rw-r--r--sys/modules/acpi/Makefile6
-rw-r--r--sys/modules/acpi/Makefile.inc2
-rw-r--r--sys/modules/acpi/acpi_asus/Makefile8
-rw-r--r--sys/modules/acpi/acpi_asus_wmi/Makefile8
-rw-r--r--sys/modules/acpi/acpi_dock/Makefile7
-rw-r--r--sys/modules/acpi/acpi_fujitsu/Makefile8
-rw-r--r--sys/modules/acpi/acpi_ged/Makefile7
-rw-r--r--sys/modules/acpi/acpi_hp/Makefile8
-rw-r--r--sys/modules/acpi/acpi_ibm/Makefile7
-rw-r--r--sys/modules/acpi/acpi_panasonic/Makefile7
-rw-r--r--sys/modules/acpi/acpi_rapidstart/Makefile7
-rw-r--r--sys/modules/acpi/acpi_sony/Makefile7
-rw-r--r--sys/modules/acpi/acpi_toshiba/Makefile7
-rw-r--r--sys/modules/acpi/acpi_video/Makefile8
-rw-r--r--sys/modules/acpi/acpi_wmi/Makefile8
-rw-r--r--sys/modules/acpi/aibs/Makefile9
-rw-r--r--sys/modules/adlink/Makefile8
-rw-r--r--sys/modules/ae/Makefile7
-rw-r--r--sys/modules/aesni/Makefile48
-rw-r--r--sys/modules/age/Makefile7
-rw-r--r--sys/modules/agp/Makefile46
-rw-r--r--sys/modules/ahci/Makefile11
-rw-r--r--sys/modules/aic7xxx/Makefile20
-rw-r--r--sys/modules/aic7xxx/Makefile.inc2
-rw-r--r--sys/modules/aic7xxx/ahc/Makefile55
-rw-r--r--sys/modules/aic7xxx/ahc/Makefile.inc2
-rw-r--r--sys/modules/aic7xxx/ahc/ahc_isa/Makefile11
-rw-r--r--sys/modules/aic7xxx/ahc/ahc_pci/Makefile13
-rw-r--r--sys/modules/aic7xxx/ahd/Makefile44
-rw-r--r--sys/modules/aic7xxx/aicasm/Makefile8
-rw-r--r--sys/modules/alc/Makefile7
-rw-r--r--sys/modules/ale/Makefile7
-rw-r--r--sys/modules/allwinner/Makefile14
-rw-r--r--sys/modules/allwinner/aw_mmc/Makefile14
-rw-r--r--sys/modules/allwinner/aw_pwm/Makefile14
-rw-r--r--sys/modules/allwinner/aw_rsb/Makefile14
-rw-r--r--sys/modules/allwinner/aw_rtc/Makefile14
-rw-r--r--sys/modules/allwinner/aw_sid/Makefile13
-rw-r--r--sys/modules/allwinner/aw_spi/Makefile14
-rw-r--r--sys/modules/allwinner/aw_thermal/Makefile13
-rw-r--r--sys/modules/allwinner/axp81x/Makefile14
-rw-r--r--sys/modules/allwinner/if_awg/Makefile14
-rw-r--r--sys/modules/alq/Makefile8
-rw-r--r--sys/modules/am335x_dmtpps/Makefile9
-rw-r--r--sys/modules/amd_ecc_inject/Makefile7
-rw-r--r--sys/modules/amdgpio/Makefile7
-rw-r--r--sys/modules/amdsbwd/Makefile7
-rw-r--r--sys/modules/amdsmb/Makefile7
-rw-r--r--sys/modules/amdsmn/Makefile9
-rw-r--r--sys/modules/amdtemp/Makefile7
-rw-r--r--sys/modules/aout/Makefile8
-rw-r--r--sys/modules/arcmsr/Makefile9
-rw-r--r--sys/modules/arm_ti/Makefile8
-rw-r--r--sys/modules/arm_ti/am335x_ehrpwm/Makefile15
-rw-r--r--sys/modules/arm_ti/ti_i2c/Makefile13
-rw-r--r--sys/modules/armv8crypto/Makefile35
-rw-r--r--sys/modules/asmc/Makefile7
-rw-r--r--sys/modules/ata/Makefile6
-rw-r--r--sys/modules/ata/Makefile.inc2
-rw-r--r--sys/modules/ata/atacore/Makefile10
-rw-r--r--sys/modules/ata/ataisa/Makefile8
-rw-r--r--sys/modules/ata/atapci/Makefile12
-rw-r--r--sys/modules/ata/atapci/Makefile.inc2
-rw-r--r--sys/modules/ata/atapci/chipsets/Makefile4
-rw-r--r--sys/modules/ata/atapci/chipsets/Makefile.inc2
-rw-r--r--sys/modules/ata/atapci/chipsets/ataacard/Makefile8
-rw-r--r--sys/modules/ata/atapci/chipsets/ataacerlabs/Makefile8
-rw-r--r--sys/modules/ata/atapci/chipsets/ataamd/Makefile8
-rw-r--r--sys/modules/ata/atapci/chipsets/ataati/Makefile8
-rw-r--r--sys/modules/ata/atapci/chipsets/atacenatek/Makefile8
-rw-r--r--sys/modules/ata/atapci/chipsets/atacypress/Makefile8
-rw-r--r--sys/modules/ata/atapci/chipsets/atacyrix/Makefile8
-rw-r--r--sys/modules/ata/atapci/chipsets/atahighpoint/Makefile8
-rw-r--r--sys/modules/ata/atapci/chipsets/ataintel/Makefile8
-rw-r--r--sys/modules/ata/atapci/chipsets/ataite/Makefile8
-rw-r--r--sys/modules/ata/atapci/chipsets/atajmicron/Makefile8
-rw-r--r--sys/modules/ata/atapci/chipsets/atamarvell/Makefile8
-rw-r--r--sys/modules/ata/atapci/chipsets/atamicron/Makefile8
-rw-r--r--sys/modules/ata/atapci/chipsets/atanational/Makefile8
-rw-r--r--sys/modules/ata/atapci/chipsets/atanetcell/Makefile8
-rw-r--r--sys/modules/ata/atapci/chipsets/atanvidia/Makefile8
-rw-r--r--sys/modules/ata/atapci/chipsets/atapromise/Makefile8
-rw-r--r--sys/modules/ata/atapci/chipsets/ataserverworks/Makefile8
-rw-r--r--sys/modules/ata/atapci/chipsets/atasiliconimage/Makefile10
-rw-r--r--sys/modules/ata/atapci/chipsets/atasis/Makefile8
-rw-r--r--sys/modules/ata/atapci/chipsets/atavia/Makefile8
-rw-r--r--sys/modules/ath/Makefile44
-rw-r--r--sys/modules/ath10k/Makefile49
-rw-r--r--sys/modules/ath11k/Makefile49
-rw-r--r--sys/modules/ath12k/Makefile35
-rw-r--r--sys/modules/ath_dfs/Makefile48
-rw-r--r--sys/modules/ath_hal/Makefile49
-rw-r--r--sys/modules/ath_hal_ar5210/Makefile54
-rw-r--r--sys/modules/ath_hal_ar5211/Makefile56
-rw-r--r--sys/modules/ath_hal_ar5212/Makefile61
-rw-r--r--sys/modules/ath_hal_ar5416/Makefile83
-rw-r--r--sys/modules/ath_hal_ar9300/Makefile59
-rw-r--r--sys/modules/ath_main/Makefile53
-rw-r--r--sys/modules/ath_rate/Makefile58
-rw-r--r--sys/modules/athk_common/Makefile36
-rw-r--r--sys/modules/autofs/Makefile10
-rw-r--r--sys/modules/axgbe/Makefile8
-rw-r--r--sys/modules/axgbe/if_axa/Makefile11
-rw-r--r--sys/modules/axgbe/if_axp/Makefile11
-rw-r--r--sys/modules/backlight/Makefile14
-rw-r--r--sys/modules/bce/Makefile7
-rw-r--r--sys/modules/bcm283x_clkman/Makefile11
-rw-r--r--sys/modules/bcm283x_pwm/Makefile9
-rw-r--r--sys/modules/bfe/Makefile7
-rw-r--r--sys/modules/bge/Makefile7
-rw-r--r--sys/modules/bhnd/Makefile76
-rw-r--r--sys/modules/bhnd/bcma/Makefile10
-rw-r--r--sys/modules/bhnd/bcma_bhndb/Makefile11
-rw-r--r--sys/modules/bhnd/bhndb/Makefile19
-rw-r--r--sys/modules/bhnd/bhndb_pci/Makefile14
-rw-r--r--sys/modules/bhnd/cores/Makefile6
-rw-r--r--sys/modules/bhnd/cores/bhnd_pci/Makefile9
-rw-r--r--sys/modules/bhnd/cores/bhnd_pci_hostb/Makefile10
-rw-r--r--sys/modules/bhnd/cores/bhnd_pcib/Makefile10
-rw-r--r--sys/modules/bhnd/siba/Makefile13
-rw-r--r--sys/modules/bhnd/siba_bhndb/Makefile11
-rw-r--r--sys/modules/bios/Makefile9
-rw-r--r--sys/modules/bios/smapi/Makefile9
-rw-r--r--sys/modules/bios/smbios/Makefile9
-rw-r--r--sys/modules/bios/vpd/Makefile9
-rw-r--r--sys/modules/blake2/Makefile90
-rw-r--r--sys/modules/bnxt/Makefile14
-rw-r--r--sys/modules/bridgestp/Makefile9
-rw-r--r--sys/modules/bwi/Makefile9
-rw-r--r--sys/modules/bwn/Makefile39
-rw-r--r--sys/modules/bxe/Makefile21
-rw-r--r--sys/modules/bytgpio/Makefile7
-rw-r--r--sys/modules/cam/Makefile55
-rw-r--r--sys/modules/cardbus/Makefile12
-rw-r--r--sys/modules/carp/Makefile10
-rw-r--r--sys/modules/cas/Makefile11
-rw-r--r--sys/modules/cbb/Makefile12
-rw-r--r--sys/modules/cc/Makefile20
-rw-r--r--sys/modules/cc/cc_cdg/Makefile6
-rw-r--r--sys/modules/cc/cc_chd/Makefile6
-rw-r--r--sys/modules/cc/cc_cubic/Makefile6
-rw-r--r--sys/modules/cc/cc_dctcp/Makefile6
-rw-r--r--sys/modules/cc/cc_hd/Makefile6
-rw-r--r--sys/modules/cc/cc_htcp/Makefile6
-rw-r--r--sys/modules/cc/cc_newreno/Makefile6
-rw-r--r--sys/modules/cc/cc_vegas/Makefile6
-rw-r--r--sys/modules/ccp/Makefile20
-rw-r--r--sys/modules/cd9660/Makefile10
-rw-r--r--sys/modules/cd9660_iconv/Makefile6
-rw-r--r--sys/modules/cfi/Makefile11
-rw-r--r--sys/modules/cfiscsi/Makefile11
-rw-r--r--sys/modules/chromebook_platform/Makefile6
-rw-r--r--sys/modules/chvgpio/Makefile7
-rw-r--r--sys/modules/ciss/Makefile10
-rw-r--r--sys/modules/coretemp/Makefile7
-rw-r--r--sys/modules/cpsw/Makefile7
-rw-r--r--sys/modules/cpuctl/Makefile7
-rw-r--r--sys/modules/cpufreq/Makefile25
-rw-r--r--sys/modules/crypto/Makefile104
-rw-r--r--sys/modules/cryptodev/Makefile7
-rw-r--r--sys/modules/ctl/Makefile32
-rw-r--r--sys/modules/cuse/Makefile31
-rw-r--r--sys/modules/cxgb/Makefile8
-rw-r--r--sys/modules/cxgb/cxgb/Makefile15
-rw-r--r--sys/modules/cxgb/cxgb_t3fw/Makefile9
-rw-r--r--sys/modules/cxgbe/Makefile33
-rw-r--r--sys/modules/cxgbe/ccr/Makefile18
-rw-r--r--sys/modules/cxgbe/cxgbei/Makefile22
-rw-r--r--sys/modules/cxgbe/if_cc/Makefile10
-rw-r--r--sys/modules/cxgbe/if_ccv/Makefile10
-rw-r--r--sys/modules/cxgbe/if_cxgbe/Makefile46
-rw-r--r--sys/modules/cxgbe/if_cxgbev/Makefile20
-rw-r--r--sys/modules/cxgbe/if_cxl/Makefile10
-rw-r--r--sys/modules/cxgbe/if_cxlv/Makefile10
-rw-r--r--sys/modules/cxgbe/iw_cxgbe/Makefile24
-rw-r--r--sys/modules/cxgbe/t4_firmware/Makefile22
-rw-r--r--sys/modules/cxgbe/t5_firmware/Makefile22
-rw-r--r--sys/modules/cxgbe/t6_firmware/Makefile22
-rw-r--r--sys/modules/cxgbe/tom/Makefile25
-rw-r--r--sys/modules/dc/Makefile8
-rw-r--r--sys/modules/dcons/Makefile21
-rw-r--r--sys/modules/dcons_crom/Makefile13
-rw-r--r--sys/modules/dpaa2/Makefile48
-rw-r--r--sys/modules/dpdk_lpm4/Makefile11
-rw-r--r--sys/modules/dpdk_lpm6/Makefile11
-rw-r--r--sys/modules/dpms/Makefile8
-rw-r--r--sys/modules/dtb/allwinner/Makefile70
-rw-r--r--sys/modules/dtb/am335x/Makefile12
-rw-r--r--sys/modules/dtb/freescale/Makefile8
-rw-r--r--sys/modules/dtb/imx5/Makefile5
-rw-r--r--sys/modules/dtb/imx6/Makefile18
-rw-r--r--sys/modules/dtb/imx8/Makefile6
-rw-r--r--sys/modules/dtb/mv/Makefile16
-rw-r--r--sys/modules/dtb/nvidia/Makefile9
-rw-r--r--sys/modules/dtb/omap4/Makefile7
-rw-r--r--sys/modules/dtb/rockchip/Makefile31
-rw-r--r--sys/modules/dtb/rpi/Makefile12
-rw-r--r--sys/modules/dtb/sifive/Makefile5
-rw-r--r--sys/modules/dtb/zynq/Makefile6
-rw-r--r--sys/modules/dtrace/Makefile35
-rw-r--r--sys/modules/dtrace/Makefile.inc24
-rw-r--r--sys/modules/dtrace/dtaudit/Makefile14
-rw-r--r--sys/modules/dtrace/dtmalloc/Makefile14
-rw-r--r--sys/modules/dtrace/dtnfscl/Makefile14
-rw-r--r--sys/modules/dtrace/dtrace/Makefile65
-rw-r--r--sys/modules/dtrace/dtrace_test/Makefile15
-rw-r--r--sys/modules/dtrace/dtraceall/Makefile11
-rw-r--r--sys/modules/dtrace/dtraceall/dtraceall.c86
-rw-r--r--sys/modules/dtrace/fasttrap/Makefile29
-rw-r--r--sys/modules/dtrace/fbt/Makefile24
-rw-r--r--sys/modules/dtrace/kinst/Makefile23
-rw-r--r--sys/modules/dtrace/profile/Makefile14
-rw-r--r--sys/modules/dtrace/prototype/Makefile14
-rw-r--r--sys/modules/dtrace/sdt/Makefile14
-rw-r--r--sys/modules/dtrace/systrace/Makefile14
-rw-r--r--sys/modules/dtrace/systrace_freebsd32/Makefile15
-rw-r--r--sys/modules/dtrace/systrace_linux/Makefile16
-rw-r--r--sys/modules/dtrace/systrace_linux32/Makefile16
-rw-r--r--sys/modules/dummynet/Makefile11
-rw-r--r--sys/modules/dwwdt/Makefile7
-rw-r--r--sys/modules/e6000sw/Makefile9
-rw-r--r--sys/modules/efirt/Makefile21
-rw-r--r--sys/modules/em/Makefile25
-rw-r--r--sys/modules/ena/Makefile42
-rw-r--r--sys/modules/enetc/Makefile8
-rw-r--r--sys/modules/enic/Makefile10
-rw-r--r--sys/modules/epoch_test/Makefile8
-rw-r--r--sys/modules/et/Makefile9
-rw-r--r--sys/modules/evdev/Makefile10
-rw-r--r--sys/modules/exca/Makefile9
-rw-r--r--sys/modules/ext2fs/Makefile10
-rw-r--r--sys/modules/fdc/Makefile12
-rw-r--r--sys/modules/fdescfs/Makefile8
-rw-r--r--sys/modules/fdt/Makefile6
-rw-r--r--sys/modules/fdt/fdt_slicer/Makefile14
-rw-r--r--sys/modules/felix/Makefile36
-rw-r--r--sys/modules/ffec/Makefile7
-rw-r--r--sys/modules/fib_dxr/Makefile10
-rw-r--r--sys/modules/filemon/Makefile8
-rw-r--r--sys/modules/filemon/Makefile.depend10
-rw-r--r--sys/modules/firewire/Makefile8
-rw-r--r--sys/modules/firewire/Makefile.inc2
-rw-r--r--sys/modules/firewire/firewire/Makefile15
-rw-r--r--sys/modules/firewire/fwe/Makefile13
-rw-r--r--sys/modules/firewire/fwip/Makefile15
-rw-r--r--sys/modules/firewire/sbp/Makefile13
-rw-r--r--sys/modules/firewire/sbp_targ/Makefile13
-rw-r--r--sys/modules/firmware/Makefile9
-rw-r--r--sys/modules/flash/Makefile9
-rw-r--r--sys/modules/flash/flexspi/Makefile14
-rw-r--r--sys/modules/ftgpio/Makefile7
-rw-r--r--sys/modules/ftwd/Makefile8
-rw-r--r--sys/modules/fusefs/Makefile9
-rw-r--r--sys/modules/fxp/Makefile7
-rw-r--r--sys/modules/gem/Makefile12
-rw-r--r--sys/modules/geom/Makefile33
-rw-r--r--sys/modules/geom/Makefile.inc2
-rw-r--r--sys/modules/geom/geom_bde/Makefile10
-rw-r--r--sys/modules/geom/geom_cache/Makefile7
-rw-r--r--sys/modules/geom/geom_ccd/Makefile7
-rw-r--r--sys/modules/geom/geom_concat/Makefile7
-rw-r--r--sys/modules/geom/geom_eli/Makefile16
-rw-r--r--sys/modules/geom/geom_flashmap/Makefile9
-rw-r--r--sys/modules/geom/geom_gate/Makefile7
-rw-r--r--sys/modules/geom/geom_journal/Makefile9
-rw-r--r--sys/modules/geom/geom_label/Makefile21
-rw-r--r--sys/modules/geom/geom_linux_lvm/Makefile7
-rw-r--r--sys/modules/geom/geom_map/Makefile7
-rw-r--r--sys/modules/geom/geom_mirror/Makefile8
-rw-r--r--sys/modules/geom/geom_mountver/Makefile7
-rw-r--r--sys/modules/geom/geom_multipath/Makefile7
-rw-r--r--sys/modules/geom/geom_nop/Makefile7
-rw-r--r--sys/modules/geom/geom_part/Makefile10
-rw-r--r--sys/modules/geom/geom_part/geom_part_apm/Makefile9
-rw-r--r--sys/modules/geom/geom_part/geom_part_bsd/Makefile9
-rw-r--r--sys/modules/geom/geom_part/geom_part_bsd64/Makefile9
-rw-r--r--sys/modules/geom/geom_part/geom_part_ebr/Makefile10
-rw-r--r--sys/modules/geom/geom_part/geom_part_gpt/Makefile9
-rw-r--r--sys/modules/geom/geom_part/geom_part_ldm/Makefile9
-rw-r--r--sys/modules/geom/geom_part/geom_part_mbr/Makefile9
-rw-r--r--sys/modules/geom/geom_raid/Makefile15
-rw-r--r--sys/modules/geom/geom_raid3/Makefile8
-rw-r--r--sys/modules/geom/geom_shsec/Makefile7
-rw-r--r--sys/modules/geom/geom_stripe/Makefile7
-rw-r--r--sys/modules/geom/geom_union/Makefile7
-rw-r--r--sys/modules/geom/geom_uzip/Makefile21
-rw-r--r--sys/modules/geom/geom_vinum/Makefile11
-rw-r--r--sys/modules/geom/geom_virstor/Makefile7
-rw-r--r--sys/modules/geom/geom_zero/Makefile7
-rw-r--r--sys/modules/glxiic/Makefile9
-rw-r--r--sys/modules/glxsb/Makefile8
-rw-r--r--sys/modules/gpio/Makefile33
-rw-r--r--sys/modules/gpio/gpiobus/Makefile46
-rw-r--r--sys/modules/gpio/gpioiic/Makefile40
-rw-r--r--sys/modules/gpio/gpiokeys/Makefile13
-rw-r--r--sys/modules/gpio/gpioled/Makefile43
-rw-r--r--sys/modules/gpio/gpiopps/Makefile39
-rw-r--r--sys/modules/gpio/gpiospi/Makefile40
-rw-r--r--sys/modules/gpio/gpioths/Makefile18
-rw-r--r--sys/modules/gve/Makefile36
-rw-r--r--sys/modules/hid/Makefile23
-rw-r--r--sys/modules/hid/bcm5974/Makefile9
-rw-r--r--sys/modules/hid/hconf/Makefile11
-rw-r--r--sys/modules/hid/hcons/Makefile8
-rw-r--r--sys/modules/hid/hgame/Makefile8
-rw-r--r--sys/modules/hid/hid/Makefile11
-rw-r--r--sys/modules/hid/hidbus/Makefile10
-rw-r--r--sys/modules/hid/hidmap/Makefile11
-rw-r--r--sys/modules/hid/hidquirk/Makefile33
-rw-r--r--sys/modules/hid/hidraw/Makefile8
-rw-r--r--sys/modules/hid/hkbd/Makefile9
-rw-r--r--sys/modules/hid/hms/Makefile9
-rw-r--r--sys/modules/hid/hmt/Makefile9
-rw-r--r--sys/modules/hid/hpen/Makefile8
-rw-r--r--sys/modules/hid/hsctrl/Makefile8
-rw-r--r--sys/modules/hid/ietp/Makefile9
-rw-r--r--sys/modules/hid/ps4dshock/Makefile9
-rw-r--r--sys/modules/hid/xb360gp/Makefile8
-rw-r--r--sys/modules/hifn/Makefile13
-rw-r--r--sys/modules/hpt27xx/Makefile10
-rw-r--r--sys/modules/hptiop/Makefile9
-rw-r--r--sys/modules/hptmv/Makefile42
-rw-r--r--sys/modules/hptnr/Makefile10
-rw-r--r--sys/modules/hptrr/Makefile10
-rw-r--r--sys/modules/hwpmc/Makefile41
-rw-r--r--sys/modules/hyperv/Makefile4
-rw-r--r--sys/modules/hyperv/hid/Makefile11
-rw-r--r--sys/modules/hyperv/hvsock/Makefile13
-rw-r--r--sys/modules/hyperv/netvsc/Makefile12
-rw-r--r--sys/modules/hyperv/pcib/Makefile11
-rw-r--r--sys/modules/hyperv/storvsc/Makefile14
-rw-r--r--sys/modules/hyperv/utilities/Makefile15
-rw-r--r--sys/modules/hyperv/vmbus/Makefile44
-rw-r--r--sys/modules/i2c/Makefile43
-rw-r--r--sys/modules/i2c/Makefile.inc2
-rw-r--r--sys/modules/i2c/ads111x/Makefile17
-rw-r--r--sys/modules/i2c/controllers/Makefile11
-rw-r--r--sys/modules/i2c/controllers/Makefile.inc2
-rw-r--r--sys/modules/i2c/controllers/alpm/Makefile7
-rw-r--r--sys/modules/i2c/controllers/amdpm/Makefile7
-rw-r--r--sys/modules/i2c/controllers/amdsmb/Makefile8
-rw-r--r--sys/modules/i2c/controllers/ichiic/Makefile13
-rw-r--r--sys/modules/i2c/controllers/ichsmb/Makefile7
-rw-r--r--sys/modules/i2c/controllers/iicoc/Makefile7
-rw-r--r--sys/modules/i2c/controllers/imcsmb/Makefile7
-rw-r--r--sys/modules/i2c/controllers/intpm/Makefile7
-rw-r--r--sys/modules/i2c/controllers/ismt/Makefile7
-rw-r--r--sys/modules/i2c/controllers/lpbb/Makefile7
-rw-r--r--sys/modules/i2c/controllers/nfsmb/Makefile8
-rw-r--r--sys/modules/i2c/controllers/pcf/Makefile13
-rw-r--r--sys/modules/i2c/controllers/viapm/Makefile7
-rw-r--r--sys/modules/i2c/cyapa/Makefile7
-rw-r--r--sys/modules/i2c/ds1307/Makefile6
-rw-r--r--sys/modules/i2c/ds13rtc/Makefile6
-rw-r--r--sys/modules/i2c/ds1672/Makefile18
-rw-r--r--sys/modules/i2c/ds3231/Makefile6
-rw-r--r--sys/modules/i2c/htu21/Makefile16
-rw-r--r--sys/modules/i2c/hym8563/Makefile13
-rw-r--r--sys/modules/i2c/icee/Makefile13
-rw-r--r--sys/modules/i2c/if_ic/Makefile7
-rw-r--r--sys/modules/i2c/iic/Makefile7
-rw-r--r--sys/modules/i2c/iicbb/Makefile9
-rw-r--r--sys/modules/i2c/iicbus/Makefile28
-rw-r--r--sys/modules/i2c/iichid/Makefile8
-rw-r--r--sys/modules/i2c/iicsmb/Makefile7
-rw-r--r--sys/modules/i2c/isl/Makefile6
-rw-r--r--sys/modules/i2c/isl12xx/Makefile6
-rw-r--r--sys/modules/i2c/jedec_dimm/Makefile6
-rw-r--r--sys/modules/i2c/max44009/Makefile16
-rw-r--r--sys/modules/i2c/mux/Makefile11
-rw-r--r--sys/modules/i2c/mux/iic_gpiomux/Makefile19
-rw-r--r--sys/modules/i2c/mux/iicmux/Makefile20
-rw-r--r--sys/modules/i2c/mux/ltc430x/Makefile19
-rw-r--r--sys/modules/i2c/mux/pca954x/Makefile19
-rw-r--r--sys/modules/i2c/nxprtc/Makefile6
-rw-r--r--sys/modules/i2c/pcf8574/Makefile17
-rw-r--r--sys/modules/i2c/pcf8591/Makefile16
-rw-r--r--sys/modules/i2c/rtc8583/Makefile18
-rw-r--r--sys/modules/i2c/rv3032/Makefile13
-rw-r--r--sys/modules/i2c/rx8803/Makefile15
-rw-r--r--sys/modules/i2c/s35390a/Makefile6
-rw-r--r--sys/modules/i2c/smb/Makefile7
-rw-r--r--sys/modules/i2c/smbus/Makefile9
-rw-r--r--sys/modules/i2c/tca6416/Makefile0
-rw-r--r--sys/modules/i2c/tca64xx/Makefile5
-rw-r--r--sys/modules/i2c/tmp461/Makefile6
-rw-r--r--sys/modules/iavf/Makefile20
-rw-r--r--sys/modules/ibcore/Makefile59
-rw-r--r--sys/modules/ice/Makefile28
-rw-r--r--sys/modules/ice_ddp/Makefile5
-rw-r--r--sys/modules/ichwd/Makefile7
-rw-r--r--sys/modules/ida/Makefile8
-rw-r--r--sys/modules/if_bridge/Makefile6
-rw-r--r--sys/modules/if_cgem/Makefile7
-rw-r--r--sys/modules/if_disc/Makefile7
-rw-r--r--sys/modules/if_edsc/Makefile7
-rw-r--r--sys/modules/if_enc/Makefile10
-rw-r--r--sys/modules/if_epair/Makefile7
-rw-r--r--sys/modules/if_gif/Makefile14
-rw-r--r--sys/modules/if_gre/Makefile11
-rw-r--r--sys/modules/if_infiniband/Makefile11
-rw-r--r--sys/modules/if_lagg/Makefile7
-rw-r--r--sys/modules/if_me/Makefile7
-rw-r--r--sys/modules/if_ovpn/Makefile6
-rw-r--r--sys/modules/if_stf/Makefile7
-rw-r--r--sys/modules/if_tuntap/Makefile7
-rw-r--r--sys/modules/if_vlan/Makefile8
-rw-r--r--sys/modules/if_vxlan/Makefile8
-rw-r--r--sys/modules/if_wg/Makefile10
-rw-r--r--sys/modules/iflib/Makefile14
-rw-r--r--sys/modules/igc/Makefile10
-rw-r--r--sys/modules/imgact_binmisc/Makefile7
-rw-r--r--sys/modules/imx/Makefile11
-rw-r--r--sys/modules/imx/imx6_ahci/Makefile13
-rw-r--r--sys/modules/imx/imx6_snvs/Makefile15
-rw-r--r--sys/modules/imx/imx_i2c/Makefile16
-rw-r--r--sys/modules/imx/imx_spi/Makefile16
-rw-r--r--sys/modules/imx/imx_wdog/Makefile13
-rw-r--r--sys/modules/intelspi/Makefile7
-rw-r--r--sys/modules/io/Makefile9
-rw-r--r--sys/modules/ioat/Makefile15
-rw-r--r--sys/modules/ip6_mroute_mod/Makefile9
-rw-r--r--sys/modules/ip_mroute_mod/Makefile9
-rw-r--r--sys/modules/ipdivert/Makefile7
-rw-r--r--sys/modules/ipfilter/Makefile32
-rw-r--r--sys/modules/ipfw/Makefile23
-rw-r--r--sys/modules/ipfw_nat/Makefile7
-rw-r--r--sys/modules/ipfw_nat64/Makefile13
-rw-r--r--sys/modules/ipfw_nptv6/Makefile7
-rw-r--r--sys/modules/ipfw_pmod/Makefile7
-rw-r--r--sys/modules/ipmi/Makefile29
-rw-r--r--sys/modules/ipmi/ipmi_linux/Makefile7
-rw-r--r--sys/modules/ipoib/Makefile16
-rw-r--r--sys/modules/ips/Makefile10
-rw-r--r--sys/modules/ipsec/Makefile10
-rw-r--r--sys/modules/ipw/Makefile7
-rw-r--r--sys/modules/ipwfw/Makefile6
-rw-r--r--sys/modules/ipwfw/ipw_bss/Makefile14
-rw-r--r--sys/modules/ipwfw/ipw_ibss/Makefile14
-rw-r--r--sys/modules/ipwfw/ipw_monitor/Makefile14
-rw-r--r--sys/modules/irdma/Makefile23
-rw-r--r--sys/modules/isci/Makefile91
-rw-r--r--sys/modules/iscsi/Makefile26
-rw-r--r--sys/modules/iser/Makefile29
-rw-r--r--sys/modules/isp/Makefile9
-rw-r--r--sys/modules/ispfw/Makefile32
-rw-r--r--sys/modules/ispfw/isp_2400/Makefile34
-rw-r--r--sys/modules/ispfw/isp_2500/Makefile35
-rw-r--r--sys/modules/ispfw/ispfw/Makefile34
-rw-r--r--sys/modules/itwd/Makefile8
-rw-r--r--sys/modules/iwi/Makefile7
-rw-r--r--sys/modules/iwifw/Makefile6
-rw-r--r--sys/modules/iwifw/iwi_bss/Makefile14
-rw-r--r--sys/modules/iwifw/iwi_ibss/Makefile14
-rw-r--r--sys/modules/iwifw/iwi_monitor/Makefile13
-rw-r--r--sys/modules/iwlwifi/Makefile69
-rw-r--r--sys/modules/iwlwififw/Makefile28
-rw-r--r--sys/modules/iwlwififw/Makefile.inc19
-rw-r--r--sys/modules/iwlwififw/iwlwifi-3160-fw/Makefile5
-rw-r--r--sys/modules/iwlwififw/iwlwifi-3168-fw/Makefile5
-rw-r--r--sys/modules/iwlwififw/iwlwifi-7260-fw/Makefile5
-rw-r--r--sys/modules/iwlwififw/iwlwifi-7265-fw/Makefile5
-rw-r--r--sys/modules/iwlwififw/iwlwifi-7265D-fw/Makefile5
-rw-r--r--sys/modules/iwlwififw/iwlwifi-8000C-fw/Makefile5
-rw-r--r--sys/modules/iwlwififw/iwlwifi-8265-fw/Makefile5
-rw-r--r--sys/modules/iwlwififw/iwlwifi-9000-pu-b0-jf-b0-fw/Makefile5
-rw-r--r--sys/modules/iwlwififw/iwlwifi-9260-th-b0-jf-b0-fw/Makefile5
-rw-r--r--sys/modules/iwlwififw/iwlwifi-Qu-b0-hr-b0-fw/Makefile5
-rw-r--r--sys/modules/iwlwififw/iwlwifi-Qu-b0-jf-b0-fw/Makefile5
-rw-r--r--sys/modules/iwlwififw/iwlwifi-Qu-c0-hr-b0-fw/Makefile5
-rw-r--r--sys/modules/iwlwififw/iwlwifi-Qu-c0-jf-b0-fw/Makefile5
-rw-r--r--sys/modules/iwlwififw/iwlwifi-QuZ-a0-hr-b0-fw/Makefile5
-rw-r--r--sys/modules/iwlwififw/iwlwifi-QuZ-a0-jf-b0-fw/Makefile5
-rw-r--r--sys/modules/iwlwififw/iwlwifi-cc-a0-fw/Makefile5
-rw-r--r--sys/modules/iwlwififw/iwlwifi-so-a0-gf-a0-fw/Makefile5
-rw-r--r--sys/modules/iwlwififw/iwlwifi-so-a0-gf-a0-pnvm/Makefile7
-rw-r--r--sys/modules/iwlwififw/iwlwifi-so-a0-gf4-a0-fw/Makefile5
-rw-r--r--sys/modules/iwlwififw/iwlwifi-so-a0-gf4-a0-pnvm/Makefile7
-rw-r--r--sys/modules/iwlwififw/iwlwifi-so-a0-hr-b0-fw/Makefile5
-rw-r--r--sys/modules/iwlwififw/iwlwifi-so-a0-jf-b0-fw/Makefile5
-rw-r--r--sys/modules/iwlwififw/iwlwifi-ty-a0-gf-a0-fw/Makefile5
-rw-r--r--sys/modules/iwlwififw/iwlwifi-ty-a0-gf-a0-pnvm/Makefile7
-rw-r--r--sys/modules/iwm/Makefile17
-rw-r--r--sys/modules/iwmfw/Makefile12
-rw-r--r--sys/modules/iwmfw/Makefile.inc17
-rw-r--r--sys/modules/iwmfw/iwm3160fw/Makefile5
-rw-r--r--sys/modules/iwmfw/iwm3168fw/Makefile5
-rw-r--r--sys/modules/iwmfw/iwm7260fw/Makefile5
-rw-r--r--sys/modules/iwmfw/iwm7265Dfw/Makefile5
-rw-r--r--sys/modules/iwmfw/iwm7265fw/Makefile5
-rw-r--r--sys/modules/iwmfw/iwm8000Cfw/Makefile5
-rw-r--r--sys/modules/iwmfw/iwm8265fw/Makefile5
-rw-r--r--sys/modules/iwmfw/iwm9000fw/Makefile5
-rw-r--r--sys/modules/iwmfw/iwm9260fw/Makefile5
-rw-r--r--sys/modules/iwn/Makefile7
-rw-r--r--sys/modules/iwnfw/Makefile16
-rw-r--r--sys/modules/iwnfw/Makefile.inc17
-rw-r--r--sys/modules/iwnfw/iwn100/Makefile5
-rw-r--r--sys/modules/iwnfw/iwn1000/Makefile5
-rw-r--r--sys/modules/iwnfw/iwn105/Makefile5
-rw-r--r--sys/modules/iwnfw/iwn135/Makefile5
-rw-r--r--sys/modules/iwnfw/iwn2000/Makefile5
-rw-r--r--sys/modules/iwnfw/iwn2030/Makefile5
-rw-r--r--sys/modules/iwnfw/iwn4965/Makefile5
-rw-r--r--sys/modules/iwnfw/iwn5000/Makefile5
-rw-r--r--sys/modules/iwnfw/iwn5150/Makefile5
-rw-r--r--sys/modules/iwnfw/iwn6000/Makefile5
-rw-r--r--sys/modules/iwnfw/iwn6000g2a/Makefile5
-rw-r--r--sys/modules/iwnfw/iwn6000g2b/Makefile5
-rw-r--r--sys/modules/iwnfw/iwn6050/Makefile5
-rw-r--r--sys/modules/ix/Makefile14
-rw-r--r--sys/modules/ixl/Makefile26
-rw-r--r--sys/modules/ixv/Makefile14
-rw-r--r--sys/modules/jme/Makefile7
-rw-r--r--sys/modules/kbdmux/Makefile14
-rw-r--r--sys/modules/kgssapi/Makefile56
-rw-r--r--sys/modules/kgssapi_krb5/Makefile18
-rw-r--r--sys/modules/khelp/Makefile12
-rw-r--r--sys/modules/khelp/h_ertt/Makefile6
-rw-r--r--sys/modules/krpc/Makefile59
-rw-r--r--sys/modules/ksyms/Makefile7
-rw-r--r--sys/modules/ktest/Makefile8
-rw-r--r--sys/modules/ktest/ktest/Makefile12
-rw-r--r--sys/modules/ktest/ktest_example/Makefile12
-rw-r--r--sys/modules/ktest/ktest_netlink_message_writer/Makefile13
-rw-r--r--sys/modules/le/Makefile13
-rw-r--r--sys/modules/lge/Makefile7
-rw-r--r--sys/modules/libalias/Makefile4
-rw-r--r--sys/modules/libalias/libalias/Makefile9
-rw-r--r--sys/modules/libalias/modules/Makefile6
-rw-r--r--sys/modules/libalias/modules/Makefile.inc2
-rw-r--r--sys/modules/libalias/modules/dummy/Makefile5
-rw-r--r--sys/modules/libalias/modules/ftp/Makefile5
-rw-r--r--sys/modules/libalias/modules/irc/Makefile5
-rw-r--r--sys/modules/libalias/modules/modules.inc9
-rw-r--r--sys/modules/libalias/modules/nbt/Makefile5
-rw-r--r--sys/modules/libalias/modules/pptp/Makefile5
-rw-r--r--sys/modules/libalias/modules/skinny/Makefile5
-rw-r--r--sys/modules/libalias/modules/smedia/Makefile5
-rw-r--r--sys/modules/libiconv/Makefile20
-rw-r--r--sys/modules/libmchain/Makefile43
-rw-r--r--sys/modules/lindebugfs/Makefile10
-rw-r--r--sys/modules/linprocfs/Makefile13
-rw-r--r--sys/modules/linsysfs/Makefile13
-rw-r--r--sys/modules/linux/Makefile146
-rw-r--r--sys/modules/linux64/Makefile112
-rw-r--r--sys/modules/linux_common/Makefile27
-rw-r--r--sys/modules/linuxkpi/Makefile53
-rw-r--r--sys/modules/linuxkpi_hdmi/Makefile13
-rw-r--r--sys/modules/linuxkpi_wlan/Makefile17
-rw-r--r--sys/modules/lio/Makefile25
-rw-r--r--sys/modules/lpt/Makefile8
-rw-r--r--sys/modules/mac_biba/Makefile8
-rw-r--r--sys/modules/mac_bsdextended/Makefile11
-rw-r--r--sys/modules/mac_ddb/Makefile6
-rw-r--r--sys/modules/mac_ifoff/Makefile8
-rw-r--r--sys/modules/mac_ipacl/Makefile8
-rw-r--r--sys/modules/mac_lomac/Makefile8
-rw-r--r--sys/modules/mac_mls/Makefile8
-rw-r--r--sys/modules/mac_none/Makefile8
-rw-r--r--sys/modules/mac_ntpd/Makefile7
-rw-r--r--sys/modules/mac_partition/Makefile8
-rw-r--r--sys/modules/mac_pimd/Makefile7
-rw-r--r--sys/modules/mac_portacl/Makefile7
-rw-r--r--sys/modules/mac_priority/Makefile6
-rw-r--r--sys/modules/mac_seeotheruids/Makefile8
-rw-r--r--sys/modules/mac_stub/Makefile8
-rw-r--r--sys/modules/mac_test/Makefile8
-rw-r--r--sys/modules/mac_veriexec/Makefile39
-rw-r--r--sys/modules/mac_veriexec_sha1/Makefile9
-rw-r--r--sys/modules/mac_veriexec_sha256/Makefile9
-rw-r--r--sys/modules/mac_veriexec_sha384/Makefile9
-rw-r--r--sys/modules/mac_veriexec_sha512/Makefile9
-rw-r--r--sys/modules/malo/Makefile11
-rw-r--r--sys/modules/mana/Makefile11
-rw-r--r--sys/modules/md/Makefile7
-rw-r--r--sys/modules/mdio/Makefile9
-rw-r--r--sys/modules/mem/Makefile19
-rw-r--r--sys/modules/mfi/Makefile19
-rw-r--r--sys/modules/mfi/mfi_linux/Makefile7
-rw-r--r--sys/modules/mfi/mfip/Makefile9
-rw-r--r--sys/modules/mgb/Makefile13
-rw-r--r--sys/modules/mii/Makefile23
-rw-r--r--sys/modules/mlx/Makefile7
-rw-r--r--sys/modules/mlx4/Makefile36
-rw-r--r--sys/modules/mlx4en/Makefile18
-rw-r--r--sys/modules/mlx4ib/Makefile29
-rw-r--r--sys/modules/mlx5/Makefile59
-rw-r--r--sys/modules/mlx5en/Makefile38
-rw-r--r--sys/modules/mlx5fpga_tools/Makefile18
-rw-r--r--sys/modules/mlx5ib/Makefile32
-rw-r--r--sys/modules/mlxfw/Makefile19
-rw-r--r--sys/modules/mmc/Makefile7
-rw-r--r--sys/modules/mmcnull/Makefile7
-rw-r--r--sys/modules/mmcsd/Makefile7
-rw-r--r--sys/modules/mpi3mr/Makefile12
-rw-r--r--sys/modules/mpr/Makefile16
-rw-r--r--sys/modules/mps/Makefile16
-rw-r--r--sys/modules/mpt/Makefile9
-rw-r--r--sys/modules/mqueue/Makefile9
-rw-r--r--sys/modules/mrsas/Makefile27
-rw-r--r--sys/modules/mrsas/mrsas_linux/Makefile9
-rw-r--r--sys/modules/msdosfs/Makefile10
-rw-r--r--sys/modules/msdosfs_iconv/Makefile6
-rw-r--r--sys/modules/msk/Makefile8
-rw-r--r--sys/modules/mt76/Makefile7
-rw-r--r--sys/modules/mt76/Makefile.inc29
-rw-r--r--sys/modules/mt76/core/Makefile41
-rw-r--r--sys/modules/mt76/mt7915/Makefile31
-rw-r--r--sys/modules/mt76/mt7921/Makefile28
-rw-r--r--sys/modules/mt76/mt7996/Makefile27
-rw-r--r--sys/modules/mthca/Makefile34
-rw-r--r--sys/modules/mvs/Makefile7
-rw-r--r--sys/modules/mwl/Makefile40
-rw-r--r--sys/modules/mwlfw/Makefile13
-rw-r--r--sys/modules/mxge/Makefile8
-rw-r--r--sys/modules/mxge/mxge/Makefile7
-rw-r--r--sys/modules/mxge/mxge_eth_z8e/Makefile6
-rw-r--r--sys/modules/mxge/mxge_ethp_z8e/Makefile6
-rw-r--r--sys/modules/mxge/mxge_rss_eth_z8e/Makefile6
-rw-r--r--sys/modules/mxge/mxge_rss_ethp_z8e/Makefile6
-rw-r--r--sys/modules/my/Makefile7
-rw-r--r--sys/modules/nctgpio/Makefile7
-rw-r--r--sys/modules/ncthwm/Makefile7
-rw-r--r--sys/modules/neta/Makefile9
-rw-r--r--sys/modules/netgraph/Makefile64
-rw-r--r--sys/modules/netgraph/Makefile.inc7
-rw-r--r--sys/modules/netgraph/UI/Makefile6
-rw-r--r--sys/modules/netgraph/async/Makefile6
-rw-r--r--sys/modules/netgraph/bluetooth/Makefile11
-rw-r--r--sys/modules/netgraph/bluetooth/Makefile.inc2
-rw-r--r--sys/modules/netgraph/bluetooth/bluetooth/Makefile12
-rw-r--r--sys/modules/netgraph/bluetooth/hci/Makefile12
-rw-r--r--sys/modules/netgraph/bluetooth/l2cap/Makefile12
-rw-r--r--sys/modules/netgraph/bluetooth/socket/Makefile17
-rw-r--r--sys/modules/netgraph/bluetooth/ubt/Makefile12
-rw-r--r--sys/modules/netgraph/bluetooth/ubtbcmfw/Makefile12
-rw-r--r--sys/modules/netgraph/bpf/Makefile8
-rw-r--r--sys/modules/netgraph/bridge/Makefile5
-rw-r--r--sys/modules/netgraph/car/Makefile5
-rw-r--r--sys/modules/netgraph/checksum/Makefile8
-rw-r--r--sys/modules/netgraph/cisco/Makefile6
-rw-r--r--sys/modules/netgraph/deflate/Makefile5
-rw-r--r--sys/modules/netgraph/device/Makefile6
-rw-r--r--sys/modules/netgraph/echo/Makefile6
-rw-r--r--sys/modules/netgraph/eiface/Makefile5
-rw-r--r--sys/modules/netgraph/etf/Makefile6
-rw-r--r--sys/modules/netgraph/ether/Makefile5
-rw-r--r--sys/modules/netgraph/ether_echo/Makefile6
-rw-r--r--sys/modules/netgraph/frame_relay/Makefile6
-rw-r--r--sys/modules/netgraph/gif/Makefile5
-rw-r--r--sys/modules/netgraph/gif_demux/Makefile5
-rw-r--r--sys/modules/netgraph/hole/Makefile6
-rw-r--r--sys/modules/netgraph/hub/Makefile5
-rw-r--r--sys/modules/netgraph/iface/Makefile6
-rw-r--r--sys/modules/netgraph/ip_input/Makefile5
-rw-r--r--sys/modules/netgraph/ipfw/Makefile5
-rw-r--r--sys/modules/netgraph/ksocket/Makefile5
-rw-r--r--sys/modules/netgraph/l2tp/Makefile5
-rw-r--r--sys/modules/netgraph/lmi/Makefile6
-rw-r--r--sys/modules/netgraph/macfilter/Makefile8
-rw-r--r--sys/modules/netgraph/mppc/Makefile30
-rw-r--r--sys/modules/netgraph/nat/Makefile5
-rw-r--r--sys/modules/netgraph/netflow/Makefile10
-rw-r--r--sys/modules/netgraph/netgraph/Makefile8
-rw-r--r--sys/modules/netgraph/one2many/Makefile5
-rw-r--r--sys/modules/netgraph/patch/Makefile5
-rw-r--r--sys/modules/netgraph/pipe/Makefile5
-rw-r--r--sys/modules/netgraph/ppp/Makefile6
-rw-r--r--sys/modules/netgraph/pppoe/Makefile6
-rw-r--r--sys/modules/netgraph/pptpgre/Makefile6
-rw-r--r--sys/modules/netgraph/pred1/Makefile5
-rw-r--r--sys/modules/netgraph/rfc1490/Makefile6
-rw-r--r--sys/modules/netgraph/sample/Makefile5
-rw-r--r--sys/modules/netgraph/socket/Makefile6
-rw-r--r--sys/modules/netgraph/source/Makefile7
-rw-r--r--sys/modules/netgraph/split/Makefile6
-rw-r--r--sys/modules/netgraph/tag/Makefile5
-rw-r--r--sys/modules/netgraph/tcpmss/Makefile5
-rw-r--r--sys/modules/netgraph/tee/Makefile6
-rw-r--r--sys/modules/netgraph/tty/Makefile6
-rw-r--r--sys/modules/netgraph/vjc/Makefile8
-rw-r--r--sys/modules/netgraph/vlan/Makefile5
-rw-r--r--sys/modules/netgraph/vlan_rotate/Makefile5
-rw-r--r--sys/modules/netlink/Makefile20
-rw-r--r--sys/modules/netmap/Makefile29
-rw-r--r--sys/modules/nfe/Makefile7
-rw-r--r--sys/modules/nfscl/Makefile45
-rw-r--r--sys/modules/nfscommon/Makefile18
-rw-r--r--sys/modules/nfsd/Makefile20
-rw-r--r--sys/modules/nfslockd/Makefile14
-rw-r--r--sys/modules/nfssvc/Makefile9
-rw-r--r--sys/modules/nge/Makefile7
-rw-r--r--sys/modules/nlsysevent/Makefile9
-rw-r--r--sys/modules/nmdm/Makefile7
-rw-r--r--sys/modules/ntb/Makefile4
-rw-r--r--sys/modules/ntb/if_ntb/Makefile8
-rw-r--r--sys/modules/ntb/ntb/Makefile10
-rw-r--r--sys/modules/ntb/ntb_hw_amd/Makefile8
-rw-r--r--sys/modules/ntb/ntb_hw_intel/Makefile8
-rw-r--r--sys/modules/ntb/ntb_hw_plx/Makefile8
-rw-r--r--sys/modules/ntb/ntb_tool/Makefile8
-rw-r--r--sys/modules/ntb/ntb_transport/Makefile10
-rw-r--r--sys/modules/nullfs/Makefile8
-rw-r--r--sys/modules/nvd/Makefile7
-rw-r--r--sys/modules/nvdimm/Makefile20
-rw-r--r--sys/modules/nvme/Makefile27
-rw-r--r--sys/modules/nvram/Makefile7
-rw-r--r--sys/modules/oce/Makefile14
-rw-r--r--sys/modules/ocs_fc/Makefile46
-rw-r--r--sys/modules/opal_nvram/Makefile9
-rw-r--r--sys/modules/opensolaris/Makefile35
-rw-r--r--sys/modules/ossl/Makefile65
-rw-r--r--sys/modules/otus/Makefile9
-rw-r--r--sys/modules/otusfw/Makefile4
-rw-r--r--sys/modules/otusfw/otusfw_init/Makefile10
-rw-r--r--sys/modules/otusfw/otusfw_main/Makefile10
-rw-r--r--sys/modules/ow/Makefile7
-rw-r--r--sys/modules/ow/ow/Makefile8
-rw-r--r--sys/modules/ow/ow_temp/Makefile8
-rw-r--r--sys/modules/ow/owc/Makefile11
-rw-r--r--sys/modules/p2sb/Makefile7
-rw-r--r--sys/modules/padlock/Makefile8
-rw-r--r--sys/modules/padlock_rng/Makefile10
-rw-r--r--sys/modules/pcfclock/Makefile8
-rw-r--r--sys/modules/pchtherm/Makefile7
-rw-r--r--sys/modules/pf/Makefile27
-rw-r--r--sys/modules/pflog/Makefile17
-rw-r--r--sys/modules/pfsync/Makefile17
-rw-r--r--sys/modules/plip/Makefile8
-rw-r--r--sys/modules/pms/Makefile57
-rw-r--r--sys/modules/pms/Makefile.inc2
-rw-r--r--sys/modules/powermac_nvram/Makefile9
-rw-r--r--sys/modules/ppbus/Makefile23
-rw-r--r--sys/modules/ppc/Makefile12
-rw-r--r--sys/modules/ppi/Makefile8
-rw-r--r--sys/modules/pps/Makefile7
-rw-r--r--sys/modules/procfs/Makefile27
-rw-r--r--sys/modules/proto/Makefile17
-rw-r--r--sys/modules/pseudofs/Makefile30
-rw-r--r--sys/modules/pst/Makefile8
-rw-r--r--sys/modules/pty/Makefile7
-rw-r--r--sys/modules/puc/Makefile8
-rw-r--r--sys/modules/pwm/Makefile14
-rw-r--r--sys/modules/pwm/pwm_backlight/Makefile15
-rw-r--r--sys/modules/pwm/pwmbus/Makefile21
-rw-r--r--sys/modules/pwm/pwmc/Makefile17
-rw-r--r--sys/modules/qat/Makefile8
-rw-r--r--sys/modules/qat/qat/Makefile28
-rw-r--r--sys/modules/qat/qat_api/Makefile79
-rw-r--r--sys/modules/qat/qat_common/Makefile32
-rw-r--r--sys/modules/qat/qat_hw/Makefile28
-rw-r--r--sys/modules/qat_c2xxx/Makefile13
-rw-r--r--sys/modules/qat_c2xxxfw/Makefile10
-rw-r--r--sys/modules/qatfw/Makefile10
-rw-r--r--sys/modules/qatfw/qat_200xx/Makefile9
-rw-r--r--sys/modules/qatfw/qat_4xxx/Makefile9
-rw-r--r--sys/modules/qatfw/qat_c3xxx/Makefile9
-rw-r--r--sys/modules/qatfw/qat_c4xxx/Makefile9
-rw-r--r--sys/modules/qatfw/qat_c62x/Makefile9
-rw-r--r--sys/modules/qatfw/qat_dh895xcc/Makefile9
-rw-r--r--sys/modules/qlnx/Makefile41
-rw-r--r--sys/modules/qlnx/qlnxe/Makefile90
-rw-r--r--sys/modules/qlnx/qlnxev/Makefile75
-rw-r--r--sys/modules/qlnx/qlnxr/Makefile87
-rw-r--r--sys/modules/qlxgb/Makefile37
-rw-r--r--sys/modules/qlxgbe/Makefile55
-rw-r--r--sys/modules/qlxge/Makefile44
-rw-r--r--sys/modules/ral/Makefile8
-rw-r--r--sys/modules/ralfw/Makefile4
-rw-r--r--sys/modules/ralfw/Makefile.inc14
-rw-r--r--sys/modules/ralfw/rt2561/Makefile4
-rw-r--r--sys/modules/ralfw/rt2561s/Makefile4
-rw-r--r--sys/modules/ralfw/rt2661/Makefile5
-rw-r--r--sys/modules/ralfw/rt2860/Makefile4
-rw-r--r--sys/modules/random_fortuna/Makefile10
-rw-r--r--sys/modules/random_other/Makefile10
-rw-r--r--sys/modules/rc4/Makefile9
-rw-r--r--sys/modules/rccgpio/Makefile7
-rw-r--r--sys/modules/rdma/Makefile4
-rw-r--r--sys/modules/rdma/krping/Makefile11
-rw-r--r--sys/modules/rdrand_rng/Makefile15
-rw-r--r--sys/modules/re/Makefile8
-rw-r--r--sys/modules/rl/Makefile8
-rw-r--r--sys/modules/rndtest/Makefile7
-rw-r--r--sys/modules/rockchip/Makefile10
-rw-r--r--sys/modules/rockchip/rk805/Makefile20
-rw-r--r--sys/modules/rockchip/rk808/Makefile20
-rw-r--r--sys/modules/rockchip/rk_dwmmc/Makefile13
-rw-r--r--sys/modules/rockchip/rk_i2c/Makefile15
-rw-r--r--sys/modules/rockchip/rk_spi/Makefile14
-rw-r--r--sys/modules/rpi_ft5406/Makefile9
-rw-r--r--sys/modules/rtsx/Makefile8
-rw-r--r--sys/modules/rtw88/Makefile42
-rw-r--r--sys/modules/rtw88fw/Makefile9
-rw-r--r--sys/modules/rtw88fw/Makefile.inc16
-rw-r--r--sys/modules/rtw88fw/rtw8723d/Makefile5
-rw-r--r--sys/modules/rtw88fw/rtw8821c/Makefile5
-rw-r--r--sys/modules/rtw88fw/rtw8822b/Makefile5
-rw-r--r--sys/modules/rtw88fw/rtw8822c/Makefile5
-rw-r--r--sys/modules/rtw88fw/rtw8822c_wow/Makefile5
-rw-r--r--sys/modules/rtw89/Makefile44
-rw-r--r--sys/modules/rtw89fw/Makefile6
-rw-r--r--sys/modules/rtw89fw/Makefile.inc16
-rw-r--r--sys/modules/rtw89fw/rtw8852a/Makefile5
-rw-r--r--sys/modules/rtw89fw/rtw8852c/Makefile5
-rw-r--r--sys/modules/rtwn/Makefile51
-rw-r--r--sys/modules/rtwn_pci/Makefile29
-rw-r--r--sys/modules/rtwn_usb/Makefile39
-rw-r--r--sys/modules/rtwnfw/Makefile5
-rw-r--r--sys/modules/rtwnfw/Makefile.inc14
-rw-r--r--sys/modules/rtwnfw/rtwnrtl8188ee/Makefile5
-rw-r--r--sys/modules/rtwnfw/rtwnrtl8188eu/Makefile5
-rw-r--r--sys/modules/rtwnfw/rtwnrtl8192cE/Makefile5
-rw-r--r--sys/modules/rtwnfw/rtwnrtl8192cEB/Makefile5
-rw-r--r--sys/modules/rtwnfw/rtwnrtl8192cT/Makefile5
-rw-r--r--sys/modules/rtwnfw/rtwnrtl8192cU/Makefile5
-rw-r--r--sys/modules/rtwnfw/rtwnrtl8192eu/Makefile5
-rw-r--r--sys/modules/rtwnfw/rtwnrtl8812au/Makefile5
-rw-r--r--sys/modules/rtwnfw/rtwnrtl8821au/Makefile5
-rw-r--r--sys/modules/s3/Makefile8
-rw-r--r--sys/modules/safe/Makefile39
-rw-r--r--sys/modules/safexcel/Makefile8
-rw-r--r--sys/modules/sbni/Makefile9
-rw-r--r--sys/modules/scc/Makefile13
-rw-r--r--sys/modules/sctp/Makefile30
-rw-r--r--sys/modules/sdhci/Makefile9
-rw-r--r--sys/modules/sdhci_acpi/Makefile9
-rw-r--r--sys/modules/sdhci_fdt/Makefile8
-rw-r--r--sys/modules/sdhci_pci/Makefile8
-rw-r--r--sys/modules/sdio/Makefile9
-rw-r--r--sys/modules/sem/Makefile7
-rw-r--r--sys/modules/send/Makefile6
-rw-r--r--sys/modules/sff/Makefile13
-rw-r--r--sys/modules/sfxge/Makefile50
-rw-r--r--sys/modules/sge/Makefile7
-rw-r--r--sys/modules/sgx/Makefile13
-rw-r--r--sys/modules/sgx_linux/Makefile7
-rw-r--r--sys/modules/siftr/Makefile9
-rw-r--r--sys/modules/siis/Makefile7
-rw-r--r--sys/modules/sis/Makefile8
-rw-r--r--sys/modules/sk/Makefile8
-rw-r--r--sys/modules/smartpqi/Makefile11
-rw-r--r--sys/modules/smbfs/Makefile34
-rw-r--r--sys/modules/snp/Makefile7
-rw-r--r--sys/modules/sound/Makefile6
-rw-r--r--sys/modules/sound/Makefile.inc2
-rw-r--r--sys/modules/sound/driver/Makefile26
-rw-r--r--sys/modules/sound/driver/Makefile.inc4
-rw-r--r--sys/modules/sound/driver/ai2s/Makefile9
-rw-r--r--sys/modules/sound/driver/als4000/Makefile8
-rw-r--r--sys/modules/sound/driver/atiixp/Makefile8
-rw-r--r--sys/modules/sound/driver/cmi/Makefile9
-rw-r--r--sys/modules/sound/driver/cs4281/Makefile8
-rw-r--r--sys/modules/sound/driver/csa/Makefile8
-rw-r--r--sys/modules/sound/driver/davbus/Makefile9
-rw-r--r--sys/modules/sound/driver/driver/Makefile8
-rw-r--r--sys/modules/sound/driver/emu10k1/Makefile9
-rw-r--r--sys/modules/sound/driver/emu10kx/Makefile13
-rw-r--r--sys/modules/sound/driver/envy24/Makefile8
-rw-r--r--sys/modules/sound/driver/envy24ht/Makefile8
-rw-r--r--sys/modules/sound/driver/es137x/Makefile8
-rw-r--r--sys/modules/sound/driver/fm801/Makefile8
-rw-r--r--sys/modules/sound/driver/hda/Makefile9
-rw-r--r--sys/modules/sound/driver/hdspe/Makefile8
-rw-r--r--sys/modules/sound/driver/ich/Makefile7
-rw-r--r--sys/modules/sound/driver/maestro3/Makefile10
-rw-r--r--sys/modules/sound/driver/neomagic/Makefile8
-rw-r--r--sys/modules/sound/driver/solo/Makefile8
-rw-r--r--sys/modules/sound/driver/spicds/Makefile10
-rw-r--r--sys/modules/sound/driver/t4dwave/Makefile8
-rw-r--r--sys/modules/sound/driver/uaudio/Makefile9
-rw-r--r--sys/modules/sound/driver/via8233/Makefile8
-rw-r--r--sys/modules/sound/driver/via82c686/Makefile8
-rw-r--r--sys/modules/sound/driver/vibes/Makefile8
-rw-r--r--sys/modules/sound/sound/Makefile36
-rw-r--r--sys/modules/speaker/Makefile8
-rw-r--r--sys/modules/spi/Makefile13
-rw-r--r--sys/modules/spi/at45d/Makefile18
-rw-r--r--sys/modules/spi/atopcase/Makefile7
-rw-r--r--sys/modules/spi/mx25l/Makefile18
-rw-r--r--sys/modules/spi/spibus/Makefile26
-rw-r--r--sys/modules/spigen/Makefile20
-rw-r--r--sys/modules/splash/Makefile4
-rw-r--r--sys/modules/splash/Makefile.inc2
-rw-r--r--sys/modules/splash/bmp/Makefile7
-rw-r--r--sys/modules/splash/pcx/Makefile7
-rw-r--r--sys/modules/splash/txt/Makefile6
-rw-r--r--sys/modules/ste/Makefile8
-rw-r--r--sys/modules/stge/Makefile8
-rw-r--r--sys/modules/sume/Makefile8
-rw-r--r--sys/modules/superio/Makefile10
-rw-r--r--sys/modules/sym/Makefile8
-rw-r--r--sys/modules/syscons/Makefile16
-rw-r--r--sys/modules/syscons/Makefile.inc2
-rw-r--r--sys/modules/syscons/beastie/Makefile9
-rw-r--r--sys/modules/syscons/blank/Makefile7
-rw-r--r--sys/modules/syscons/daemon/Makefile7
-rw-r--r--sys/modules/syscons/dragon/Makefile7
-rw-r--r--sys/modules/syscons/fade/Makefile7
-rw-r--r--sys/modules/syscons/fire/Makefile7
-rw-r--r--sys/modules/syscons/green/Makefile7
-rw-r--r--sys/modules/syscons/logo/Makefile7
-rw-r--r--sys/modules/syscons/plasma/Makefile7
-rw-r--r--sys/modules/syscons/rain/Makefile7
-rw-r--r--sys/modules/syscons/snake/Makefile7
-rw-r--r--sys/modules/syscons/star/Makefile7
-rw-r--r--sys/modules/syscons/warp/Makefile7
-rw-r--r--sys/modules/sysvipc/Makefile4
-rw-r--r--sys/modules/sysvipc/Makefile.inc2
-rw-r--r--sys/modules/sysvipc/sysvmsg/Makefile9
-rw-r--r--sys/modules/sysvipc/sysvsem/Makefile9
-rw-r--r--sys/modules/sysvipc/sysvshm/Makefile9
-rw-r--r--sys/modules/tarfs/Makefile22
-rw-r--r--sys/modules/tcp/Makefile20
-rw-r--r--sys/modules/tcp/bbr/Makefile22
-rw-r--r--sys/modules/tcp/rack/Makefile22
-rw-r--r--sys/modules/tcp/tcpmd5/Makefile7
-rw-r--r--sys/modules/tests/Makefile8
-rw-r--r--sys/modules/tests/callout_test/Makefile14
-rw-r--r--sys/modules/tests/fib_lookup/Makefile10
-rw-r--r--sys/modules/tests/framework/Makefile15
-rw-r--r--sys/modules/ti/Makefile9
-rw-r--r--sys/modules/tmpfs/Makefile9
-rw-r--r--sys/modules/toecore/Makefile10
-rw-r--r--sys/modules/tpm/Makefile12
-rw-r--r--sys/modules/tsec/Makefile10
-rw-r--r--sys/modules/tws/Makefile9
-rw-r--r--sys/modules/uart/Makefile43
-rw-r--r--sys/modules/ubser/Makefile8
-rw-r--r--sys/modules/uchcom/Makefile8
-rw-r--r--sys/modules/ucycom/Makefile8
-rw-r--r--sys/modules/udf/Makefile10
-rw-r--r--sys/modules/udf_iconv/Makefile8
-rw-r--r--sys/modules/ufs/Makefile18
-rw-r--r--sys/modules/uinput/Makefile8
-rw-r--r--sys/modules/unionfs/Makefile8
-rw-r--r--sys/modules/usb/Makefile106
-rw-r--r--sys/modules/usb/atmegadci/Makefile41
-rw-r--r--sys/modules/usb/atp/Makefile10
-rw-r--r--sys/modules/usb/aue/Makefile36
-rw-r--r--sys/modules/usb/avr32dci/Makefile37
-rw-r--r--sys/modules/usb/axe/Makefile36
-rw-r--r--sys/modules/usb/axge/Makefile9
-rw-r--r--sys/modules/usb/cdce/Makefile36
-rw-r--r--sys/modules/usb/cdceem/Makefile10
-rw-r--r--sys/modules/usb/cfumass/Makefile8
-rw-r--r--sys/modules/usb/cp2112/Makefile36
-rw-r--r--sys/modules/usb/cue/Makefile36
-rw-r--r--sys/modules/usb/dwc_otg/Makefile37
-rw-r--r--sys/modules/usb/ehci/Makefile37
-rw-r--r--sys/modules/usb/g_audio/Makefile34
-rw-r--r--sys/modules/usb/g_keyboard/Makefile34
-rw-r--r--sys/modules/usb/g_modem/Makefile34
-rw-r--r--sys/modules/usb/g_mouse/Makefile34
-rw-r--r--sys/modules/usb/ipheth/Makefile36
-rw-r--r--sys/modules/usb/kue/Makefile36
-rw-r--r--sys/modules/usb/mos/Makefile36
-rw-r--r--sys/modules/usb/muge/Makefile12
-rw-r--r--sys/modules/usb/musb/Makefile41
-rw-r--r--sys/modules/usb/ohci/Makefile37
-rw-r--r--sys/modules/usb/quirk/Makefile35
-rw-r--r--sys/modules/usb/rsu/Makefile9
-rw-r--r--sys/modules/usb/rsufw/Makefile4
-rw-r--r--sys/modules/usb/rsufw/Makefile.inc14
-rw-r--r--sys/modules/usb/rsufw/rsurtl8712fw/Makefile5
-rw-r--r--sys/modules/usb/rue/Makefile35
-rw-r--r--sys/modules/usb/rum/Makefile35
-rw-r--r--sys/modules/usb/run/Makefile35
-rw-r--r--sys/modules/usb/runfw/Makefile10
-rw-r--r--sys/modules/usb/smsc/Makefile37
-rw-r--r--sys/modules/usb/template/Makefile52
-rw-r--r--sys/modules/usb/u3g/Makefile35
-rw-r--r--sys/modules/usb/uacpi/Makefile35
-rw-r--r--sys/modules/usb/uark/Makefile35
-rw-r--r--sys/modules/usb/uath/Makefile9
-rw-r--r--sys/modules/usb/ubsa/Makefile35
-rw-r--r--sys/modules/usb/ubser/Makefile35
-rw-r--r--sys/modules/usb/uchcom/Makefile35
-rw-r--r--sys/modules/usb/ucom/Makefile37
-rw-r--r--sys/modules/usb/ucycom/Makefile35
-rw-r--r--sys/modules/usb/udav/Makefile36
-rw-r--r--sys/modules/usb/udbp/Makefile36
-rw-r--r--sys/modules/usb/udl/Makefile11
-rw-r--r--sys/modules/usb/uep/Makefile10
-rw-r--r--sys/modules/usb/uether/Makefile38
-rw-r--r--sys/modules/usb/ufoma/Makefile35
-rw-r--r--sys/modules/usb/uftdi/Makefile35
-rw-r--r--sys/modules/usb/ugensa/Makefile35
-rw-r--r--sys/modules/usb/ugold/Makefile12
-rw-r--r--sys/modules/usb/uhci/Makefile37
-rw-r--r--sys/modules/usb/uhid/Makefile37
-rw-r--r--sys/modules/usb/uhid_snes/Makefile35
-rw-r--r--sys/modules/usb/uhso/Makefile36
-rw-r--r--sys/modules/usb/uipaq/Makefile35
-rw-r--r--sys/modules/usb/ukbd/Makefile36
-rw-r--r--sys/modules/usb/uled/Makefile35
-rw-r--r--sys/modules/usb/ulpt/Makefile35
-rw-r--r--sys/modules/usb/umass/Makefile35
-rw-r--r--sys/modules/usb/umcs/Makefile35
-rw-r--r--sys/modules/usb/umct/Makefile35
-rw-r--r--sys/modules/usb/umodem/Makefile35
-rw-r--r--sys/modules/usb/umoscom/Makefile35
-rw-r--r--sys/modules/usb/ums/Makefile35
-rw-r--r--sys/modules/usb/upgt/Makefile9
-rw-r--r--sys/modules/usb/uplcom/Makefile35
-rw-r--r--sys/modules/usb/ural/Makefile35
-rw-r--r--sys/modules/usb/ure/Makefile9
-rw-r--r--sys/modules/usb/urio/Makefile34
-rw-r--r--sys/modules/usb/urndis/Makefile36
-rw-r--r--sys/modules/usb/urtw/Makefile9
-rw-r--r--sys/modules/usb/usb/Makefile45
-rw-r--r--sys/modules/usb/usbhid/Makefile9
-rw-r--r--sys/modules/usb/usfs/Makefile35
-rw-r--r--sys/modules/usb/usie/Makefile34
-rw-r--r--sys/modules/usb/uslcom/Makefile35
-rw-r--r--sys/modules/usb/uss820dci/Makefile41
-rw-r--r--sys/modules/usb/uvisor/Makefile35
-rw-r--r--sys/modules/usb/uvscom/Makefile35
-rw-r--r--sys/modules/usb/wmt/Makefile9
-rw-r--r--sys/modules/usb/wsp/Makefile35
-rw-r--r--sys/modules/usb/xhci/Makefile37
-rw-r--r--sys/modules/usb/zyd/Makefile35
-rw-r--r--sys/modules/veriexec/Makefile11
-rw-r--r--sys/modules/vesa/Makefile12
-rw-r--r--sys/modules/vge/Makefile7
-rw-r--r--sys/modules/viawd/Makefile7
-rw-r--r--sys/modules/videomode/Makefile39
-rw-r--r--sys/modules/virtio/Makefile27
-rw-r--r--sys/modules/virtio/balloon/Makefile32
-rw-r--r--sys/modules/virtio/block/Makefile32
-rw-r--r--sys/modules/virtio/console/Makefile32
-rw-r--r--sys/modules/virtio/network/Makefile33
-rw-r--r--sys/modules/virtio/pci/Makefile33
-rw-r--r--sys/modules/virtio/random/Makefile32
-rw-r--r--sys/modules/virtio/scsi/Makefile32
-rw-r--r--sys/modules/virtio/virtio/Makefile36
-rw-r--r--sys/modules/vkbd/Makefile13
-rw-r--r--sys/modules/vmd/Makefile13
-rw-r--r--sys/modules/vmm/Makefile90
-rw-r--r--sys/modules/vmware/Makefile29
-rw-r--r--sys/modules/vmware/pvscsi/Makefile9
-rw-r--r--sys/modules/vmware/vmci/Makefile10
-rw-r--r--sys/modules/vmware/vmxnet3/Makefile32
-rw-r--r--sys/modules/vnic/Makefile9
-rw-r--r--sys/modules/vnic/mrmlbus/Makefile15
-rw-r--r--sys/modules/vnic/thunder_bgx/Makefile15
-rw-r--r--sys/modules/vnic/thunder_mdio/Makefile15
-rw-r--r--sys/modules/vnic/vnicpf/Makefile15
-rw-r--r--sys/modules/vnic/vnicvf/Makefile15
-rw-r--r--sys/modules/vr/Makefile8
-rw-r--r--sys/modules/vte/Makefile7
-rw-r--r--sys/modules/wbwd/Makefile8
-rw-r--r--sys/modules/wdatwd/Makefile8
-rw-r--r--sys/modules/wlan/Makefile26
-rw-r--r--sys/modules/wlan_acl/Makefile8
-rw-r--r--sys/modules/wlan_amrr/Makefile8
-rw-r--r--sys/modules/wlan_ccmp/Makefile10
-rw-r--r--sys/modules/wlan_rssadapt/Makefile8
-rw-r--r--sys/modules/wlan_tkip/Makefile8
-rw-r--r--sys/modules/wlan_wep/Makefile8
-rw-r--r--sys/modules/wlan_xauth/Makefile8
-rw-r--r--sys/modules/wpi/Makefile7
-rw-r--r--sys/modules/wpifw/Makefile12
-rw-r--r--sys/modules/wtap/Makefile23
-rw-r--r--sys/modules/x86bios/Makefile13
-rw-r--r--sys/modules/xdr/Makefile13
-rw-r--r--sys/modules/xl/Makefile7
-rw-r--r--sys/modules/xz/Makefile23
-rw-r--r--sys/modules/zfs/Makefile527
-rw-r--r--sys/modules/zfs/static_ccompile.h28
-rw-r--r--sys/modules/zfs/zfs_config.h1149
-rw-r--r--sys/modules/zfs/zfs_gitrev.h1
-rw-r--r--sys/modules/zlib/Makefile29
1089 files changed, 19513 insertions, 0 deletions
diff --git a/sys/modules/3dfx/Makefile b/sys/modules/3dfx/Makefile
new file mode 100644
index 000000000000..8d553b25c656
--- /dev/null
+++ b/sys/modules/3dfx/Makefile
@@ -0,0 +1,11 @@
+
+.PATH: ${SRCTOP}/sys/dev/tdfx
+
+KMOD= 3dfx
+SRCS= bus_if.h pci_if.h device_if.h tdfx_pci.h tdfx_io.h\
+ tdfx_vars.h tdfx_pci.c
+
+# Uncomment this for debugging messages
+#CFLAGS+= -DDEBUG
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/3dfx_linux/Makefile b/sys/modules/3dfx_linux/Makefile
new file mode 100644
index 000000000000..b6da59fd35c2
--- /dev/null
+++ b/sys/modules/3dfx_linux/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/tdfx
+
+KMOD= 3dfx_linux
+SRCS= tdfx_linux.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/Makefile b/sys/modules/Makefile
new file mode 100644
index 000000000000..3eff75312fd3
--- /dev/null
+++ b/sys/modules/Makefile
@@ -0,0 +1,916 @@
+
+SYSDIR?=${SRCTOP}/sys
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+SUBDIR_PARALLEL=
+
+# Modules that include binary-only blobs of microcode should be selectable by
+# MK_SOURCELESS_UCODE option (see below).
+
+.include "${SYSDIR}/conf/config.mk"
+
+.if defined(MODULES_OVERRIDE) && !defined(ALL_MODULES)
+SUBDIR=${MODULES_OVERRIDE}
+.else
+SUBDIR= \
+ ${_3dfx} \
+ ${_3dfx_linux} \
+ ${_aac} \
+ ${_aacraid} \
+ accf_data \
+ accf_dns \
+ accf_http \
+ acl_nfs4 \
+ acl_posix1e \
+ ${_acpi} \
+ ae \
+ ${_aesni} \
+ age \
+ ${_agp} \
+ ahci \
+ aic7xxx \
+ alc \
+ ale \
+ alq \
+ ${_amd_ecc_inject} \
+ ${_amdgpio} \
+ ${_amdsbwd} \
+ ${_amdsmn} \
+ ${_amdtemp} \
+ ${_aout} \
+ ${_arcmsr} \
+ ${_allwinner} \
+ ${_armv8crypto} \
+ ${_asmc} \
+ ata \
+ ath \
+ ath_dfs \
+ ath_hal \
+ ath_hal_ar5210 \
+ ath_hal_ar5211 \
+ ath_hal_ar5212 \
+ ath_hal_ar5416 \
+ ath_hal_ar9300 \
+ ath_main \
+ ath_rate \
+ ${_autofs} \
+ axgbe \
+ backlight \
+ ${_bce} \
+ ${_bcm283x_clkman} \
+ ${_bcm283x_pwm} \
+ bfe \
+ bge \
+ bhnd \
+ ${_bxe} \
+ ${_bios} \
+ ${_blake2} \
+ ${_bnxt} \
+ bridgestp \
+ bwi \
+ bwn \
+ ${_bytgpio} \
+ ${_chvgpio} \
+ cam \
+ ${_cardbus} \
+ ${_carp} \
+ cas \
+ ${_cbb} \
+ cc \
+ ${_ccp} \
+ cd9660 \
+ cd9660_iconv \
+ ${_cfi} \
+ ${_chromebook_platform} \
+ ${_ciss} \
+ ${_coretemp} \
+ ${_cpsw} \
+ ${_cpuctl} \
+ ${_cpufreq} \
+ ${_crypto} \
+ ${_cryptodev} \
+ ctl \
+ ${_cxgb} \
+ ${_cxgbe} \
+ dc \
+ dcons \
+ dcons_crom \
+ ${_dpaa2} \
+ ${_dpdk_lpm4} \
+ ${_dpdk_lpm6} \
+ ${_dpms} \
+ dummynet \
+ ${_dwwdt} \
+ ${_e6000sw} \
+ ${_efirt} \
+ ${_em} \
+ ${_ena} \
+ ${_enic} \
+ ${_enetc} \
+ ${_et} \
+ evdev \
+ ${_exca} \
+ ext2fs \
+ fdc \
+ fdescfs \
+ ${_felix} \
+ ${_ffec} \
+ ${_fib_dxr} \
+ filemon \
+ firewire \
+ firmware \
+ flash \
+ ${_ftgpio} \
+ ${_ftwd} \
+ fusefs \
+ ${_fxp} \
+ gem \
+ geom \
+ ${_glxiic} \
+ ${_glxsb} \
+ gpio \
+ ${_gve} \
+ hid \
+ hifn \
+ ${_hpt27xx} \
+ ${_hptiop} \
+ ${_hptmv} \
+ ${_hptnr} \
+ ${_hptrr} \
+ hwpmc \
+ ${_hyperv} \
+ i2c \
+ ${_iavf} \
+ ${_ibcore} \
+ ${_ichwd} \
+ ${_ice} \
+ ${_ice_ddp} \
+ ${_irdma} \
+ ${_ida} \
+ if_bridge \
+ ${_if_cgem} \
+ if_disc \
+ if_edsc \
+ ${_if_enc} \
+ if_epair \
+ ${_if_gif} \
+ ${_if_gre} \
+ ${_if_me} \
+ if_infiniband \
+ if_lagg \
+ if_ovpn \
+ ${_if_stf} \
+ if_tuntap \
+ if_vlan \
+ if_vxlan \
+ ${_if_wg} \
+ iflib \
+ ${_igc} \
+ imgact_binmisc \
+ ${_intelspi} \
+ ${_io} \
+ ${_ioat} \
+ ${_ipoib} \
+ ipdivert \
+ ${_ipfilter} \
+ ${_ipfw} \
+ ipfw_nat \
+ ${_ipfw_nat64} \
+ ${_ipfw_nptv6} \
+ ${_ipfw_pmod} \
+ ${_ipmi} \
+ ip6_mroute_mod \
+ ip_mroute_mod \
+ ${_ips} \
+ ${_ipsec} \
+ ${_ipw} \
+ ${_ipwfw} \
+ ${_isci} \
+ ${_iser} \
+ isp \
+ ${_ispfw} \
+ ${_itwd} \
+ ${_iwi} \
+ ${_iwifw} \
+ ${_iwlwifi} \
+ ${_iwlwififw} \
+ ${_iwm} \
+ ${_iwmfw} \
+ ${_iwn} \
+ ${_iwnfw} \
+ ${_ix} \
+ ${_ixv} \
+ ${_ixl} \
+ jme \
+ kbdmux \
+ kgssapi \
+ kgssapi_krb5 \
+ khelp \
+ krpc \
+ ksyms \
+ le \
+ lge \
+ libalias \
+ libiconv \
+ libmchain \
+ lindebugfs \
+ linuxkpi \
+ linuxkpi_hdmi \
+ linuxkpi_wlan \
+ ${_lio} \
+ lpt \
+ ${_mac_biba} \
+ ${_mac_bsdextended} \
+ ${_mac_ddb} \
+ ${_mac_ifoff} \
+ ${_mac_ipacl} \
+ ${_mac_lomac} \
+ ${_mac_mls} \
+ ${_mac_none} \
+ ${_mac_ntpd} \
+ ${_mac_partition} \
+ ${_mac_pimd} \
+ ${_mac_portacl} \
+ ${_mac_priority} \
+ ${_mac_seeotheruids} \
+ ${_mac_stub} \
+ ${_mac_test} \
+ ${_mac_veriexec} \
+ ${_mac_veriexec_sha1} \
+ ${_mac_veriexec_sha256} \
+ ${_mac_veriexec_sha384} \
+ ${_mac_veriexec_sha512} \
+ ${_malo} \
+ ${_mana} \
+ md \
+ mdio \
+ ${_mgb} \
+ mem \
+ mfi \
+ mii \
+ mlx \
+ mlxfw \
+ ${_mlx4} \
+ ${_mlx4ib} \
+ ${_mlx4en} \
+ ${_mlx5} \
+ ${_mlx5en} \
+ ${_mlx5ib} \
+ mmc \
+ mmcsd \
+ ${_mpi3mr} \
+ ${_mpr} \
+ ${_mps} \
+ mpt \
+ mqueue \
+ mrsas \
+ msdosfs \
+ msdosfs_iconv \
+ msk \
+ ${_mthca} \
+ mvs \
+ mwl \
+ ${_mwlfw} \
+ mxge \
+ my \
+ ${_nctgpio} \
+ ${_ncthwm} \
+ ${_neta} \
+ netlink \
+ ${_netgraph} \
+ ${_nfe} \
+ nfscl \
+ nfscommon \
+ nfsd \
+ nfslockd \
+ nfssvc \
+ nlsysevent \
+ nge \
+ nmdm \
+ nullfs \
+ ${_ntb} \
+ ${_nvd} \
+ ${_nvdimm} \
+ ${_nvme} \
+ ${_nvram} \
+ oce \
+ ${_ocs_fc} \
+ ${_ossl} \
+ otus \
+ ${_otusfw} \
+ ow \
+ ${_padlock} \
+ ${_padlock_rng} \
+ ${_pchtherm} \
+ ${_pcfclock} \
+ ${_pf} \
+ ${_pflog} \
+ ${_pfsync} \
+ plip \
+ ${_pms} \
+ ppbus \
+ ppc \
+ ppi \
+ pps \
+ procfs \
+ proto \
+ pseudofs \
+ ${_pst} \
+ pty \
+ puc \
+ pwm \
+ ${_qat} \
+ ${_qatfw} \
+ ${_qat_c2xxx} \
+ ${_qat_c2xxxfw} \
+ ${_qlxge} \
+ ${_qlxgb} \
+ ${_qlxgbe} \
+ ${_qlnx} \
+ ral \
+ ${_ralfw} \
+ ${_random_fortuna} \
+ ${_random_other} \
+ rc4 \
+ ${_rdma} \
+ ${_rdrand_rng} \
+ re \
+ rl \
+ ${_rockchip} \
+ rtsx \
+ ${_rtw88} \
+ rtwn \
+ rtwn_pci \
+ rtwn_usb \
+ ${_rtwnfw} \
+ ${_s3} \
+ ${_safe} \
+ safexcel \
+ ${_sbni} \
+ scc \
+ ${_sctp} \
+ sdhci \
+ ${_sdhci_acpi} \
+ ${_sdhci_fdt} \
+ sdhci_pci \
+ sdio \
+ ${_sff} \
+ sem \
+ send \
+ ${_sfxge} \
+ sge \
+ ${_sgx} \
+ ${_sgx_linux} \
+ siftr \
+ siis \
+ sis \
+ sk \
+ ${_smartpqi} \
+ smbfs \
+ snp \
+ sound \
+ ${_speaker} \
+ spi \
+ ${_splash} \
+ ste \
+ stge \
+ ${_sume} \
+ ${_superio} \
+ ${_p2sb} \
+ sym \
+ ${_syscons} \
+ sysvipc \
+ tarfs \
+ tcp \
+ ${_ti} \
+ tmpfs \
+ ${_toecore} \
+ ${_tpm} \
+ tws \
+ uart \
+ udf \
+ udf_iconv \
+ ufs \
+ uinput \
+ unionfs \
+ usb \
+ ${_vesa} \
+ virtio \
+ vge \
+ ${_viawd} \
+ videomode \
+ vkbd \
+ ${_vmd} \
+ ${_vmm} \
+ ${_vmware} \
+ vr \
+ vte \
+ ${_wbwd} \
+ ${_wdatwd} \
+ wlan \
+ wlan_acl \
+ wlan_amrr \
+ wlan_ccmp \
+ wlan_rssadapt \
+ wlan_tkip \
+ wlan_wep \
+ wlan_xauth \
+ ${_wpi} \
+ ${_wpifw} \
+ ${_x86bios} \
+ xdr \
+ xl \
+ xz \
+ zlib
+
+.if ${MK_AUTOFS} != "no" || defined(ALL_MODULES)
+_autofs= autofs
+.endif
+
+.if ${MK_DTRACE} != "no" || defined(ALL_MODULES)
+.if ${KERN_OPTS:MKDTRACE_HOOKS}
+SUBDIR+= dtrace
+.endif
+SUBDIR+= opensolaris
+.endif
+
+# Requires bus_space_read_8
+.if ${MACHINE_ARCH} != "i386"
+_bnxt= bnxt
+.endif
+
+.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
+.if exists(${SRCTOP}/sys/opencrypto)
+_crypto= crypto
+_cryptodev= cryptodev
+_random_fortuna=random_fortuna
+_random_other= random_other
+.endif
+.endif
+
+.if ${MK_CUSE} != "no" || defined(ALL_MODULES)
+SUBDIR+= cuse
+.endif
+
+.if ${MK_EFI} != "no"
+.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
+_efirt= efirt
+.endif
+.endif
+
+.if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \
+ defined(ALL_MODULES)
+_carp= carp
+_toecore= toecore
+_if_enc= if_enc
+_if_gif= if_gif
+_if_gre= if_gre
+.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
+_if_wg= if_wg
+.endif
+_ipfw_pmod= ipfw_pmod
+.if ${KERN_OPTS:MIPSEC_SUPPORT} && !${KERN_OPTS:MIPSEC}
+_ipsec= ipsec
+.endif
+.if ${KERN_OPTS:MSCTP_SUPPORT} || ${KERN_OPTS:MSCTP}
+_sctp= sctp
+.endif
+.endif
+
+.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
+ defined(ALL_MODULES)
+_if_stf= if_stf
+.endif
+
+.if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES)
+_if_me= if_me
+_ipfw= ipfw
+.if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
+_ipfw_nat64= ipfw_nat64
+.endif
+.endif
+
+.if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
+_ipfw_nptv6= ipfw_nptv6
+.endif
+
+.if ${MK_IPFILTER} != "no" || defined(ALL_MODULES)
+_ipfilter= ipfilter
+.endif
+
+.if ${MK_INET_SUPPORT} != "no" && ${KERN_OPTS:MFIB_ALGO}
+_dpdk_lpm4= dpdk_lpm4
+_fib_dxr= fib_dxr
+.endif
+
+.if ${MK_INET6_SUPPORT} != "no" && ${KERN_OPTS:MFIB_ALGO}
+_dpdk_lpm6= dpdk_lpm6
+.endif
+
+.if ${MK_ISCSI} != "no" || defined(ALL_MODULES)
+SUBDIR+= cfiscsi
+SUBDIR+= iscsi
+.endif
+
+.if !empty(OPT_FDT)
+SUBDIR+= fdt
+.endif
+
+# Linuxulator
+.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
+ ${MACHINE_CPUARCH} == "i386"
+SUBDIR+= linprocfs
+SUBDIR+= linsysfs
+.endif
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
+SUBDIR+= linux
+.endif
+.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
+SUBDIR+= linux64
+SUBDIR+= linux_common
+.endif
+
+.if ${MACHINE_CPUARCH} != "arm"
+.if ${MK_OFED} != "no" || defined(ALL_MODULES)
+_ibcore= ibcore
+_ipoib= ipoib
+_iser= iser
+_mthca= mthca
+_rdma= rdma
+.endif
+.endif
+
+.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
+ ${MACHINE_CPUARCH} == "i386" || ${MACHINE_ARCH:Mpowerpc64*} != ""
+_ipmi= ipmi
+_mlx4= mlx4
+_mlx5= mlx5
+.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
+ defined(ALL_MODULES)
+_mlx4en= mlx4en
+_mlx5en= mlx5en
+.endif
+.if ${MK_OFED} != "no" || defined(ALL_MODULES)
+_mlx4ib= mlx4ib
+_mlx5ib= mlx5ib
+.endif
+.endif
+
+.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
+ ${MACHINE_CPUARCH} == "i386"
+_ena= ena
+_gve= gve
+_iwlwifi= iwlwifi
+.if ${MK_SOURCELESS_UCODE} != "no"
+_iwlwififw= iwlwififw
+.endif
+_ossl= ossl
+_rtw88= rtw88
+_vmware= vmware
+.endif
+
+# MAC framework
+.if ${KERN_OPTS:MMAC} || defined(ALL_MODULES)
+_mac_biba= mac_biba
+_mac_bsdextended= mac_bsdextended
+.if ${KERN_OPTS:MDDB} || defined(ALL_MODULES)
+_mac_ddb= mac_ddb
+.endif
+_mac_ifoff= mac_ifoff
+_mac_ipacl= mac_ipacl
+_mac_lomac= mac_lomac
+_mac_mls= mac_mls
+_mac_none= mac_none
+_mac_ntpd= mac_ntpd
+_mac_partition= mac_partition
+_mac_pimd= mac_pimd
+_mac_portacl= mac_portacl
+_mac_priority= mac_priority
+_mac_seeotheruids= mac_seeotheruids
+_mac_stub= mac_stub
+_mac_test= mac_test
+.if ${MK_VERIEXEC} != "no" || defined(ALL_MODULES)
+_mac_veriexec= mac_veriexec
+_mac_veriexec_sha1= mac_veriexec_sha1
+_mac_veriexec_sha256= mac_veriexec_sha256
+_mac_veriexec_sha384= mac_veriexec_sha384
+_mac_veriexec_sha512= mac_veriexec_sha512
+.endif
+.endif
+
+.if ${MK_NETGRAPH} != "no" || defined(ALL_MODULES)
+_netgraph= netgraph
+.endif
+
+.if (${MK_PF} != "no" && (${MK_INET_SUPPORT} != "no" || \
+ ${MK_INET6_SUPPORT} != "no")) || defined(ALL_MODULES)
+_pf= pf
+_pflog= pflog
+.if ${MK_INET_SUPPORT} != "no"
+_pfsync= pfsync
+.endif
+.endif
+
+.if ${MK_SOURCELESS_UCODE} != "no"
+_bce= bce
+_fxp= fxp
+_ispfw= ispfw
+_ti= ti
+_mwlfw= mwlfw
+_otusfw= otusfw
+_ralfw= ralfw
+_rtwnfw= rtwnfw
+.endif
+
+.if ${MK_SOURCELESS_UCODE} != "no" && ${MACHINE_CPUARCH} != "arm" && \
+ ${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe" && \
+ ${MACHINE_CPUARCH} != "riscv"
+_cxgbe= cxgbe
+.endif
+
+# This has only been tested on amd64 and arm64
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "aarch64"
+_mpi3mr=mpi3mr
+.endif
+
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "aarch64" || \
+ ${MACHINE_ARCH:Mpowerpc64*}
+_ice= ice
+.if ${MK_SOURCELESS_UCODE} != "no"
+_ice_ddp= ice_ddp
+.endif
+.if ${MK_OFED} != "no" || defined(ALL_MODULES)
+.if ${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no"
+_irdma= irdma
+.endif
+.endif
+.endif
+
+.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" || \
+ ${MACHINE_CPUARCH} == "riscv"
+.if !empty(OPT_FDT)
+_if_cgem= if_cgem
+.endif
+.endif
+
+# These rely on 64bit atomics
+.if ${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe"
+_mps= mps
+_mpr= mpr
+.endif
+
+.if ${MK_TESTS} != "no" || defined(ALL_MODULES)
+SUBDIR+= ktest
+SUBDIR+= tests
+.endif
+
+.if ${MK_ZFS} != "no" || defined(ALL_MODULES)
+SUBDIR+= zfs
+.endif
+
+.if ${MK_SOURCELESS_UCODE} != "no"
+_cxgb= cxgb
+.endif
+
+.if ${MACHINE_CPUARCH} == "aarch64"
+_armv8crypto= armv8crypto
+_dpaa2= dpaa2
+_sff= sff
+_em= em
+_hyperv= hyperv
+
+.if !empty(OPT_FDT)
+_allwinner= allwinner
+_dwwdt= dwwdt
+_enetc= enetc
+_felix= felix
+_rockchip= rockchip
+.endif
+.endif
+
+.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm"
+.if !empty(OPT_FDT)
+_sdhci_fdt= sdhci_fdt
+.endif
+_e6000sw= e6000sw
+_neta= neta
+.endif
+
+.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
+_agp= agp
+.if ${MACHINE_CPUARCH} == "i386" || !empty(COMPAT_FREEBSD32_ENABLED)
+_aout= aout
+.endif
+_bios= bios
+.if ${MK_SOURCELESS_UCODE} != "no"
+_bxe= bxe
+.endif
+_cardbus= cardbus
+_cbb= cbb
+_cpuctl= cpuctl
+_cpufreq= cpufreq
+_dpms= dpms
+_em= em
+_et= et
+_ftgpio= ftgpio
+_ftwd= ftwd
+_exca= exca
+_igc= igc
+_io= io
+_itwd= itwd
+_ix= ix
+_ixv= ixv
+.if ${MK_SOURCELESS_UCODE} != "no"
+_lio= lio
+.endif
+_mana= mana
+_mgb= mgb
+_nctgpio= nctgpio
+_ncthwm= ncthwm
+_ntb= ntb
+_ocs_fc= ocs_fc
+_p2sb= p2sb
+_qat_c2xxx= qat_c2xxx
+_qat_c2xxxfw= qat_c2xxxfw
+_safe= safe
+_speaker= speaker
+_splash= splash
+_syscons= syscons
+_wbwd= wbwd
+_wdatwd= wdatwd
+
+_aac= aac
+_aacraid= aacraid
+_acpi= acpi
+.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
+_aesni= aesni
+.endif
+_amd_ecc_inject=amd_ecc_inject
+_amdsbwd= amdsbwd
+_amdsmn= amdsmn
+_amdtemp= amdtemp
+_arcmsr= arcmsr
+_asmc= asmc
+.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
+_blake2= blake2
+.endif
+_bytgpio= bytgpio
+_chvgpio= chvgpio
+_ciss= ciss
+_chromebook_platform= chromebook_platform
+_coretemp= coretemp
+.if ${MK_SOURCELESS_HOST} != "no" && empty(KCSAN_ENABLED)
+_hpt27xx= hpt27xx
+.endif
+_hptiop= hptiop
+.if ${MK_SOURCELESS_HOST} != "no" && empty(KCSAN_ENABLED)
+_hptmv= hptmv
+_hptnr= hptnr
+_hptrr= hptrr
+.endif
+_hyperv= hyperv
+_ichwd= ichwd
+_ida= ida
+_intelspi= intelspi
+_ips= ips
+_isci= isci
+_ipw= ipw
+_iwi= iwi
+_iwm= iwm
+_iwn= iwn
+.if ${MK_SOURCELESS_UCODE} != "no"
+_ipwfw= ipwfw
+_iwifw= iwifw
+_iwmfw= iwmfw
+_iwnfw= iwnfw
+.endif
+_nfe= nfe
+_nvd= nvd
+_nvme= nvme
+_nvram= nvram
+.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
+_padlock= padlock
+_padlock_rng= padlock_rng
+_rdrand_rng= rdrand_rng
+.endif
+_pchtherm = pchtherm
+_s3= s3
+_sdhci_acpi= sdhci_acpi
+_superio= superio
+_tpm= tpm
+_vesa= vesa
+_viawd= viawd
+_vmd= vmd
+_wpi= wpi
+.if ${MK_SOURCELESS_UCODE} != "no"
+_wpifw= wpifw
+.endif
+_x86bios= x86bios
+.endif
+
+.if ${MACHINE_CPUARCH} == "amd64"
+_amdgpio= amdgpio
+_ccp= ccp
+_enic= enic
+_iavf= iavf
+_ioat= ioat
+_ixl= ixl
+_nvdimm= nvdimm
+_pms= pms
+_qat= qat
+.if ${MK_SOURCELESS_UCODE} != "no"
+_qatfw= qatfw
+.endif
+_qlxge= qlxge
+_qlxgb= qlxgb
+_sume= sume
+.if ${MK_SOURCELESS_UCODE} != "no"
+_qlxgbe= qlxgbe
+_qlnx= qlnx
+.endif
+_sfxge= sfxge
+_sgx= sgx
+_sgx_linux= sgx_linux
+_smartpqi= smartpqi
+_p2sb= p2sb
+
+.if ${MK_BHYVE} != "no" || defined(ALL_MODULES)
+.if ${KERN_OPTS:MSMP}
+_vmm= vmm
+.endif
+.endif
+.endif
+
+.if ${MACHINE_CPUARCH} == "i386"
+# XXX some of these can move to the general case when de-i386'ed
+# XXX some of these can move now, but are untested on other architectures.
+_3dfx= 3dfx
+_3dfx_linux= 3dfx_linux
+_glxiic= glxiic
+_glxsb= glxsb
+_pcfclock= pcfclock
+_pst= pst
+_sbni= sbni
+.endif
+
+.if ${MACHINE_ARCH} == "armv7"
+_cfi= cfi
+_cpsw= cpsw
+.endif
+
+.if ${MACHINE_CPUARCH} == "powerpc"
+_aacraid= aacraid
+_agp= agp
+_an= an
+_cardbus= cardbus
+_cbb= cbb
+_cfi= cfi
+_cpufreq= cpufreq
+_exca= exca
+_ffec= ffec
+_nvd= nvd
+_nvme= nvme
+.endif
+
+.if ${MACHINE_ARCH:Mpowerpc64*} != ""
+_ixl= ixl
+_nvram= opal_nvram
+.endif
+
+.if ${MACHINE_CPUARCH} == "powerpc" && ${MACHINE_ARCH} != "powerpcspe"
+# Don't build powermac_nvram for powerpcspe, it's never supported.
+_nvram+= powermac_nvram
+.endif
+
+.if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "aarch64"
+_bcm283x_clkman= bcm283x_clkman
+_bcm283x_pwm= bcm283x_pwm
+.endif
+
+.if !(${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 110000)
+# LLVM 10 crashes when building if_malo_pci.c, fixed in LLVM11:
+# https://bugs.llvm.org/show_bug.cgi?id=44351
+_malo= malo
+.endif
+
+SUBDIR+=${MODULES_EXTRA}
+
+.for reject in ${WITHOUT_MODULES}
+SUBDIR:= ${SUBDIR:N${reject}}
+.endfor
+
+.endif # MODULES_OVERRIDE -- Keep last
+
+# Calling kldxref(8) for each module is expensive.
+.if !defined(NO_XREF)
+.MAKEFLAGS+= -DNO_XREF
+afterinstall: .PHONY
+ @if type kldxref >/dev/null 2>&1; then \
+ ${ECHO} ${KLDXREF_CMD} ${DESTDIR}${KMODDIR}; \
+ ${KLDXREF_CMD} ${DESTDIR}${KMODDIR}; \
+ fi
+.endif
+
+SUBDIR:= ${SUBDIR:u:O}
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/Makefile.inc b/sys/modules/Makefile.inc
new file mode 100644
index 000000000000..d6f8b49f655c
--- /dev/null
+++ b/sys/modules/Makefile.inc
@@ -0,0 +1,2 @@
+
+SUBDIR_PARALLEL= yes
diff --git a/sys/modules/aac/Makefile b/sys/modules/aac/Makefile
new file mode 100644
index 000000000000..549619098e78
--- /dev/null
+++ b/sys/modules/aac/Makefile
@@ -0,0 +1,17 @@
+
+.PATH: ${SRCTOP}/sys/dev/aac
+
+.if ${MACHINE_CPUARCH} == "i386"
+SUBDIR= aac_linux
+.endif
+
+KMOD= aac
+SRCS= aac.c aac_pci.c aac_disk.c aac_cam.c
+SRCS+= opt_scsi.h opt_cam.h opt_aac.h
+SRCS+= device_if.h bus_if.h pci_if.h
+
+# To enable debug output from the driver, uncomment these two lines.
+#CFLAGS+= -DAAC_DEBUG=2
+#SRCS+= aac_debug.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/aac/Makefile.inc b/sys/modules/aac/Makefile.inc
new file mode 100644
index 000000000000..d3b5cbd3a79b
--- /dev/null
+++ b/sys/modules/aac/Makefile.inc
@@ -0,0 +1,2 @@
+
+.include "../Makefile.inc"
diff --git a/sys/modules/aac/aac_linux/Makefile b/sys/modules/aac/aac_linux/Makefile
new file mode 100644
index 000000000000..b6ff82211308
--- /dev/null
+++ b/sys/modules/aac/aac_linux/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/aac
+
+KMOD= aac_linux
+SRCS= aac_linux.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/aacraid/Makefile b/sys/modules/aacraid/Makefile
new file mode 100644
index 000000000000..22815f9b4e56
--- /dev/null
+++ b/sys/modules/aacraid/Makefile
@@ -0,0 +1,20 @@
+
+.PATH: ${SRCTOP}/sys/dev/aacraid
+
+.if ${MACHINE_CPUARCH} == "i386"
+SUBDIR= aacraid_linux
+.endif
+
+KMOD= aacraid
+SRCS= aacraid.c aacraid_pci.c aacraid_cam.c
+.if ${MACHINE_CPUARCH} == "powerpc"
+SRCS+= aacraid_endian.c
+.endif
+SRCS+= opt_scsi.h opt_cam.h opt_aacraid.h
+SRCS+= device_if.h bus_if.h pci_if.h
+
+# To enable debug output from the driver, uncomment these two lines.
+#CFLAGS+= -DAACRAID_DEBUG=2
+#SRCS+= aacraid_debug.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/aacraid/Makefile.inc b/sys/modules/aacraid/Makefile.inc
new file mode 100644
index 000000000000..d3b5cbd3a79b
--- /dev/null
+++ b/sys/modules/aacraid/Makefile.inc
@@ -0,0 +1,2 @@
+
+.include "../Makefile.inc"
diff --git a/sys/modules/aacraid/aacraid_linux/Makefile b/sys/modules/aacraid/aacraid_linux/Makefile
new file mode 100644
index 000000000000..cf661c61d5a4
--- /dev/null
+++ b/sys/modules/aacraid/aacraid_linux/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/aacraid
+
+KMOD= aacraid_linux
+SRCS= aacraid_linux.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/accf_data/Makefile b/sys/modules/accf_data/Makefile
new file mode 100644
index 000000000000..10e7e6fa850d
--- /dev/null
+++ b/sys/modules/accf_data/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/netinet
+
+KMOD= accf_data
+SRCS= accf_data.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/accf_dns/Makefile b/sys/modules/accf_dns/Makefile
new file mode 100644
index 000000000000..c7c780843fe7
--- /dev/null
+++ b/sys/modules/accf_dns/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/netinet
+
+KMOD= accf_dns
+SRCS= accf_dns.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/accf_http/Makefile b/sys/modules/accf_http/Makefile
new file mode 100644
index 000000000000..dc491a819747
--- /dev/null
+++ b/sys/modules/accf_http/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/netinet
+
+KMOD= accf_http
+SRCS= accf_http.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/acl_nfs4/Makefile b/sys/modules/acl_nfs4/Makefile
new file mode 100644
index 000000000000..ae12090d11a9
--- /dev/null
+++ b/sys/modules/acl_nfs4/Makefile
@@ -0,0 +1,6 @@
+
+.PATH: ${SRCTOP}/sys/kern
+KMOD= acl_nfs4
+SRCS= vnode_if.h subr_acl_nfs4.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/acl_posix1e/Makefile b/sys/modules/acl_posix1e/Makefile
new file mode 100644
index 000000000000..f9333de37375
--- /dev/null
+++ b/sys/modules/acl_posix1e/Makefile
@@ -0,0 +1,6 @@
+
+.PATH: ${SRCTOP}/sys/kern
+KMOD= acl_posix1e
+SRCS= vnode_if.h subr_acl_posix1e.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/acpi/Makefile b/sys/modules/acpi/Makefile
new file mode 100644
index 000000000000..ee921a23aeb7
--- /dev/null
+++ b/sys/modules/acpi/Makefile
@@ -0,0 +1,6 @@
+
+SUBDIR= acpi_asus acpi_asus_wmi acpi_dock acpi_fujitsu acpi_hp \
+ acpi_ged acpi_ibm acpi_panasonic acpi_sony acpi_toshiba \
+ acpi_video acpi_wmi aibs
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/acpi/Makefile.inc b/sys/modules/acpi/Makefile.inc
new file mode 100644
index 000000000000..d3b5cbd3a79b
--- /dev/null
+++ b/sys/modules/acpi/Makefile.inc
@@ -0,0 +1,2 @@
+
+.include "../Makefile.inc"
diff --git a/sys/modules/acpi/acpi_asus/Makefile b/sys/modules/acpi/acpi_asus/Makefile
new file mode 100644
index 000000000000..234fc11c3355
--- /dev/null
+++ b/sys/modules/acpi/acpi_asus/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/acpi_support
+
+KMOD= acpi_asus
+SRCS= acpi_asus.c opt_acpi.h acpi_if.h bus_if.h device_if.h
+SRCS+= opt_ddb.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/acpi/acpi_asus_wmi/Makefile b/sys/modules/acpi/acpi_asus_wmi/Makefile
new file mode 100644
index 000000000000..0e831bf05e47
--- /dev/null
+++ b/sys/modules/acpi/acpi_asus_wmi/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/acpi_support
+
+KMOD= acpi_asus_wmi
+CFLAGS+=-I${SRCTOP}/sys/dev/acpi_support
+SRCS= acpi_asus_wmi.c opt_acpi.h acpi_if.h acpi_wmi_if.h device_if.h bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/acpi/acpi_dock/Makefile b/sys/modules/acpi/acpi_dock/Makefile
new file mode 100644
index 000000000000..f9856e1295d2
--- /dev/null
+++ b/sys/modules/acpi/acpi_dock/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/acpica
+KMOD= acpi_dock
+SRCS= acpi_dock.c opt_acpi.h device_if.h bus_if.h acpi_if.h
+SRCS+= opt_ddb.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/acpi/acpi_fujitsu/Makefile b/sys/modules/acpi/acpi_fujitsu/Makefile
new file mode 100644
index 000000000000..8053f9891e65
--- /dev/null
+++ b/sys/modules/acpi/acpi_fujitsu/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/acpi_support
+
+KMOD= acpi_fujitsu
+CFLAGS+=-I${SRCTOP}/sys/dev/acpi_support
+SRCS= acpi_fujitsu.c opt_acpi.h acpi_if.h device_if.h bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/acpi/acpi_ged/Makefile b/sys/modules/acpi/acpi_ged/Makefile
new file mode 100644
index 000000000000..3cfc3b51a21e
--- /dev/null
+++ b/sys/modules/acpi/acpi_ged/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/acpica
+KMOD= acpi_ged
+SRCS= acpi_ged.c
+SRCS+= opt_acpi.h opt_evdev.h acpi_if.h bus_if.h device_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/acpi/acpi_hp/Makefile b/sys/modules/acpi/acpi_hp/Makefile
new file mode 100644
index 000000000000..0d1a03c30b6b
--- /dev/null
+++ b/sys/modules/acpi/acpi_hp/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/acpi_support
+
+KMOD= acpi_hp
+CFLAGS+=-I${SRCTOP}/sys/dev/acpi_support
+SRCS= acpi_hp.c opt_acpi.h acpi_if.h acpi_wmi_if.h device_if.h bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/acpi/acpi_ibm/Makefile b/sys/modules/acpi/acpi_ibm/Makefile
new file mode 100644
index 000000000000..9e815ccc9e80
--- /dev/null
+++ b/sys/modules/acpi/acpi_ibm/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/acpi_support
+KMOD= acpi_ibm
+SRCS= acpi_ibm.c opt_acpi.h device_if.h bus_if.h acpi_if.h
+SRCS+= opt_ddb.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/acpi/acpi_panasonic/Makefile b/sys/modules/acpi/acpi_panasonic/Makefile
new file mode 100644
index 000000000000..60a04cecb57f
--- /dev/null
+++ b/sys/modules/acpi/acpi_panasonic/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/acpi_support
+
+KMOD= acpi_panasonic
+SRCS= acpi_panasonic.c opt_acpi.h acpi_if.h bus_if.h device_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/acpi/acpi_rapidstart/Makefile b/sys/modules/acpi/acpi_rapidstart/Makefile
new file mode 100644
index 000000000000..109fc30ba1d5
--- /dev/null
+++ b/sys/modules/acpi/acpi_rapidstart/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/acpi_support
+
+KMOD= acpi_rapidstart
+SRCS= acpi_rapidstart.c opt_acpi.h device_if.h bus_if.h acpi_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/acpi/acpi_sony/Makefile b/sys/modules/acpi/acpi_sony/Makefile
new file mode 100644
index 000000000000..b1c93c3d4be1
--- /dev/null
+++ b/sys/modules/acpi/acpi_sony/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/acpi_support
+
+KMOD= acpi_sony
+SRCS= acpi_sony.c opt_acpi.h device_if.h bus_if.h acpi_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/acpi/acpi_toshiba/Makefile b/sys/modules/acpi/acpi_toshiba/Makefile
new file mode 100644
index 000000000000..2f6190e1524f
--- /dev/null
+++ b/sys/modules/acpi/acpi_toshiba/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/acpi_support
+
+KMOD= acpi_toshiba
+SRCS= acpi_toshiba.c opt_acpi.h acpi_if.h bus_if.h device_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/acpi/acpi_video/Makefile b/sys/modules/acpi/acpi_video/Makefile
new file mode 100644
index 000000000000..78c20b705cb9
--- /dev/null
+++ b/sys/modules/acpi/acpi_video/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/acpica
+
+KMOD= acpi_video
+SRCS= acpi_video.c
+SRCS+= opt_acpi.h opt_evdev.h acpi_if.h bus_if.h device_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/acpi/acpi_wmi/Makefile b/sys/modules/acpi/acpi_wmi/Makefile
new file mode 100644
index 000000000000..850be463e076
--- /dev/null
+++ b/sys/modules/acpi/acpi_wmi/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/acpi_support
+
+KMOD= acpi_wmi
+CFLAGS+=-I${SRCTOP}/sys/dev/acpi_support
+SRCS= acpi_wmi.c opt_acpi.h acpi_if.h acpi_wmi_if.h device_if.h bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/acpi/aibs/Makefile b/sys/modules/acpi/aibs/Makefile
new file mode 100644
index 000000000000..b3af05552f8f
--- /dev/null
+++ b/sys/modules/acpi/aibs/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/acpi_support
+
+KMOD= aibs
+SRCS= atk0110.c
+SRCS+= opt_acpi.h acpi_if.h bus_if.h device_if.h
+SRCS+= opt_ddb.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/adlink/Makefile b/sys/modules/adlink/Makefile
new file mode 100644
index 000000000000..1d5931cfcc9b
--- /dev/null
+++ b/sys/modules/adlink/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/adlink
+
+KMOD= adlink
+SRCS= adlink.c \
+ device_if.h bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ae/Makefile b/sys/modules/ae/Makefile
new file mode 100644
index 000000000000..b9e1e6bf16b6
--- /dev/null
+++ b/sys/modules/ae/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/ae
+
+KMOD= if_ae
+SRCS= if_ae.c device_if.h bus_if.h pci_if.h miibus_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/aesni/Makefile b/sys/modules/aesni/Makefile
new file mode 100644
index 000000000000..2ae256e40e89
--- /dev/null
+++ b/sys/modules/aesni/Makefile
@@ -0,0 +1,48 @@
+
+.PATH: ${SRCTOP}/sys/crypto/aesni
+.PATH: ${SRCTOP}/contrib/llvm-project/clang/lib/Headers
+
+KMOD= aesni
+SRCS= aesni.c
+SRCS+= aeskeys_${MACHINE_CPUARCH}.S
+SRCS+= device_if.h bus_if.h opt_bus.h cryptodev_if.h
+
+OBJS+= aesni_ghash.o aesni_wrap.o aesni_ccm.o
+OBJS+= intel_sha1.o intel_sha256.o
+
+# Remove -nostdinc so we can get the intrinsics.
+aesni_ghash.o: aesni_ghash.c
+ ${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${PROF} \
+ -mmmx -msse -msse4 -maes -mpclmul ${.IMPSRC}
+ ${CTFCONVERT_CMD}
+
+aesni_ccm.o: aesni_ccm.c
+ ${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${PROF} \
+ -mmmx -msse -msse4 -maes -mpclmul ${.IMPSRC}
+ ${CTFCONVERT_CMD}
+
+aesni_wrap.o: aesni_wrap.c
+ ${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${PROF} \
+ -mmmx -msse -msse4 -maes ${.IMPSRC}
+ ${CTFCONVERT_CMD}
+
+intel_sha1.o: intel_sha1.c
+ ${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${PROF} \
+ -mmmx -msse -msse4 -msha ${.IMPSRC}
+ ${CTFCONVERT_CMD}
+
+intel_sha256.o: intel_sha256.c
+ ${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${PROF} \
+ -mmmx -msse -msse4 -msha ${.IMPSRC}
+ ${CTFCONVERT_CMD}
+
+aesni_ghash.o: aesni.h
+aesni_wrap.o: aesni.h
+aesni_ccm.o: aesni.h
+intel_sha1.o: sha_sse.h immintrin.h shaintrin.h tmmintrin.h xmmintrin.h
+intel_sha256.o: sha_sse.h immintrin.h shaintrin.h tmmintrin.h xmmintrin.h
+
+.include <bsd.kmod.mk>
+
+CWARNFLAGS.aesni_ghash.c= ${NO_WCAST_QUAL}
+CWARNFLAGS.aesni_wrap.c= ${NO_WCAST_QUAL}
diff --git a/sys/modules/age/Makefile b/sys/modules/age/Makefile
new file mode 100644
index 000000000000..e1e895222b2c
--- /dev/null
+++ b/sys/modules/age/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/age
+
+KMOD= if_age
+SRCS= if_age.c device_if.h bus_if.h pci_if.h miibus_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/agp/Makefile b/sys/modules/agp/Makefile
new file mode 100644
index 000000000000..c5ce53d2ef13
--- /dev/null
+++ b/sys/modules/agp/Makefile
@@ -0,0 +1,46 @@
+
+.PATH: ${SRCTOP}/sys/dev/agp
+
+KMOD= agp
+SRCS= agp.c agp_if.c
+.if ${MACHINE_CPUARCH} == "i386"
+SRCS+= agp_i810.c agp_intel.c agp_via.c agp_sis.c agp_ali.c agp_amd.c \
+ agp_nvidia.c agp_ati.c
+.endif
+.if ${MACHINE} == "i386"
+SRCS+= agp_amd64.c
+.endif
+.if ${MACHINE_CPUARCH} == "amd64"
+SRCS+= agp_amd64.c agp_i810.c agp_via.c
+.endif
+.if ${MACHINE_CPUARCH} == "powerpc"
+SRCS+= agp_apple.c
+.endif
+SRCS+= device_if.h bus_if.h agp_if.h pci_if.h
+SRCS+= opt_agp.h
+
+EXPORT_SYMS= agp_find_device \
+ agp_state \
+ agp_acquire \
+ agp_release \
+ agp_enable \
+ agp_alloc_memory \
+ agp_free_memory \
+ agp_bind_memory \
+ agp_unbind_memory \
+ agp_memory_info
+
+
+.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
+EXPORT_SYMS+= intel_gtt_clear_range \
+ intel_gtt_insert_pages \
+ intel_gtt_install_pte \
+ intel_gtt_get \
+ intel_gtt_chipset_flush \
+ intel_gtt_unmap_memory \
+ intel_gtt_map_memory \
+ intel_gtt_insert_sg_entries \
+ intel_gtt_get_bridge_device
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ahci/Makefile b/sys/modules/ahci/Makefile
new file mode 100644
index 000000000000..b7d8aadc4fc0
--- /dev/null
+++ b/sys/modules/ahci/Makefile
@@ -0,0 +1,11 @@
+
+.PATH: ${SRCTOP}/sys/dev/ahci
+
+KMOD= ahci
+SRCS= ahci.c ahci_pci.c ahciem.c ahci.h device_if.h bus_if.h pci_if.h opt_cam.h
+
+.if ${MACHINE_CPUARCH} == "aarch64"
+SRCS+= ahci_generic.c acpi_if.h ofw_bus_if.h
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/aic7xxx/Makefile b/sys/modules/aic7xxx/Makefile
new file mode 100644
index 000000000000..720a7709a31d
--- /dev/null
+++ b/sys/modules/aic7xxx/Makefile
@@ -0,0 +1,20 @@
+
+SUBDIR= ahc ahd
+
+firmware: aicasm/aicasm ahdfirmware ahcfirmware
+
+aicasm/aicasm:
+ ( cd ${.CURDIR}/aicasm ; ${MAKE} aicasm )
+
+ahdfirmware:
+ ( cd ${.CURDIR}/ahd ; ${MAKE} ahdfirmware )
+
+ahcfirmware:
+ ( cd ${.CURDIR}/ahc ; ${MAKE} ahcfirmware )
+
+cleanfirmware:
+ ( cd .${CURDIR}/aicasm ; ${MAKE} clean )
+ ( cd .${CURDIR}/ahc ; ${MAKE} cleanfirmware )
+ ( cd .${CURDIR}/ahd ; ${MAKE} cleanfirmware )
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/aic7xxx/Makefile.inc b/sys/modules/aic7xxx/Makefile.inc
new file mode 100644
index 000000000000..d3b5cbd3a79b
--- /dev/null
+++ b/sys/modules/aic7xxx/Makefile.inc
@@ -0,0 +1,2 @@
+
+.include "../Makefile.inc"
diff --git a/sys/modules/aic7xxx/ahc/Makefile b/sys/modules/aic7xxx/ahc/Makefile
new file mode 100644
index 000000000000..8fc4c68feebb
--- /dev/null
+++ b/sys/modules/aic7xxx/ahc/Makefile
@@ -0,0 +1,55 @@
+
+SYSDIR?=${SRCTOP}/sys
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+.PATH: ${SYSDIR}/dev/aic7xxx
+KMOD= ahc
+SUBDIR+= ahc_isa ahc_pci
+
+GENSRCS= aic7xxx_seq.h aic7xxx_reg.h
+# AHC_REG_PRETTY_PRINT=1
+REG_PRINT_OPT=
+.ifdef AHC_REG_PRETTY_PRINT
+GENSRCS+= aic7xxx_reg_print.c
+CFLAGS+= -DAHC_REG_PRETTY_PRINT=1
+REG_PRINT_OPT= -p aic7xxx_reg_print.c
+.endif
+BEFORE_DEPEND = ${GENSRCS}
+
+../aicasm/aicasm: ${SYSDIR}/dev/aic7xxx/aicasm/*.[chyl]
+ ( cd ${.CURDIR}/../aicasm; ${MAKE} aicasm; )
+
+.if make(ahcfirmware)
+ahcfirmware: ${GENSRCS}
+${GENSRCS}: \
+ ${SYSDIR}/dev/aic7xxx/aic7xxx.{reg,seq} \
+ ${SYSDIR}/cam/scsi/scsi_message.h
+ ../aicasm/aicasm ${INCLUDES} -I${SYSDIR}/cam/scsi \
+ -I${SYSDIR}/dev/aic7xxx \
+ -o aic7xxx_seq.h -r aic7xxx_reg.h \
+ ${REG_PRINT_OPT} \
+ -i ${SYSDIR}/dev/aic7xxx/aic7xxx_osm.h \
+ ${SYSDIR}/dev/aic7xxx/aic7xxx.seq
+.elif defined(.MAKE.LEVEL)
+# This target interfers with fmake's world view and causes this message
+# to appear when building the tree from 8.x worlds where fmake is the
+# default. fmake doens't define .MAKE.LEVEL so key off that to omit it,
+# while still allowing more-modern makes to theoretically update things.
+${GENSRCS}: .NOMETA
+ @echo "Error: ${.TARGET} is missing. Run 'make ahcfirmware'"
+.endif
+
+
+SRCS= ${GENSRCS}
+SRCS+= aic7xxx.c aic7xxx_93cx6.c aic7xxx_osm.c aic7770.c
+SRCS+= opt_scsi.h opt_aic7xxx.h opt_cam.h
+SRCS+= device_if.h bus_if.h pci_if.h
+
+.if make(cleanfirmware)
+cleanfirmware: clean
+CLEANFILES= ${GENSRCS}
+.endif
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/aic7xxx/ahc/Makefile.inc b/sys/modules/aic7xxx/ahc/Makefile.inc
new file mode 100644
index 000000000000..d3b5cbd3a79b
--- /dev/null
+++ b/sys/modules/aic7xxx/ahc/Makefile.inc
@@ -0,0 +1,2 @@
+
+.include "../Makefile.inc"
diff --git a/sys/modules/aic7xxx/ahc/ahc_isa/Makefile b/sys/modules/aic7xxx/ahc/ahc_isa/Makefile
new file mode 100644
index 000000000000..0d33d08e6e1e
--- /dev/null
+++ b/sys/modules/aic7xxx/ahc/ahc_isa/Makefile
@@ -0,0 +1,11 @@
+
+.PATH: ${SRCTOP}/sys/dev/aic7xxx
+KMOD= ahc_isa
+
+SRCS= ahc_isa.c
+SRCS+= device_if.h bus_if.h pci_if.h isa_if.h
+SRCS+= opt_scsi.h opt_cam.h opt_aic7xxx.h
+
+CFLAGS+= -I${SRCTOP}/sys/dev/aic7xxx -I..
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/aic7xxx/ahc/ahc_pci/Makefile b/sys/modules/aic7xxx/ahc/ahc_pci/Makefile
new file mode 100644
index 000000000000..5b4059f2ceff
--- /dev/null
+++ b/sys/modules/aic7xxx/ahc/ahc_pci/Makefile
@@ -0,0 +1,13 @@
+
+.PATH: ${SRCTOP}/sys/dev/aic7xxx
+KMOD= ahc_pci
+
+SRCS= ahc_pci.c aic7xxx_pci.c
+SRCS+= device_if.h bus_if.h pci_if.h
+SRCS+= opt_scsi.h opt_cam.h opt_aic7xxx.h
+
+CFLAGS+= -I${SRCTOP}/sys/dev/aic7xxx -I..
+
+.include <bsd.kmod.mk>
+
+CWARNFLAGS.ahc_pci.c= ${NO_WCONSTANT_CONVERSION}
diff --git a/sys/modules/aic7xxx/ahd/Makefile b/sys/modules/aic7xxx/ahd/Makefile
new file mode 100644
index 000000000000..2fff21f332e9
--- /dev/null
+++ b/sys/modules/aic7xxx/ahd/Makefile
@@ -0,0 +1,44 @@
+
+.PATH: ${SRCTOP}/sys/dev/aic7xxx
+KMOD= ahd
+
+GENSRCS= aic79xx_seq.h aic79xx_reg.h
+REG_PRINT_OPT=
+# AHD_REG_PRETTY_PRINT=1
+.ifdef AHD_REG_PRETTY_PRINT
+GENSRCS += aic79xx_reg_print.c
+CFLAGS+= -DAHD_REG_PRETTY_PRINT=1
+REG_PRINT_OPT= -p aic79xx_reg_print.c
+.endif
+BEFORE_DEPEND= ${GENSRCS}
+
+.if make(ahdfirmware)
+ahdfirmware: ${GENSRCS}
+${GENSRCS}: \
+ ${SRCTOP}/sys/dev/aic7xxx/aic79xx.{reg,seq} \
+ ${SRCTOP}/sys/cam/scsi/scsi_message.h
+ aicasm ${INCLUDES} -I${SRCTOP}/sys/cam/scsi \
+ -I${SRCTOP}/sys/dev/aic7xxx \
+ -o aic79xx_seq.h -r aic79xx_reg.h \
+ ${REG_PRINT_OPT} \
+ -i ${SRCTOP}/sys/dev/aic7xxx/aic79xx_osm.h \
+ ${SRCTOP}/sys/dev/aic7xxx/aic79xx.seq
+.else
+${GENSRCS}: .NOMETA
+ @echo "Error: ${.TARGET} is missing. Run 'make ahdfirmware'."
+.endif
+
+
+SRCS= ${GENSRCS}
+SRCS+= aic79xx.c aic79xx_osm.c aic79xx_pci.c ahd_pci.c
+SRCS+= opt_scsi.h opt_aic79xx.h opt_cam.h opt_ddb.h
+SRCS+= device_if.h bus_if.h pci_if.h
+
+.if make(cleanfirmware)
+cleanfirmware: clean
+CLEANFILES= ${GENSRCS}
+.endif
+
+.include <bsd.kmod.mk>
+
+CWARNFLAGS.ahd_pci.c= ${NO_WCONSTANT_CONVERSION}
diff --git a/sys/modules/aic7xxx/aicasm/Makefile b/sys/modules/aic7xxx/aicasm/Makefile
new file mode 100644
index 000000000000..d1e744e3583e
--- /dev/null
+++ b/sys/modules/aic7xxx/aicasm/Makefile
@@ -0,0 +1,8 @@
+
+MAKESRCPATH= ${SRCTOP}/sys/dev/aic7xxx/aicasm
+
+install:
+
+.include "${SRCTOP}/sys/dev/aic7xxx/aicasm/Makefile"
+
+build-tools: ${PROG}
diff --git a/sys/modules/alc/Makefile b/sys/modules/alc/Makefile
new file mode 100644
index 000000000000..49aa0247cd43
--- /dev/null
+++ b/sys/modules/alc/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/alc
+
+KMOD= if_alc
+SRCS= if_alc.c device_if.h bus_if.h pci_if.h miibus_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ale/Makefile b/sys/modules/ale/Makefile
new file mode 100644
index 000000000000..beed313e4953
--- /dev/null
+++ b/sys/modules/ale/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/ale
+
+KMOD= if_ale
+SRCS= if_ale.c device_if.h bus_if.h pci_if.h miibus_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/allwinner/Makefile b/sys/modules/allwinner/Makefile
new file mode 100644
index 000000000000..c74d772224db
--- /dev/null
+++ b/sys/modules/allwinner/Makefile
@@ -0,0 +1,14 @@
+# Build modules specific to Allwinner.
+
+SUBDIR = \
+ aw_mmc \
+ aw_pwm \
+ aw_rtc \
+ aw_rsb \
+ aw_sid \
+ aw_spi \
+ aw_thermal \
+ axp81x \
+ if_awg
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/allwinner/aw_mmc/Makefile b/sys/modules/allwinner/aw_mmc/Makefile
new file mode 100644
index 000000000000..450ba717829b
--- /dev/null
+++ b/sys/modules/allwinner/aw_mmc/Makefile
@@ -0,0 +1,14 @@
+
+.PATH: ${SRCTOP}/sys/arm/allwinner
+
+KMOD= aw_mmc
+SRCS= aw_mmc.c
+
+SRCS+= \
+ bus_if.h \
+ clknode_if.h \
+ device_if.h \
+ mmc_pwrseq_if.h \
+ ofw_bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/allwinner/aw_pwm/Makefile b/sys/modules/allwinner/aw_pwm/Makefile
new file mode 100644
index 000000000000..2ffc5baab879
--- /dev/null
+++ b/sys/modules/allwinner/aw_pwm/Makefile
@@ -0,0 +1,14 @@
+
+.PATH: ${SRCTOP}/sys/arm/allwinner
+
+KMOD= aw_pwm
+SRCS= aw_pwm.c
+
+SRCS+= \
+ bus_if.h \
+ clknode_if.h \
+ device_if.h \
+ ofw_bus_if.h \
+ pwmbus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/allwinner/aw_rsb/Makefile b/sys/modules/allwinner/aw_rsb/Makefile
new file mode 100644
index 000000000000..89f5ec687170
--- /dev/null
+++ b/sys/modules/allwinner/aw_rsb/Makefile
@@ -0,0 +1,14 @@
+
+.PATH: ${SRCTOP}/sys/arm/allwinner
+
+KMOD= aw_rsb
+SRCS= aw_rsb.c
+
+SRCS+= \
+ bus_if.h \
+ clknode_if.h \
+ device_if.h \
+ ofw_bus_if.h \
+ iicbus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/allwinner/aw_rtc/Makefile b/sys/modules/allwinner/aw_rtc/Makefile
new file mode 100644
index 000000000000..0eaa9befd88e
--- /dev/null
+++ b/sys/modules/allwinner/aw_rtc/Makefile
@@ -0,0 +1,14 @@
+
+.PATH: ${SRCTOP}/sys/arm/allwinner
+
+KMOD= aw_rtc
+SRCS= aw_rtc.c
+
+SRCS+= \
+ bus_if.h \
+ clknode_if.h \
+ device_if.h \
+ ofw_bus_if.h \
+ spibus_if.h \
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/allwinner/aw_sid/Makefile b/sys/modules/allwinner/aw_sid/Makefile
new file mode 100644
index 000000000000..edbaf33f1a0a
--- /dev/null
+++ b/sys/modules/allwinner/aw_sid/Makefile
@@ -0,0 +1,13 @@
+
+.PATH: ${SRCTOP}/sys/arm/allwinner
+
+KMOD= aw_sid
+SRCS= aw_sid.c
+
+SRCS+= \
+ bus_if.h \
+ clknode_if.h \
+ device_if.h \
+ ofw_bus_if.h \
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/allwinner/aw_spi/Makefile b/sys/modules/allwinner/aw_spi/Makefile
new file mode 100644
index 000000000000..e26ffd6589e5
--- /dev/null
+++ b/sys/modules/allwinner/aw_spi/Makefile
@@ -0,0 +1,14 @@
+
+.PATH: ${SRCTOP}/sys/arm/allwinner
+
+KMOD= aw_spi
+SRCS= aw_spi.c
+
+SRCS+= \
+ bus_if.h \
+ clknode_if.h \
+ device_if.h \
+ ofw_bus_if.h \
+ spibus_if.h \
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/allwinner/aw_thermal/Makefile b/sys/modules/allwinner/aw_thermal/Makefile
new file mode 100644
index 000000000000..1552d420af87
--- /dev/null
+++ b/sys/modules/allwinner/aw_thermal/Makefile
@@ -0,0 +1,13 @@
+
+.PATH: ${SRCTOP}/sys/arm/allwinner
+
+KMOD= aw_thermal
+SRCS= aw_thermal.c
+
+SRCS+= \
+ bus_if.h \
+ clknode_if.h \
+ device_if.h \
+ ofw_bus_if.h \
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/allwinner/axp81x/Makefile b/sys/modules/allwinner/axp81x/Makefile
new file mode 100644
index 000000000000..589303de4caa
--- /dev/null
+++ b/sys/modules/allwinner/axp81x/Makefile
@@ -0,0 +1,14 @@
+
+.PATH: ${SRCTOP}/sys/arm/allwinner
+
+KMOD= axp81x
+SRCS= axp81x.c
+
+SRCS+= \
+ bus_if.h \
+ clknode_if.h \
+ device_if.h \
+ ofw_bus_if.h \
+ iicbus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/allwinner/if_awg/Makefile b/sys/modules/allwinner/if_awg/Makefile
new file mode 100644
index 000000000000..41d98909583e
--- /dev/null
+++ b/sys/modules/allwinner/if_awg/Makefile
@@ -0,0 +1,14 @@
+
+.PATH: ${SRCTOP}/sys/arm/allwinner
+
+KMOD= if_awg
+SRCS= if_awg.c
+
+SRCS+= \
+ bus_if.h \
+ clknode_if.h \
+ device_if.h \
+ miibus_if.h \
+ ofw_bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/alq/Makefile b/sys/modules/alq/Makefile
new file mode 100644
index 000000000000..4eee884b3b07
--- /dev/null
+++ b/sys/modules/alq/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/kern
+KMOD= alq
+SRCS= opt_mac.h vnode_if.h kern_alq.c
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/am335x_dmtpps/Makefile b/sys/modules/am335x_dmtpps/Makefile
new file mode 100644
index 000000000000..9fabb2aeaf40
--- /dev/null
+++ b/sys/modules/am335x_dmtpps/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/arm/ti/am335x
+
+KMOD= am335x_dmtpps
+SRCS= am335x_dmtpps.c
+
+SRCS+= bus_if.h device_if.h ofw_bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/amd_ecc_inject/Makefile b/sys/modules/amd_ecc_inject/Makefile
new file mode 100644
index 000000000000..93d26d73beef
--- /dev/null
+++ b/sys/modules/amd_ecc_inject/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/amd_ecc_inject
+
+KMOD= amd_ecc_inject
+SRCS= ecc_inject.c bus_if.h device_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/amdgpio/Makefile b/sys/modules/amdgpio/Makefile
new file mode 100644
index 000000000000..f825cd059bd4
--- /dev/null
+++ b/sys/modules/amdgpio/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/amdgpio
+KMOD= amdgpio
+SRCS= amdgpio.c
+SRCS+= acpi_if.h device_if.h bus_if.h gpio_if.h pic_if.h opt_acpi.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/amdsbwd/Makefile b/sys/modules/amdsbwd/Makefile
new file mode 100644
index 000000000000..78166c67c775
--- /dev/null
+++ b/sys/modules/amdsbwd/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/amdsbwd
+KMOD = amdsbwd
+SRCS = amdsbwd.c
+SRCS += device_if.h bus_if.h pci_if.h isa_if.h opt_amdsbwd.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/amdsmb/Makefile b/sys/modules/amdsmb/Makefile
new file mode 100644
index 000000000000..91762bf883da
--- /dev/null
+++ b/sys/modules/amdsmb/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/amdsmb
+
+KMOD= amdsmb
+SRCS= amdsmb.c bus_if.h device_if.h pci_if.h smbus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/amdsmn/Makefile b/sys/modules/amdsmn/Makefile
new file mode 100644
index 000000000000..f41b8ac5c2b5
--- /dev/null
+++ b/sys/modules/amdsmn/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/amdsmn
+
+KMOD= amdsmn
+SRCS= amdsmn.c bus_if.h device_if.h pci_if.h
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/amdtemp/Makefile b/sys/modules/amdtemp/Makefile
new file mode 100644
index 000000000000..04b2b7b1135d
--- /dev/null
+++ b/sys/modules/amdtemp/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/amdtemp
+
+KMOD= amdtemp
+SRCS= amdtemp.c bus_if.h device_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/aout/Makefile b/sys/modules/aout/Makefile
new file mode 100644
index 000000000000..cd5f6b99dcb4
--- /dev/null
+++ b/sys/modules/aout/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/kern
+
+KMOD= aout
+SRCS= imgact_aout.c \
+ vnode_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/arcmsr/Makefile b/sys/modules/arcmsr/Makefile
new file mode 100644
index 000000000000..ec5e69f73eb6
--- /dev/null
+++ b/sys/modules/arcmsr/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/arcmsr
+
+KMOD= arcmsr
+SRCS= arcmsr.c
+SRCS+= opt_scsi.h opt_cam.h
+SRCS+= device_if.h bus_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/arm_ti/Makefile b/sys/modules/arm_ti/Makefile
new file mode 100644
index 000000000000..a90d4aee3a60
--- /dev/null
+++ b/sys/modules/arm_ti/Makefile
@@ -0,0 +1,8 @@
+# Build modules specific to Texas Instruments ARM SoCs.
+
+SUBDIR = \
+ ../am335x_dmtpps \
+ am335x_ehrpwm \
+ ti_i2c \
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/arm_ti/am335x_ehrpwm/Makefile b/sys/modules/arm_ti/am335x_ehrpwm/Makefile
new file mode 100644
index 000000000000..75139fff2bb0
--- /dev/null
+++ b/sys/modules/arm_ti/am335x_ehrpwm/Makefile
@@ -0,0 +1,15 @@
+
+.PATH: ${SRCTOP}/sys/arm/ti/am335x
+
+KMOD= am335x_ehrpwm
+SRCS= am335x_ehrpwm.c
+
+# Generated files...
+SRCS+= \
+ bus_if.h \
+ device_if.h \
+ ofw_bus_if.h \
+ pwmbus_if.h \
+
+.include <bsd.kmod.mk>
+
diff --git a/sys/modules/arm_ti/ti_i2c/Makefile b/sys/modules/arm_ti/ti_i2c/Makefile
new file mode 100644
index 000000000000..3a5e1a35b2a4
--- /dev/null
+++ b/sys/modules/arm_ti/ti_i2c/Makefile
@@ -0,0 +1,13 @@
+
+.PATH: ${SRCTOP}/sys/arm/ti
+
+KMOD= ti_i2c
+SRCS= ti_i2c.c
+
+SRCS+= \
+ bus_if.h \
+ device_if.h \
+ iicbus_if.h \
+ ofw_bus_if.h \
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/armv8crypto/Makefile b/sys/modules/armv8crypto/Makefile
new file mode 100644
index 000000000000..da8e962c0307
--- /dev/null
+++ b/sys/modules/armv8crypto/Makefile
@@ -0,0 +1,35 @@
+
+.PATH: ${SRCTOP}/sys/crypto/armv8
+.PATH: ${SRCTOP}/sys/crypto/openssl/aarch64
+
+KMOD= armv8crypto
+SRCS= armv8_crypto.c
+SRCS+= device_if.h bus_if.h opt_bus.h cryptodev_if.h
+
+OBJS+= armv8_crypto_wrap.o aesv8-armx.o ghashv8-armx.o
+
+# Remove -nostdinc so we can get the intrinsics.
+armv8_crypto_wrap.o: armv8_crypto_wrap.c
+ ${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc:N-mgeneral-regs-only} \
+ -I${SRCTOP}/sys/crypto/armv8 \
+ ${WERROR} ${PROF} \
+ -march=armv8-a+crypto ${.IMPSRC}
+ ${CTFCONVERT_CMD}
+
+aesv8-armx.o: aesv8-armx.S
+ ${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc:N-mgeneral-regs-only} \
+ -I${SRCTOP}/sys/crypto/armv8 \
+ ${WERROR} ${PROF} \
+ -march=armv8-a+crypto ${.IMPSRC}
+ ${CTFCONVERT_CMD}
+
+ghashv8-armx.o: ghashv8-armx.S
+ ${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc:N-mgeneral-regs-only} \
+ -I${SRCTOP}/sys/crypto/armv8 \
+ ${WERROR} ${PROF} \
+ -march=armv8-a+crypto ${.IMPSRC}
+ ${CTFCONVERT_CMD}
+
+armv8_crypto_wrap.o: armv8_crypto.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/asmc/Makefile b/sys/modules/asmc/Makefile
new file mode 100644
index 000000000000..70d8ed845900
--- /dev/null
+++ b/sys/modules/asmc/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/asmc
+
+KMOD= asmc
+SRCS= asmc.c opt_acpi.h acpi_if.h bus_if.h device_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ata/Makefile b/sys/modules/ata/Makefile
new file mode 100644
index 000000000000..3a9ad0dd123f
--- /dev/null
+++ b/sys/modules/ata/Makefile
@@ -0,0 +1,6 @@
+
+SUBDIR = atacore
+SUBDIR += ataisa
+SUBDIR += atapci
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/ata/Makefile.inc b/sys/modules/ata/Makefile.inc
new file mode 100644
index 000000000000..d3b5cbd3a79b
--- /dev/null
+++ b/sys/modules/ata/Makefile.inc
@@ -0,0 +1,2 @@
+
+.include "../Makefile.inc"
diff --git a/sys/modules/ata/atacore/Makefile b/sys/modules/ata/atacore/Makefile
new file mode 100644
index 000000000000..f4eff60f7b86
--- /dev/null
+++ b/sys/modules/ata/atacore/Makefile
@@ -0,0 +1,10 @@
+
+.PATH: ${SRCTOP}/sys/dev/ata
+
+KMOD= ata
+SRCS= ata-all.c ata_if.c ata-lowlevel.c
+SRCS+= ata_if.h bus_if.h device_if.h opt_cam.h pci_if.h
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ata/ataisa/Makefile b/sys/modules/ata/ataisa/Makefile
new file mode 100644
index 000000000000..7aab7b999be6
--- /dev/null
+++ b/sys/modules/ata/ataisa/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ata
+
+KMOD= ataisa
+SRCS= ata-isa.c
+SRCS+= ata_if.h bus_if.h device_if.h isa_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ata/atapci/Makefile b/sys/modules/ata/atapci/Makefile
new file mode 100644
index 000000000000..dfabcf765a16
--- /dev/null
+++ b/sys/modules/ata/atapci/Makefile
@@ -0,0 +1,12 @@
+
+SUBDIR += chipsets
+
+.PATH: ${SRCTOP}/sys/dev/ata
+
+KMOD= atapci
+SRCS= ata-pci.c ata-dma.c ata-sata.c
+SRCS+= ata_if.h bus_if.h device_if.h pci_if.h
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ata/atapci/Makefile.inc b/sys/modules/ata/atapci/Makefile.inc
new file mode 100644
index 000000000000..d3b5cbd3a79b
--- /dev/null
+++ b/sys/modules/ata/atapci/Makefile.inc
@@ -0,0 +1,2 @@
+
+.include "../Makefile.inc"
diff --git a/sys/modules/ata/atapci/chipsets/Makefile b/sys/modules/ata/atapci/chipsets/Makefile
new file mode 100644
index 000000000000..c17c84e6496c
--- /dev/null
+++ b/sys/modules/ata/atapci/chipsets/Makefile
@@ -0,0 +1,4 @@
+
+SUBDIR += ataacard ataacerlabs ataamd ataati atacenatek atacypress atacyrix atahighpoint ataintel ataite atajmicron atamarvell atamicron atanational atanetcell atanvidia atapromise ataserverworks atasiliconimage atasis atavia
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/ata/atapci/chipsets/Makefile.inc b/sys/modules/ata/atapci/chipsets/Makefile.inc
new file mode 100644
index 000000000000..d3b5cbd3a79b
--- /dev/null
+++ b/sys/modules/ata/atapci/chipsets/Makefile.inc
@@ -0,0 +1,2 @@
+
+.include "../Makefile.inc"
diff --git a/sys/modules/ata/atapci/chipsets/ataacard/Makefile b/sys/modules/ata/atapci/chipsets/ataacard/Makefile
new file mode 100644
index 000000000000..23ced8d7473b
--- /dev/null
+++ b/sys/modules/ata/atapci/chipsets/ataacard/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ata/chipsets
+
+KMOD= ataacard
+SRCS= ata-acard.c
+SRCS+= ata_if.h bus_if.h device_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ata/atapci/chipsets/ataacerlabs/Makefile b/sys/modules/ata/atapci/chipsets/ataacerlabs/Makefile
new file mode 100644
index 000000000000..971d626dc12c
--- /dev/null
+++ b/sys/modules/ata/atapci/chipsets/ataacerlabs/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ata/chipsets
+
+KMOD= ataacerlabs
+SRCS= ata-acerlabs.c
+SRCS+= ata_if.h bus_if.h device_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ata/atapci/chipsets/ataamd/Makefile b/sys/modules/ata/atapci/chipsets/ataamd/Makefile
new file mode 100644
index 000000000000..eff9a378b130
--- /dev/null
+++ b/sys/modules/ata/atapci/chipsets/ataamd/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ata/chipsets
+
+KMOD= ataamd
+SRCS= ata-amd.c
+SRCS+= ata_if.h bus_if.h device_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ata/atapci/chipsets/ataati/Makefile b/sys/modules/ata/atapci/chipsets/ataati/Makefile
new file mode 100644
index 000000000000..6bd4a306f6dd
--- /dev/null
+++ b/sys/modules/ata/atapci/chipsets/ataati/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ata/chipsets
+
+KMOD= ataati
+SRCS= ata-ati.c
+SRCS+= ata_if.h bus_if.h device_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ata/atapci/chipsets/atacenatek/Makefile b/sys/modules/ata/atapci/chipsets/atacenatek/Makefile
new file mode 100644
index 000000000000..7c9cec4c3ee8
--- /dev/null
+++ b/sys/modules/ata/atapci/chipsets/atacenatek/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ata/chipsets
+
+KMOD= atacenatek
+SRCS= ata-cenatek.c
+SRCS+= ata_if.h bus_if.h device_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ata/atapci/chipsets/atacypress/Makefile b/sys/modules/ata/atapci/chipsets/atacypress/Makefile
new file mode 100644
index 000000000000..c0dae4ce6143
--- /dev/null
+++ b/sys/modules/ata/atapci/chipsets/atacypress/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ata/chipsets
+
+KMOD= atacypress
+SRCS= ata-cypress.c
+SRCS+= ata_if.h bus_if.h device_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ata/atapci/chipsets/atacyrix/Makefile b/sys/modules/ata/atapci/chipsets/atacyrix/Makefile
new file mode 100644
index 000000000000..7a39455ba1d1
--- /dev/null
+++ b/sys/modules/ata/atapci/chipsets/atacyrix/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ata/chipsets
+
+KMOD= atacyrix
+SRCS= ata-cyrix.c
+SRCS+= ata_if.h bus_if.h device_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ata/atapci/chipsets/atahighpoint/Makefile b/sys/modules/ata/atapci/chipsets/atahighpoint/Makefile
new file mode 100644
index 000000000000..a889fc8ea47f
--- /dev/null
+++ b/sys/modules/ata/atapci/chipsets/atahighpoint/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ata/chipsets
+
+KMOD= atahighpoint
+SRCS= ata-highpoint.c
+SRCS+= ata_if.h bus_if.h device_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ata/atapci/chipsets/ataintel/Makefile b/sys/modules/ata/atapci/chipsets/ataintel/Makefile
new file mode 100644
index 000000000000..4734ccff6d7e
--- /dev/null
+++ b/sys/modules/ata/atapci/chipsets/ataintel/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ata/chipsets
+
+KMOD= ataintel
+SRCS= ata-intel.c
+SRCS+= ata_if.h bus_if.h device_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ata/atapci/chipsets/ataite/Makefile b/sys/modules/ata/atapci/chipsets/ataite/Makefile
new file mode 100644
index 000000000000..e1a17c373b64
--- /dev/null
+++ b/sys/modules/ata/atapci/chipsets/ataite/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ata/chipsets
+
+KMOD= ataite
+SRCS= ata-ite.c
+SRCS+= ata_if.h bus_if.h device_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ata/atapci/chipsets/atajmicron/Makefile b/sys/modules/ata/atapci/chipsets/atajmicron/Makefile
new file mode 100644
index 000000000000..71ee58d6e89e
--- /dev/null
+++ b/sys/modules/ata/atapci/chipsets/atajmicron/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ata/chipsets
+
+KMOD= atajmicron
+SRCS= ata-jmicron.c
+SRCS+= ata_if.h bus_if.h device_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ata/atapci/chipsets/atamarvell/Makefile b/sys/modules/ata/atapci/chipsets/atamarvell/Makefile
new file mode 100644
index 000000000000..9fccff592287
--- /dev/null
+++ b/sys/modules/ata/atapci/chipsets/atamarvell/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ata/chipsets
+
+KMOD= atamarvell
+SRCS= ata-marvell.c
+SRCS+= ata_if.h bus_if.h device_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ata/atapci/chipsets/atamicron/Makefile b/sys/modules/ata/atapci/chipsets/atamicron/Makefile
new file mode 100644
index 000000000000..54934f6d11c3
--- /dev/null
+++ b/sys/modules/ata/atapci/chipsets/atamicron/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ata/chipsets
+
+KMOD= atamicron
+SRCS= ata-micron.c
+SRCS+= ata_if.h bus_if.h device_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ata/atapci/chipsets/atanational/Makefile b/sys/modules/ata/atapci/chipsets/atanational/Makefile
new file mode 100644
index 000000000000..3e486b1637e3
--- /dev/null
+++ b/sys/modules/ata/atapci/chipsets/atanational/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ata/chipsets
+
+KMOD= atanational
+SRCS= ata-national.c
+SRCS+= ata_if.h bus_if.h device_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ata/atapci/chipsets/atanetcell/Makefile b/sys/modules/ata/atapci/chipsets/atanetcell/Makefile
new file mode 100644
index 000000000000..b317e950a22b
--- /dev/null
+++ b/sys/modules/ata/atapci/chipsets/atanetcell/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ata/chipsets
+
+KMOD= atanetcell
+SRCS= ata-netcell.c
+SRCS+= ata_if.h bus_if.h device_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ata/atapci/chipsets/atanvidia/Makefile b/sys/modules/ata/atapci/chipsets/atanvidia/Makefile
new file mode 100644
index 000000000000..b4b720cfea13
--- /dev/null
+++ b/sys/modules/ata/atapci/chipsets/atanvidia/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ata/chipsets
+
+KMOD= atanvidia
+SRCS= ata-nvidia.c
+SRCS+= ata_if.h bus_if.h device_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ata/atapci/chipsets/atapromise/Makefile b/sys/modules/ata/atapci/chipsets/atapromise/Makefile
new file mode 100644
index 000000000000..d6296769f63f
--- /dev/null
+++ b/sys/modules/ata/atapci/chipsets/atapromise/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ata/chipsets
+
+KMOD= atapromise
+SRCS= ata-promise.c
+SRCS+= ata_if.h bus_if.h device_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ata/atapci/chipsets/ataserverworks/Makefile b/sys/modules/ata/atapci/chipsets/ataserverworks/Makefile
new file mode 100644
index 000000000000..76662f0a81c9
--- /dev/null
+++ b/sys/modules/ata/atapci/chipsets/ataserverworks/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ata/chipsets
+
+KMOD= ataserverworks
+SRCS= ata-serverworks.c
+SRCS+= ata_if.h bus_if.h device_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ata/atapci/chipsets/atasiliconimage/Makefile b/sys/modules/ata/atapci/chipsets/atasiliconimage/Makefile
new file mode 100644
index 000000000000..3bb7248468f3
--- /dev/null
+++ b/sys/modules/ata/atapci/chipsets/atasiliconimage/Makefile
@@ -0,0 +1,10 @@
+
+.PATH: ${SRCTOP}/sys/dev/ata/chipsets
+
+KMOD= atasiliconimage
+SRCS= ata-siliconimage.c
+SRCS+= ata_if.h bus_if.h device_if.h pci_if.h
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ata/atapci/chipsets/atasis/Makefile b/sys/modules/ata/atapci/chipsets/atasis/Makefile
new file mode 100644
index 000000000000..16252fff2861
--- /dev/null
+++ b/sys/modules/ata/atapci/chipsets/atasis/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ata/chipsets
+
+KMOD= atasis
+SRCS= ata-sis.c
+SRCS+= ata_if.h bus_if.h device_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ata/atapci/chipsets/atavia/Makefile b/sys/modules/ata/atapci/chipsets/atavia/Makefile
new file mode 100644
index 000000000000..04a76295277f
--- /dev/null
+++ b/sys/modules/ata/atapci/chipsets/atavia/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ata/chipsets
+
+KMOD= atavia
+SRCS= ata-via.c
+SRCS+= ata_if.h bus_if.h device_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ath/Makefile b/sys/modules/ath/Makefile
new file mode 100644
index 000000000000..7a6b38438032
--- /dev/null
+++ b/sys/modules/ath/Makefile
@@ -0,0 +1,44 @@
+#
+# Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer,
+# without modification.
+# 2. Redistributions in binary form must reproduce at minimum a disclaimer
+# similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
+# redistribution must be conditioned upon including a substantially
+# similar Disclaimer requirement for further binary redistribution.
+#
+# NO WARRANTY
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+# THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
+# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGES.
+#
+#
+
+.PATH: ${SRCTOP}/sys/dev/ath
+.PATH: ${SRCTOP}/sys/dev/ath/ath_hal
+
+KMOD= if_ath
+SRCS= if_ath_drv.c
+
+SRCS+= device_if.h bus_if.h pci_if.h opt_inet.h opt_ath.h opt_ah.h opt_wlan.h
+
+CFLAGS+= -I. -I${SRCTOP}/sys/dev/ath -I${SRCTOP}/sys/dev/ath/ath_hal
+CFLAGS+= -I. -I${SRCTOP}/sys/contrib/dev/ath/ath_hal/
+
+.include <bsd.kmod.mk>
+
+CWARNFLAGS+= ${NO_WUNUSED_BUT_SET_VARIABLE}
diff --git a/sys/modules/ath10k/Makefile b/sys/modules/ath10k/Makefile
new file mode 100644
index 000000000000..318b49fe43a1
--- /dev/null
+++ b/sys/modules/ath10k/Makefile
@@ -0,0 +1,49 @@
+
+DEVATH10KDIR= ${SRCTOP}/sys/contrib/dev/athk/ath10k
+
+.PATH: ${DEVATH10KDIR}
+
+WITH_CONFIG_FWLOG= 1
+
+KMOD= if_ath10k
+
+SRCS+= core.c debug.c mac.c ce.c hw.c bmi.c
+SRCS+= htc.c htt.c htt_rx.c htt_tx.c
+SRCS+= txrx.c wmi.c wmi-tlv.c
+SRCS+= p2p.c swap.c
+
+SRCS+= pci.c
+
+# Other
+SRCS+= ${LINUXKPI_GENSRCS}
+SRCS+= opt_wlan.h opt_inet6.h opt_inet.h opt_acpi.h
+
+.if defined(WITH_CONFIG_FWLOG) && ${WITH_CONFIG_FWLOG} > 0
+SRCS+= fwlog.c
+CFLAGS+= -DCONFIG_FWLOG=${WITH_CONFIG_FWLOG}
+.endif
+
+CFLAGS+= -DKBUILD_MODNAME='"ath10k"'
+
+CFLAGS+= -I${DEVATH10KDIR}
+CFLAGS+= -I${DEVATH10KDIR}/..
+CFLAGS+= ${LINUXKPI_INCLUDES}
+# Helpful after fresh imports.
+#CFLAGS+= -ferror-limit=0
+
+CFLAGS+= -DCONFIG_ATH10K_DEBUG
+
+#CFLAGS+= -DCONFIG_ATH10K_AHB
+#CFLAGS+= -DCONFIG_ATH10K_DEBUGFS
+#CFLAGS+= -DCONFIG_ATH10K_DFS_CERTIFIED
+#CFLAGS+= -DCONFIG_ATH10K_SPECTRAL
+#CFLAGS+= -DCONFIG_ATH10K_TRACING
+#CFLAGS+= -DCONFIG_DEV_COREDUMP
+#CFLAGS+= -DCONFIG_MAC80211_DEBUGFS
+#CFLAGS+= -DCONFIG_MAC80211_MESH
+#CFLAGS+= -DCONFIG_NL80211_TESTMODE
+#CFLAGS+= -DCONFIG_PM
+#CFLAGS+= -DCONFIG_PM_SLEEP
+#CFLAGS+= -DCONFIG_THERMAL
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ath11k/Makefile b/sys/modules/ath11k/Makefile
new file mode 100644
index 000000000000..162b22d33074
--- /dev/null
+++ b/sys/modules/ath11k/Makefile
@@ -0,0 +1,49 @@
+
+DEVATH11KDIR= ${SRCTOP}/sys/contrib/dev/athk/ath11k
+
+.PATH: ${DEVATH11KDIR}
+
+WITH_DEBUGFS= 0 # Does not yet compile
+WITH_CONFIG_PM= 0
+
+KMOD= if_ath11k
+
+SRCS+= core.c hal.c hal_tx.c hal_rx.c
+SRCS+= wmi.c mac.c reg.c htc.c qmi.c
+SRCS+= dp.c dp_tx.c dp_rx.c debug.c
+SRCS+= ce.c peer.c dbring.c hw.c
+
+SRCS+= mhi.c pci.c pcic.c
+
+.if defined(WITH_CONFIG_PM) && ${WITH_CONFIG_PM} > 0
+CFLAGS+= -DCONFIG_PM=${WITH_CONFIG_PM}
+SRCS+= wow.c
+.endif
+
+# Other
+SRCS+= ${LINUXKPI_GENSRCS}
+SRCS+= opt_wlan.h opt_inet6.h opt_inet.h opt_acpi.h
+
+CFLAGS+= -DKBUILD_MODNAME='"ath11k"'
+
+CFLAGS+= -I${DEVATH11KDIR}
+CFLAGS+= -I${DEVATH11KDIR}/..
+CFLAGS+= ${LINUXKPI_INCLUDES}
+# Helpful after fresh imports.
+#CFLAGS+= -ferror-limit=0
+
+CFLAGS+= -DCONFIG_ATH11K_DEBUG
+
+.if defined(WITH_DEBUGFS) && ${WITH_DEBUGFS} > 0
+SRCS+= debugfs.c debugfs_htt_stats.c debugfs_sta.c
+CFLAGS+= -DCONFIG_ATH11K_DEBUGFS=${WITH_DEBUGFS}
+CFLAGS+= -DCONFIG_MAC80211_DEBUGFS=${WITH_DEBUGFS}
+.endif
+
+#CFLAGS+= -DCONFIG_ATH11K_SPECTRAL
+#CFLAGS+= -DCONFIG_ATH11K_TRACING
+#CFLAGS+= -DCONFIG_NL80211_TESTMODE
+#CFLAGS+= -DCONFIG_PM
+#CFLAGS+= -DCONFIG_THERMAL
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ath12k/Makefile b/sys/modules/ath12k/Makefile
new file mode 100644
index 000000000000..674a68e12813
--- /dev/null
+++ b/sys/modules/ath12k/Makefile
@@ -0,0 +1,35 @@
+DEVATH12KDIR= ${SRCTOP}/sys/contrib/dev/athk/ath12k
+
+.PATH: ${DEVATH12KDIR}
+
+WITH_CONFIG_ATH12K_TRACING= 0
+
+KMOD= if_ath12k
+
+SRCS+= core.c hal.c hal_tx.c hal_rx.c
+SRCS+= wmi.c mac.c reg.c htc.c qmi.c
+SRCS+= dp.c dp_tx.c dp_rx.c dp_mon.c debug.c
+SRCS+= ce.c peer.c dbring.c hw.c
+
+SRCS+= mhi.c pci.c
+
+.if defined(WITH_CONFIG_ATH12K_TRACING) && ${WITH_CONFIG_ATH12K_TRACING} > 0
+CFLAGS+= -DCONFIG_ATH12K_TRACING=${WITH_CONFIG_ATH12K_TRACING}
+SRCS+= trace.c
+.endif
+
+# Other
+SRCS+= ${LINUXKPI_GENSRCS}
+SRCS+= opt_wlan.h opt_inet6.h opt_inet.h opt_acpi.h
+
+CFLAGS+= -DKBUILD_MODNAME='"ath12k"'
+
+CFLAGS+= -I${DEVATH12KDIR}
+CFLAGS+= -I${DEVATH12KDIR}/..
+CFLAGS+= ${LINUXKPI_INCLUDES}
+# Helpful after fresh imports.
+#CFLAGS+= -ferror-limit=0
+
+CFLAGS+= -DCONFIG_ATH12K_DEBUG
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ath_dfs/Makefile b/sys/modules/ath_dfs/Makefile
new file mode 100644
index 000000000000..4e0243178cca
--- /dev/null
+++ b/sys/modules/ath_dfs/Makefile
@@ -0,0 +1,48 @@
+#
+# Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer,
+# without modification.
+# 2. Redistributions in binary form must reproduce at minimum a disclaimer
+# similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
+# redistribution must be conditioned upon including a substantially
+# similar Disclaimer requirement for further binary redistribution.
+#
+# NO WARRANTY
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+# THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
+# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGES.
+#
+#
+
+.PATH: ${SRCTOP}/sys/dev/ath
+
+KMOD= ath_dfs
+
+SRCS= if_ath_dfs.c
+
+# DFS
+.PATH: ${SRCTOP}/sys/dev/ath/ath_dfs/null
+SRCS+= dfs_null.c
+
+SRCS+= device_if.h bus_if.h pci_if.h opt_inet.h opt_ath.h opt_ah.h opt_wlan.h
+
+CFLAGS+= -I. -I${SRCTOP}/sys/dev/ath -I${SRCTOP}/sys/dev/ath/ath_hal
+CFLAGS+= -I. -I${SRCTOP}/sys/contrib/dev/ath/ath_hal/
+
+.include <bsd.kmod.mk>
+
+CWARNFLAGS+= ${NO_WUNUSED_BUT_SET_VARIABLE}
diff --git a/sys/modules/ath_hal/Makefile b/sys/modules/ath_hal/Makefile
new file mode 100644
index 000000000000..15a124dcbf04
--- /dev/null
+++ b/sys/modules/ath_hal/Makefile
@@ -0,0 +1,49 @@
+#
+# Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer,
+# without modification.
+# 2. Redistributions in binary form must reproduce at minimum a disclaimer
+# similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
+# redistribution must be conditioned upon including a substantially
+# similar Disclaimer requirement for further binary redistribution.
+#
+# NO WARRANTY
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+# THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
+# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGES.
+#
+#
+
+.PATH: ${SRCTOP}/sys/dev/ath
+.PATH: ${SRCTOP}/sys/dev/ath/ath_hal
+
+KMOD= ath_hal
+
+SRCS= ah_osdep.c ah.c ah_regdomain.c
+SRCS+= ah_eeprom_v1.c ah_eeprom_v3.c ah_eeprom_v14.c ah_eeprom_v4k.c
+
+SRCS+= device_if.h bus_if.h pci_if.h opt_inet.h opt_ath.h opt_ah.h opt_wlan.h
+
+CFLAGS+= -I. -I${SRCTOP}/sys/dev/ath -I${SRCTOP}/sys/dev/ath/ath_hal
+CFLAGS+= -I. -I${SRCTOP}/sys/contrib/dev/ath/ath_hal/
+
+.include <bsd.kmod.mk>
+
+EXPORT_SYMS= YES
+
+CWARNFLAGS.ah_regdomain.c= ${NO_WSHIFT_COUNT_NEGATIVE} ${NO_WSHIFT_COUNT_OVERFLOW}
+CWARNFLAGS+= ${NO_WUNUSED_BUT_SET_VARIABLE}
diff --git a/sys/modules/ath_hal_ar5210/Makefile b/sys/modules/ath_hal_ar5210/Makefile
new file mode 100644
index 000000000000..6a73cef89ad9
--- /dev/null
+++ b/sys/modules/ath_hal_ar5210/Makefile
@@ -0,0 +1,54 @@
+#
+# Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer,
+# without modification.
+# 2. Redistributions in binary form must reproduce at minimum a disclaimer
+# similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
+# redistribution must be conditioned upon including a substantially
+# similar Disclaimer requirement for further binary redistribution.
+#
+# NO WARRANTY
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+# THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
+# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGES.
+#
+#
+
+.PATH: ${SRCTOP}/sys/dev/ath
+
+KMOD= ath_hal_ar5210
+
+# FreeBSD module loading pieces
+.PATH: ${SRCTOP}/sys/dev/ath/
+SRCS= ah_osdep_ar5210.c
+
+#
+# AR5210 support; these are first generation 11a-only devices.
+#
+.PATH: ${SRCTOP}/sys/dev/ath/ath_hal/ar5210
+SRCS+= ar5210_attach.c ar5210_beacon.c ar5210_interrupts.c \
+ ar5210_keycache.c ar5210_misc.c ar5210_phy.c ar5210_power.c \
+ ar5210_recv.c ar5210_reset.c ar5210_xmit.c
+
+SRCS+= device_if.h bus_if.h pci_if.h opt_inet.h opt_ath.h opt_ah.h opt_wlan.h
+
+CFLAGS+= -I. -I${SRCTOP}/sys/dev/ath -I${SRCTOP}/sys/dev/ath/ath_hal
+CFLAGS+= -I. -I${SRCTOP}/sys/contrib/dev/ath/ath_hal/
+
+.include <bsd.kmod.mk>
+
+CWARNFLAGS+= ${NO_WUNUSED_BUT_SET_VARIABLE}
diff --git a/sys/modules/ath_hal_ar5211/Makefile b/sys/modules/ath_hal_ar5211/Makefile
new file mode 100644
index 000000000000..5c2e6b40741f
--- /dev/null
+++ b/sys/modules/ath_hal_ar5211/Makefile
@@ -0,0 +1,56 @@
+#
+# Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer,
+# without modification.
+# 2. Redistributions in binary form must reproduce at minimum a disclaimer
+# similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
+# redistribution must be conditioned upon including a substantially
+# similar Disclaimer requirement for further binary redistribution.
+#
+# NO WARRANTY
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+# THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
+# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGES.
+#
+#
+
+.PATH: ${SRCTOP}/sys/dev/ath
+.PATH: ${SRCTOP}/sys/dev/ath/ath_hal
+
+KMOD= ath_hal_ar5211
+
+# FreeBSD module loading pieces
+.PATH: ${SRCTOP}/sys/dev/ath/
+SRCS= ah_osdep_ar5211.c
+
+#
+# AR5211 support; these are second generation 11b/g/a devices
+# (but 11g was OFDM only and is not supported).
+#
+.PATH: ${SRCTOP}/sys/dev/ath/ath_hal/ar5211
+SRCS+= ar5211_attach.c ar5211_beacon.c ar5211_interrupts.c \
+ ar5211_keycache.c ar5211_misc.c ar5211_phy.c ar5211_power.c \
+ ar5211_recv.c ar5211_reset.c ar5211_xmit.c
+
+SRCS+= device_if.h bus_if.h pci_if.h opt_inet.h opt_ath.h opt_ah.h opt_wlan.h
+
+CFLAGS+= -I. -I${SRCTOP}/sys/dev/ath -I${SRCTOP}/sys/dev/ath/ath_hal
+CFLAGS+= -I. -I${SRCTOP}/sys/contrib/dev/ath/ath_hal/
+
+.include <bsd.kmod.mk>
+
+CWARNFLAGS+= ${NO_WUNUSED_BUT_SET_VARIABLE}
diff --git a/sys/modules/ath_hal_ar5212/Makefile b/sys/modules/ath_hal_ar5212/Makefile
new file mode 100644
index 000000000000..9c6eac976fa6
--- /dev/null
+++ b/sys/modules/ath_hal_ar5212/Makefile
@@ -0,0 +1,61 @@
+#
+# Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer,
+# without modification.
+# 2. Redistributions in binary form must reproduce at minimum a disclaimer
+# similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
+# redistribution must be conditioned upon including a substantially
+# similar Disclaimer requirement for further binary redistribution.
+#
+# NO WARRANTY
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+# THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
+# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGES.
+#
+#
+
+.PATH: ${SRCTOP}/sys/dev/ath
+.PATH: ${SRCTOP}/sys/dev/ath/ath_hal
+
+KMOD= ath_hal_ar5212
+
+# FreeBSD module loading pieces
+.PATH: ${SRCTOP}/sys/dev/ath/
+SRCS= ah_osdep_ar5212.c
+
+#
+# AR5212 support; this covers almost all other pci/cardbus legacy parts.
+#
+.PATH: ${SRCTOP}/sys/dev/ath/ath_hal/ar5212
+SRCS+= ar5212_ani.c ar5212_attach.c ar5212_beacon.c ar5212_eeprom.c \
+ ar5212_gpio.c ar5212_interrupts.c ar5212_keycache.c ar5212_misc.c \
+ ar5212_phy.c ar5212_power.c ar5212_recv.c ar5212_reset.c \
+ ar5212_rfgain.c ar5212_xmit.c
+SRCS+= device_if.h bus_if.h pci_if.h opt_inet.h opt_ath.h opt_ah.h opt_wlan.h
+# RF backends
+SRCS+= ar5111.c
+SRCS+= ar5112.c
+SRCS+= ar2413.c
+SRCS+= ar2425.c
+SRCS+= ar5413.c
+
+CFLAGS+= -I. -I${SRCTOP}/sys/dev/ath -I${SRCTOP}/sys/dev/ath/ath_hal
+CFLAGS+= -I. -I${SRCTOP}/sys/contrib/dev/ath/ath_hal/
+
+.include <bsd.kmod.mk>
+
+CWARNFLAGS+= ${NO_WUNUSED_BUT_SET_VARIABLE}
diff --git a/sys/modules/ath_hal_ar5416/Makefile b/sys/modules/ath_hal_ar5416/Makefile
new file mode 100644
index 000000000000..b0885b55b1c0
--- /dev/null
+++ b/sys/modules/ath_hal_ar5416/Makefile
@@ -0,0 +1,83 @@
+#
+# Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer,
+# without modification.
+# 2. Redistributions in binary form must reproduce at minimum a disclaimer
+# similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
+# redistribution must be conditioned upon including a substantially
+# similar Disclaimer requirement for further binary redistribution.
+#
+# NO WARRANTY
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+# THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
+# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGES.
+#
+#
+
+.PATH: ${SRCTOP}/sys/dev/ath
+.PATH: ${SRCTOP}/sys/dev/ath/ath_hal
+
+KMOD= ath_hal_ar5416
+
+# FreeBSD module loading pieces
+.PATH: ${SRCTOP}/sys/dev/ath/
+SRCS= ah_osdep_ar5416.c
+
+#
+# AR5416, AR9130, AR9160, AR9220, AR9280, AR9285, AR9287 support.
+#
+# NB: 9160 depends on 5416 but 5416 does not require 9160
+#
+# + 5416 (Owl)
+.PATH: ${SRCTOP}/sys/dev/ath/ath_hal/ar5416
+
+SRCS+= ar5416_ani.c ar5416_attach.c ar5416_beacon.c ar5416_btcoex.c \
+ ar5416_cal.c ar5416_cal_iq.c ar5416_cal_adcgain.c ar5416_cal_adcdc.c \
+ ar5416_eeprom.c ar5416_gpio.c ar5416_interrupts.c ar5416_keycache.c \
+ ar5416_misc.c ar5416_phy.c ar5416_power.c ar5416_radar.c ar5416_spectral.c \
+ ar5416_recv.c ar5416_reset.c ar5416_xmit.c
+
+SRCS+= device_if.h bus_if.h pci_if.h opt_inet.h opt_ath.h opt_ah.h opt_wlan.h
+
+# RF backend for 5416, 9130 and 9160
+SRCS+= ar2133.c
+
+# + AR9160 (Sowl)
+.PATH: ${SRCTOP}/sys/dev/ath/ath_hal/ar9001
+SRCS+= ar9160_attach.c
+
+# AR9002 series chips
+# + AR9220/AR9280 - Merlin
+.PATH: ${SRCTOP}/sys/dev/ath/ath_hal/ar9002
+SRCS+= ar9280.c ar9280_attach.c ar9280_olc.c
+
+# + AR9285 - Kite
+SRCS+= ar9285.c ar9285_reset.c ar9285_attach.c ar9285_cal.c ar9285_phy.c
+SRCS+= ar9285_diversity.c ar9285_btcoex.c
+
+# + AR9287 - Kiwi
+.PATH: ${SRCTOP}/sys/dev/ath/ath_hal
+SRCS+= ah_eeprom_9287.c
+.PATH: ${SRCTOP}/sys/dev/ath/ath_hal/ar9002
+SRCS+= ar9287.c ar9287_reset.c ar9287_attach.c ar9287_cal.c ar9287_olc.c
+
+CFLAGS+= -I. -I${SRCTOP}/sys/dev/ath -I${SRCTOP}/sys/dev/ath/ath_hal
+CFLAGS+= -I. -I${SRCTOP}/sys/contrib/dev/ath/ath_hal/
+
+.include <bsd.kmod.mk>
+
+CWARNFLAGS+= ${NO_WUNUSED_BUT_SET_VARIABLE}
diff --git a/sys/modules/ath_hal_ar9300/Makefile b/sys/modules/ath_hal_ar9300/Makefile
new file mode 100644
index 000000000000..57e566f5bac9
--- /dev/null
+++ b/sys/modules/ath_hal_ar9300/Makefile
@@ -0,0 +1,59 @@
+#
+# Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer,
+# without modification.
+# 2. Redistributions in binary form must reproduce at minimum a disclaimer
+# similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
+# redistribution must be conditioned upon including a substantially
+# similar Disclaimer requirement for further binary redistribution.
+#
+# NO WARRANTY
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+# THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
+# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGES.
+#
+#
+
+.PATH: ${SRCTOP}/sys/dev/ath
+.PATH: ${SRCTOP}/sys/dev/ath/ath_hal
+
+KMOD= ath_hal_ar9300
+
+# FreeBSD module loading pieces
+.PATH: ${SRCTOP}/sys/dev/ath/
+SRCS= ah_osdep_ar9300.c
+
+# + AR9300 HAL
+.PATH: ${SRCTOP}/sys/contrib/dev/ath/ath_hal/ar9300
+SRCS+= ar9300_interrupts.c ar9300_radar.c ar9300_ani.c ar9300_keycache.c
+SRCS+= ar9300_radio.c ar9300_xmit.c ar9300_attach.c ar9300_mci.c ar9300_stub.c
+SRCS+= ar9300_xmit_ds.c ar9300_beacon.c ar9300_misc.c ar9300_recv.c
+SRCS+= ar9300_stub_funcs.c ar9300_eeprom.c ar9300_paprd.c ar9300_recv_ds.c
+SRCS+= ar9300_freebsd.c ar9300_phy.c ar9300_reset.c ar9300_gpio.c
+SRCS+= ar9300_power.c ar9300_timer.c ar9300_spectral.c
+
+SRCS+= device_if.h bus_if.h pci_if.h opt_inet.h opt_ath.h opt_ah.h opt_wlan.h
+
+CFLAGS+= -I. -I${SRCTOP}/sys/dev/ath -I${SRCTOP}/sys/dev/ath/ath_hal
+CFLAGS+= -I. -I${SRCTOP}/sys/contrib/dev/ath/ath_hal/
+
+.include <bsd.kmod.mk>
+
+# AR9300 HAL build overrides, as there's still some code to tidy up
+CWARNFLAGS.ar9300_eeprom.c= ${NO_WCONSTANT_CONVERSION}
+CWARNFLAGS.ar9300_reset.c= ${NO_WSOMETIMES_UNINITIALIZED} -Wno-unused-function
+CWARNFLAGS+= ${NO_WUNUSED_BUT_SET_VARIABLE}
diff --git a/sys/modules/ath_main/Makefile b/sys/modules/ath_main/Makefile
new file mode 100644
index 000000000000..5b479ce67a48
--- /dev/null
+++ b/sys/modules/ath_main/Makefile
@@ -0,0 +1,53 @@
+#
+# Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer,
+# without modification.
+# 2. Redistributions in binary form must reproduce at minimum a disclaimer
+# similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
+# redistribution must be conditioned upon including a substantially
+# similar Disclaimer requirement for further binary redistribution.
+#
+# NO WARRANTY
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+# THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
+# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGES.
+#
+#
+
+ATH_RATE?= sample # tx rate control algorithm
+
+.PATH: ${SRCTOP}/sys/dev/ath
+.PATH: ${SRCTOP}/sys/dev/ath/ath_hal
+
+KMOD= ath_main
+SRCS= if_ath.c if_ath_alq.c if_ath_debug.c if_ath_keycache.c if_ath_sysctl.c
+SRCS+= if_ath_tx.c if_ath_tx_ht.c if_ath_led.c if_ath_rx.c if_ath_tdma.c
+SRCS+= if_ath_beacon.c if_ath_rx_edma.c if_ath_tx_edma.c if_ath_spectral.c
+SRCS+= if_ath_btcoex.c if_ath_btcoex_mci.c if_ath_lna_div.c if_ath_ioctl.c if_ath_descdma.c
+SRCS+= if_ath_pci.c
+
+SRCS+= device_if.h bus_if.h pci_if.h opt_inet.h opt_ath.h opt_ah.h opt_wlan.h
+
+CFLAGS+= -I. -I${SRCTOP}/sys/dev/ath -I${SRCTOP}/sys/dev/ath/ath_hal
+CFLAGS+= -I. -I${SRCTOP}/sys/contrib/dev/ath/ath_hal/
+CFLAGS+= ${ATH_CFLAGS}
+
+.include <bsd.kmod.mk>
+
+# XXX Work around clang warnings, until maintainer approves fix.
+CWARNFLAGS.if_ath.c= ${NO_WSOMETIMES_UNINITIALIZED}
+CWARNFLAGS+= ${NO_WUNUSED_BUT_SET_VARIABLE}
diff --git a/sys/modules/ath_rate/Makefile b/sys/modules/ath_rate/Makefile
new file mode 100644
index 000000000000..537f59ef3eef
--- /dev/null
+++ b/sys/modules/ath_rate/Makefile
@@ -0,0 +1,58 @@
+#
+# Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer,
+# without modification.
+# 2. Redistributions in binary form must reproduce at minimum a disclaimer
+# similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
+# redistribution must be conditioned upon including a substantially
+# similar Disclaimer requirement for further binary redistribution.
+#
+# NO WARRANTY
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+# THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
+# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGES.
+#
+#
+
+ATH_RATE?= sample # tx rate control algorithm
+
+.PATH: ${SRCTOP}/sys/dev/ath
+
+KMOD= ath_rate
+
+SRCS= if_ath_rate.c
+
+# NB: rate control is bound to the driver by symbol names so only pick one
+.if ${ATH_RATE} == "sample"
+.PATH: ${SRCTOP}/sys/dev/ath/ath_rate/sample
+SRCS+= sample.c
+.elif ${ATH_RATE} == "onoe"
+.PATH: ${SRCTOP}/sys/dev/ath/ath_rate/onoe
+SRCS+= onoe.c
+.elif ${ATH_RATE} == "amrr"
+.PATH: ${SRCTOP}/sys/dev/ath/ath_rate/amrr
+SRCS+= amrr.c
+.endif
+
+SRCS+= device_if.h bus_if.h pci_if.h opt_inet.h opt_ath.h opt_ah.h opt_wlan.h
+
+CFLAGS+= -I. -I${SRCTOP}/sys/dev/ath -I${SRCTOP}/sys/dev/ath/ath_hal
+CFLAGS+= -I. -I${SRCTOP}/sys/contrib/dev/ath/ath_hal/
+
+.include <bsd.kmod.mk>
+
+CWARNFLAGS+= ${NO_WUNUSED_BUT_SET_VARIABLE}
diff --git a/sys/modules/athk_common/Makefile b/sys/modules/athk_common/Makefile
new file mode 100644
index 000000000000..284e1b187405
--- /dev/null
+++ b/sys/modules/athk_common/Makefile
@@ -0,0 +1,36 @@
+
+DEVDIR= ${SRCTOP}/sys/contrib/dev/athk
+
+.PATH: ${DEVDIR}
+
+KMOD= athk_common
+
+WITH_ATH_DEBUG= 1
+WITH_ATH_TRACEPOINTS= 0
+
+SRCS= main.c
+SRCS+= dfs_pattern_detector.c dfs_pri_detector.c
+SRCS+= hw.c key.c regd.c
+
+.if defined(WITH_ATH_DEBUG) && ${WITH_ATH_DEBUG} > 0
+SRCS+= debug.c
+CFLAGS+= -DCONFIG_ATH_DEBUG
+.endif
+
+.if defined(WITH_ATH_TRACEPOINTS) && ${WITH_ATH_TRACEPOINTS} > 0
+SRCS+= trace.c
+CFLAGS+= -DCONFIG_ATH_TRACEPOINTS
+.endif
+
+# Other
+SRCS+= ${LINUXKPI_GENSRCS}
+SRCS+= opt_wlan.h opt_inet6.h opt_inet.h opt_acpi.h
+
+CFLAGS+= -DKBUILD_MODNAME='"athk_common"'
+
+CFLAGS+= -I${DEVDIR}
+CFLAGS+= ${LINUXKPI_INCLUDES}
+# Helpful after fresh imports.
+#CFLAGS+= -ferror-limit=0
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/autofs/Makefile b/sys/modules/autofs/Makefile
new file mode 100644
index 000000000000..3fbd3a7db707
--- /dev/null
+++ b/sys/modules/autofs/Makefile
@@ -0,0 +1,10 @@
+
+.PATH: ${SRCTOP}/sys/fs/autofs
+
+KMOD= autofs
+SRCS= vnode_if.h \
+ autofs.c \
+ autofs_vnops.c \
+ autofs_vfsops.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/axgbe/Makefile b/sys/modules/axgbe/Makefile
new file mode 100644
index 000000000000..bc5c5b1299f3
--- /dev/null
+++ b/sys/modules/axgbe/Makefile
@@ -0,0 +1,8 @@
+
+.if ${MACHINE_CPUARCH} == "aarch64"
+SUBDIR= if_axa
+.elif ${MACHINE_CPUARCH} == "amd64"
+SUBDIR= if_axp
+.endif
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/axgbe/if_axa/Makefile b/sys/modules/axgbe/if_axa/Makefile
new file mode 100644
index 000000000000..088e4383b9e0
--- /dev/null
+++ b/sys/modules/axgbe/if_axa/Makefile
@@ -0,0 +1,11 @@
+
+.PATH: ${SRCTOP}/sys/dev/axgbe
+
+KMOD = if_axa
+SRCS = device_if.h bus_if.h miibus_if.h ofw_bus_if.h ifdi_if.h vnode_if.h
+SRCS += opt_inet.h opt_inet6.h opt_rss.h opt_iflib.h opt_platform.h
+SRCS += if_axgbe.c xgbe-sysctl.c xgbe_osdep.c xgbe-desc.c xgbe-drv.c xgbe-mdio.c xgbe-dev.c xgbe-i2c.c xgbe-phy-v1.c xgbe-txrx.c
+
+CFLAGS+= ${LINUXKPI_INCLUDES}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/axgbe/if_axp/Makefile b/sys/modules/axgbe/if_axp/Makefile
new file mode 100644
index 000000000000..6cab3317c1e2
--- /dev/null
+++ b/sys/modules/axgbe/if_axp/Makefile
@@ -0,0 +1,11 @@
+
+.PATH: ${SRCTOP}/sys/dev/axgbe
+
+KMOD = if_axp
+SRCS = device_if.h bus_if.h miibus_if.h pci_if.h ifdi_if.h vnode_if.h
+SRCS += opt_inet.h opt_inet6.h opt_rss.h opt_iflib.h opt_platform.h
+SRCS += if_axgbe_pci.c xgbe-sysctl.c xgbe_osdep.c xgbe-desc.c xgbe-drv.c xgbe-mdio.c xgbe-dev.c xgbe-i2c.c xgbe-phy-v2.c xgbe-txrx.c
+
+CFLAGS+= ${LINUXKPI_INCLUDES}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/backlight/Makefile b/sys/modules/backlight/Makefile
new file mode 100644
index 000000000000..48c45d785ada
--- /dev/null
+++ b/sys/modules/backlight/Makefile
@@ -0,0 +1,14 @@
+
+.PATH: ${SRCTOP}/sys/dev/backlight
+KMOD= backlight
+SRCS= backlight.c
+
+SRCS+= bus_if.h \
+ device_if.h \
+ opt_platform.h \
+ backlight_if.h \
+ backlight_if.c
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/bce/Makefile b/sys/modules/bce/Makefile
new file mode 100644
index 000000000000..6e6756f5fbc2
--- /dev/null
+++ b/sys/modules/bce/Makefile
@@ -0,0 +1,7 @@
+.PATH: ${SRCTOP}/sys/dev/bce
+KMOD= if_bce
+SRCS= opt_platform.h opt_bce.h if_bce.c miibus_if.h miidevs.h device_if.h bus_if.h pci_if.h
+
+#CFLAGS += -DBCE_DEBUG=0
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/bcm283x_clkman/Makefile b/sys/modules/bcm283x_clkman/Makefile
new file mode 100644
index 000000000000..06ae3cfc5668
--- /dev/null
+++ b/sys/modules/bcm283x_clkman/Makefile
@@ -0,0 +1,11 @@
+
+.PATH: ${SRCTOP}/sys/arm/broadcom/bcm2835/
+
+KMOD= bcm283x_clkman
+SRCS= bcm2835_clkman.c
+
+EXPORT_SYMS= bcm2835_clkman_set_frequency
+
+SRCS+= bus_if.h device_if.h ofw_bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/bcm283x_pwm/Makefile b/sys/modules/bcm283x_pwm/Makefile
new file mode 100644
index 000000000000..16f3364ef8e4
--- /dev/null
+++ b/sys/modules/bcm283x_pwm/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/arm/broadcom/bcm2835/
+
+KMOD= bcm283x_pwm
+SRCS= bcm2835_pwm.c
+
+SRCS+= bus_if.h device_if.h ofw_bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/bfe/Makefile b/sys/modules/bfe/Makefile
new file mode 100644
index 000000000000..99458b2bec7b
--- /dev/null
+++ b/sys/modules/bfe/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/bfe
+
+KMOD= if_bfe
+SRCS= if_bfe.c miibus_if.h miidevs.h device_if.h bus_if.h pci_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/bge/Makefile b/sys/modules/bge/Makefile
new file mode 100644
index 000000000000..4ded89da977b
--- /dev/null
+++ b/sys/modules/bge/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/bge
+
+KMOD= if_bge
+SRCS= if_bge.c miibus_if.h miidevs.h device_if.h bus_if.h pci_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/bhnd/Makefile b/sys/modules/bhnd/Makefile
new file mode 100644
index 000000000000..032d33210079
--- /dev/null
+++ b/sys/modules/bhnd/Makefile
@@ -0,0 +1,76 @@
+
+.PATH: ${SRCTOP}/sys/dev/bhnd
+.PATH: ${SRCTOP}/sys/dev/bhnd/cores/chipc
+.PATH: ${SRCTOP}/sys/dev/bhnd/cores/chipc/pwrctl
+.PATH: ${SRCTOP}/sys/dev/bhnd/cores/pmu
+.PATH: ${SRCTOP}/sys/dev/bhnd/nvram
+
+KMOD= bhnd
+SRCS= bhnd.c bhnd_subr.c
+SRCS+= bhnd_bus_if.c bhnd_bus_if.h
+
+SRCS+= bhnd_erom.c
+SRCS+= bhnd_erom_if.c bhnd_erom_if.h
+
+# ChipCommon
+SRCS+= chipc.c chipc_subr.c
+
+SRCS+= chipc_gpio.c
+SRCS+= gpio_if.h ofw_bus_if.h
+SRCS+= opt_platform.h
+
+SRCS+= bhnd_sprom_chipc.c \
+ bhnd_pmu_chipc.c
+
+SRCS+= bhnd_pwrctl.c \
+ bhnd_pwrctl_subr.c \
+ bhnd_pwrctl_if.c \
+ bhnd_pwrctl_if.h
+SRCS+= bhnd_pwrctl_hostb_if.c bhnd_pwrctl_hostb_if.h
+
+SRCS+= bhnd_chipc_if.c bhnd_chipc_if.h
+
+# PMU
+SRCS+= bhnd_pmu.c \
+ bhnd_pmu_core.c \
+ bhnd_pmu_subr.c
+SRCS+= bhnd_pmu_if.c bhnd_pmu_if.h
+
+# NVRAM/SPROM
+SRCS+= bhnd_nvram_data.c \
+ bhnd_nvram_data_bcm.c \
+ bhnd_nvram_data_bcmraw.c \
+ bhnd_nvram_data_btxt.c \
+ bhnd_nvram_data_sprom.c \
+ bhnd_nvram_data_sprom_subr.c \
+ bhnd_nvram_data_tlv.c \
+ bhnd_nvram_io.c \
+ bhnd_nvram_iobuf.c \
+ bhnd_nvram_ioptr.c \
+ bhnd_nvram_iores.c \
+ bhnd_nvram_plist.c \
+ bhnd_nvram_store.c \
+ bhnd_nvram_store_subr.c \
+ bhnd_nvram_subr.c \
+ bhnd_nvram_value.c \
+ bhnd_nvram_value_fmts.c \
+ bhnd_nvram_value_prf.c \
+ bhnd_nvram_value_subr.c \
+ bhnd_sprom.c
+SRCS+= bhnd_nvram_map.h bhnd_nvram_map_data.h
+SRCS+= bhnd_nvram_if.c bhnd_nvram_if.h
+
+SRCS+= device_if.h bus_if.h
+
+SUBDIR= bcma \
+ bcma_bhndb \
+ bhndb \
+ bhndb_pci \
+ cores \
+ siba \
+ siba_bhndb
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
+.include <bsd.subdir.mk>
diff --git a/sys/modules/bhnd/bcma/Makefile b/sys/modules/bhnd/bcma/Makefile
new file mode 100644
index 000000000000..c329aa3c6e98
--- /dev/null
+++ b/sys/modules/bhnd/bcma/Makefile
@@ -0,0 +1,10 @@
+
+.PATH: ${SRCTOP}/sys/dev/bhnd/bcma
+
+KMOD= bcma
+SRCS= bcma.c bcma_subr.c bcma_erom.c
+
+SRCS+= device_if.h bus_if.h
+SRCS+= bhnd_bus_if.h bhnd_erom_if.h bhnd_pmu_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/bhnd/bcma_bhndb/Makefile b/sys/modules/bhnd/bcma_bhndb/Makefile
new file mode 100644
index 000000000000..c771985ecde4
--- /dev/null
+++ b/sys/modules/bhnd/bcma_bhndb/Makefile
@@ -0,0 +1,11 @@
+
+.PATH: ${SRCTOP}/sys/dev/bhnd/bcma
+
+KMOD= bcma_bhndb
+SRCS= bcma_bhndb.c
+
+SRCS+= bhnd_bus_if.h bhnd_erom_if.h
+SRCS+= bhndb_bus_if.h bhndb_if.h
+SRCS+= device_if.h bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/bhnd/bhndb/Makefile b/sys/modules/bhnd/bhndb/Makefile
new file mode 100644
index 000000000000..c4745f17b74e
--- /dev/null
+++ b/sys/modules/bhnd/bhndb/Makefile
@@ -0,0 +1,19 @@
+
+.PATH: ${SRCTOP}/sys/dev/bhnd/bhndb
+
+KMOD= bhndb
+SRCS= bhndb.c bhndb_subr.c bhndb_hwdata.c \
+ bhnd_bhndb.c \
+ bhndb_bus_if.c bhndb_bus_if.h \
+ bhndb_if.c bhndb_if.h
+SRCS+= bhnd_bus_if.h \
+ bhnd_chipc_if.h \
+ bhnd_erom_if.h \
+ bhnd_pwrctl_hostb_if.h \
+ bhnd_nvram_if.h
+
+SRCS+= device_if.h bus_if.h pci_if.h
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/bhnd/bhndb_pci/Makefile b/sys/modules/bhnd/bhndb_pci/Makefile
new file mode 100644
index 000000000000..958502b29c0e
--- /dev/null
+++ b/sys/modules/bhnd/bhndb_pci/Makefile
@@ -0,0 +1,14 @@
+
+.PATH: ${SRCTOP}/sys/dev/bhnd/bhndb
+
+KMOD= bhndb_pci
+SRCS= bhndb_pci.c bhndb_pci_hwdata.c \
+ bhndb_pci_sprom.c
+SRCS+= bhnd_bus_if.h bhndb_bus_if.h bhndb_if.h
+SRCS+= bhnd_erom_if.h
+SRCS+= bhnd_nvram_if.h
+SRCS+= bhnd_pwrctl_hostb_if.h
+
+SRCS+= device_if.h bus_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/bhnd/cores/Makefile b/sys/modules/bhnd/cores/Makefile
new file mode 100644
index 000000000000..610d735f723d
--- /dev/null
+++ b/sys/modules/bhnd/cores/Makefile
@@ -0,0 +1,6 @@
+
+SUBDIR= bhnd_pci \
+ bhnd_pci_hostb \
+ bhnd_pcib
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/bhnd/cores/bhnd_pci/Makefile b/sys/modules/bhnd/cores/bhnd_pci/Makefile
new file mode 100644
index 000000000000..96275c7d5ee8
--- /dev/null
+++ b/sys/modules/bhnd/cores/bhnd_pci/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/bhnd/cores/pci
+.PATH: ${SRCTOP}/sys/dev/bhnd/cores/pcie2
+
+KMOD= bhnd_pci
+SRCS= bhnd_pci.c bhnd_pcie2.c
+SRCS+= device_if.h bus_if.h bhnd_bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/bhnd/cores/bhnd_pci_hostb/Makefile b/sys/modules/bhnd/cores/bhnd_pci_hostb/Makefile
new file mode 100644
index 000000000000..a27d30f50677
--- /dev/null
+++ b/sys/modules/bhnd/cores/bhnd_pci_hostb/Makefile
@@ -0,0 +1,10 @@
+
+.PATH: ${SRCTOP}/sys/dev/bhnd/cores/pci
+.PATH: ${SRCTOP}/sys/dev/bhnd/cores/pcie2
+
+KMOD= bhnd_pci_hostb
+SRCS= bhnd_pci_hostb.c bhnd_pcie2_hostb.c
+SRCS+= device_if.h bus_if.h pci_if.h \
+ bhnd_bus_if.h bhnd_chipc_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/bhnd/cores/bhnd_pcib/Makefile b/sys/modules/bhnd/cores/bhnd_pcib/Makefile
new file mode 100644
index 000000000000..93e53415df0d
--- /dev/null
+++ b/sys/modules/bhnd/cores/bhnd_pcib/Makefile
@@ -0,0 +1,10 @@
+
+.PATH: ${SRCTOP}/sys/dev/bhnd/cores/pci
+.PATH: ${SRCTOP}/sys/dev/bhnd/cores/pcie2
+
+KMOD= bhnd_pcib
+SRCS= bhnd_pcib.c bhnd_pcie2b.c
+SRCS+= device_if.h bus_if.h pci_if.h \
+ bhnd_bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/bhnd/siba/Makefile b/sys/modules/bhnd/siba/Makefile
new file mode 100644
index 000000000000..572fab726664
--- /dev/null
+++ b/sys/modules/bhnd/siba/Makefile
@@ -0,0 +1,13 @@
+
+.PATH: ${SRCTOP}/sys/dev/bhnd/siba
+
+KMOD= siba
+SRCS= siba.c siba_subr.c \
+ siba_erom.c
+
+SRCS+= device_if.h bus_if.h
+SRCS+= bhnd_bus_if.h bhnd_chipc_if.h \
+ bhnd_erom_if.h bhnd_pmu_if.h \
+ bhnd_pwrctl_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/bhnd/siba_bhndb/Makefile b/sys/modules/bhnd/siba_bhndb/Makefile
new file mode 100644
index 000000000000..ccf978edf515
--- /dev/null
+++ b/sys/modules/bhnd/siba_bhndb/Makefile
@@ -0,0 +1,11 @@
+
+.PATH: ${SRCTOP}/sys/dev/bhnd/siba
+
+KMOD= siba_bhndb
+SRCS= siba_bhndb.c
+
+SRCS+= bhnd_bus_if.h bhnd_erom_if.h
+SRCS+= bhndb_bus_if.h bhndb_if.h
+SRCS+= device_if.h bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/bios/Makefile b/sys/modules/bios/Makefile
new file mode 100644
index 000000000000..1fe7e1e1bba3
--- /dev/null
+++ b/sys/modules/bios/Makefile
@@ -0,0 +1,9 @@
+#
+
+SUBDIR= smbios vpd
+
+.if ${MACHINE_ARCH} == "i386"
+SUBDIR+= smapi
+.endif
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/bios/smapi/Makefile b/sys/modules/bios/smapi/Makefile
new file mode 100644
index 000000000000..1b5df8d12957
--- /dev/null
+++ b/sys/modules/bios/smapi/Makefile
@@ -0,0 +1,9 @@
+#
+
+.PATH: ${SRCTOP}/sys/i386/bios
+
+KMOD= smapi
+SRCS= smapi.c smapi_bios.S \
+ bus_if.h device_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/bios/smbios/Makefile b/sys/modules/bios/smbios/Makefile
new file mode 100644
index 000000000000..ca1e4b04815d
--- /dev/null
+++ b/sys/modules/bios/smbios/Makefile
@@ -0,0 +1,9 @@
+#
+
+.PATH: ${SRCTOP}/sys/dev/smbios
+
+KMOD= smbios
+SRCS= smbios.c \
+ bus_if.h device_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/bios/vpd/Makefile b/sys/modules/bios/vpd/Makefile
new file mode 100644
index 000000000000..bab4e7286098
--- /dev/null
+++ b/sys/modules/bios/vpd/Makefile
@@ -0,0 +1,9 @@
+#
+
+.PATH: ${SRCTOP}/sys/x86/bios
+
+KMOD= vpd
+SRCS= vpd.c \
+ bus_if.h device_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/blake2/Makefile b/sys/modules/blake2/Makefile
new file mode 100644
index 000000000000..a8863c2e67e7
--- /dev/null
+++ b/sys/modules/blake2/Makefile
@@ -0,0 +1,90 @@
+
+.PATH: ${SRCTOP}/sys/contrib/libb2
+.PATH: ${SRCTOP}/sys/crypto/blake2
+.PATH: ${SRCTOP}/sys/opencrypto
+.PATH: ${SRCTOP}/contrib/llvm-project/clang/lib/Headers
+
+KMOD = blake2
+
+# Vendor sources
+SRCS += blake2.h
+SRCS += blake2-impl.h
+SRCS += blake2-config.h
+
+SRCS += blake2-dispatch.c
+SRCS += blake2bp.c
+SRCS += blake2sp.c
+
+CFLAGS += -I${SRCTOP}/sys/contrib/libb2
+CFLAGS += -I${SRCTOP}/sys/crypto/blake2
+
+# x86 specific optimization headers:
+SRCS += blake2b-load-sse2.h
+SRCS += blake2b-load-sse41.h
+SRCS += blake2b-round.h
+
+SRCS += blake2s-load-sse2.h
+SRCS += blake2s-load-sse41.h
+SRCS += blake2s-load-xop.h
+SRCS += blake2s-round.h
+
+# C files to build a dispatched fat implementation on x86
+SRCS_IN += blake2b-sse2.c
+SRCS_IN += blake2b-ssse3.c
+SRCS_IN += blake2b-sse41.c
+SRCS_IN += blake2b-avx.c
+SRCS_IN += blake2b-xop.c
+SRCS_IN += blake2s-sse2.c
+SRCS_IN += blake2s-ssse3.c
+SRCS_IN += blake2s-sse41.c
+SRCS_IN += blake2s-avx.c
+SRCS_IN += blake2s-xop.c
+
+OBJS+= ${SRCS_IN:S/.c/.o/g}
+
+CFLAGS.blake2b-sse2.c += -DSUFFIX=_sse2 -msse2
+CFLAGS.blake2s-sse2.c += -DSUFFIX=_sse2 -msse2
+
+CFLAGS.blake2b-ssse3.c += -DSUFFIX=_ssse3 -msse2 -mssse3
+CFLAGS.blake2s-ssse3.c += -DSUFFIX=_ssse3 -msse2 -mssse3
+
+CFLAGS.blake2b-sse41.c += -DSUFFIX=_sse41 -msse2 -mssse3 -msse4.1
+CFLAGS.blake2s-sse41.c += -DSUFFIX=_sse41 -msse2 -mssse3 -msse4.1
+
+CFLAGS.blake2b-avx.c += -DSUFFIX=_avx -msse2 -mssse3 -msse4.1 -mavx
+CFLAGS.blake2s-avx.c += -DSUFFIX=_avx -msse2 -mssse3 -msse4.1 -mavx
+
+CFLAGS.blake2b-xop.c += -DSUFFIX=_xop -msse2 -mssse3 -msse4.1 -mavx -mxop
+CFLAGS.blake2s-xop.c += -DSUFFIX=_xop -msse2 -mssse3 -msse4.1 -mavx -mxop
+
+.for src in ${SRCS_IN}
+${src:S/.c/.o/}: ${src}
+ ${CC} -c ${CFLAGS:N-nostdinc} ${CFLAGS.${src}} ${WERROR} ${PROF} \
+ -D_MM_MALLOC_H_INCLUDED -Wno-unused-function ${.IMPSRC}
+ ${CTFCONVERT_CMD}
+
+${src:S/.c/.o/}: intrin.h emmintrin.h tmmintrin.h smmintrin.h immintrin.h \
+ x86intrin.h ${SRCS:M*.h}
+.endfor
+
+# FreeBSD-specific sources:
+SRCS += blake2_kfreebsd.h
+SRCS += config.h
+
+SRCS += stddef.h
+SRCS += stdint.h
+SRCS += stdio.h
+SRCS += stdlib.h
+SRCS += string.h
+
+SRCS += blake2_cryptodev.c
+
+SRCS += opt_param.h cryptodev_if.h bus_if.h device_if.h
+
+WARNS ?= 6
+
+.include <bsd.kmod.mk>
+
+CWARNFLAGS.blake2-dispatch.c += -Wno-unused-const-variable
+CWARNFLAGS.blake2s-ref.c += -Wno-cast-qual -Wno-unused-function
+CWARNFLAGS += -Wno-cast-qual
diff --git a/sys/modules/bnxt/Makefile b/sys/modules/bnxt/Makefile
new file mode 100644
index 000000000000..5cef9f8d5343
--- /dev/null
+++ b/sys/modules/bnxt/Makefile
@@ -0,0 +1,14 @@
+
+.PATH: ${SRCTOP}/sys/dev/bnxt
+
+KMOD = if_bnxt
+SRCS = device_if.h bus_if.h pci_if.h pci_iov_if.h ifdi_if.h
+SRCS += opt_inet.h opt_inet6.h opt_rss.h
+SRCS += bnxt_txrx.c if_bnxt.c
+SRCS += bnxt_hwrm.c
+SRCS += bnxt_sysctl.c
+SRCS += bnxt_mgmt.c
+
+CFLAGS+= -DIFLIB
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/bridgestp/Makefile b/sys/modules/bridgestp/Makefile
new file mode 100644
index 000000000000..79b339bb3d44
--- /dev/null
+++ b/sys/modules/bridgestp/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/net
+
+KMOD= bridgestp
+SRCS= bridgestp.c
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/bwi/Makefile b/sys/modules/bwi/Makefile
new file mode 100644
index 000000000000..6fbf77bc903f
--- /dev/null
+++ b/sys/modules/bwi/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/bwi
+
+KMOD = if_bwi
+
+SRCS = if_bwi.c if_bwi_pci.c bwimac.c bwiphy.c bwirf.c
+SRCS += device_if.h bus_if.h pci_if.h opt_inet.h opt_bwi.h opt_wlan.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/bwn/Makefile b/sys/modules/bwn/Makefile
new file mode 100644
index 000000000000..4385b5498ad8
--- /dev/null
+++ b/sys/modules/bwn/Makefile
@@ -0,0 +1,39 @@
+
+.PATH: ${SRCTOP}/sys/dev/bwn
+
+KMOD= if_bwn
+SRCS= if_bwn.c if_bwnreg.h if_bwnvar.h
+SRCS+= if_bwn_pci.c
+SRCS+= if_bwn_util.c
+
+# PHY
+SRCS+= if_bwn_phy_common.c
+SRCS+= if_bwn_phy_g.c if_bwn_phy_lp.c
+SRCS+= if_bwn_phy_n.c
+
+# BHND
+SRCS+= bhnd_bus_if.h \
+ bhnd_chipc_if.h \
+ bhnd_pmu_if.h \
+ bhnd_pwrctl_if.h
+SRCS+= bhnd_nvram_map.h
+
+# BHNDB
+SRCS+= bhndb_bus_if.h \
+ bhndb_if.h
+
+# Other
+SRCS+= device_if.h bus_if.h gpio_if.h pci_if.h opt_bwn.h opt_wlan.h
+
+# The following need the BWN_GPL_PHY kenrel option to opt-in
+# to the GPL'd 802.11n PHY support for this driver.
+.PATH: ${SRCTOP}/sys/gnu/dev/bwn/phy_n
+SRCS.BWN_GPL_PHY+= if_bwn_radio_2055.c
+SRCS.BWN_GPL_PHY+= if_bwn_radio_2056.c
+SRCS.BWN_GPL_PHY+= if_bwn_radio_2057.c
+SRCS.BWN_GPL_PHY+= if_bwn_phy_n_sprom.c
+SRCS.BWN_GPL_PHY+= if_bwn_phy_n_tables.c
+SRCS.BWN_GPL_PHY+= if_bwn_phy_n_ppr.c
+SRCS.BWN_GPL_PHY+= if_bwn_phy_n_core.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/bxe/Makefile b/sys/modules/bxe/Makefile
new file mode 100644
index 000000000000..70b2965ece51
--- /dev/null
+++ b/sys/modules/bxe/Makefile
@@ -0,0 +1,21 @@
+
+SYSDIR ?= ${SRCTOP}/sys
+
+BXE = ${SYSDIR}/dev/bxe
+.PATH: ${BXE}
+
+KMOD = if_bxe
+SRCS = device_if.h bus_if.h pci_if.h
+SRCS += bxe.c \
+ bxe_stats.c \
+ bxe_debug.c \
+ bxe_elink.c \
+ ecore_sp.c \
+ 57710_init_values.c \
+ 57711_init_values.c \
+ 57712_init_values.c
+
+CFLAGS += -I${BXE}
+
+.include <bsd.kmod.mk>
+CWARNFLAGS+= ${NO_WUNUSED_BUT_SET_VARIABLE}
diff --git a/sys/modules/bytgpio/Makefile b/sys/modules/bytgpio/Makefile
new file mode 100644
index 000000000000..a25a76141031
--- /dev/null
+++ b/sys/modules/bytgpio/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/gpio
+KMOD= bytgpio
+SRCS= bytgpio.c
+SRCS+= acpi_if.h device_if.h bus_if.h gpio_if.h opt_acpi.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cam/Makefile b/sys/modules/cam/Makefile
new file mode 100644
index 000000000000..566b245dca2c
--- /dev/null
+++ b/sys/modules/cam/Makefile
@@ -0,0 +1,55 @@
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/cam $S/cam/scsi $S/cam/ata $S/cam/nvme $S/dev/nvme
+
+KMOD= cam
+
+# See sys/conf/options for the flags that go into the different opt_*.h files.
+SRCS= opt_cam.h
+SRCS+= opt_ada.h
+SRCS+= opt_scsi.h
+SRCS+= opt_cd.h
+SRCS+= opt_da.h
+SRCS+= opt_pt.h
+SRCS+= opt_sa.h
+SRCS+= opt_ses.h
+SRCS+= opt_ddb.h
+SRCS+= opt_printf.h
+SRCS+= bus_if.h
+SRCS+= device_if.h
+SRCS+= vnode_if.h
+SRCS+= ata_all.c
+SRCS+= ata_da.c
+SRCS+= ata_pmp.c
+SRCS+= ata_xpt.c
+SRCS+= cam.c
+SRCS+= cam_compat.c
+SRCS+= cam_iosched.c
+SRCS+= cam_periph.c
+SRCS+= cam_queue.c
+SRCS+= cam_sim.c
+SRCS+= cam_xpt.c
+SRCS+= nvme_all.c
+SRCS+= nvme_da.c
+SRCS+= nvme_util.c
+SRCS+= nvme_xpt.c
+SRCS+= scsi_all.c
+SRCS+= scsi_cd.c
+SRCS+= scsi_ch.c
+SRCS+= scsi_da.c
+SRCS+= scsi_enc.c
+SRCS+= scsi_enc_safte.c
+SRCS+= scsi_enc_ses.c
+SRCS+= scsi_pass.c
+SRCS+= scsi_pt.c
+SRCS+= scsi_sa.c
+SRCS+= scsi_sg.c
+SRCS+= scsi_targ_bh.c
+SRCS+= scsi_target.c
+SRCS+= scsi_xpt.c
+SRCS+= smp_all.c
+
+EXPORT_SYMS= YES # XXX evaluate
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cardbus/Makefile b/sys/modules/cardbus/Makefile
new file mode 100644
index 000000000000..a87a0de5185a
--- /dev/null
+++ b/sys/modules/cardbus/Makefile
@@ -0,0 +1,12 @@
+
+.PATH: ${SRCTOP}/sys/dev/cardbus
+
+KMOD= cardbus
+SRCS= cardbus.c cardbus_cis.c cardbus_device.c \
+ device_if.h bus_if.h card_if.h power_if.h pci_if.h pcib_if.h
+
+.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
+CFLAGS += -DNEW_PCIB
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/carp/Makefile b/sys/modules/carp/Makefile
new file mode 100644
index 000000000000..d7a85043539f
--- /dev/null
+++ b/sys/modules/carp/Makefile
@@ -0,0 +1,10 @@
+
+.PATH: ${SRCTOP}/sys/netinet
+.PATH: ${SRCTOP}/sys/crypto
+
+KMOD= carp
+SRCS= ip_carp.c sha1.c
+SRCS+= device_if.h bus_if.h vnode_if.h
+SRCS+= opt_carp.h opt_bpf.h opt_inet.h opt_inet6.h opt_ofed.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cas/Makefile b/sys/modules/cas/Makefile
new file mode 100644
index 000000000000..45d475734562
--- /dev/null
+++ b/sys/modules/cas/Makefile
@@ -0,0 +1,11 @@
+
+.PATH: ${SRCTOP}/sys/dev/cas
+
+KMOD= if_cas
+SRCS= bus_if.h device_if.h if_cas.c miibus_if.h pci_if.h ${ofw_bus_if} opt_platform.h
+
+.if ${MACHINE_CPUARCH} == "powerpc"
+ofw_bus_if= ofw_bus_if.h
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cbb/Makefile b/sys/modules/cbb/Makefile
new file mode 100644
index 000000000000..156a273e01b2
--- /dev/null
+++ b/sys/modules/cbb/Makefile
@@ -0,0 +1,12 @@
+
+.PATH: ${SRCTOP}/sys/dev/pccbb
+
+KMOD= cbb
+SRCS= pccbb.c pccbb_pci.c \
+ device_if.h bus_if.h power_if.h card_if.h pci_if.h pcib_if.h
+
+.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
+CFLAGS += -DNEW_PCIB
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cc/Makefile b/sys/modules/cc/Makefile
new file mode 100644
index 000000000000..c3e59aef331e
--- /dev/null
+++ b/sys/modules/cc/Makefile
@@ -0,0 +1,20 @@
+
+SUBDIR= cc_newreno \
+ cc_cubic \
+ cc_dctcp \
+ cc_htcp
+
+
+# Do we have the TCP_HHOOK symbol defined? If not, there is no point in
+# building these modules by default.
+# We will default to building these modules if $OPT_GLOBAL does contain
+# the TCP_HHOOK option.
+.if defined(ALL_MODULES) || ${OPT_GLOBAL:UTCP_HHOOK:MTCP_HHOOK} != ""
+SUBDIR+= \
+ cc_cdg \
+ cc_chd \
+ cc_hd \
+ cc_vegas
+.endif
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/cc/cc_cdg/Makefile b/sys/modules/cc/cc_cdg/Makefile
new file mode 100644
index 000000000000..8da536709e7d
--- /dev/null
+++ b/sys/modules/cc/cc_cdg/Makefile
@@ -0,0 +1,6 @@
+
+.PATH: ${SRCTOP}/sys/netinet/cc
+KMOD= cc_cdg
+SRCS= cc_cdg.c opt_kern_tls.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cc/cc_chd/Makefile b/sys/modules/cc/cc_chd/Makefile
new file mode 100644
index 000000000000..0f682432d26d
--- /dev/null
+++ b/sys/modules/cc/cc_chd/Makefile
@@ -0,0 +1,6 @@
+
+.PATH: ${SRCTOP}/sys/netinet/cc
+KMOD= cc_chd
+SRCS= cc_chd.c opt_kern_tls.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cc/cc_cubic/Makefile b/sys/modules/cc/cc_cubic/Makefile
new file mode 100644
index 000000000000..6599126e0b8d
--- /dev/null
+++ b/sys/modules/cc/cc_cubic/Makefile
@@ -0,0 +1,6 @@
+
+.PATH: ${SRCTOP}/sys/netinet/cc
+KMOD= cc_cubic
+SRCS= cc_cubic.c opt_kern_tls.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cc/cc_dctcp/Makefile b/sys/modules/cc/cc_dctcp/Makefile
new file mode 100644
index 000000000000..a084ae4f6e0e
--- /dev/null
+++ b/sys/modules/cc/cc_dctcp/Makefile
@@ -0,0 +1,6 @@
+
+.PATH: ${SRCTOP}/sys/netinet/cc
+KMOD= cc_dctcp
+SRCS= cc_dctcp.c opt_kern_tls.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cc/cc_hd/Makefile b/sys/modules/cc/cc_hd/Makefile
new file mode 100644
index 000000000000..ae3fe500a278
--- /dev/null
+++ b/sys/modules/cc/cc_hd/Makefile
@@ -0,0 +1,6 @@
+
+.PATH: ${SRCTOP}/sys/netinet/cc
+KMOD= cc_hd
+SRCS= cc_hd.c opt_kern_tls.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cc/cc_htcp/Makefile b/sys/modules/cc/cc_htcp/Makefile
new file mode 100644
index 000000000000..0475f768a545
--- /dev/null
+++ b/sys/modules/cc/cc_htcp/Makefile
@@ -0,0 +1,6 @@
+
+.PATH: ${SRCTOP}/sys/netinet/cc
+KMOD= cc_htcp
+SRCS= cc_htcp.c opt_kern_tls.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cc/cc_newreno/Makefile b/sys/modules/cc/cc_newreno/Makefile
new file mode 100644
index 000000000000..d6ec03807b6f
--- /dev/null
+++ b/sys/modules/cc/cc_newreno/Makefile
@@ -0,0 +1,6 @@
+
+.PATH: ${SRCTOP}/sys/netinet/cc
+KMOD= cc_newreno
+SRCS= cc_newreno.c opt_kern_tls.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cc/cc_vegas/Makefile b/sys/modules/cc/cc_vegas/Makefile
new file mode 100644
index 000000000000..87f36414a2e2
--- /dev/null
+++ b/sys/modules/cc/cc_vegas/Makefile
@@ -0,0 +1,6 @@
+
+.PATH: ${SRCTOP}/sys/netinet/cc
+KMOD= cc_vegas
+SRCS= cc_vegas.c opt_kern_tls.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ccp/Makefile b/sys/modules/ccp/Makefile
new file mode 100644
index 000000000000..c31c2a3bfe99
--- /dev/null
+++ b/sys/modules/ccp/Makefile
@@ -0,0 +1,20 @@
+
+.PATH: ${SRCTOP}/sys/crypto/ccp
+
+KMOD= ccp
+
+SRCS= ccp.c ccp_hardware.c ccp_lsb.c
+SRCS+= ccp.h ccp_hardware.h ccp_lsb.h
+SRCS+= opt_ddb.h
+SRCS+= bus_if.h
+SRCS+= device_if.h
+SRCS+= cryptodev_if.h
+SRCS+= pci_if.h
+
+CFLAGS+= -fms-extensions
+CFLAGS.clang+= -Wno-microsoft-anon-tag
+
+MFILES= kern/bus_if.m kern/device_if.m opencrypto/cryptodev_if.m \
+ dev/pci/pci_if.m
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cd9660/Makefile b/sys/modules/cd9660/Makefile
new file mode 100644
index 000000000000..d1563bcafd34
--- /dev/null
+++ b/sys/modules/cd9660/Makefile
@@ -0,0 +1,10 @@
+
+.PATH: ${SRCTOP}/sys/fs/cd9660
+
+KMOD= cd9660
+SRCS= vnode_if.h \
+ cd9660_bmap.c cd9660_lookup.c cd9660_node.c cd9660_rrip.c \
+ cd9660_util.c cd9660_vfsops.c cd9660_vnops.c
+EXPORT_SYMS= cd9660_iconv
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cd9660_iconv/Makefile b/sys/modules/cd9660_iconv/Makefile
new file mode 100644
index 000000000000..9a4f27e829a2
--- /dev/null
+++ b/sys/modules/cd9660_iconv/Makefile
@@ -0,0 +1,6 @@
+
+.PATH: ${SRCTOP}/sys/fs/cd9660
+KMOD= cd9660_iconv
+SRCS= cd9660_iconv.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cfi/Makefile b/sys/modules/cfi/Makefile
new file mode 100644
index 000000000000..c795803a08f3
--- /dev/null
+++ b/sys/modules/cfi/Makefile
@@ -0,0 +1,11 @@
+
+.PATH: ${SRCTOP}/sys/dev/cfi
+
+KMOD= cfi
+SRCS= cfi_bus_fdt.c ofw_bus_if.h cfi_core.c cfi_dev.c
+SRCS+= bus_if.h device_if.h opt_cfi.h
+
+opt_cfi.h:
+ echo "#define CFI_SUPPORT_STRATAFLASH 1" > ${.TARGET}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cfiscsi/Makefile b/sys/modules/cfiscsi/Makefile
new file mode 100644
index 000000000000..4d6538684038
--- /dev/null
+++ b/sys/modules/cfiscsi/Makefile
@@ -0,0 +1,11 @@
+
+.PATH: ${SRCTOP}/sys/cam/ctl
+
+KMOD= cfiscsi
+
+#CFLAGS+=-DICL_KERNEL_PROXY
+
+MFILES= dev/iscsi/icl_conn_if.m
+SRCS= ctl_frontend_iscsi.c icl_conn_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/chromebook_platform/Makefile b/sys/modules/chromebook_platform/Makefile
new file mode 100644
index 000000000000..2f8ff9167b75
--- /dev/null
+++ b/sys/modules/chromebook_platform/Makefile
@@ -0,0 +1,6 @@
+
+.PATH: ${SRCTOP}/sys/dev/chromebook_platform
+KMOD= chromebook_platform
+SRCS= chromebook_platform.c bus_if.h device_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/chvgpio/Makefile b/sys/modules/chvgpio/Makefile
new file mode 100644
index 000000000000..8c4dbcdb2830
--- /dev/null
+++ b/sys/modules/chvgpio/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/gpio
+KMOD= chvgpio
+SRCS= chvgpio.c
+SRCS+= acpi_if.h device_if.h bus_if.h gpio_if.h opt_acpi.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ciss/Makefile b/sys/modules/ciss/Makefile
new file mode 100644
index 000000000000..b2025106248e
--- /dev/null
+++ b/sys/modules/ciss/Makefile
@@ -0,0 +1,10 @@
+
+KMOD = ciss
+.PATH: ${SRCTOP}/sys/dev/${KMOD}
+SRCS = ciss.c
+SRCS += opt_scsi.h opt_cam.h
+SRCS += device_if.h bus_if.h pci_if.h
+
+#CFLAGS +=-DCISS_DEBUG
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/coretemp/Makefile b/sys/modules/coretemp/Makefile
new file mode 100644
index 000000000000..a77c8c956956
--- /dev/null
+++ b/sys/modules/coretemp/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/coretemp
+
+KMOD= coretemp
+SRCS= coretemp.c bus_if.h device_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cpsw/Makefile b/sys/modules/cpsw/Makefile
new file mode 100644
index 000000000000..05dc943bace9
--- /dev/null
+++ b/sys/modules/cpsw/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/arm/ti/cpsw
+
+KMOD= if_cpsw
+SRCS= if_cpsw.c device_if.h bus_if.h ofw_bus_if.h miibus_if.h syscon_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cpuctl/Makefile b/sys/modules/cpuctl/Makefile
new file mode 100644
index 000000000000..4a6e302b60c7
--- /dev/null
+++ b/sys/modules/cpuctl/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/cpuctl
+
+KMOD= cpuctl
+SRCS= cpuctl.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cpufreq/Makefile b/sys/modules/cpufreq/Makefile
new file mode 100644
index 000000000000..6b88f1a6c02a
--- /dev/null
+++ b/sys/modules/cpufreq/Makefile
@@ -0,0 +1,25 @@
+
+.PATH: ${SRCTOP}/sys/dev/cpufreq \
+ ${SRCTOP}/sys/${MACHINE_CPUARCH}/cpufreq
+
+KMOD= cpufreq
+SRCS= ichss.c
+SRCS+= bus_if.h cpufreq_if.h device_if.h pci_if.h
+
+.if ${MACHINE} == "i386" || ${MACHINE} == "amd64"
+.PATH: ${SRCTOP}/sys/x86/cpufreq
+
+SRCS+= acpi_if.h opt_acpi.h
+SRCS+= est.c hwpstate_amd.c p4tcc.c powernow.c hwpstate_intel.c
+.endif
+
+.if ${MACHINE} == "i386"
+SRCS+= smist.c
+.endif
+
+.if ${MACHINE} == "powerpc"
+.PATH: ${SRCTOP}/sys/powerpc/cpufreq
+SRCS+= dfs.c
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/crypto/Makefile b/sys/modules/crypto/Makefile
new file mode 100644
index 000000000000..59f66aeff3cc
--- /dev/null
+++ b/sys/modules/crypto/Makefile
@@ -0,0 +1,104 @@
+
+LIBSODIUM=${SRCTOP}/sys/contrib/libsodium/src/libsodium
+
+.PATH: ${SRCTOP}/sys/opencrypto
+.PATH: ${SRCTOP}/sys/crypto
+.PATH: ${SRCTOP}/sys/crypto/camellia
+.PATH: ${SRCTOP}/sys/crypto/des
+.PATH: ${SRCTOP}/sys/crypto/rijndael
+.PATH: ${SRCTOP}/sys/crypto/sha2
+.PATH: ${SRCTOP}/sys/crypto/siphash
+.PATH: ${SRCTOP}/sys/crypto/skein
+.PATH: ${SRCTOP}/sys/crypto/blake2
+.PATH: ${SRCTOP}/sys/crypto/chacha20
+.PATH: ${SRCTOP}/sys/contrib/libb2
+.PATH: ${LIBSODIUM}/crypto_core/ed25519/ref10
+.PATH: ${LIBSODIUM}/crypto_core/hchacha20
+.PATH: ${LIBSODIUM}/crypto_onetimeauth/poly1305
+.PATH: ${LIBSODIUM}/crypto_onetimeauth/poly1305/donna
+.PATH: ${LIBSODIUM}/crypto_scalarmult/curve25519
+.PATH: ${LIBSODIUM}/crypto_scalarmult/curve25519/ref10
+.PATH: ${LIBSODIUM}/crypto_stream/chacha20
+.PATH: ${LIBSODIUM}/crypto_stream/chacha20/ref
+.PATH: ${LIBSODIUM}/crypto_verify/sodium
+.PATH: ${SRCTOP}/sys/crypto/libsodium
+
+KMOD = crypto
+SRCS = crypto.c cryptodev_if.c
+SRCS += criov.c cryptosoft.c
+SRCS += xform_aes_cbc.c xform_aes_icm.c xform_aes_xts.c xform_cml.c
+SRCS += xform_deflate.c xform_gmac.c xform_null.c xform_rmd160.c
+SRCS += xform_sha1.c xform_sha2.c
+SRCS += cryptodeflate.c rmd160.c rijndael-alg-fst.c rijndael-api.c rijndael-api-fst.c
+SRCS += camellia.c camellia-api.c
+SRCS += des_ecb.c des_enc.c des_setkey.c
+SRCS += sha1.c sha256c.c sha512c.c
+SRCS += skein.c skein_block.c
+# unroll the 256 and 512 loops, half unroll the 1024
+CFLAGS.skein_block.c += -DSKEIN_LOOP=995
+.if exists(${MACHINE_ARCH}/skein_block_asm.S)
+.PATH: ${SRCTOP}/sys/crypto/skein/${MACHINE_ARCH}
+SRCS += skein_block_asm.S
+CFLAGS += -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to replace with assembly: 256+512+1024 = 1792
+ACFLAGS += -DELF -Wa,--noexecstack
+# Fully unroll all loops in the assembly optimized version
+ACFLAGS += -DSKEIN_LOOP=0
+# 20201002 Add explict Makefile dependency for reenabled assembly optimized
+# version. SKEIN_USE_ASM determines which routines should come from the assembly
+# vs C versions, and skein_block needs to be rebuilt if it changes.
+skein_block.o: Makefile
+.endif
+SRCS += siphash.c
+SRCS += gmac.c gfmult.c
+SRCS += blake2b-ref.c
+SRCS += blake2s-ref.c
+SRCS += blake2-sw.c
+CFLAGS.blake2b-ref.c += -I${SRCTOP}/sys/crypto/blake2 -DSUFFIX=_ref
+CFLAGS.blake2s-ref.c += -I${SRCTOP}/sys/crypto/blake2 -DSUFFIX=_ref
+CFLAGS.blake2-sw.c += -I${SRCTOP}/sys/crypto/blake2
+CWARNFLAGS.blake2b-ref.c += -Wno-cast-qual -Wno-unused-function
+CWARNFLAGS.blake2s-ref.c += -Wno-cast-qual -Wno-unused-function
+SRCS += chacha.c
+SRCS += chacha-sw.c
+SRCS += chacha20_poly1305.c
+
+LIBSODIUM_INC=${LIBSODIUM}/include
+LIBSODIUM_COMPAT=${SRCTOP}/sys/crypto/libsodium
+SRCS += xform_chacha20_poly1305.c
+CFLAGS.xform_chacha20_poly1305.c+= -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT}
+SRCS += xform_poly1305.c
+CFLAGS.xform_poly1305.c += -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT}
+SRCS += ed25519_ref10.c
+CFLAGS.ed25519_ref10.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
+CWARNFLAGS.ed25519_ref10.c += -Wno-unused-function
+SRCS += core_hchacha20.c
+CFLAGS.core_hchacha20.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
+SRCS += onetimeauth_poly1305.c
+CFLAGS.onetimeauth_poly1305.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
+SRCS += poly1305_donna.c
+CFLAGS.poly1305_donna.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
+SRCS += stream_chacha20.c
+CFLAGS.stream_chacha20.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
+SRCS += chacha20_ref.c
+CFLAGS.chacha20_ref.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
+SRCS += scalarmult_curve25519.c
+CFLAGS.scalarmult_curve25519.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
+SRCS += x25519_ref10.c
+CFLAGS.x25519_ref10.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
+CWARNFLAGS.x25519_ref10.c += -Wno-unused-function
+SRCS += verify.c
+CFLAGS.verify.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
+SRCS += randombytes.c
+CFLAGS.randombytes.c += -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT}
+SRCS += utils.c
+CFLAGS.utils.c += -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT}
+
+SRCS += curve25519.c
+CFLAGS.curve25519.c += -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT}
+
+SRCS += opt_param.h cryptodev_if.h bus_if.h device_if.h
+SRCS += opt_ddb.h
+SRCS += cbc_mac.c
+SRCS += xform_cbc_mac.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cryptodev/Makefile b/sys/modules/cryptodev/Makefile
new file mode 100644
index 000000000000..a6e9ef9ae822
--- /dev/null
+++ b/sys/modules/cryptodev/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/opencrypto
+KMOD = cryptodev
+SRCS = cryptodev.c
+SRCS += bus_if.h device_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ctl/Makefile b/sys/modules/ctl/Makefile
new file mode 100644
index 000000000000..960cd60bfa9a
--- /dev/null
+++ b/sys/modules/ctl/Makefile
@@ -0,0 +1,32 @@
+
+.PATH: ${SRCTOP}/sys/cam/ctl
+
+KMOD= ctl
+
+SRCS= ctl.c
+SRCS+= ctl_backend.c
+SRCS+= ctl_backend_block.c
+SRCS+= ctl_backend_ramdisk.c
+SRCS+= ctl_cmd_table.c
+SRCS+= ctl_frontend.c
+SRCS+= ctl_frontend_cam_sim.c
+SRCS+= ctl_frontend_ioctl.c
+SRCS+= ctl_ha.c
+SRCS+= ctl_scsi_all.c
+SRCS+= ctl_tpc.c
+SRCS+= ctl_tpc_local.c
+SRCS+= ctl_error.c
+SRCS+= ctl_util.c
+SRCS+= scsi_ctl.c
+SRCS+= bus_if.h
+SRCS+= device_if.h
+SRCS+= vnode_if.h
+SRCS+= opt_cam.h
+
+#CFLAGS+=-DICL_KERNEL_PROXY
+
+MFILES= kern/bus_if.m kern/device_if.m
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cuse/Makefile b/sys/modules/cuse/Makefile
new file mode 100644
index 000000000000..f7a2c9d5c0c5
--- /dev/null
+++ b/sys/modules/cuse/Makefile
@@ -0,0 +1,31 @@
+#
+# Copyright (c) 2010 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+.PATH: ${SRCTOP}/sys/fs/cuse
+
+KMOD= cuse
+SRCS= cuse.c device_if.h bus_if.h vnode_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cxgb/Makefile b/sys/modules/cxgb/Makefile
new file mode 100644
index 000000000000..144d8f8531db
--- /dev/null
+++ b/sys/modules/cxgb/Makefile
@@ -0,0 +1,8 @@
+
+SYSDIR?=${SRCTOP}/sys
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+SUBDIR= cxgb
+SUBDIR+= cxgb_t3fw
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/cxgb/cxgb/Makefile b/sys/modules/cxgb/cxgb/Makefile
new file mode 100644
index 000000000000..08644a5d8058
--- /dev/null
+++ b/sys/modules/cxgb/cxgb/Makefile
@@ -0,0 +1,15 @@
+
+CXGB = ${SRCTOP}/sys/dev/cxgb
+.PATH: ${CXGB} ${CXGB}/common ${CXGB}/sys
+
+KMOD= if_cxgb
+SRCS= cxgb_mc5.c cxgb_vsc8211.c cxgb_ael1002.c cxgb_mv88e1xxx.c
+SRCS+= cxgb_xgmac.c cxgb_vsc7323.c cxgb_t3_hw.c cxgb_main.c cxgb_aq100x.c
+SRCS+= cxgb_sge.c cxgb_tn1010.c
+SRCS+= device_if.h bus_if.h pci_if.h
+SRCS+= opt_inet.h opt_inet6.h
+SRCS+= uipc_mvec.c
+
+CFLAGS+= -g -DDEFAULT_JUMBO -I${CXGB}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cxgb/cxgb_t3fw/Makefile b/sys/modules/cxgb/cxgb_t3fw/Makefile
new file mode 100644
index 000000000000..602fae4ff2a9
--- /dev/null
+++ b/sys/modules/cxgb/cxgb_t3fw/Makefile
@@ -0,0 +1,9 @@
+
+CXGB = ${SRCTOP}/sys/dev/cxgb
+.PATH: ${CXGB}
+
+KMOD= cxgb_t3fw
+SRCS+= cxgb_t3fw.c
+CFLAGS+= -g -I${CXGB}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cxgbe/Makefile b/sys/modules/cxgbe/Makefile
new file mode 100644
index 000000000000..f94d3ae07f66
--- /dev/null
+++ b/sys/modules/cxgbe/Makefile
@@ -0,0 +1,33 @@
+#
+#
+
+SYSDIR?=${SRCTOP}/sys
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+SUBDIR= if_cxgbe
+SUBDIR+= if_cxl
+SUBDIR+= if_cc
+SUBDIR+= if_cxgbev
+SUBDIR+= if_cxlv
+SUBDIR+= if_ccv
+SUBDIR+= t4_firmware
+SUBDIR+= t5_firmware
+SUBDIR+= t6_firmware
+SUBDIR+= ${_tom}
+SUBDIR+= ${_iw_cxgbe}
+SUBDIR+= ${_cxgbei}
+SUBDIR+= ccr
+
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "aarch64"
+_tom= tom
+_cxgbei= cxgbei
+.if ${MK_OFED} != "no" || defined(ALL_MODULES)
+_iw_cxgbe= iw_cxgbe
+.endif
+.endif
+
+.if ${MACHINE_CPUARCH} == "i386"
+_tom= tom
+.endif
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/cxgbe/ccr/Makefile b/sys/modules/cxgbe/ccr/Makefile
new file mode 100644
index 000000000000..eb2171f6ea80
--- /dev/null
+++ b/sys/modules/cxgbe/ccr/Makefile
@@ -0,0 +1,18 @@
+
+CXGBE= ${SRCTOP}/sys/dev/cxgbe
+.PATH: ${CXGBE}/crypto
+
+KMOD= ccr
+
+SRCS= t4_crypto.c
+SRCS+= bus_if.h
+SRCS+= device_if.h
+SRCS+= cryptodev_if.h
+SRCS+= pci_if.h
+
+CFLAGS+= -I${CXGBE}
+
+MFILES= kern/bus_if.m kern/device_if.m opencrypto/cryptodev_if.m \
+ dev/pci/pci_if.m
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cxgbe/cxgbei/Makefile b/sys/modules/cxgbe/cxgbei/Makefile
new file mode 100644
index 000000000000..6e87566b07e8
--- /dev/null
+++ b/sys/modules/cxgbe/cxgbei/Makefile
@@ -0,0 +1,22 @@
+
+CXGBE = ${SRCTOP}/sys/dev/cxgbe
+.PATH: ${CXGBE}/cxgbei
+
+KMOD= cxgbei
+
+SRCS= cxgbei.c
+SRCS+= icl_cxgbei.c
+SRCS+= bus_if.h
+SRCS+= device_if.h
+SRCS+= opt_inet.h
+SRCS+= opt_inet6.h
+SRCS+= opt_kern_tls.h
+SRCS+= pci_if.h
+SRCS+= opt_cam.h
+SRCS+= icl_conn_if.h
+
+CFLAGS+= -I${CXGBE}
+
+MFILES= kern/bus_if.m kern/device_if.m dev/iscsi/icl_conn_if.m dev/pci/pci_if.m
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cxgbe/if_cc/Makefile b/sys/modules/cxgbe/if_cc/Makefile
new file mode 100644
index 000000000000..76a482a98b30
--- /dev/null
+++ b/sys/modules/cxgbe/if_cc/Makefile
@@ -0,0 +1,10 @@
+#
+#
+
+CXGBE= ${SRCTOP}/sys/dev/cxgbe
+.PATH: ${CXGBE}
+
+KMOD= if_cc
+SRCS= if_cc.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cxgbe/if_ccv/Makefile b/sys/modules/cxgbe/if_ccv/Makefile
new file mode 100644
index 000000000000..fc71092dd70e
--- /dev/null
+++ b/sys/modules/cxgbe/if_ccv/Makefile
@@ -0,0 +1,10 @@
+#
+#
+
+CXGBE= ${SRCTOP}/sys/dev/cxgbe
+.PATH: ${CXGBE}
+
+KMOD= if_ccv
+SRCS= if_ccv.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cxgbe/if_cxgbe/Makefile b/sys/modules/cxgbe/if_cxgbe/Makefile
new file mode 100644
index 000000000000..981c3466c452
--- /dev/null
+++ b/sys/modules/cxgbe/if_cxgbe/Makefile
@@ -0,0 +1,46 @@
+#
+#
+
+.include <kmod.opts.mk>
+
+CXGBE= ${SRCTOP}/sys/dev/cxgbe
+.PATH: ${CXGBE} ${CXGBE}/common ${CXGBE}/crypto ${CXGBE}/cudbg
+
+KMOD= if_cxgbe
+SRCS= bus_if.h
+SRCS+= device_if.h
+SRCS+= opt_ddb.h
+SRCS+= opt_inet.h
+SRCS+= opt_inet6.h
+SRCS+= opt_kern_tls.h
+SRCS+= opt_ofed.h
+SRCS+= opt_ratelimit.h
+SRCS+= opt_rss.h
+SRCS+= pci_if.h pci_iov_if.h
+SRCS+= t4_clip.c
+SRCS+= t4_filter.c
+SRCS+= t4_hw.c
+SRCS+= t4_if.c t4_if.h
+SRCS+= t4_iov.c
+SRCS.KERN_TLS+= t6_kern_tls.c
+SRCS+= t4_keyctx.c
+SRCS+= t4_l2t.c
+SRCS+= t4_main.c
+SRCS+= t4_mp_ring.c
+SRCS+= t4_netmap.c
+SRCS+= t4_sched.c
+SRCS+= t4_sge.c
+SRCS+= t4_smt.c
+SRCS+= t4_tracer.c
+SRCS+= cudbg_common.c
+SRCS+= cudbg_flash_utils.c
+SRCS+= cudbg_lib.c
+SRCS+= cudbg_wtp.c
+SRCS+= fastlz_api.c
+SRCS+= fastlz.c
+
+CFLAGS+= -I${CXGBE}
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cxgbe/if_cxgbev/Makefile b/sys/modules/cxgbe/if_cxgbev/Makefile
new file mode 100644
index 000000000000..122733276535
--- /dev/null
+++ b/sys/modules/cxgbe/if_cxgbev/Makefile
@@ -0,0 +1,20 @@
+#
+#
+
+CXGBE= ${SRCTOP}/sys/dev/cxgbe
+.PATH: ${CXGBE} ${CXGBE}/common
+
+KMOD= if_cxgbev
+SRCS= bus_if.h
+SRCS+= device_if.h
+SRCS+= opt_inet.h
+SRCS+= opt_inet6.h
+SRCS+= opt_ofed.h
+SRCS+= opt_rss.h
+SRCS+= pci_if.h pci_iov_if.h
+SRCS+= t4_vf.c
+SRCS+= t4vf_hw.c
+
+CFLAGS+= -I${CXGBE}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cxgbe/if_cxl/Makefile b/sys/modules/cxgbe/if_cxl/Makefile
new file mode 100644
index 000000000000..f387de89eb33
--- /dev/null
+++ b/sys/modules/cxgbe/if_cxl/Makefile
@@ -0,0 +1,10 @@
+#
+#
+
+CXGBE= ${SRCTOP}/sys/dev/cxgbe
+.PATH: ${CXGBE}
+
+KMOD= if_cxl
+SRCS= if_cxl.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cxgbe/if_cxlv/Makefile b/sys/modules/cxgbe/if_cxlv/Makefile
new file mode 100644
index 000000000000..b289f673bf15
--- /dev/null
+++ b/sys/modules/cxgbe/if_cxlv/Makefile
@@ -0,0 +1,10 @@
+#
+#
+
+CXGBE= ${SRCTOP}/sys/dev/cxgbe
+.PATH: ${CXGBE}
+
+KMOD= if_cxlv
+SRCS= if_cxlv.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cxgbe/iw_cxgbe/Makefile b/sys/modules/cxgbe/iw_cxgbe/Makefile
new file mode 100644
index 000000000000..9416cdec5ce3
--- /dev/null
+++ b/sys/modules/cxgbe/iw_cxgbe/Makefile
@@ -0,0 +1,24 @@
+
+CXGBE= ${SRCTOP}/sys/dev/cxgbe
+.PATH: ${CXGBE}/iw_cxgbe
+
+KMOD= iw_cxgbe
+SRCS+= cm.c
+SRCS+= cq.c
+SRCS+= device.c
+SRCS+= ev.c
+SRCS+= id_table.c
+SRCS+= mem.c
+SRCS+= provider.c
+SRCS+= qp.c
+SRCS+= resource.c
+SRCS+= ${LINUXKPI_GENSRCS}
+SRCS+= opt_inet.h opt_inet6.h opt_kern_tls.h opt_ktr.h opt_ofed.h
+
+CFLAGS+= -I${CXGBE} -I${SRCTOP}/sys/ofed/include -DLINUX_TYPES_DEFINED
+CFLAGS+= -I${SRCTOP}/sys/ofed/include/uapi
+CFLAGS+= ${LINUXKPI_INCLUDES}
+CFLAGS+= -DCONFIG_INFINIBAND_USER_MEM
+CFLAGS+= -DINET6 -DINET
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cxgbe/t4_firmware/Makefile b/sys/modules/cxgbe/t4_firmware/Makefile
new file mode 100644
index 000000000000..fb8eeb0d6c8e
--- /dev/null
+++ b/sys/modules/cxgbe/t4_firmware/Makefile
@@ -0,0 +1,22 @@
+#
+#
+
+T4FW= ${SRCTOP}/sys/dev/cxgbe/firmware
+.PATH: ${T4FW}
+
+KMOD= t4fw_cfg
+FIRMWS= ${KMOD}.txt:${KMOD}:1.0.0.0
+
+# You can have additional configuration files in the ${T4FW} directory.
+# t4fw_cfg_<name>.txt
+CFG_FILES != cd ${T4FW} && echo ${KMOD}_*.txt
+.for F in ${CFG_FILES}
+.if exists(${F})
+FIRMWS+= ${F}:${F:C/.txt//}:1.0.0.0
+.endif
+.endfor
+
+T4FW_VER= 1.27.4.0
+FIRMWS+= t4fw-${T4FW_VER}.bin:t4fw:${T4FW_VER}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cxgbe/t5_firmware/Makefile b/sys/modules/cxgbe/t5_firmware/Makefile
new file mode 100644
index 000000000000..2876d1a6b041
--- /dev/null
+++ b/sys/modules/cxgbe/t5_firmware/Makefile
@@ -0,0 +1,22 @@
+#
+#
+
+T5FW= ${SRCTOP}/sys/dev/cxgbe/firmware
+.PATH: ${T5FW}
+
+KMOD= t5fw_cfg
+FIRMWS= ${KMOD}.txt:${KMOD}:1.0.0.0
+
+# You can have additional configuration files in the ${T5FW} directory.
+# t5fw_cfg_<name>.txt
+CFG_FILES != cd ${T5FW} && echo ${KMOD}_*.txt
+.for F in ${CFG_FILES}
+.if exists(${F})
+FIRMWS+= ${F}:${F:C/.txt//}:1.0.0.0
+.endif
+.endfor
+
+T5FW_VER= 1.27.4.0
+FIRMWS+= t5fw-${T5FW_VER}.bin:t5fw:${T5FW_VER}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cxgbe/t6_firmware/Makefile b/sys/modules/cxgbe/t6_firmware/Makefile
new file mode 100644
index 000000000000..7ac481c4bdb9
--- /dev/null
+++ b/sys/modules/cxgbe/t6_firmware/Makefile
@@ -0,0 +1,22 @@
+#
+#
+
+T6FW= ${SRCTOP}/sys/dev/cxgbe/firmware
+.PATH: ${T6FW}
+
+KMOD= t6fw_cfg
+FIRMWS= ${KMOD}.txt:${KMOD}:1.0.0.0
+
+# You can have additional configuration files in the ${T6FW} directory.
+# t6fw_cfg_<name>.txt
+CFG_FILES != cd ${T6FW} && echo ${KMOD}_*.txt
+.for F in ${CFG_FILES}
+.if exists(${F})
+FIRMWS+= ${F}:${F:C/.txt//}:1.0.0.0
+.endif
+.endfor
+
+T6FW_VER= 1.27.4.0
+FIRMWS+= t6fw-${T6FW_VER}.bin:t6fw:${T6FW_VER}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/cxgbe/tom/Makefile b/sys/modules/cxgbe/tom/Makefile
new file mode 100644
index 000000000000..301958ac5844
--- /dev/null
+++ b/sys/modules/cxgbe/tom/Makefile
@@ -0,0 +1,25 @@
+#
+#
+
+CXGBE= ${SRCTOP}/sys/dev/cxgbe
+.PATH: ${CXGBE}/tom
+
+KMOD= t4_tom
+SRCS= bus_if.h
+SRCS+= device_if.h
+SRCS+= opt_inet.h
+SRCS+= opt_inet6.h
+SRCS+= opt_kern_tls.h
+SRCS+= opt_ratelimit.h
+SRCS+= pci_if.h
+SRCS+= t4_connect.c
+SRCS+= t4_cpl_io.c
+SRCS+= t4_ddp.c
+SRCS+= t4_listen.c
+SRCS+= t4_tls.c
+SRCS+= t4_tom.c
+SRCS+= t4_tom_l2t.c
+
+CFLAGS+= -I${CXGBE}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/dc/Makefile b/sys/modules/dc/Makefile
new file mode 100644
index 000000000000..e45f76fdf917
--- /dev/null
+++ b/sys/modules/dc/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/dc
+
+KMOD= if_dc
+SRCS= if_dc.c dcphy.c pnphy.c device_if.h bus_if.h pci_if.h
+SRCS+= miibus_if.h miidevs.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/dcons/Makefile b/sys/modules/dcons/Makefile
new file mode 100644
index 000000000000..ce264992a657
--- /dev/null
+++ b/sys/modules/dcons/Makefile
@@ -0,0 +1,21 @@
+# $Id: Makefile,v 1.6 2003/10/24 15:41:26 simokawa Exp $
+
+.PATH: ${SRCTOP}/sys/dev/dcons
+
+KMOD = dcons
+SRCS = dcons.c dcons.h dcons_os.c dcons_os.h \
+ opt_dcons.h opt_kdb.h opt_ddb.h opt_gdb.h
+
+.if !defined(KERNBUILDDIR)
+opt_kdb.h:
+ echo "#define KDB 1" > $@
+
+opt_ddb.h:
+ echo "#define DDB 1" > $@
+.endif
+
+CFLAGS+= -I${SRCTOP}/sys
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/dcons_crom/Makefile b/sys/modules/dcons_crom/Makefile
new file mode 100644
index 000000000000..497d957abe62
--- /dev/null
+++ b/sys/modules/dcons_crom/Makefile
@@ -0,0 +1,13 @@
+# $Id: Makefile,v 1.6 2003/10/24 15:43:24 simokawa Exp $
+
+.PATH: ${SRCTOP}/sys/dev/dcons
+
+KMOD = dcons_crom
+SRCS = dcons_crom.c dcons.h dcons_os.h \
+ bus_if.h device_if.h
+
+#KMODDEPS = firewire dcons
+
+CFLAGS+= -I${SRCTOP}/sys
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/dpaa2/Makefile b/sys/modules/dpaa2/Makefile
new file mode 100644
index 000000000000..816d6fa5cf4a
--- /dev/null
+++ b/sys/modules/dpaa2/Makefile
@@ -0,0 +1,48 @@
+.PATH: ${SRCTOP}/sys/dev/dpaa2
+
+KMOD= dpaa2
+
+SRCS= dpaa2_mc.c
+SRCS+= dpaa2_rc.c
+SRCS+= dpaa2_io.c
+SRCS+= dpaa2_bp.c
+SRCS+= dpaa2_ni.c
+SRCS+= dpaa2_mcp.c
+SRCS+= dpaa2_swp.c
+SRCS+= dpaa2_mac.c
+SRCS+= dpaa2_con.c
+SRCS+= dpaa2_buf.c
+SRCS+= dpaa2_channel.c
+SRCS+= dpaa2_types.c
+
+SRCS+= dpaa2_cmd_if.c dpaa2_cmd_if.h
+SRCS+= dpaa2_swp_if.c dpaa2_swp_if.h
+SRCS+= dpaa2_mc_if.c dpaa2_mc_if.h
+SRCS+= memac_mdio_common.c memac_mdio_if.c memac_mdio_if.h
+
+SRCS+= dpaa2_console.c
+
+SRCS+= bus_if.h device_if.h miibus_if.h
+SRCS+= pcib_if.h pci_if.h
+
+SRCS+= opt_acpi.h
+SRCS+= opt_platform.h
+SRCS+= opt_rss.h
+
+SRCS.DEV_ACPI= dpaa2_mc_acpi.c \
+ memac_mdio_acpi.c \
+ acpi_if.h \
+ acpi_bus_if.h
+
+.if !empty(OPT_FDT)
+SRCS+= dpaa2_mc_fdt.c \
+ memac_mdio_fdt.c \
+ ofw_bus_if.h
+.endif
+
+MFILES= dev/dpaa2/dpaa2_cmd_if.m \
+ dev/dpaa2/dpaa2_swp_if.m \
+ dev/dpaa2/dpaa2_mc_if.m \
+ dev/dpaa2/memac_mdio_if.m
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/dpdk_lpm4/Makefile b/sys/modules/dpdk_lpm4/Makefile
new file mode 100644
index 000000000000..cd9f0f415ce7
--- /dev/null
+++ b/sys/modules/dpdk_lpm4/Makefile
@@ -0,0 +1,11 @@
+
+SYSDIR?=${SRCTOP}/sys
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+.PATH: ${SYSDIR}/contrib/dpdk_rte_lpm
+
+KMOD= dpdk_lpm4
+SRCS= opt_inet.h
+SRCS.INET=dpdk_lpm.c rte_lpm.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/dpdk_lpm6/Makefile b/sys/modules/dpdk_lpm6/Makefile
new file mode 100644
index 000000000000..3145c0646a90
--- /dev/null
+++ b/sys/modules/dpdk_lpm6/Makefile
@@ -0,0 +1,11 @@
+
+SYSDIR?=${SRCTOP}/sys
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+.PATH: ${SYSDIR}/contrib/dpdk_rte_lpm
+
+KMOD= dpdk_lpm6
+SRCS= opt_inet6.h
+SRCS.INET6=dpdk_lpm6.c rte_lpm6.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/dpms/Makefile b/sys/modules/dpms/Makefile
new file mode 100644
index 000000000000..55b0a1ef1c3f
--- /dev/null
+++ b/sys/modules/dpms/Makefile
@@ -0,0 +1,8 @@
+
+KMOD= dpms
+SRCS= bus_if.h device_if.h pci_if.h
+
+.PATH: ${SRCTOP}/sys/dev/dpms
+SRCS+= dpms.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/dtb/allwinner/Makefile b/sys/modules/dtb/allwinner/Makefile
new file mode 100644
index 000000000000..524636e380d6
--- /dev/null
+++ b/sys/modules/dtb/allwinner/Makefile
@@ -0,0 +1,70 @@
+# All the dts files for allwinner systems we support.
+
+.if ${MACHINE_ARCH} == "armv7"
+DTS= \
+ sun4i-a10-cubieboard.dts \
+ sun4i-a10-olinuxino-lime.dts \
+ sun6i-a31s-sinovoip-bpi-m2.dts \
+ sun5i-a13-olinuxino.dts \
+ sun5i-r8-chip.dts \
+ sun7i-a20-bananapi.dts \
+ sun7i-a20-cubieboard2.dts \
+ sun7i-a20-lamobo-r1.dts \
+ sun7i-a20-olimex-som-evb.dts \
+ sun7i-a20-pcduino3.dts \
+ sun8i-a83t-bananapi-m3.dts \
+ sun8i-h2-plus-orangepi-r1.dts \
+ sun8i-h2-plus-orangepi-zero.dts \
+ sun8i-h3-nanopi-m1.dts \
+ sun8i-h3-nanopi-m1-plus.dts \
+ sun8i-h3-nanopi-neo.dts \
+ sun8i-h3-orangepi-one.dts \
+ sun8i-h3-orangepi-pc.dts \
+ sun8i-h3-orangepi-pc-plus.dts \
+ sun8i-h3-orangepi-plus2e.dts
+
+DTSO= sun8i-a83t-sid.dtso \
+ sun8i-h3-i2c0.dtso \
+ sun8i-h3-i2c1.dtso \
+ sun8i-h3-mmc0-disable.dtso \
+ sun8i-h3-mmc1-disable.dtso \
+ sun8i-h3-mmc2-disable.dtso \
+ sun8i-h3-spi0.dtso
+
+LINKS= \
+ ${DTBDIR}/sun4i-a10-cubieboard.dtb ${DTBDIR}/cubieboard.dtb \
+ ${DTBDIR}/sun4i-a10-olinuxino-lime.dtb ${DTBDIR}/olinuxino-lime.dtb \
+ ${DTBDIR}/sun6i-a31s-sinovoip-bpi-m2.dtb ${DTBDIR}/bananapim2.dtb \
+ ${DTBDIR}/sun7i-a20-bananapi.dtb ${DTBDIR}/bananapi.dtb \
+ ${DTBDIR}/sun7i-a20-cubieboard2.dtb ${DTBDIR}/cubieboard2.dtb \
+ ${DTBDIR}/sun7i-a20-olimex-som-evb.dtb ${DTBDIR}/olimex-a20-som-evb.dtb \
+ ${DTBDIR}/sun7i-a20-pcduino3.dtb ${DTBDIR}/pcduino3.dtb \
+ ${DTBDIR}/sun8i-a83t-bananapi-m3.dtb ${DTBDIR}/sinovoip-bpi-m3.dtb \
+ ${DTBDIR}/sun8i-a83t-bananapi-m3.dtb ${DTBDIR}/sun8i-a83t-sinovoip-bpi-m3.dtb
+.elif ${MACHINE_ARCH} == "aarch64"
+DTS= \
+ allwinner/sun50i-a64-nanopi-a64.dts \
+ allwinner/sun50i-a64-olinuxino.dts \
+ allwinner/sun50i-a64-pine64-lts.dts \
+ allwinner/sun50i-a64-pine64-plus.dts \
+ allwinner/sun50i-a64-pine64.dts \
+ allwinner/sun50i-a64-pinebook.dts \
+ allwinner/sun50i-a64-sopine-baseboard.dts \
+ allwinner/sun50i-h5-orangepi-pc2.dts \
+ allwinner/sun50i-h5-nanopi-neo2.dts \
+ allwinner/sun50i-h6-pine-h64.dts \
+ allwinner/sun50i-h6-pine-h64-model-b.dts
+
+DTSO= sun50i-a64-mmc0-disable.dtso \
+ sun50i-a64-mmc1-disable.dtso \
+ sun50i-a64-mmc2-disable.dtso \
+ sun50i-a64-pwm.dtso \
+ sun50i-a64-rpwm.dtso \
+ sun50i-a64-spi0-spigen.dtso \
+ sun50i-a64-timer.dtso \
+ sun50i-h5-opp.dtso \
+ sun50i-h5-nanopi-neo2-opp.dtso
+
+.endif
+
+.include <bsd.dtb.mk>
diff --git a/sys/modules/dtb/am335x/Makefile b/sys/modules/dtb/am335x/Makefile
new file mode 100644
index 000000000000..9c8f007cf4e2
--- /dev/null
+++ b/sys/modules/dtb/am335x/Makefile
@@ -0,0 +1,12 @@
+# All the dts files for am335x systems we support.
+DTS= \
+ am335x-bone.dts \
+ am335x-boneblack.dts \
+ am335x-boneblack-wireless.dts \
+ am335x-bonegreen.dts \
+ am335x-bonegreen-wireless.dts \
+ am335x-boneblue.dts \
+ am335x-pocketbeagle.dts \
+ ufw.dts
+
+.include <bsd.dtb.mk>
diff --git a/sys/modules/dtb/freescale/Makefile b/sys/modules/dtb/freescale/Makefile
new file mode 100644
index 000000000000..871c15330fe3
--- /dev/null
+++ b/sys/modules/dtb/freescale/Makefile
@@ -0,0 +1,8 @@
+# All the dts files for Freescale (now NXP) systems we support.
+DTS= freescale/fsl-ls1028a-rdb.dts \
+ freescale/fsl-lx2160a-clearfog-cx.dts \
+ freescale/fsl-lx2160a-honeycomb.dts \
+ freescale/fsl-lx2160a-qds.dts \
+ freescale/fsl-lx2160a-rdb.dts
+
+.include <bsd.dtb.mk>
diff --git a/sys/modules/dtb/imx5/Makefile b/sys/modules/dtb/imx5/Makefile
new file mode 100644
index 000000000000..ff55e4fc85a1
--- /dev/null
+++ b/sys/modules/dtb/imx5/Makefile
@@ -0,0 +1,5 @@
+# All the dts files for imx5 systems we support.
+DTS= \
+ imx53-qsb.dts
+
+.include <bsd.dtb.mk>
diff --git a/sys/modules/dtb/imx6/Makefile b/sys/modules/dtb/imx6/Makefile
new file mode 100644
index 000000000000..46daa29188bc
--- /dev/null
+++ b/sys/modules/dtb/imx6/Makefile
@@ -0,0 +1,18 @@
+# All the dts files for imx6 systems we support.
+DTS= \
+ imx6dl-cubox-i.dts \
+ imx6q-cubox-i.dts \
+ imx6dl-hummingboard.dts \
+ imx6q-hummingboard.dts \
+ imx6dl-nitrogen6x.dts \
+ imx6q-nitrogen6_max.dts \
+ imx6q-nitrogen6x.dts \
+ imx6qp-nitrogen6_max.dts \
+ imx6sx-nitrogen6sx.dts \
+ imx6dl-riotboard.dts \
+ imx6dl-wandboard.dts \
+ imx6dl-wandboard-revb1.dts \
+ imx6q-wandboard.dts \
+ imx6q-wandboard-revb1.dts \
+
+.include <bsd.dtb.mk>
diff --git a/sys/modules/dtb/imx8/Makefile b/sys/modules/dtb/imx8/Makefile
new file mode 100644
index 000000000000..1622cf68b6e0
--- /dev/null
+++ b/sys/modules/dtb/imx8/Makefile
@@ -0,0 +1,6 @@
+# All the dts files for imx8 systems we support.
+DTS= \
+ freescale/imx8mq-evk.dts \
+ freescale/imx8mq-nitrogen.dts
+
+.include <bsd.dtb.mk>
diff --git a/sys/modules/dtb/mv/Makefile b/sys/modules/dtb/mv/Makefile
new file mode 100644
index 000000000000..3e6da07796a4
--- /dev/null
+++ b/sys/modules/dtb/mv/Makefile
@@ -0,0 +1,16 @@
+# All the dts files for Marvell systems we support.
+
+.if ${MACHINE_ARCH} == "armv7"
+DTS= \
+ armada-388-clearfog.dts \
+ armada-388-gp.dts
+.elif ${MACHINE_ARCH} == "aarch64"
+DTS= \
+ marvell/armada-3720-espressobin.dts \
+ marvell/armada-8040-clearfog-gt-8k.dts \
+ marvell/armada-8040-db \
+ marvell/armada-8040-mcbin.dts \
+ marvell/armada-8040-mcbin-singleshot.dts
+.endif
+
+.include <bsd.dtb.mk>
diff --git a/sys/modules/dtb/nvidia/Makefile b/sys/modules/dtb/nvidia/Makefile
new file mode 100644
index 000000000000..1bda4d1085af
--- /dev/null
+++ b/sys/modules/dtb/nvidia/Makefile
@@ -0,0 +1,9 @@
+# All the dts files for Nvidia ARM systems we support.
+.if ${MACHINE_ARCH} == "armv7"
+DTS= tegra124-jetson-tk1-fbsd.dts
+DTS+= tegra124-jetson-tk1.dts
+.elif ${MACHINE_ARCH} == "aarch64"
+DTS= nvidia/tegra210-p2371-2180.dts
+DTS+= nvidia/tegra210-p3450-0000.dts
+.endif
+.include <bsd.dtb.mk>
diff --git a/sys/modules/dtb/omap4/Makefile b/sys/modules/dtb/omap4/Makefile
new file mode 100644
index 000000000000..cd545cdfd0b1
--- /dev/null
+++ b/sys/modules/dtb/omap4/Makefile
@@ -0,0 +1,7 @@
+# All the dts files for omap4 systems we support.
+DTS= \
+ omap4-duovero-parlor.dts \
+ omap4-panda.dts \
+ omap4-panda-es.dts
+
+.include <bsd.dtb.mk>
diff --git a/sys/modules/dtb/rockchip/Makefile b/sys/modules/dtb/rockchip/Makefile
new file mode 100644
index 000000000000..f8796ebb17af
--- /dev/null
+++ b/sys/modules/dtb/rockchip/Makefile
@@ -0,0 +1,31 @@
+# All the dts files for rockchip systems we support.
+
+.if ${MACHINE_ARCH} == "armv7"
+DTS= \
+ rk3288-tinker.dts \
+ rk3288-tinker-s.dts
+.elif ${MACHINE_ARCH} == "aarch64"
+DTS= \
+ rockchip/rk3399-khadas-edge-captain.dts \
+ rockchip/rk3399-khadas-edge.dts \
+ rockchip/rk3399-khadas-edge-v.dts \
+ rockchip/rk3399-nanopc-t4.dts \
+ rockchip/rk3328-nanopi-r2s.dts \
+ rockchip/rk3399-nanopi-r4s.dts \
+ rockchip/rk3399-rock-pi-4.dts \
+ rockchip/rk3328-rock-pi-e.dts \
+ rockchip/rk3328-rock64.dts \
+ rockchip/rk3399-firefly.dts \
+ rockchip/rk3399-rockpro64.dts \
+ rockchip/rk3566-quartz64-a.dts \
+ rockchip/rk3568-nanopi-r5s.dts
+
+DTSO= rk3328-analog-sound.dtso \
+ rk3328-i2c0.dtso \
+ rk3328-uart1.dtso \
+ rk3399-mmc0-disable.dtso \
+ rk3399-mmc1-disable.dtso \
+ rk3399-sdhci-disable.dtso
+.endif
+
+.include <bsd.dtb.mk>
diff --git a/sys/modules/dtb/rpi/Makefile b/sys/modules/dtb/rpi/Makefile
new file mode 100644
index 000000000000..57ba9ec98d09
--- /dev/null
+++ b/sys/modules/dtb/rpi/Makefile
@@ -0,0 +1,12 @@
+# DTS files for the 32-bit and 64-bit arm-based Raspberry Pi family of devices
+.if ${MACHINE_CPUARCH} == "arm"
+DTSO= \
+ spigen-rpi-b.dtso \
+ spigen-rpi2.dtso
+.elif ${MACHINE_CPUARCH} == "aarch64"
+DTSO= \
+ spigen-rpi3.dtso \
+ spigen-rpi4.dtso
+.endif
+
+.include <bsd.dtb.mk>
diff --git a/sys/modules/dtb/sifive/Makefile b/sys/modules/dtb/sifive/Makefile
new file mode 100644
index 000000000000..818ffa472ec0
--- /dev/null
+++ b/sys/modules/dtb/sifive/Makefile
@@ -0,0 +1,5 @@
+
+DTS= \
+ sifive/hifive-unleashed-a00.dts
+
+.include <bsd.dtb.mk>
diff --git a/sys/modules/dtb/zynq/Makefile b/sys/modules/dtb/zynq/Makefile
new file mode 100644
index 000000000000..d10c42afe24c
--- /dev/null
+++ b/sys/modules/dtb/zynq/Makefile
@@ -0,0 +1,6 @@
+# All the dts files for Zynq systems we support.
+DTS= \
+ zedboard.dts \
+ zybo.dts
+
+.include <bsd.dtb.mk>
diff --git a/sys/modules/dtrace/Makefile b/sys/modules/dtrace/Makefile
new file mode 100644
index 000000000000..73c71c5bd1fb
--- /dev/null
+++ b/sys/modules/dtrace/Makefile
@@ -0,0 +1,35 @@
+
+.include "Makefile.inc"
+
+SUBDIR= dtaudit \
+ dtmalloc \
+ dtnfscl \
+ dtrace \
+ dtraceall \
+ dtrace_test \
+ fbt \
+ profile \
+ prototype \
+ sdt \
+ systrace
+
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
+SUBDIR+= fasttrap systrace_linux
+.endif
+.if ${MACHINE_CPUARCH} == "amd64"
+SUBDIR+= systrace_linux32
+SUBDIR+= kinst
+.endif
+.if ${MACHINE_CPUARCH} == "riscv" || ${MACHINE_CPUARCH} == "aarch64"
+SUBDIR+= kinst
+.endif
+.if ${MACHINE_CPUARCH} == "powerpc"
+SUBDIR+= fasttrap
+.endif
+.if ${MACHINE_CPUARCH} == "amd64" || \
+ ${MACHINE_CPUARCH} == "aarch64" || \
+ ${MACHINE_ARCH} == "powerpc64"
+SUBDIR+= systrace_freebsd32
+.endif
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/dtrace/Makefile.inc b/sys/modules/dtrace/Makefile.inc
new file mode 100644
index 000000000000..fd3c99a9407a
--- /dev/null
+++ b/sys/modules/dtrace/Makefile.inc
@@ -0,0 +1,24 @@
+
+IGNORE_PRAGMA= 1
+
+load :
+ -kldload dtrace
+.if ${MACHINE_CPUARCH} == "i386"
+ -kldload sdt
+ -kldload fbt
+ -kldload prototype
+.endif
+ -kldload profile
+ -kldload systrace
+ kldstat
+
+unload :
+ -kldunload systrace
+ -kldunload profile
+.if ${MACHINE_CPUARCH} == "i386"
+ -kldunload prototype
+ -kldunload fbt
+ -kldunload sdt
+.endif
+ -kldunload dtrace
+ kldstat
diff --git a/sys/modules/dtrace/dtaudit/Makefile b/sys/modules/dtrace/dtaudit/Makefile
new file mode 100644
index 000000000000..22e85a70afac
--- /dev/null
+++ b/sys/modules/dtrace/dtaudit/Makefile
@@ -0,0 +1,14 @@
+
+SYSDIR?= ${SRCTOP}/sys
+
+.PATH: ${SYSDIR}/security/audit
+
+KMOD= dtaudit
+SRCS= audit_dtrace.c \
+ vnode_if.h
+
+CFLAGS+= ${OPENZFS_CFLAGS}
+
+.include <bsd.kmod.mk>
+
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
diff --git a/sys/modules/dtrace/dtmalloc/Makefile b/sys/modules/dtrace/dtmalloc/Makefile
new file mode 100644
index 000000000000..5c1570b69e86
--- /dev/null
+++ b/sys/modules/dtrace/dtmalloc/Makefile
@@ -0,0 +1,14 @@
+
+SYSDIR?= ${SRCTOP}/sys
+
+.PATH: ${SYSDIR}/cddl/dev/dtmalloc
+
+KMOD= dtmalloc
+SRCS= dtmalloc.c
+SRCS+= vnode_if.h
+
+CFLAGS+= ${OPENZFS_CFLAGS}
+
+.include <bsd.kmod.mk>
+
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
diff --git a/sys/modules/dtrace/dtnfscl/Makefile b/sys/modules/dtrace/dtnfscl/Makefile
new file mode 100644
index 000000000000..24e58828a8b7
--- /dev/null
+++ b/sys/modules/dtrace/dtnfscl/Makefile
@@ -0,0 +1,14 @@
+
+SYSDIR?= ${SRCTOP}/sys
+
+.PATH: ${SYSDIR}/fs/nfsclient
+
+KMOD= dtnfscl
+SRCS= nfs_clkdtrace.c \
+ vnode_if.h
+
+CFLAGS+= ${OPENZFS_CFLAGS}
+
+.include <bsd.kmod.mk>
+
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
diff --git a/sys/modules/dtrace/dtrace/Makefile b/sys/modules/dtrace/dtrace/Makefile
new file mode 100644
index 000000000000..53e5f1792ad5
--- /dev/null
+++ b/sys/modules/dtrace/dtrace/Makefile
@@ -0,0 +1,65 @@
+
+SYSDIR?= ${SRCTOP}/sys
+
+ARCHDIR= ${MACHINE_CPUARCH}
+
+.PATH: ${SYSDIR}/cddl/contrib/opensolaris/uts/common/dtrace
+.PATH: ${SYSDIR}/cddl/compat/opensolaris/kern
+.PATH: ${SYSDIR}/cddl/kern
+.PATH: ${SYSDIR}/cddl/dev/dtrace
+.PATH: ${SYSDIR}/cddl/dev/dtrace/${ARCHDIR}
+
+KMOD= dtrace
+SRCS= dtrace.c \
+ dtrace_xoroshiro128_plus.c \
+ dtrace_asm.S \
+ dtrace_subr.c
+
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
+.PATH: ${SYSDIR}/cddl/dev/dtrace/x86
+SRCS+= dis_tables.c \
+ instr_size.c
+CFLAGS+= -I${SYSDIR}/cddl/contrib/opensolaris/uts/intel \
+ -I${SYSDIR}/cddl/dev/dtrace/x86
+.endif
+
+.if ${MACHINE_CPUARCH} == "riscv" || ${MACHINE_CPUARCH} == "aarch64"
+SRCS+= instr_size.c
+.endif
+
+CFLAGS+= ${OPENZFS_CFLAGS}
+
+SRCS+= bus_if.h device_if.h vnode_if.h
+
+# Needed for dtrace_asm.S
+DPSRCS+= assym.inc
+
+# These are needed for assym.inc
+SRCS+= opt_kstack_pages.h opt_nfs.h opt_hwpmc_hooks.h
+
+#This is needed for dtrace.c
+SRCS += opensolaris_taskq.c
+
+.if ${MACHINE_CPUARCH} == "i386"
+SRCS+= opt_apic.h
+.endif
+
+CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \
+ -I${SYSDIR}/cddl/dev/dtrace \
+ -I${SYSDIR}/cddl/dev/dtrace/${ARCHDIR} \
+ -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
+ -I${SYSDIR}/cddl/contrib/opensolaris/uts/common/dtrace \
+ -I${SYSDIR}/cddl/contrib/opensolaris/common/util \
+ -I${SYSDIR} -DDIS_MEM
+
+EXPORT_SYMS= YES
+
+dtrace_asm.o: assym.inc
+
+.include <bsd.kmod.mk>
+
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
+CFLAGS.dtrace_asm.S+= -D_SYS_ERRNO_H_ -D_SYS_PARAM_H_ -DLOCORE
+CWARNFLAGS+= -Wno-parentheses
+CWARNFLAGS+= -Wno-cast-qual
+CWARNFLAGS+= -Wno-unused
diff --git a/sys/modules/dtrace/dtrace_test/Makefile b/sys/modules/dtrace/dtrace_test/Makefile
new file mode 100644
index 000000000000..70f12982162c
--- /dev/null
+++ b/sys/modules/dtrace/dtrace_test/Makefile
@@ -0,0 +1,15 @@
+
+SYSDIR?= ${SRCTOP}/sys
+
+.PATH: ${SYSDIR}/cddl/dev/dtrace
+
+KMOD= dtrace_test
+SRCS= dtrace_test.c
+
+SRCS+= vnode_if.h
+
+CFLAGS+= -I${SYSDIR}
+
+.include <bsd.kmod.mk>
+
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
diff --git a/sys/modules/dtrace/dtraceall/Makefile b/sys/modules/dtrace/dtraceall/Makefile
new file mode 100644
index 000000000000..ecbb0f4a21bb
--- /dev/null
+++ b/sys/modules/dtrace/dtraceall/Makefile
@@ -0,0 +1,11 @@
+
+SYSDIR?= ${SRCTOP}/sys
+
+KMOD= dtraceall
+SRCS= dtraceall.c opt_nfs.h
+
+CFLAGS+= -I${SYSDIR}
+
+.include <bsd.kmod.mk>
+
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
diff --git a/sys/modules/dtrace/dtraceall/dtraceall.c b/sys/modules/dtrace/dtraceall/dtraceall.c
new file mode 100644
index 000000000000..7d41901f28d5
--- /dev/null
+++ b/sys/modules/dtrace/dtraceall/dtraceall.c
@@ -0,0 +1,86 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2008 John Birrell <jb@freebsd.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/conf.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+#include <sys/errno.h>
+#include "opt_nfs.h"
+
+static int
+dtraceall_modevent(module_t mod __unused, int type, void *data __unused)
+{
+ int error = 0;
+
+ switch (type) {
+ case MOD_LOAD:
+ break;
+
+ case MOD_UNLOAD:
+ break;
+
+ case MOD_SHUTDOWN:
+ break;
+
+ default:
+ error = EOPNOTSUPP;
+ break;
+
+ }
+
+ return (error);
+}
+
+DEV_MODULE(dtraceall, dtraceall_modevent, NULL);
+MODULE_VERSION(dtraceall, 1);
+
+/* All the DTrace modules should be dependencies here: */
+MODULE_DEPEND(dtraceall, opensolaris, 1, 1, 1);
+MODULE_DEPEND(dtraceall, dtrace, 1, 1, 1);
+MODULE_DEPEND(dtraceall, dtmalloc, 1, 1, 1);
+#if defined(NFSCL)
+MODULE_DEPEND(dtraceall, dtnfscl, 1, 1, 1);
+#endif
+#if defined(__aarch64__) || defined(__amd64__) || defined(__arm__) || \
+ defined(__i386__) || defined(__powerpc__) || defined(__riscv)
+MODULE_DEPEND(dtraceall, fbt, 1, 1, 1);
+#endif
+#if defined(__amd64__) || defined(__i386__) || defined(__powerpc__)
+MODULE_DEPEND(dtraceall, fasttrap, 1, 1, 1);
+#if defined(__amd64__)
+MODULE_DEPEND(dtraceall, kinst, 1, 1, 1);
+#endif
+#endif
+MODULE_DEPEND(dtraceall, sdt, 1, 1, 1);
+MODULE_DEPEND(dtraceall, systrace, 1, 1, 1);
+#if defined(COMPAT_FREEBSD32)
+MODULE_DEPEND(dtraceall, systrace_freebsd32, 1, 1, 1);
+#endif
+MODULE_DEPEND(dtraceall, profile, 1, 1, 1);
diff --git a/sys/modules/dtrace/fasttrap/Makefile b/sys/modules/dtrace/fasttrap/Makefile
new file mode 100644
index 000000000000..271ac07cfbbb
--- /dev/null
+++ b/sys/modules/dtrace/fasttrap/Makefile
@@ -0,0 +1,29 @@
+
+SYSDIR?= ${SRCTOP}/sys
+
+.PATH: ${SYSDIR}/cddl/contrib/opensolaris/uts/common/dtrace
+
+KMOD= fasttrap
+SRCS= fasttrap.c fasttrap_isa.c
+SRCS+= vnode_if.h opt_global.h
+
+CFLAGS+= -include ${.OBJDIR}/opt_global.h
+CFLAGS+= ${OPENZFS_CFLAGS}
+
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
+CFLAGS+= -I${SYSDIR}/cddl/contrib/opensolaris/uts/intel
+.PATH: ${SYSDIR}/cddl/contrib/opensolaris/uts/intel/dtrace
+.elif ${MACHINE_CPUARCH} == "powerpc"
+CFLAGS+= -I${SYSDIR}/cddl/contrib/opensolaris/uts/powerpc
+.PATH: ${SYSDIR}/cddl/contrib/opensolaris/uts/powerpc/dtrace
+.endif
+
+.PATH: ${SYSDIR}/contrib/openzfs/module/unicode
+SRCS+= u8_textprep.c
+
+.include <bsd.kmod.mk>
+
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
+
+CWARNFLAGS+= -Wno-cast-qual
+CWARNFLAGS+= -Wno-unused
diff --git a/sys/modules/dtrace/fbt/Makefile b/sys/modules/dtrace/fbt/Makefile
new file mode 100644
index 000000000000..370ee316098d
--- /dev/null
+++ b/sys/modules/dtrace/fbt/Makefile
@@ -0,0 +1,24 @@
+
+SYSDIR?= ${SRCTOP}/sys
+
+.PATH: ${SYSDIR}/cddl/dev/fbt
+
+KMOD= fbt
+SRCS= fbt.c fbt_isa.c
+SRCS+= vnode_if.h
+
+
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
+CFLAGS+= -I${SYSDIR}/cddl/dev/fbt/x86
+.PATH: ${SYSDIR}/cddl/dev/fbt/x86
+.else
+CFLAGS+= -I${SYSDIR}/cddl/dev/fbt/${MACHINE_CPUARCH}
+.PATH: ${SYSDIR}/cddl/dev/fbt/${MACHINE_CPUARCH}
+.endif
+
+CFLAGS+= ${OPENZFS_CFLAGS}
+CFLAGS+= -I${SYSDIR}/cddl/dev/fbt
+
+.include <bsd.kmod.mk>
+
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
diff --git a/sys/modules/dtrace/kinst/Makefile b/sys/modules/dtrace/kinst/Makefile
new file mode 100644
index 000000000000..1cbfe5e72ff1
--- /dev/null
+++ b/sys/modules/dtrace/kinst/Makefile
@@ -0,0 +1,23 @@
+SYSDIR?= ${SRCTOP}/sys
+
+KMOD= kinst
+SRCS= kinst.c kinst_isa.c trampoline.c
+
+CFLAGS+= ${OPENZFS_CFLAGS} \
+ -I${SYSDIR}/cddl/dev/kinst \
+ -I${SYSDIR}/cddl/dev/kinst/${MACHINE_CPUARCH}
+
+.PATH: ${SYSDIR}/cddl/dev/kinst \
+ ${SYSDIR}/cddl/dev/kinst/${MACHINE_CPUARCH}
+
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
+CFLAGS+= -I${SYSDIR}/cddl/dev/dtrace/x86
+.PATH: ${SYSDIR}/cddl/dev/dtrace/x86
+.else
+CFLAGS+= -I${SYSDIR}/cddl/dev/dtrace/${MACHINE_CPUARCH}
+.PATH: ${SYSDIR}/cddl/dev/dtrace/${MACHINE_CPUARCH}
+.endif
+
+.include <bsd.kmod.mk>
+
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
diff --git a/sys/modules/dtrace/profile/Makefile b/sys/modules/dtrace/profile/Makefile
new file mode 100644
index 000000000000..b193ee0e3e43
--- /dev/null
+++ b/sys/modules/dtrace/profile/Makefile
@@ -0,0 +1,14 @@
+
+SYSDIR?= ${SRCTOP}/sys
+
+.PATH: ${SYSDIR}/cddl/dev/profile
+
+KMOD= profile
+SRCS= profile.c
+SRCS+= vnode_if.h
+
+CFLAGS+= ${OPENZFS_CFLAGS}
+
+.include <bsd.kmod.mk>
+
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
diff --git a/sys/modules/dtrace/prototype/Makefile b/sys/modules/dtrace/prototype/Makefile
new file mode 100644
index 000000000000..b622d628eacd
--- /dev/null
+++ b/sys/modules/dtrace/prototype/Makefile
@@ -0,0 +1,14 @@
+
+SYSDIR?= ${SRCTOP}/sys
+
+.PATH: ${SYSDIR}/cddl/dev
+
+KMOD= prototype
+SRCS= prototype.c
+SRCS+= vnode_if.h
+
+CFLAGS+= ${OPENZFS_CFLAGS}
+
+.include <bsd.kmod.mk>
+
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
diff --git a/sys/modules/dtrace/sdt/Makefile b/sys/modules/dtrace/sdt/Makefile
new file mode 100644
index 000000000000..ee6627c5e72e
--- /dev/null
+++ b/sys/modules/dtrace/sdt/Makefile
@@ -0,0 +1,14 @@
+
+SYSDIR?= ${SRCTOP}/sys
+
+.PATH: ${SYSDIR}/cddl/dev/sdt
+
+KMOD= sdt
+SRCS= sdt.c
+SRCS+= vnode_if.h
+
+CFLAGS+= ${OPENZFS_CFLAGS}
+
+.include <bsd.kmod.mk>
+
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
diff --git a/sys/modules/dtrace/systrace/Makefile b/sys/modules/dtrace/systrace/Makefile
new file mode 100644
index 000000000000..ab16dd031244
--- /dev/null
+++ b/sys/modules/dtrace/systrace/Makefile
@@ -0,0 +1,14 @@
+
+SYSDIR?= ${SRCTOP}/sys
+
+.PATH: ${SYSDIR}/cddl/dev/systrace
+
+KMOD= systrace
+SRCS= systrace.c
+SRCS+= vnode_if.h
+
+CFLAGS+= ${OPENZFS_CFLAGS}
+
+.include <bsd.kmod.mk>
+
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
diff --git a/sys/modules/dtrace/systrace_freebsd32/Makefile b/sys/modules/dtrace/systrace_freebsd32/Makefile
new file mode 100644
index 000000000000..c9376a4b206d
--- /dev/null
+++ b/sys/modules/dtrace/systrace_freebsd32/Makefile
@@ -0,0 +1,15 @@
+
+SYSDIR?= ${SRCTOP}/sys
+
+.PATH: ${SYSDIR}/cddl/dev/systrace
+
+KMOD= systrace_freebsd32
+SRCS= systrace.c
+SRCS+= vnode_if.h
+
+CFLAGS+= ${OPENZFS_CFLAGS}
+CFLAGS+= -DFREEBSD32_SYSTRACE
+
+.include <bsd.kmod.mk>
+
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
diff --git a/sys/modules/dtrace/systrace_linux/Makefile b/sys/modules/dtrace/systrace_linux/Makefile
new file mode 100644
index 000000000000..acdc7c0c967b
--- /dev/null
+++ b/sys/modules/dtrace/systrace_linux/Makefile
@@ -0,0 +1,16 @@
+
+SYSDIR?= ${SRCTOP}/sys
+
+.PATH: ${SYSDIR}/cddl/dev/systrace
+
+KMOD= systrace_linux
+
+SRCS= systrace.c
+SRCS+= vnode_if.h
+
+CFLAGS+= ${OPENZFS_CFLAGS}
+CFLAGS+= -DLINUX_SYSTRACE
+
+.include <bsd.kmod.mk>
+
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
diff --git a/sys/modules/dtrace/systrace_linux32/Makefile b/sys/modules/dtrace/systrace_linux32/Makefile
new file mode 100644
index 000000000000..2970e42a58f5
--- /dev/null
+++ b/sys/modules/dtrace/systrace_linux32/Makefile
@@ -0,0 +1,16 @@
+
+SYSDIR?= ${SRCTOP}/sys
+
+.PATH: ${SYSDIR}/cddl/dev/systrace
+
+KMOD= systrace_linux32
+
+SRCS= systrace.c
+SRCS+= vnode_if.h
+
+CFLAGS+= ${OPENZFS_CFLAGS}
+CFLAGS+= -DLINUX32_SYSTRACE
+
+.include <bsd.kmod.mk>
+
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
diff --git a/sys/modules/dummynet/Makefile b/sys/modules/dummynet/Makefile
new file mode 100644
index 000000000000..6c7599eae45f
--- /dev/null
+++ b/sys/modules/dummynet/Makefile
@@ -0,0 +1,11 @@
+
+.PATH: ${SRCTOP}/sys/netpfil/ipfw
+KMOD= dummynet
+SRCS= ip_dummynet.c
+SRCS+= ip_dn_glue.c ip_dn_io.c
+SRCS+= dn_aqm_codel.c dn_aqm_pie.c
+SRCS+= dn_heap.c dn_sched_fifo.c dn_sched_qfq.c dn_sched_rr.c dn_sched_wf2q.c
+SRCS+= dn_sched_prio.c dn_sched_fq_codel.c dn_sched_fq_pie.c
+SRCS+= opt_inet6.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/dwwdt/Makefile b/sys/modules/dwwdt/Makefile
new file mode 100644
index 000000000000..e486705998d5
--- /dev/null
+++ b/sys/modules/dwwdt/Makefile
@@ -0,0 +1,7 @@
+.PATH: ${SRCTOP}/sys/dev/dwwdt
+
+KMOD = dwwdt
+SRCS = dwwdt.c \
+ device_if.h bus_if.h ofw_bus_if.h
+
+.include<bsd.kmod.mk>
diff --git a/sys/modules/e6000sw/Makefile b/sys/modules/e6000sw/Makefile
new file mode 100644
index 000000000000..a4315ca16ddc
--- /dev/null
+++ b/sys/modules/e6000sw/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/etherswitch/e6000sw
+
+KMOD= e6000sw
+SRCS= e6000sw.c
+
+SRCS+= bus_if.h etherswitch_if.h mdio_if.h miibus_if.h ofw_bus_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/efirt/Makefile b/sys/modules/efirt/Makefile
new file mode 100644
index 000000000000..2993f5de0ef6
--- /dev/null
+++ b/sys/modules/efirt/Makefile
@@ -0,0 +1,21 @@
+
+.PATH: ${SRCTOP}/sys/${MACHINE}/${MACHINE}
+.PATH: ${SRCTOP}/sys/dev/efidev
+
+KMOD= efirt
+SRCS= efirt.c efirt_machdep.c efidev.c
+SRCS+= efirtc.c
+SRCS+= device_if.h bus_if.h clock_if.h
+
+.if ${MACHINE_CPUARCH} == "amd64"
+SRCS+= opt_hwpmc_hooks.h opt_kstack_pages.h
+SRCS+= efirt_support.S
+DPSRCS+= assym.inc
+efirt_support.o: efirt_support.S assym.inc
+ ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \
+ ${.IMPSRC} -o ${.TARGET}
+.endif
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/em/Makefile b/sys/modules/em/Makefile
new file mode 100644
index 000000000000..bcf8d262dc45
--- /dev/null
+++ b/sys/modules/em/Makefile
@@ -0,0 +1,25 @@
+
+.PATH: ${SRCTOP}/sys/dev/e1000
+KMOD = if_em
+SRCS = device_if.h bus_if.h pci_if.h opt_ddb.h opt_inet.h \
+ opt_inet6.h opt_rss.h ifdi_if.h
+SRCS += $(CORE_SRC) $(LEGACY_SRC)
+SRCS += $(COMMON_SHARED) $(LEGACY_SHARED) $(PCIE_SHARED)
+CORE_SRC = if_em.c em_txrx.c e1000_osdep.c
+CORE_SRC += igb_txrx.c
+COMMON_SHARED = e1000_api.c e1000_base.c e1000_phy.c e1000_nvm.c e1000_mac.c \
+ e1000_manage.c e1000_vf.c e1000_mbx.c e1000_i210.c
+PCIE_SHARED = e1000_80003es2lan.c e1000_ich8lan.c e1000_82571.c e1000_82575.c
+# This is the Legacy, pre-PCIE source, it can be
+# undefined when using modular driver if not needed
+LEGACY_SHARED = e1000_82540.c e1000_82542.c e1000_82541.c e1000_82543.c
+
+
+CFLAGS += -I${SRCTOP}/sys/dev/e1000
+
+# DEVICE_POLLING for a non-interrupt-driven method
+#CFLAGS += -DDEVICE_POLLING
+
+SYMLINKS= ${KMOD}.ko ${KMODDIR}/if_igb.ko
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ena/Makefile b/sys/modules/ena/Makefile
new file mode 100644
index 000000000000..95326888cc6c
--- /dev/null
+++ b/sys/modules/ena/Makefile
@@ -0,0 +1,42 @@
+#
+# SPDX-License-Identifier: BSD-2-Clause
+#
+# Copyright (c) 2015-2020 Amazon.com, Inc. or its affiliates.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#
+
+.PATH: ${SRCTOP}/sys/dev/ena \
+ ${SRCTOP}/sys/contrib/ena-com
+
+KMOD = if_ena
+SRCS = ena_com.c ena_eth_com.c
+SRCS += ena.c ena_sysctl.c ena_datapath.c ena_netmap.c ena_rss.c
+SRCS += device_if.h bus_if.h pci_if.h
+SRCS += opt_rss.h
+CFLAGS += -I${SRCTOP}/sys/contrib
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/enetc/Makefile b/sys/modules/enetc/Makefile
new file mode 100644
index 000000000000..b54c5171616b
--- /dev/null
+++ b/sys/modules/enetc/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/enetc
+
+KMOD = if_enetc
+SRCS = if_enetc.c enetc_mdio.c
+SRCS += bus_if.h device_if.h ifdi_if.h miibus_if.h ofw_bus_if.h pci_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/enic/Makefile b/sys/modules/enic/Makefile
new file mode 100644
index 000000000000..420942c44ead
--- /dev/null
+++ b/sys/modules/enic/Makefile
@@ -0,0 +1,10 @@
+.PATH: ${SRCTOP}/sys/dev/enic
+
+KMOD = if_enic
+SRCS = device_if.h bus_if.h pci_if.h pci_iov_if.h ifdi_if.h
+SRCS += opt_inet.h opt_inet6.h opt_rss.h
+
+SRCS += if_enic.c enic_txrx.c enic_res.c
+SRCS += vnic_cq.c vnic_dev.c vnic_intr.c vnic_rq.c vnic_wq.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/epoch_test/Makefile b/sys/modules/epoch_test/Makefile
new file mode 100644
index 000000000000..64d16faf7893
--- /dev/null
+++ b/sys/modules/epoch_test/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/tests/epoch
+KMOD= epoch_test
+SRCS= epoch_test.c \
+ bus_if.h \
+ device_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/et/Makefile b/sys/modules/et/Makefile
new file mode 100644
index 000000000000..6de777450535
--- /dev/null
+++ b/sys/modules/et/Makefile
@@ -0,0 +1,9 @@
+# $DragonFly: src/sys/dev/netif/et/Makefile,v 1.1 2007/10/12 14:12:42 sephe Exp $
+
+.PATH: ${SRCTOP}/sys/dev/et
+
+KMOD= if_et
+SRCS= if_et.c
+SRCS+= bus_if.h pci_if.h device_if.h miibus_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/evdev/Makefile b/sys/modules/evdev/Makefile
new file mode 100644
index 000000000000..49183bd3a8de
--- /dev/null
+++ b/sys/modules/evdev/Makefile
@@ -0,0 +1,10 @@
+
+.PATH: ${SRCTOP}/sys/dev/evdev
+
+KMOD= evdev
+SRCS= cdev.c evdev.c evdev_mt.c evdev_utils.c
+SRCS+= opt_evdev.h bus_if.h device_if.h
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/exca/Makefile b/sys/modules/exca/Makefile
new file mode 100644
index 000000000000..210a6eed5454
--- /dev/null
+++ b/sys/modules/exca/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/exca
+
+KMOD= exca
+SRCS= exca.c device_if.h bus_if.h power_if.h card_if.h
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ext2fs/Makefile b/sys/modules/ext2fs/Makefile
new file mode 100644
index 000000000000..0b0b20e29b1f
--- /dev/null
+++ b/sys/modules/ext2fs/Makefile
@@ -0,0 +1,10 @@
+
+.PATH: ${SRCTOP}/sys/fs/ext2fs
+KMOD= ext2fs
+SRCS= opt_ddb.h opt_directio.h opt_quota.h opt_suiddir.h vnode_if.h \
+ ext2_acl.c ext2_alloc.c ext2_balloc.c ext2_bmap.c ext2_csum.c \
+ ext2_extattr.c ext2_extents.c ext2_hash.c ext2_htree.c \
+ ext2_inode.c ext2_inode_cnv.c ext2_lookup.c ext2_subr.c \
+ ext2_vfsops.c ext2_vnops.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/fdc/Makefile b/sys/modules/fdc/Makefile
new file mode 100644
index 000000000000..1b131cc4d162
--- /dev/null
+++ b/sys/modules/fdc/Makefile
@@ -0,0 +1,12 @@
+
+KMOD= fdc
+
+.PATH: ${SRCTOP}/sys/dev/fdc
+SRCS= fdc.c fdc_isa.c
+.if ${MACHINE} == "i386" || ${MACHINE} == "amd64"
+SRCS+= opt_acpi.h acpi_if.h fdc_acpi.c
+.endif
+
+SRCS+= opt_fdc.h bus_if.h device_if.h isa_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/fdescfs/Makefile b/sys/modules/fdescfs/Makefile
new file mode 100644
index 000000000000..6745cffcfb24
--- /dev/null
+++ b/sys/modules/fdescfs/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/fs/fdescfs
+
+KMOD= fdescfs
+SRCS= vnode_if.h \
+ fdesc_vfsops.c fdesc_vnops.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/fdt/Makefile b/sys/modules/fdt/Makefile
new file mode 100644
index 000000000000..bc27e25a0897
--- /dev/null
+++ b/sys/modules/fdt/Makefile
@@ -0,0 +1,6 @@
+# Build dev/fdt modules.
+
+SUBDIR = \
+ fdt_slicer \
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/fdt/fdt_slicer/Makefile b/sys/modules/fdt/fdt_slicer/Makefile
new file mode 100644
index 000000000000..75de4cc58172
--- /dev/null
+++ b/sys/modules/fdt/fdt_slicer/Makefile
@@ -0,0 +1,14 @@
+
+.PATH: ${SRCTOP}/sys/dev/fdt
+
+KMOD= fdt_slicer
+SRCS= fdt_slicer.c
+
+# Generated files...
+SRCS+= \
+ bus_if.h \
+ device_if.h \
+ ofw_bus_if.h \
+ opt_platform.h \
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/felix/Makefile b/sys/modules/felix/Makefile
new file mode 100644
index 000000000000..0e7369ac08c1
--- /dev/null
+++ b/sys/modules/felix/Makefile
@@ -0,0 +1,36 @@
+#-
+# SPDX-License-Identifier: BSD-2-Clause
+#
+# Copyright (c) 2021 Alstom Group.
+# Copyright (c) 2021 Semihalf.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+.PATH: ${SRCTOP}/sys/dev/etherswitch/felix
+.PATH: ${SRCTOP}/sys/dev/enetc
+
+KMOD = felix
+SRCS = felix.c enetc_mdio.c
+SRCS += bus_if.h device_if.h etherswitch_if.h miibus_if.h ofw_bus_if.h pci_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ffec/Makefile b/sys/modules/ffec/Makefile
new file mode 100644
index 000000000000..72bf600ac444
--- /dev/null
+++ b/sys/modules/ffec/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/ffec
+
+KMOD= if_ffec
+SRCS= if_ffec.c miibus_if.h device_if.h bus_if.h pci_if.h ofw_bus_if.h opt_global.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/fib_dxr/Makefile b/sys/modules/fib_dxr/Makefile
new file mode 100644
index 000000000000..e620fdeb7fa8
--- /dev/null
+++ b/sys/modules/fib_dxr/Makefile
@@ -0,0 +1,10 @@
+
+SYSDIR?=${SRCTOP}/sys
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+.PATH: ${SYSDIR}/netinet
+
+KMOD= fib_dxr
+SRCS= in_fib_dxr.c opt_inet.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/filemon/Makefile b/sys/modules/filemon/Makefile
new file mode 100644
index 000000000000..26c23854b984
--- /dev/null
+++ b/sys/modules/filemon/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/filemon
+
+KMOD= filemon
+SRCS= ${KMOD}.c
+SRCS+= vnode_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/filemon/Makefile.depend b/sys/modules/filemon/Makefile.depend
new file mode 100644
index 000000000000..11aba52f82cf
--- /dev/null
+++ b/sys/modules/filemon/Makefile.depend
@@ -0,0 +1,10 @@
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/sys/modules/firewire/Makefile b/sys/modules/firewire/Makefile
new file mode 100644
index 000000000000..d5254f528eea
--- /dev/null
+++ b/sys/modules/firewire/Makefile
@@ -0,0 +1,8 @@
+
+SUBDIR= firewire \
+ fwe \
+ fwip \
+ sbp \
+ sbp_targ
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/firewire/Makefile.inc b/sys/modules/firewire/Makefile.inc
new file mode 100644
index 000000000000..d3b5cbd3a79b
--- /dev/null
+++ b/sys/modules/firewire/Makefile.inc
@@ -0,0 +1,2 @@
+
+.include "../Makefile.inc"
diff --git a/sys/modules/firewire/firewire/Makefile b/sys/modules/firewire/firewire/Makefile
new file mode 100644
index 000000000000..7eb04113b8a5
--- /dev/null
+++ b/sys/modules/firewire/firewire/Makefile
@@ -0,0 +1,15 @@
+
+# Makefile for the IEEE1394 OHCI chipset
+
+.PATH: ${SRCTOP}/sys/dev/firewire
+
+KMOD= firewire
+SRCS = bus_if.h device_if.h pci_if.h \
+ firewire.c firewire.h firewire_phy.h firewirereg.h \
+ fwohci.c fwohci_pci.c fwohcireg.h fwohcivar.h \
+ iec13213.h iec68113.h \
+ fwcrom.c fwdev.c fwmem.c fwmem.h fwdma.c fwdma.h
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/firewire/fwe/Makefile b/sys/modules/firewire/fwe/Makefile
new file mode 100644
index 000000000000..0e05a7d35489
--- /dev/null
+++ b/sys/modules/firewire/fwe/Makefile
@@ -0,0 +1,13 @@
+
+# Makefile for the fwe(4) module (Ethernet over IEEE1394)
+
+.PATH: ${SRCTOP}/sys/dev/firewire
+
+KMOD = if_fwe
+SRCS = bus_if.h device_if.h \
+ opt_inet.h \
+ if_fwe.c if_fwevar.h \
+ firewire.h firewirereg.h
+#CFLAGS += -DDEVICE_POLLING
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/firewire/fwip/Makefile b/sys/modules/firewire/fwip/Makefile
new file mode 100644
index 000000000000..063dc2f0d502
--- /dev/null
+++ b/sys/modules/firewire/fwip/Makefile
@@ -0,0 +1,15 @@
+
+# Makefile for the fwip(4) module (IP over IEEE1394)
+
+.PATH: ${SRCTOP}/sys/dev/firewire ${SRCTOP}/sys/net
+
+KMOD = if_fwip
+SRCS = bus_if.h device_if.h \
+ opt_inet.h opt_inet6.h opt_ofed.h \
+ if_fwip.c if_fwipvar.h \
+ firewire.h firewirereg.h \
+ if_fwsubr.c
+
+#CFLAGS += -DDEVICE_POLLING
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/firewire/sbp/Makefile b/sys/modules/firewire/sbp/Makefile
new file mode 100644
index 000000000000..c4fb487c3093
--- /dev/null
+++ b/sys/modules/firewire/sbp/Makefile
@@ -0,0 +1,13 @@
+
+# Makefile for the SBP-II (Serial Bus Protocol 2/SCSI over IEEE1394)
+
+.PATH: ${SRCTOP}/sys/dev/firewire
+
+KMOD = sbp
+SRCS = bus_if.h device_if.h \
+ opt_cam.h opt_scsi.h \
+ sbp.c sbp.h \
+ firewire.h firewirereg.h \
+ iec13213.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/firewire/sbp_targ/Makefile b/sys/modules/firewire/sbp_targ/Makefile
new file mode 100644
index 000000000000..ff14615bd541
--- /dev/null
+++ b/sys/modules/firewire/sbp_targ/Makefile
@@ -0,0 +1,13 @@
+
+# Makefile for the SBP-II Target mode
+
+.PATH: ${SRCTOP}/sys/dev/firewire
+
+KMOD = sbp_targ
+SRCS = bus_if.h device_if.h \
+ opt_cam.h opt_scsi.h \
+ sbp_targ.c sbp.h \
+ firewire.h firewirereg.h \
+ iec13213.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/firmware/Makefile b/sys/modules/firmware/Makefile
new file mode 100644
index 000000000000..949bc3e6cf24
--- /dev/null
+++ b/sys/modules/firmware/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/kern
+
+KMOD= firmware
+SRCS= subr_firmware.c vnode_if.h
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/flash/Makefile b/sys/modules/flash/Makefile
new file mode 100644
index 000000000000..0a11b1242579
--- /dev/null
+++ b/sys/modules/flash/Makefile
@@ -0,0 +1,9 @@
+# Build dev/flash modules.
+
+SUBDIR =
+
+.if (${MACHINE_CPUARCH} == "aarch64") && !empty(OPT_FDT)
+SUBDIR+= flexspi
+.endif
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/flash/flexspi/Makefile b/sys/modules/flash/flexspi/Makefile
new file mode 100644
index 000000000000..25d937df9316
--- /dev/null
+++ b/sys/modules/flash/flexspi/Makefile
@@ -0,0 +1,14 @@
+
+.PATH: ${SRCTOP}/sys/dev/flash/flexspi
+
+KMOD= flexspi
+SRCS= flex_spi.c
+
+# Generated files...
+SRCS+= \
+ bus_if.h \
+ device_if.h \
+ ofw_bus_if.h \
+ opt_platform.h \
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ftgpio/Makefile b/sys/modules/ftgpio/Makefile
new file mode 100644
index 000000000000..eb8e22b48870
--- /dev/null
+++ b/sys/modules/ftgpio/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/ftgpio
+KMOD= ftgpio
+SRCS= ftgpio.c
+SRCS+= device_if.h bus_if.h isa_if.h gpio_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ftwd/Makefile b/sys/modules/ftwd/Makefile
new file mode 100644
index 000000000000..56dd7c8a04f9
--- /dev/null
+++ b/sys/modules/ftwd/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ftwd
+
+KMOD= ftwd
+SRCS= ftwd.c
+SRCS+= device_if.h bus_if.h isa_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/fusefs/Makefile b/sys/modules/fusefs/Makefile
new file mode 100644
index 000000000000..682505c401ba
--- /dev/null
+++ b/sys/modules/fusefs/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/fs/fuse
+
+KMOD= fusefs
+SRCS= vnode_if.h \
+ fuse_node.c fuse_io.c fuse_device.c fuse_ipc.c fuse_file.c \
+ fuse_vfsops.c fuse_vnops.c fuse_internal.c fuse_main.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/fxp/Makefile b/sys/modules/fxp/Makefile
new file mode 100644
index 000000000000..3f8963b3f38a
--- /dev/null
+++ b/sys/modules/fxp/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/fxp
+
+KMOD= if_fxp
+SRCS= device_if.h bus_if.h if_fxp.c inphy.c miibus_if.h miidevs.h pci_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/gem/Makefile b/sys/modules/gem/Makefile
new file mode 100644
index 000000000000..820ff4f7bd53
--- /dev/null
+++ b/sys/modules/gem/Makefile
@@ -0,0 +1,12 @@
+
+.PATH: ${SRCTOP}/sys/dev/gem
+
+KMOD= if_gem
+SRCS= bus_if.h device_if.h if_gem.c if_gem_pci.c miibus_if.h
+SRCS+= ${ofw_bus_if} pci_if.h opt_platform.h
+
+.if ${MACHINE_CPUARCH} == "powerpc"
+ofw_bus_if= ofw_bus_if.h
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/geom/Makefile b/sys/modules/geom/Makefile
new file mode 100644
index 000000000000..48f225d0a33e
--- /dev/null
+++ b/sys/modules/geom/Makefile
@@ -0,0 +1,33 @@
+
+SYSDIR?=${SRCTOP}/sys
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+SUBDIR= geom_bde \
+ geom_cache \
+ geom_concat \
+ geom_eli \
+ geom_flashmap \
+ geom_gate \
+ geom_journal \
+ geom_label \
+ geom_linux_lvm \
+ geom_mirror \
+ geom_mountver \
+ geom_multipath \
+ geom_nop \
+ geom_part \
+ geom_raid \
+ geom_raid3 \
+ geom_shsec \
+ geom_stripe \
+ geom_union \
+ geom_uzip \
+ geom_vinum \
+ geom_virstor \
+ geom_zero
+
+.if ${MK_CCD} != "no" || defined(ALL_MODULES)
+SUBDIR+= geom_ccd
+.endif
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/geom/Makefile.inc b/sys/modules/geom/Makefile.inc
new file mode 100644
index 000000000000..d3b5cbd3a79b
--- /dev/null
+++ b/sys/modules/geom/Makefile.inc
@@ -0,0 +1,2 @@
+
+.include "../Makefile.inc"
diff --git a/sys/modules/geom/geom_bde/Makefile b/sys/modules/geom/geom_bde/Makefile
new file mode 100644
index 000000000000..808775a79743
--- /dev/null
+++ b/sys/modules/geom/geom_bde/Makefile
@@ -0,0 +1,10 @@
+
+.PATH: ${SRCTOP}/sys/geom/bde
+.PATH: ${SRCTOP}/sys/crypto/rijndael
+.PATH: ${SRCTOP}/sys/crypto/sha2
+
+KMOD= geom_bde
+SRCS= g_bde.c g_bde_crypt.c g_bde_lock.c g_bde_work.c
+SRCS+= rijndael-alg-fst.c rijndael-api-fst.c sha256c.c sha512c.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/geom/geom_cache/Makefile b/sys/modules/geom/geom_cache/Makefile
new file mode 100644
index 000000000000..73bb7665d745
--- /dev/null
+++ b/sys/modules/geom/geom_cache/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/geom/cache
+
+KMOD= geom_cache
+SRCS= g_cache.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/geom/geom_ccd/Makefile b/sys/modules/geom/geom_ccd/Makefile
new file mode 100644
index 000000000000..ada4b9259c0d
--- /dev/null
+++ b/sys/modules/geom/geom_ccd/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/geom
+
+KMOD= geom_ccd
+SRCS= geom_ccd.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/geom/geom_concat/Makefile b/sys/modules/geom/geom_concat/Makefile
new file mode 100644
index 000000000000..603f7d81cb19
--- /dev/null
+++ b/sys/modules/geom/geom_concat/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/geom/concat
+
+KMOD= geom_concat
+SRCS= g_concat.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/geom/geom_eli/Makefile b/sys/modules/geom/geom_eli/Makefile
new file mode 100644
index 000000000000..68907218fdae
--- /dev/null
+++ b/sys/modules/geom/geom_eli/Makefile
@@ -0,0 +1,16 @@
+
+.PATH: ${SRCTOP}/sys/geom/eli
+
+KMOD= geom_eli
+SRCS= g_eli.c
+SRCS+= g_eli_crypto.c
+SRCS+= g_eli_ctl.c
+SRCS+= g_eli_hmac.c
+SRCS+= g_eli_integrity.c
+SRCS+= g_eli_key.c
+SRCS+= g_eli_key_cache.c
+SRCS+= g_eli_privacy.c
+SRCS+= pkcs5v2.c
+SRCS+= vnode_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/geom/geom_flashmap/Makefile b/sys/modules/geom/geom_flashmap/Makefile
new file mode 100644
index 000000000000..520d0ad783c6
--- /dev/null
+++ b/sys/modules/geom/geom_flashmap/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/geom
+
+KMOD= geom_flashmap
+SRCS= geom_flashmap.c
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/geom/geom_gate/Makefile b/sys/modules/geom/geom_gate/Makefile
new file mode 100644
index 000000000000..3d084790eb7c
--- /dev/null
+++ b/sys/modules/geom/geom_gate/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/geom/gate
+
+KMOD= geom_gate
+SRCS= g_gate.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/geom/geom_journal/Makefile b/sys/modules/geom/geom_journal/Makefile
new file mode 100644
index 000000000000..b8bd96d3b242
--- /dev/null
+++ b/sys/modules/geom/geom_journal/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/geom/journal
+
+KMOD= geom_journal
+SRCS= g_journal.c
+SRCS+= g_journal_ufs.c
+SRCS+= vnode_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/geom/geom_label/Makefile b/sys/modules/geom/geom_label/Makefile
new file mode 100644
index 000000000000..4ed9c6e5630e
--- /dev/null
+++ b/sys/modules/geom/geom_label/Makefile
@@ -0,0 +1,21 @@
+
+.PATH: ${SRCTOP}/sys/geom/label
+
+KMOD= geom_label
+SRCS= g_label.c
+SRCS+= g_label_disk_ident.c
+SRCS+= g_label_ext2fs.c
+SRCS+= g_label_flashmap.c
+SRCS+= g_label_gpt.c
+SRCS+= g_label_iso9660.c
+SRCS+= g_label_msdosfs.c
+SRCS+= g_label_ntfs.c
+SRCS+= g_label_reiserfs.c
+SRCS+= g_label_ufs.c
+SRCS+= opt_geom.h
+SRCS+= vnode_if.h
+
+opt_geom.h:
+ echo "#define GEOM_LABEL 1" > ${.TARGET}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/geom/geom_linux_lvm/Makefile b/sys/modules/geom/geom_linux_lvm/Makefile
new file mode 100644
index 000000000000..0d0ee72e8d87
--- /dev/null
+++ b/sys/modules/geom/geom_linux_lvm/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/geom/linux_lvm
+
+KMOD= geom_linux_lvm
+SRCS= g_linux_lvm.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/geom/geom_map/Makefile b/sys/modules/geom/geom_map/Makefile
new file mode 100644
index 000000000000..85beccbf493e
--- /dev/null
+++ b/sys/modules/geom/geom_map/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/geom
+
+KMOD= geom_map
+SRCS= geom_map.c bus_if.h device_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/geom/geom_mirror/Makefile b/sys/modules/geom/geom_mirror/Makefile
new file mode 100644
index 000000000000..a46e0ceebf38
--- /dev/null
+++ b/sys/modules/geom/geom_mirror/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/geom/mirror
+
+KMOD= geom_mirror
+SRCS= g_mirror.c
+SRCS+= g_mirror_ctl.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/geom/geom_mountver/Makefile b/sys/modules/geom/geom_mountver/Makefile
new file mode 100644
index 000000000000..f5df29d8f29a
--- /dev/null
+++ b/sys/modules/geom/geom_mountver/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/geom/mountver
+
+KMOD= geom_mountver
+SRCS= g_mountver.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/geom/geom_multipath/Makefile b/sys/modules/geom/geom_multipath/Makefile
new file mode 100644
index 000000000000..a45f5d330631
--- /dev/null
+++ b/sys/modules/geom/geom_multipath/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/geom/multipath
+
+KMOD= geom_multipath
+SRCS= g_multipath.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/geom/geom_nop/Makefile b/sys/modules/geom/geom_nop/Makefile
new file mode 100644
index 000000000000..2436fc81e268
--- /dev/null
+++ b/sys/modules/geom/geom_nop/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/geom/nop
+
+KMOD= geom_nop
+SRCS= g_nop.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/geom/geom_part/Makefile b/sys/modules/geom/geom_part/Makefile
new file mode 100644
index 000000000000..f9a6076f184b
--- /dev/null
+++ b/sys/modules/geom/geom_part/Makefile
@@ -0,0 +1,10 @@
+
+SUBDIR= geom_part_apm \
+ geom_part_bsd \
+ geom_part_bsd64 \
+ geom_part_ebr \
+ geom_part_gpt \
+ geom_part_ldm \
+ geom_part_mbr
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/geom/geom_part/geom_part_apm/Makefile b/sys/modules/geom/geom_part/geom_part_apm/Makefile
new file mode 100644
index 000000000000..2922e575ac0e
--- /dev/null
+++ b/sys/modules/geom/geom_part/geom_part_apm/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/geom/part
+
+KMOD= geom_part_apm
+SRCS= g_part_apm.c
+
+SRCS+= bus_if.h device_if.h g_part_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/geom/geom_part/geom_part_bsd/Makefile b/sys/modules/geom/geom_part/geom_part_bsd/Makefile
new file mode 100644
index 000000000000..63c8a4813bd9
--- /dev/null
+++ b/sys/modules/geom/geom_part/geom_part_bsd/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/geom/part ${SRCTOP}/sys/geom
+
+KMOD= geom_part_bsd
+SRCS= g_part_bsd.c geom_bsd_enc.c
+
+SRCS+= bus_if.h device_if.h g_part_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/geom/geom_part/geom_part_bsd64/Makefile b/sys/modules/geom/geom_part/geom_part_bsd64/Makefile
new file mode 100644
index 000000000000..c4848ffd3c00
--- /dev/null
+++ b/sys/modules/geom/geom_part/geom_part_bsd64/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/geom/part
+
+KMOD= geom_part_bsd64
+SRCS= g_part_bsd64.c
+
+SRCS+= bus_if.h device_if.h g_part_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/geom/geom_part/geom_part_ebr/Makefile b/sys/modules/geom/geom_part/geom_part_ebr/Makefile
new file mode 100644
index 000000000000..cbc970754444
--- /dev/null
+++ b/sys/modules/geom/geom_part/geom_part_ebr/Makefile
@@ -0,0 +1,10 @@
+
+.PATH: ${SRCTOP}/sys/geom/part
+
+KMOD= geom_part_ebr
+SRCS= g_part_ebr.c
+
+SRCS+= bus_if.h device_if.h g_part_if.h
+SRCS+= opt_geom.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/geom/geom_part/geom_part_gpt/Makefile b/sys/modules/geom/geom_part/geom_part_gpt/Makefile
new file mode 100644
index 000000000000..0183caa98e59
--- /dev/null
+++ b/sys/modules/geom/geom_part/geom_part_gpt/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/geom/part
+
+KMOD= geom_part_gpt
+SRCS= g_part_gpt.c
+
+SRCS+= bus_if.h device_if.h g_part_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/geom/geom_part/geom_part_ldm/Makefile b/sys/modules/geom/geom_part/geom_part_ldm/Makefile
new file mode 100644
index 000000000000..dcf3a83f4039
--- /dev/null
+++ b/sys/modules/geom/geom_part/geom_part_ldm/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/geom/part
+
+KMOD= geom_part_ldm
+SRCS= g_part_ldm.c
+
+SRCS+= bus_if.h device_if.h g_part_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/geom/geom_part/geom_part_mbr/Makefile b/sys/modules/geom/geom_part/geom_part_mbr/Makefile
new file mode 100644
index 000000000000..b0c6664a33c6
--- /dev/null
+++ b/sys/modules/geom/geom_part/geom_part_mbr/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/geom/part
+
+KMOD= geom_part_mbr
+SRCS= g_part_mbr.c
+
+SRCS+= bus_if.h device_if.h g_part_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/geom/geom_raid/Makefile b/sys/modules/geom/geom_raid/Makefile
new file mode 100644
index 000000000000..65bd41b92698
--- /dev/null
+++ b/sys/modules/geom/geom_raid/Makefile
@@ -0,0 +1,15 @@
+
+.PATH: ${SRCTOP}/sys/geom/raid
+
+KMOD= geom_raid
+SRCS= g_raid.c
+SRCS+= g_raid_ctl.c
+SRCS+= bus_if.h device_if.h
+SRCS+= g_raid_md_if.h g_raid_md_if.c
+SRCS+= g_raid_tr_if.h g_raid_tr_if.c
+
+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
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/geom/geom_raid3/Makefile b/sys/modules/geom/geom_raid3/Makefile
new file mode 100644
index 000000000000..8581b689aacf
--- /dev/null
+++ b/sys/modules/geom/geom_raid3/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/geom/raid3
+
+KMOD= geom_raid3
+SRCS= g_raid3.c
+SRCS+= g_raid3_ctl.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/geom/geom_shsec/Makefile b/sys/modules/geom/geom_shsec/Makefile
new file mode 100644
index 000000000000..618dfba4387a
--- /dev/null
+++ b/sys/modules/geom/geom_shsec/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/geom/shsec
+
+KMOD= geom_shsec
+SRCS= g_shsec.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/geom/geom_stripe/Makefile b/sys/modules/geom/geom_stripe/Makefile
new file mode 100644
index 000000000000..4ae94ca09bd5
--- /dev/null
+++ b/sys/modules/geom/geom_stripe/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/geom/stripe
+
+KMOD= geom_stripe
+SRCS= g_stripe.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/geom/geom_union/Makefile b/sys/modules/geom/geom_union/Makefile
new file mode 100644
index 000000000000..3ca2f4ce151e
--- /dev/null
+++ b/sys/modules/geom/geom_union/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/geom/union
+
+KMOD= geom_union
+SRCS= g_union.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/geom/geom_uzip/Makefile b/sys/modules/geom/geom_uzip/Makefile
new file mode 100644
index 000000000000..958da0c9d214
--- /dev/null
+++ b/sys/modules/geom/geom_uzip/Makefile
@@ -0,0 +1,21 @@
+
+.include <kmod.opts.mk>
+
+.PATH: ${SRCTOP}/sys/geom/uzip ${SRCTOP}/sys/net
+
+KMOD= geom_uzip
+SRCS= g_uzip.c g_uzip_zlib.c g_uzip_lzma.c g_uzip_wrkthr.c
+SRCS+= g_uzip.h g_uzip_dapi.h g_uzip_lzma.h g_uzip_zlib.h g_uzip_softc.h \
+ g_uzip_wrkthr.h
+
+# This works for buildkernel, but will disable zstd in geom_uzip out of tree.
+SRCS.ZSTDIO+= g_uzip_zstd.c g_uzip_zstd.h
+CFLAGS.g_uzip_zstd.c+= -I${SRCTOP}/sys/contrib/zstd/lib/freebsd
+
+#CFLAGS= -g -DINVARIANT_SUPPORT -DINVARIANTS
+
+CFLAGS.g_uzip_lzma.c+= -I${SRCTOP}/sys/contrib/xz-embedded/freebsd \
+ -I${SRCTOP}/sys/contrib/xz-embedded/linux/lib/xz/
+SRCS+= opt_geom.h opt_zstdio.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/geom/geom_vinum/Makefile b/sys/modules/geom/geom_vinum/Makefile
new file mode 100644
index 000000000000..d66ac02a13d4
--- /dev/null
+++ b/sys/modules/geom/geom_vinum/Makefile
@@ -0,0 +1,11 @@
+
+.PATH: ${SRCTOP}/sys/geom/vinum
+
+KMOD= geom_vinum
+SRCS= geom_vinum.c geom_vinum_create.c geom_vinum_drive.c geom_vinum_plex.c \
+ geom_vinum_volume.c geom_vinum_subr.c geom_vinum_raid5.c \
+ geom_vinum_share.c geom_vinum_list.c geom_vinum_rm.c \
+ geom_vinum_init.c geom_vinum_state.c geom_vinum_rename.c \
+ geom_vinum_move.c geom_vinum_events.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/geom/geom_virstor/Makefile b/sys/modules/geom/geom_virstor/Makefile
new file mode 100644
index 000000000000..2e19affd247a
--- /dev/null
+++ b/sys/modules/geom/geom_virstor/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/geom/virstor
+
+KMOD= geom_virstor
+SRCS= g_virstor.c g_virstor_md.c binstream.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/geom/geom_zero/Makefile b/sys/modules/geom/geom_zero/Makefile
new file mode 100644
index 000000000000..c43d896d5399
--- /dev/null
+++ b/sys/modules/geom/geom_zero/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/geom/zero
+
+KMOD= geom_zero
+SRCS= g_zero.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/glxiic/Makefile b/sys/modules/glxiic/Makefile
new file mode 100644
index 000000000000..09853747adb0
--- /dev/null
+++ b/sys/modules/glxiic/Makefile
@@ -0,0 +1,9 @@
+
+#CFLAGS+= -DGLXIIC_DEBUG
+
+.PATH: ${SRCTOP}/sys/dev/glxiic
+KMOD= glxiic
+SRCS= glxiic.c
+SRCS+= device_if.h bus_if.h pci_if.h iicbus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/glxsb/Makefile b/sys/modules/glxsb/Makefile
new file mode 100644
index 000000000000..8a138e0fea71
--- /dev/null
+++ b/sys/modules/glxsb/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/glxsb
+KMOD = glxsb
+SRCS = glxsb.c glxsb_hash.c glxsb.h
+SRCS += device_if.h pci_if.h bus_if.h
+SRCS += opt_bus.h cryptodev_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/gpio/Makefile b/sys/modules/gpio/Makefile
new file mode 100644
index 000000000000..ffb3581d1f01
--- /dev/null
+++ b/sys/modules/gpio/Makefile
@@ -0,0 +1,33 @@
+#
+#
+# Copyright (c) 2011 Adrian Chadd. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+SUBDIR = gpiobus gpioiic gpioled gpiospi gpioths
+
+.if !empty(OPT_FDT)
+SUBDIR += gpiokeys gpiopps
+.endif
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/gpio/gpiobus/Makefile b/sys/modules/gpio/gpiobus/Makefile
new file mode 100644
index 000000000000..d9345e00e2be
--- /dev/null
+++ b/sys/modules/gpio/gpiobus/Makefile
@@ -0,0 +1,46 @@
+#
+# Copyright (c) 2012 Adrian Chadd, Xenion Pty Ltd
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer,
+# without modification.
+# 2. Redistributions in binary form must reproduce at minimum a disclaimer
+# similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
+# redistribution must be conditioned upon including a substantially
+# similar Disclaimer requirement for further binary redistribution.
+#
+# NO WARRANTY
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+# THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
+# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGES.
+#
+#
+
+.PATH: ${SRCTOP}/sys/dev/gpio/
+
+KMOD= gpiobus
+SRCS= gpiobus.c gpioc.c
+SRCS+= gpio_if.c gpio_if.h gpiobus_if.c gpiobus_if.h ofw_bus_if.h
+SRCS+= device_if.h bus_if.h opt_platform.h
+
+.if !empty(OPT_FDT)
+SRCS+= ofw_gpiobus.c
+.endif
+
+CFLAGS+= -I. -I${SRCTOP}/sys/dev/gpio/
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/gpio/gpioiic/Makefile b/sys/modules/gpio/gpioiic/Makefile
new file mode 100644
index 000000000000..5dff8544cd76
--- /dev/null
+++ b/sys/modules/gpio/gpioiic/Makefile
@@ -0,0 +1,40 @@
+#
+# Copyright (c) 2012 Adrian Chadd, Xenion Pty Ltd
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer,
+# without modification.
+# 2. Redistributions in binary form must reproduce at minimum a disclaimer
+# similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
+# redistribution must be conditioned upon including a substantially
+# similar Disclaimer requirement for further binary redistribution.
+#
+# NO WARRANTY
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+# THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
+# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGES.
+#
+#
+
+.PATH: ${SRCTOP}/sys/dev/gpio/
+
+KMOD= gpioiic
+SRCS= gpioiic.c
+SRCS+= device_if.h bus_if.h gpio_if.h gpiobus_if.h iicbus_if.h iicbb_if.h
+SRCS+= ofw_bus_if.h opt_platform.h
+
+CFLAGS+= -I. -I${SRCTOP}/sys/dev/gpio/
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/gpio/gpiokeys/Makefile b/sys/modules/gpio/gpiokeys/Makefile
new file mode 100644
index 000000000000..c24e70505ccb
--- /dev/null
+++ b/sys/modules/gpio/gpiokeys/Makefile
@@ -0,0 +1,13 @@
+#
+#
+
+.PATH: ${SRCTOP}/sys/dev/gpio/
+
+KMOD= gpiokeys
+SRCS= gpiokeys.c gpiokeys_codes.c
+SRCS+= bus_if.h device_if.h gpio_if.h ofw_bus_if.h
+SRCS+= opt_platform.h opt_kbd.h
+
+CFLAGS+= -I. -I${SRCTOP}/sys/dev/gpio/
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/gpio/gpioled/Makefile b/sys/modules/gpio/gpioled/Makefile
new file mode 100644
index 000000000000..8b0cf7a3b4c8
--- /dev/null
+++ b/sys/modules/gpio/gpioled/Makefile
@@ -0,0 +1,43 @@
+#
+# Copyright (c) 2012 Adrian Chadd, Xenion Pty Ltd
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer,
+# without modification.
+# 2. Redistributions in binary form must reproduce at minimum a disclaimer
+# similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
+# redistribution must be conditioned upon including a substantially
+# similar Disclaimer requirement for further binary redistribution.
+#
+# NO WARRANTY
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+# THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
+# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGES.
+#
+#
+
+.PATH: ${SRCTOP}/sys/dev/gpio/
+
+KMOD= gpioled
+.if !empty(OPT_FDT)
+SRCS= gpioled_fdt.c
+.else
+SRCS= gpioled.c
+.endif
+SRCS+= device_if.h bus_if.h gpio_if.h gpiobus_if.h opt_platform.h ofw_bus_if.h
+
+CFLAGS+= -I. -I${SRCTOP}/sys/dev/gpio/
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/gpio/gpiopps/Makefile b/sys/modules/gpio/gpiopps/Makefile
new file mode 100644
index 000000000000..4b101064b88f
--- /dev/null
+++ b/sys/modules/gpio/gpiopps/Makefile
@@ -0,0 +1,39 @@
+#
+# Copyright (c) 2016 Ian Lepore <ian@FreeBSD.org>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer,
+# without modification.
+# 2. Redistributions in binary form must reproduce at minimum a disclaimer
+# similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
+# redistribution must be conditioned upon including a substantially
+# similar Disclaimer requirement for further binary redistribution.
+#
+# NO WARRANTY
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+# THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
+# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGES.
+#
+#
+
+.PATH: ${SRCTOP}/sys/dev/gpio/
+
+KMOD= gpiopps
+SRCS= gpiopps.c
+SRCS+= device_if.h bus_if.h gpio_if.h gpiobus_if.h opt_platform.h ofw_bus_if.h
+
+CFLAGS+= -I. -I${SRCTOP}/sys/dev/gpio/
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/gpio/gpiospi/Makefile b/sys/modules/gpio/gpiospi/Makefile
new file mode 100644
index 000000000000..e42581705e9b
--- /dev/null
+++ b/sys/modules/gpio/gpiospi/Makefile
@@ -0,0 +1,40 @@
+#
+# Copyright (c) 2016 Adrian Chadd <adrian@FreeBSD.org>.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer,
+# without modification.
+# 2. Redistributions in binary form must reproduce at minimum a disclaimer
+# similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
+# redistribution must be conditioned upon including a substantially
+# similar Disclaimer requirement for further binary redistribution.
+#
+# NO WARRANTY
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+# THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
+# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGES.
+#
+#
+
+.PATH: ${SRCTOP}/sys/dev/gpio/
+
+KMOD= gpiospi
+SRCS= gpiospi.c
+SRCS+= device_if.h bus_if.h gpio_if.h gpiobus_if.h spibus_if.h
+SRCS+= ofw_bus_if.h opt_gpio.h opt_platform.h
+
+CFLAGS+= -I. -I${SRCTOP}/sys/dev/gpio/
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/gpio/gpioths/Makefile b/sys/modules/gpio/gpioths/Makefile
new file mode 100644
index 000000000000..bcc8681baf55
--- /dev/null
+++ b/sys/modules/gpio/gpioths/Makefile
@@ -0,0 +1,18 @@
+#
+
+.PATH: ${SRCTOP}/sys/dev/gpio/
+
+KMOD= gpioths
+SRCS= gpioths.c
+
+SRCS+= \
+ bus_if.h \
+ device_if.h \
+ gpio_if.h \
+ gpiobus_if.h \
+ ofw_bus_if.h \
+ opt_platform.h \
+
+CFLAGS+= -I. -I${SRCTOP}/sys/dev/gpio/
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/gve/Makefile b/sys/modules/gve/Makefile
new file mode 100644
index 000000000000..13c88c6c0a96
--- /dev/null
+++ b/sys/modules/gve/Makefile
@@ -0,0 +1,36 @@
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Copyright (c) 2023 Google LLC
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+#
+# 3. Neither the name of the copyright holder nor the names of its contributors
+# may be used to endorse or promote products derived from this software without
+# specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+.PATH: ${SRCTOP}/sys/dev/gve
+
+KMOD= if_gve
+SRCS= gve_main.c gve_adminq.c gve_utils.c gve_qpl.c gve_rx.c gve_tx.c gve_sysctl.c
+SRCS+= device_if.h bus_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/hid/Makefile b/sys/modules/hid/Makefile
new file mode 100644
index 000000000000..f2331d7db728
--- /dev/null
+++ b/sys/modules/hid/Makefile
@@ -0,0 +1,23 @@
+
+SUBDIR = \
+ hid \
+ hidbus \
+ hidmap \
+ hidquirk \
+ hidraw
+
+SUBDIR += \
+ bcm5974 \
+ hconf \
+ hcons \
+ hgame \
+ hkbd \
+ hms \
+ hmt \
+ hpen \
+ hsctrl \
+ ietp \
+ ps4dshock \
+ xb360gp
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/hid/bcm5974/Makefile b/sys/modules/hid/bcm5974/Makefile
new file mode 100644
index 000000000000..50b51f497d85
--- /dev/null
+++ b/sys/modules/hid/bcm5974/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/hid
+
+KMOD= bcm5974
+SRCS= bcm5974.c
+SRCS+= opt_hid.h opt_usb.h
+SRCS+= bus_if.h device_if.h usbdevs.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/hid/hconf/Makefile b/sys/modules/hid/hconf/Makefile
new file mode 100644
index 000000000000..32ab19a954f6
--- /dev/null
+++ b/sys/modules/hid/hconf/Makefile
@@ -0,0 +1,11 @@
+
+.PATH: ${SRCTOP}/sys/dev/hid
+
+KMOD= hconf
+SRCS= hconf.c
+SRCS+= opt_hid.h
+SRCS+= bus_if.h device_if.h
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/hid/hcons/Makefile b/sys/modules/hid/hcons/Makefile
new file mode 100644
index 000000000000..d012a3f49569
--- /dev/null
+++ b/sys/modules/hid/hcons/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/hid
+
+KMOD= hcons
+SRCS= hcons.c
+SRCS+= bus_if.h device_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/hid/hgame/Makefile b/sys/modules/hid/hgame/Makefile
new file mode 100644
index 000000000000..3af829d1e971
--- /dev/null
+++ b/sys/modules/hid/hgame/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/hid
+
+KMOD= hgame
+SRCS= hgame.c
+SRCS+= bus_if.h device_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/hid/hid/Makefile b/sys/modules/hid/hid/Makefile
new file mode 100644
index 000000000000..e9104b27e377
--- /dev/null
+++ b/sys/modules/hid/hid/Makefile
@@ -0,0 +1,11 @@
+
+.PATH: ${SRCTOP}/sys/dev/hid
+
+KMOD= hid
+SRCS= hid.c hid_if.c
+SRCS+= opt_hid.h
+SRCS+= bus_if.h device_if.h hid_if.h
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/hid/hidbus/Makefile b/sys/modules/hid/hidbus/Makefile
new file mode 100644
index 000000000000..c3aa91acff4d
--- /dev/null
+++ b/sys/modules/hid/hidbus/Makefile
@@ -0,0 +1,10 @@
+
+.PATH: ${SRCTOP}/sys/dev/hid
+
+KMOD= hidbus
+SRCS= hidbus.c
+SRCS+= bus_if.h device_if.h hid_if.h
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/hid/hidmap/Makefile b/sys/modules/hid/hidmap/Makefile
new file mode 100644
index 000000000000..f682a39925eb
--- /dev/null
+++ b/sys/modules/hid/hidmap/Makefile
@@ -0,0 +1,11 @@
+
+.PATH: ${SRCTOP}/sys/dev/hid
+
+KMOD= hidmap
+SRCS= hidmap.c
+SRCS+= opt_hid.h
+SRCS+= bus_if.h device_if.h
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/hid/hidquirk/Makefile b/sys/modules/hid/hidquirk/Makefile
new file mode 100644
index 000000000000..dbf2fa8f8e18
--- /dev/null
+++ b/sys/modules/hid/hidquirk/Makefile
@@ -0,0 +1,33 @@
+#
+# Copyright (c) 2020 Vladimir Kondratyev <wulf@FreeBSD.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+#
+
+.PATH: ${SRCTOP}/sys/dev/hid
+
+KMOD= hidquirk
+SRCS= hidquirk.c
+SRCS+= bus_if.h device_if.h usbdevs.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/hid/hidraw/Makefile b/sys/modules/hid/hidraw/Makefile
new file mode 100644
index 000000000000..6148cf9e193e
--- /dev/null
+++ b/sys/modules/hid/hidraw/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/hid
+
+KMOD= hidraw
+SRCS= hidraw.c
+SRCS+= opt_hid.h bus_if.h device_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/hid/hkbd/Makefile b/sys/modules/hid/hkbd/Makefile
new file mode 100644
index 000000000000..5dc4040783ef
--- /dev/null
+++ b/sys/modules/hid/hkbd/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/hid
+
+KMOD= hkbd
+SRCS= hkbd.c
+SRCS+= opt_hid.h opt_evdev.h opt_kbd.h opt_hkbd.h
+SRCS+= bus_if.h device_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/hid/hms/Makefile b/sys/modules/hid/hms/Makefile
new file mode 100644
index 000000000000..573757cad525
--- /dev/null
+++ b/sys/modules/hid/hms/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/hid
+
+KMOD= hms
+SRCS= hms.c
+SRCS+= opt_hid.h
+SRCS+= bus_if.h device_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/hid/hmt/Makefile b/sys/modules/hid/hmt/Makefile
new file mode 100644
index 000000000000..a96fdd44b311
--- /dev/null
+++ b/sys/modules/hid/hmt/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/hid
+
+KMOD= hmt
+SRCS= hmt.c
+SRCS+= opt_hid.h
+SRCS+= bus_if.h device_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/hid/hpen/Makefile b/sys/modules/hid/hpen/Makefile
new file mode 100644
index 000000000000..ed008b43565e
--- /dev/null
+++ b/sys/modules/hid/hpen/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/hid
+
+KMOD= hpen
+SRCS= hpen.c
+SRCS+= bus_if.h device_if.h usbdevs.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/hid/hsctrl/Makefile b/sys/modules/hid/hsctrl/Makefile
new file mode 100644
index 000000000000..4e0dd5d0c4cc
--- /dev/null
+++ b/sys/modules/hid/hsctrl/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/hid
+
+KMOD= hsctrl
+SRCS= hsctrl.c
+SRCS+= bus_if.h device_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/hid/ietp/Makefile b/sys/modules/hid/ietp/Makefile
new file mode 100644
index 000000000000..c3b39e7b7a58
--- /dev/null
+++ b/sys/modules/hid/ietp/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/hid
+
+KMOD= ietp
+SRCS= ietp.c
+SRCS+= opt_hid.h
+SRCS+= bus_if.h device_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/hid/ps4dshock/Makefile b/sys/modules/hid/ps4dshock/Makefile
new file mode 100644
index 000000000000..bb12c8a16971
--- /dev/null
+++ b/sys/modules/hid/ps4dshock/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/hid
+
+KMOD= ps4dshock
+SRCS= ps4dshock.c
+SRCS+= opt_hid.h
+SRCS+= bus_if.h device_if.h usbdevs.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/hid/xb360gp/Makefile b/sys/modules/hid/xb360gp/Makefile
new file mode 100644
index 000000000000..1570a6cfadc9
--- /dev/null
+++ b/sys/modules/hid/xb360gp/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/hid
+
+KMOD= xb360gp
+SRCS= xb360gp.c
+SRCS+= bus_if.h device_if.h opt_usb.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/hifn/Makefile b/sys/modules/hifn/Makefile
new file mode 100644
index 000000000000..8c36def0c97d
--- /dev/null
+++ b/sys/modules/hifn/Makefile
@@ -0,0 +1,13 @@
+
+.PATH: ${SRCTOP}/sys/dev/hifn
+KMOD = hifn
+SRCS = hifn7751.c opt_hifn.h
+SRCS += device_if.h bus_if.h pci_if.h
+SRCS += opt_bus.h cryptodev_if.h
+
+.if !defined(KERNBUILDDIR)
+opt_hifn.h:
+ echo "#define HIFN_DEBUG 1" > ${.TARGET}
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/hpt27xx/Makefile b/sys/modules/hpt27xx/Makefile
new file mode 100644
index 000000000000..d8689c376322
--- /dev/null
+++ b/sys/modules/hpt27xx/Makefile
@@ -0,0 +1,10 @@
+HPT27XX= ${SRCTOP}/sys/dev/hpt27xx
+.PATH: ${HPT27XX}
+
+KMOD= hpt27xx
+SRCS= bus_if.h device_if.h pci_if.h
+SRCS+= opt_cam.h opt_scsi.h
+SRCS+= os_bsd.h hpt27xx_os_bsd.c hpt27xx_osm_bsd.c hpt27xx_config.c
+BLOB_OBJS+= ${HPT27XX}/$(MACHINE_ARCH)-elf.hpt27xx_lib.o
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/hptiop/Makefile b/sys/modules/hptiop/Makefile
new file mode 100644
index 000000000000..ca28125f3c1a
--- /dev/null
+++ b/sys/modules/hptiop/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/hptiop
+
+KMOD= hptiop
+SRCS= hptiop.c
+SRCS+= opt_scsi.h opt_cam.h
+SRCS+= device_if.h bus_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/hptmv/Makefile b/sys/modules/hptmv/Makefile
new file mode 100644
index 000000000000..374204891ca8
--- /dev/null
+++ b/sys/modules/hptmv/Makefile
@@ -0,0 +1,42 @@
+#
+# Makefile for RR182x FreeBSD driver
+# Copyright (c) 2004-2005 HighPoint Technologies, Inc. All rights reserved
+#
+
+HPTMV= ${SRCTOP}/sys/dev/hptmv
+.PATH: ${HPTMV}
+
+KMOD= hptmv
+SRCS= opt_scsi.h opt_cam.h
+SRCS+= bus_if.h device_if.h pci_if.h
+SRCS+= mv.c entry.c ioctl.c hptproc.c gui_lib.c
+BLOB_OBJS+= ${HPTMV}/${MACHINE_CPUARCH}-elf.hptmvraid.o
+
+#
+# Debug Options:
+#
+# -DDEBUG: include debug code
+# -DDEBUG_LEVEL=x:
+# 0 - No debug output message
+# 1 - print only error messages
+# 2 - print error and warning
+# 3 - print all messages (info, warning, error)
+#
+#DEBUGOPT = -O2
+
+.if defined(DEBUG) && $(DEBUG) == 1
+DEBUGOPT += -DDEBUG
+.if defined(DEBUG_LEVEL)
+DEBUGOPT += -DDEBUG_LEVEL=$(DEBUG_LEVEL)
+.else
+DEBUGOPT += -DDEBUG_LEVEL=1
+.endif
+.endif
+
+.if defined(FOR_DEMO) && $(FOR_DEMO) == 1
+DEBUGOPT += -DFOR_DEMO
+.endif
+
+CFLAGS = ${DEBUGOPT}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/hptnr/Makefile b/sys/modules/hptnr/Makefile
new file mode 100644
index 000000000000..a69b1ec649a6
--- /dev/null
+++ b/sys/modules/hptnr/Makefile
@@ -0,0 +1,10 @@
+HPTNR= ${SRCTOP}/sys/dev/hptnr
+.PATH: ${HPTNR}
+
+KMOD= hptnr
+SRCS= bus_if.h device_if.h pci_if.h
+SRCS+= opt_cam.h opt_scsi.h
+SRCS+= os_bsd.h hptnr_os_bsd.c hptnr_osm_bsd.c hptnr_config.c
+BLOB_OBJS+= ${HPTNR}/${MACHINE_ARCH}-elf.hptnr_lib.o
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/hptrr/Makefile b/sys/modules/hptrr/Makefile
new file mode 100644
index 000000000000..2a5f665cbd69
--- /dev/null
+++ b/sys/modules/hptrr/Makefile
@@ -0,0 +1,10 @@
+# $Id: Makefile.def,v 1.18 2007/03/22 11:20:15 gmm Exp $
+
+HPTRR= ${SRCTOP}/sys/dev/hptrr
+.PATH: ${HPTRR}
+KMOD = hptrr
+SRCS = opt_scsi.h opt_cam.h bus_if.h device_if.h pci_if.h os_bsd.h
+SRCS+= hptrr_os_bsd.c hptrr_osm_bsd.c hptrr_config.c
+BLOB_OBJS = ${HPTRR}/${MACHINE_CPUARCH}-elf.hptrr_lib.o
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/hwpmc/Makefile b/sys/modules/hwpmc/Makefile
new file mode 100644
index 000000000000..812e3fbf182c
--- /dev/null
+++ b/sys/modules/hwpmc/Makefile
@@ -0,0 +1,41 @@
+#
+#
+
+.PATH: ${SRCTOP}/sys/dev/hwpmc
+.PATH: ${SRCTOP}/sys/arm64/arm64
+
+KMOD= hwpmc
+
+SRCS= bus_if.h device_if.h hwpmc_mod.c hwpmc_logging.c hwpmc_soft.c
+SRCS+= vnode_if.h
+
+.if ${MACHINE_CPUARCH} == "aarch64"
+SRCS+= hwpmc_arm64.c hwpmc_arm64_md.c
+SRCS.DEV_ACPI= cmn600.c hwpmc_cmn600.c
+SRCS.DEV_ACPI+= hwpmc_dmc620.c pmu_dmc620.c
+.endif
+
+.if ${MACHINE_CPUARCH} == "amd64"
+SRCS+= hwpmc_amd.c hwpmc_core.c hwpmc_intel.c hwpmc_tsc.c
+SRCS+= hwpmc_x86.c hwpmc_uncore.c
+.endif
+
+.if ${MACHINE_CPUARCH} == "arm"
+SRCS+= hwpmc_arm.c
+.endif
+
+.if ${MACHINE_ARCH} == "armv7"
+SRCS+= hwpmc_armv7.c
+.endif
+
+.if ${MACHINE_CPUARCH} == "i386"
+SRCS+= hwpmc_amd.c hwpmc_core.c hwpmc_intel.c
+SRCS+= hwpmc_tsc.c hwpmc_x86.c hwpmc_uncore.c
+.endif
+
+.if ${MACHINE_CPUARCH} == "powerpc"
+SRCS+= hwpmc_powerpc.c hwpmc_e500.c hwpmc_mpc7xxx.c hwpmc_ppc970.c \
+ hwpmc_power8.c
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/hyperv/Makefile b/sys/modules/hyperv/Makefile
new file mode 100644
index 000000000000..4b9c179641de
--- /dev/null
+++ b/sys/modules/hyperv/Makefile
@@ -0,0 +1,4 @@
+
+SUBDIR = vmbus netvsc storvsc utilities hvsock hid
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/hyperv/hid/Makefile b/sys/modules/hyperv/hid/Makefile
new file mode 100644
index 000000000000..22c8c46490c7
--- /dev/null
+++ b/sys/modules/hyperv/hid/Makefile
@@ -0,0 +1,11 @@
+
+.PATH: ${SRCTOP}/sys/dev/hyperv/input
+
+KMOD= hv_hid
+SRCS= hv_hid.c
+SRCS+= bus_if.h device_if.h hid_if.h vmbus_if.h
+
+CFLAGS+= -I${SRCTOP}/sys/dev/hyperv/include \
+ -I${SRCTOP}/sys/dev/hyperv/vmbus
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/hyperv/hvsock/Makefile b/sys/modules/hyperv/hvsock/Makefile
new file mode 100644
index 000000000000..d00b8dd35dcb
--- /dev/null
+++ b/sys/modules/hyperv/hvsock/Makefile
@@ -0,0 +1,13 @@
+
+.PATH: ${SRCTOP}/sys/dev/hyperv/hvsock
+
+KMOD= hv_sock
+SRCS= hv_sock.c
+SRCS+= hv_sock.h
+SRCS+= device_if.h bus_if.h
+
+CFLAGS+= -I${SRCTOP}/sys/dev/hyperv/include \
+ -I${SRCTOP}/sys/dev/hyperv/vmbus \
+ -I${SRCTOP}/sys/dev/hyperv/hvsock
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/hyperv/netvsc/Makefile b/sys/modules/hyperv/netvsc/Makefile
new file mode 100644
index 000000000000..1dad0d7b6b6c
--- /dev/null
+++ b/sys/modules/hyperv/netvsc/Makefile
@@ -0,0 +1,12 @@
+
+.PATH: ${SRCTOP}/sys/dev/hyperv/netvsc \
+ ${SRCTOP}/sys/dev/hyperv/vmbus
+
+KMOD= hv_netvsc
+SRCS= hn_nvs.c hn_rndis.c if_hn.c
+SRCS+= bus_if.h device_if.h vmbus_if.h
+SRCS+= opt_hn.h opt_inet.h opt_inet6.h opt_rss.h
+
+CFLAGS+= -I${SRCTOP}/sys/dev/hyperv/netvsc
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/hyperv/pcib/Makefile b/sys/modules/hyperv/pcib/Makefile
new file mode 100644
index 000000000000..ae785de5e093
--- /dev/null
+++ b/sys/modules/hyperv/pcib/Makefile
@@ -0,0 +1,11 @@
+
+.PATH: ${SRCTOP}/sys/dev/hyperv/pcib \
+ ${SRCTOP}/sys/dev/hyperv/vmbus
+
+KMOD= vmbus_pcib
+SRCS= vmbus_pcib.c
+SRCS+= bus_if.h device_if.h pci_if.h pcib_if.h vmbus_if.h
+
+CFLAGS+= -I${SRCTOP}/sys/dev/hyperv/pcib
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/hyperv/storvsc/Makefile b/sys/modules/hyperv/storvsc/Makefile
new file mode 100644
index 000000000000..9802a8af02c9
--- /dev/null
+++ b/sys/modules/hyperv/storvsc/Makefile
@@ -0,0 +1,14 @@
+
+.PATH: ${SRCTOP}/sys/dev/hyperv/storvsc \
+ ${SRCTOP}/sys/dev/hyperv/vmbus \
+
+KMOD= hv_storvsc
+SRCS = hv_storvsc_drv_freebsd.c \
+ hv_vstorage.h
+SRCS+= bus_if.h device_if.h opt_cam.h vmbus_if.h
+
+CFLAGS+= -I${SRCTOP}/sys/dev/hyperv/include \
+ -I${SRCTOP}/sys/dev/hyperv/vmbus \
+ -I${SRCTOP}/sys/dev/hyperv/storvsc
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/hyperv/utilities/Makefile b/sys/modules/hyperv/utilities/Makefile
new file mode 100644
index 000000000000..353b59af9e5e
--- /dev/null
+++ b/sys/modules/hyperv/utilities/Makefile
@@ -0,0 +1,15 @@
+
+.PATH: ${SRCTOP}/sys/dev/hyperv/utilities
+
+KMOD= hv_utils
+SRCS= vmbus_ic.c
+SRCS+= hv_kvp.c
+SRCS+= vmbus_heartbeat.c
+SRCS+= vmbus_shutdown.c
+SRCS+= vmbus_timesync.c
+SRCS+= bus_if.h device_if.h vmbus_if.h
+
+CFLAGS+= -I${SRCTOP}/sys/dev/hyperv/include \
+ -I${SRCTOP}/sys/dev/hyperv/vmbus
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/hyperv/vmbus/Makefile b/sys/modules/hyperv/vmbus/Makefile
new file mode 100644
index 000000000000..1659d5186493
--- /dev/null
+++ b/sys/modules/hyperv/vmbus/Makefile
@@ -0,0 +1,44 @@
+
+.PATH: ${SRCTOP}/sys/dev/hyperv/vmbus \
+ ${SRCTOP}/sys/dev/hyperv/vmbus/${MACHINE_CPUARCH} \
+ ${SRCTOP}/sys/dev/hyperv/vmbus/x86
+
+KMOD= hv_vmbus
+SRCS= hyperv.c \
+ hyperv_busdma.c \
+ hyperv_machdep.c \
+ vmbus.c \
+ vmbus_br.c \
+ vmbus_chan.c \
+ vmbus_if.c \
+ vmbus_res.c \
+ vmbus_xact.c
+
+.if ${MACHINE_CPUARCH} != "i386" && ${MACHINE_CPUARCH} != "aarch64"
+SRCS+= vmbus_vector.S
+.endif
+.if ${MACHINE_CPUARCH} != "aarch64"
+SRCS+= vmbus_et.c hyperv_x86.c vmbus_x86.c
+.else
+SRC+= hyperv_aarch64.c vmbus_aarch64.c
+.endif
+SRCS+= acpi_if.h bus_if.h device_if.h opt_acpi.h pci_if.h pcib_if.h vmbus_if.h
+
+# XXX: for assym.inc
+SRCS+= opt_kstack_pages.h opt_nfs.h opt_hwpmc_hooks.h
+.if ${MACHINE_CPUARCH} == "i386"
+SRCS+= opt_apic.h
+.endif
+
+DPSRCS= assym.inc
+
+vmbus_vector.o:
+ ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \
+ ${.IMPSRC} -o ${.TARGET}
+
+CFLAGS+= -I${SRCTOP}/sys/dev/hyperv/include \
+ -I${SRCTOP}/sys/dev/hyperv/vmbus
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/Makefile b/sys/modules/i2c/Makefile
new file mode 100644
index 000000000000..6c976e9303f1
--- /dev/null
+++ b/sys/modules/i2c/Makefile
@@ -0,0 +1,43 @@
+
+SUBDIR = \
+ ads111x \
+ controllers \
+ cyapa \
+ ds1307 \
+ ds13rtc \
+ ds1672 \
+ ds3231 \
+ htu21 \
+ icee \
+ if_ic \
+ iic \
+ iicbb \
+ iicbus \
+ iicsmb \
+ isl \
+ isl12xx \
+ jedec_dimm \
+ max44009 \
+ mux \
+ nxprtc \
+ pcf8574 \
+ pcf8591 \
+ rtc8583 \
+ s35390a \
+ smb \
+ smbus \
+
+.if !empty(OPT_FDT)
+SUBDIR += hym8563 \
+ rv3032 \
+ rx8803 \
+ tca64xx \
+ tmp461
+.endif
+
+.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
+ ${MACHINE_CPUARCH} == "i386"
+SUBDIR += iichid
+.endif
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/i2c/Makefile.inc b/sys/modules/i2c/Makefile.inc
new file mode 100644
index 000000000000..d3b5cbd3a79b
--- /dev/null
+++ b/sys/modules/i2c/Makefile.inc
@@ -0,0 +1,2 @@
+
+.include "../Makefile.inc"
diff --git a/sys/modules/i2c/ads111x/Makefile b/sys/modules/i2c/ads111x/Makefile
new file mode 100644
index 000000000000..d02cb704146c
--- /dev/null
+++ b/sys/modules/i2c/ads111x/Makefile
@@ -0,0 +1,17 @@
+
+.PATH: ${SRCTOP}/sys/dev/iicbus/adc
+
+KMOD= ads111x
+SRCS= ads111x.c
+
+SRCS+= \
+ bus_if.h \
+ device_if.h \
+ iicbus_if.h \
+ opt_platform.h \
+
+.if !empty(OPT_FDT)
+SRCS+= ofw_bus_if.h
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/controllers/Makefile b/sys/modules/i2c/controllers/Makefile
new file mode 100644
index 000000000000..ce96c9d5ac8e
--- /dev/null
+++ b/sys/modules/i2c/controllers/Makefile
@@ -0,0 +1,11 @@
+
+SUBDIR = alpm amdpm amdsmb ichiic ichsmb intpm ismt nfsmb viapm lpbb pcf
+
+.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
+SUBDIR += imcsmb
+.endif
+.if ${MACHINE_CPUARCH} == "riscv"
+SUBDIR += iicoc
+.endif
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/i2c/controllers/Makefile.inc b/sys/modules/i2c/controllers/Makefile.inc
new file mode 100644
index 000000000000..d3b5cbd3a79b
--- /dev/null
+++ b/sys/modules/i2c/controllers/Makefile.inc
@@ -0,0 +1,2 @@
+
+.include "../Makefile.inc"
diff --git a/sys/modules/i2c/controllers/alpm/Makefile b/sys/modules/i2c/controllers/alpm/Makefile
new file mode 100644
index 000000000000..5c09fbf1db51
--- /dev/null
+++ b/sys/modules/i2c/controllers/alpm/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/alpm
+KMOD = alpm
+SRCS = device_if.h bus_if.h iicbus_if.h smbus_if.h pci_if.h \
+ alpm.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/controllers/amdpm/Makefile b/sys/modules/i2c/controllers/amdpm/Makefile
new file mode 100644
index 000000000000..d04ea542cd37
--- /dev/null
+++ b/sys/modules/i2c/controllers/amdpm/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/amdpm
+KMOD = amdpm
+SRCS = device_if.h bus_if.h pci_if.h smbus_if.h \
+ amdpm.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/controllers/amdsmb/Makefile b/sys/modules/i2c/controllers/amdsmb/Makefile
new file mode 100644
index 000000000000..2c3dd2a2e6b6
--- /dev/null
+++ b/sys/modules/i2c/controllers/amdsmb/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/amdsmb
+
+KMOD= amdsmb
+SRCS= amdsmb.c
+SRCS+= device_if.h smbus_if.h pci_if.h bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/controllers/ichiic/Makefile b/sys/modules/i2c/controllers/ichiic/Makefile
new file mode 100644
index 000000000000..02ea3694fc89
--- /dev/null
+++ b/sys/modules/i2c/controllers/ichiic/Makefile
@@ -0,0 +1,13 @@
+
+.PATH: ${SRCTOP}/sys/dev/ichiic
+KMOD = ig4
+SRCS = acpi_if.h device_if.h bus_if.h iicbus_if.h pci_if.h \
+ smbus_if.h ${ig4_acpi} ig4_iic.c ig4_pci.c ig4_reg.h \
+ ig4_var.h opt_acpi.h
+
+.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
+ ${MACHINE_CPUARCH} == "i386"
+ig4_acpi= ig4_acpi.c
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/controllers/ichsmb/Makefile b/sys/modules/i2c/controllers/ichsmb/Makefile
new file mode 100644
index 000000000000..3601f737628c
--- /dev/null
+++ b/sys/modules/i2c/controllers/ichsmb/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/ichsmb
+KMOD = ichsmb
+SRCS = device_if.h bus_if.h iicbb_if.h pci_if.h smbus_if.h \
+ ichsmb.c ichsmb_pci.c ichsmb_reg.h ichsmb_var.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/controllers/iicoc/Makefile b/sys/modules/i2c/controllers/iicoc/Makefile
new file mode 100644
index 000000000000..f86a6513ad22
--- /dev/null
+++ b/sys/modules/i2c/controllers/iicoc/Makefile
@@ -0,0 +1,7 @@
+.PATH: ${SRCTOP}/sys/dev/iicbus/controller/opencores
+
+KMOD = iicoc
+SRCS = device_if.h bus_if.h iicbus_if.h \
+ iicoc.c iicoc_fdt.c iicoc_pci.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/controllers/imcsmb/Makefile b/sys/modules/i2c/controllers/imcsmb/Makefile
new file mode 100644
index 000000000000..25fa1965f463
--- /dev/null
+++ b/sys/modules/i2c/controllers/imcsmb/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/imcsmb
+KMOD = imcsmb
+SRCS = device_if.h bus_if.h pci_if.h smbus_if.h \
+ imcsmb.c imcsmb_pci.c imcsmb_reg.h imcsmb_var.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/controllers/intpm/Makefile b/sys/modules/i2c/controllers/intpm/Makefile
new file mode 100644
index 000000000000..294f7e05ecdd
--- /dev/null
+++ b/sys/modules/i2c/controllers/intpm/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/intpm
+KMOD = intpm
+SRCS = device_if.h bus_if.h iicbus_if.h smbus_if.h pci_if.h \
+ opt_intpm.h intpmreg.h intpm.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/controllers/ismt/Makefile b/sys/modules/i2c/controllers/ismt/Makefile
new file mode 100644
index 000000000000..ac00cfad17bc
--- /dev/null
+++ b/sys/modules/i2c/controllers/ismt/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/ismt
+KMOD = ismt
+SRCS = device_if.h bus_if.h iicbb_if.h pci_if.h smbus_if.h \
+ ismt.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/controllers/lpbb/Makefile b/sys/modules/i2c/controllers/lpbb/Makefile
new file mode 100644
index 000000000000..20f39f4b5ad2
--- /dev/null
+++ b/sys/modules/i2c/controllers/lpbb/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/ppbus
+KMOD = lpbb
+SRCS = device_if.h bus_if.h iicbb_if.h ppbus_if.h \
+ lpbb.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/controllers/nfsmb/Makefile b/sys/modules/i2c/controllers/nfsmb/Makefile
new file mode 100644
index 000000000000..5ad838650224
--- /dev/null
+++ b/sys/modules/i2c/controllers/nfsmb/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/nfsmb
+
+KMOD= nfsmb
+SRCS= nfsmb.c
+SRCS+= device_if.h smbus_if.h pci_if.h bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/controllers/pcf/Makefile b/sys/modules/i2c/controllers/pcf/Makefile
new file mode 100644
index 000000000000..fc42100b8cfd
--- /dev/null
+++ b/sys/modules/i2c/controllers/pcf/Makefile
@@ -0,0 +1,13 @@
+
+.PATH: ${SRCTOP}/sys/dev/pcf
+
+KMOD= pcf
+SRCS= pcf.c ${pcf_isa}
+SRCS+= bus_if.h device_if.h iicbus_if.h ${isa_if}
+
+.if ${MACHINE_CPUARCH} == "i386"
+isa_if= isa_if.h
+pcf_isa= pcf_isa.c
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/controllers/viapm/Makefile b/sys/modules/i2c/controllers/viapm/Makefile
new file mode 100644
index 000000000000..9a6c5bda1c16
--- /dev/null
+++ b/sys/modules/i2c/controllers/viapm/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/viapm
+KMOD = viapm
+SRCS = device_if.h bus_if.h iicbb_if.h isa_if.h pci_if.h smbus_if.h \
+ opt_isa.h viapm.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/cyapa/Makefile b/sys/modules/i2c/cyapa/Makefile
new file mode 100644
index 000000000000..f69e270f855c
--- /dev/null
+++ b/sys/modules/i2c/cyapa/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/cyapa
+KMOD = cyapa
+SRCS = cyapa.c device_if.h bus_if.h iicbus_if.h vnode_if.h \
+ opt_evdev.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/ds1307/Makefile b/sys/modules/i2c/ds1307/Makefile
new file mode 100644
index 000000000000..363aa412cbdc
--- /dev/null
+++ b/sys/modules/i2c/ds1307/Makefile
@@ -0,0 +1,6 @@
+
+.PATH: ${SRCTOP}/sys/dev/iicbus/rtc
+KMOD = ds1307
+SRCS = ds1307.c bus_if.h clock_if.h device_if.h iicbus_if.h ofw_bus_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/ds13rtc/Makefile b/sys/modules/i2c/ds13rtc/Makefile
new file mode 100644
index 000000000000..a9616765b7a5
--- /dev/null
+++ b/sys/modules/i2c/ds13rtc/Makefile
@@ -0,0 +1,6 @@
+
+.PATH: ${SRCTOP}/sys/dev/iicbus/rtc
+KMOD = ds13rtc
+SRCS = ds13rtc.c bus_if.h clock_if.h device_if.h iicbus_if.h ofw_bus_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/ds1672/Makefile b/sys/modules/i2c/ds1672/Makefile
new file mode 100644
index 000000000000..c160e317c36d
--- /dev/null
+++ b/sys/modules/i2c/ds1672/Makefile
@@ -0,0 +1,18 @@
+
+.PATH: ${SRCTOP}/sys/dev/iicbus/rtc
+KMOD = ds1672
+SRCS = ds1672.c
+
+# Generated files...
+SRCS+= \
+ bus_if.h \
+ clock_if.h \
+ device_if.h \
+ iicbus_if.h \
+ opt_platform.h \
+
+.if !empty(OPT_FDT)
+SRCS+= ofw_bus_if.h
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/ds3231/Makefile b/sys/modules/i2c/ds3231/Makefile
new file mode 100644
index 000000000000..4c6a7241bf76
--- /dev/null
+++ b/sys/modules/i2c/ds3231/Makefile
@@ -0,0 +1,6 @@
+
+.PATH: ${SRCTOP}/sys/dev/iicbus/rtc
+KMOD = ds3231
+SRCS = ds3231.c bus_if.h clock_if.h device_if.h iicbus_if.h ofw_bus_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/htu21/Makefile b/sys/modules/i2c/htu21/Makefile
new file mode 100644
index 000000000000..e049139c20cf
--- /dev/null
+++ b/sys/modules/i2c/htu21/Makefile
@@ -0,0 +1,16 @@
+
+.PATH: ${SRCTOP}/sys/dev/iicbus/sensor
+KMOD= htu21
+SRCS= htu21.c
+
+SRCS+= \
+ bus_if.h \
+ device_if.h \
+ iicbus_if.h \
+ opt_platform.h
+
+.if !empty(OPT_FDT)
+SRCS+= ofw_bus_if.h
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/hym8563/Makefile b/sys/modules/i2c/hym8563/Makefile
new file mode 100644
index 000000000000..e64190887610
--- /dev/null
+++ b/sys/modules/i2c/hym8563/Makefile
@@ -0,0 +1,13 @@
+
+.PATH: ${SRCTOP}/sys/dev/iicbus/rtc
+KMOD= hym8563
+SRCS= hym8563.c
+
+SRCS+= bus_if.h \
+ clock_if.h \
+ device_if.h \
+ iicbus_if.h \
+ opt_platform.h \
+ ofw_bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/icee/Makefile b/sys/modules/i2c/icee/Makefile
new file mode 100644
index 000000000000..b66bb5a5f8c4
--- /dev/null
+++ b/sys/modules/i2c/icee/Makefile
@@ -0,0 +1,13 @@
+
+.PATH: ${SRCTOP}/sys/dev/iicbus
+KMOD= icee
+SRCS= icee.c
+
+SRCS+= \
+ bus_if.h \
+ device_if.h \
+ iicbus_if.h \
+ ofw_bus_if.h \
+ opt_platform.h \
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/if_ic/Makefile b/sys/modules/i2c/if_ic/Makefile
new file mode 100644
index 000000000000..4fac1ac0fef9
--- /dev/null
+++ b/sys/modules/i2c/if_ic/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/iicbus
+KMOD = if_ic
+SRCS = device_if.h bus_if.h iicbus_if.h \
+ if_ic.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/iic/Makefile b/sys/modules/i2c/iic/Makefile
new file mode 100644
index 000000000000..34ca739a06a8
--- /dev/null
+++ b/sys/modules/i2c/iic/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/iicbus
+KMOD = iic
+SRCS = device_if.h bus_if.h iicbus_if.h \
+ iic.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/iicbb/Makefile b/sys/modules/i2c/iicbb/Makefile
new file mode 100644
index 000000000000..e0b7e4049de0
--- /dev/null
+++ b/sys/modules/i2c/iicbb/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/iicbus
+KMOD = iicbb
+SRCS = device_if.h bus_if.h iicbus_if.h \
+ iicbb_if.h iicbb_if.c iicbb.c ofw_bus_if.h opt_platform.h
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/iicbus/Makefile b/sys/modules/i2c/iicbus/Makefile
new file mode 100644
index 000000000000..11df1b902e7e
--- /dev/null
+++ b/sys/modules/i2c/iicbus/Makefile
@@ -0,0 +1,28 @@
+
+.PATH: ${SRCTOP}/sys/dev/iicbus
+
+KMOD= iicbus
+SRCS= \
+ bus_if.h \
+ device_if.h \
+ iic_recover_bus.c \
+ iicbus.c \
+ iicbus.h \
+ iicbus_if.c \
+ iicbus_if.h \
+ iiconf.c \
+ iiconf.h \
+ opt_platform.h \
+
+.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
+ ${MACHINE_CPUARCH} == "i386"
+SRCS+= acpi_iicbus.c opt_acpi.h acpi_if.h
+.endif
+
+.if !empty(OPT_FDT)
+SRCS+= ofw_iicbus.c ofw_iicbus_if.h ofw_bus_if.h
+.endif
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/iichid/Makefile b/sys/modules/i2c/iichid/Makefile
new file mode 100644
index 000000000000..96c0257ca89d
--- /dev/null
+++ b/sys/modules/i2c/iichid/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/iicbus
+KMOD = iichid
+SRCS = iichid.c
+SRCS += acpi_if.h bus_if.h device_if.h hid_if.h iicbus_if.h
+SRCS += opt_acpi.h opt_hid.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/iicsmb/Makefile b/sys/modules/i2c/iicsmb/Makefile
new file mode 100644
index 000000000000..ca70677c453d
--- /dev/null
+++ b/sys/modules/i2c/iicsmb/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/iicbus
+KMOD = iicsmb
+SRCS = device_if.h bus_if.h iicbus_if.h \
+ smbus_if.h iicsmb.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/isl/Makefile b/sys/modules/i2c/isl/Makefile
new file mode 100644
index 000000000000..320f6ed6704e
--- /dev/null
+++ b/sys/modules/i2c/isl/Makefile
@@ -0,0 +1,6 @@
+
+.PATH: ${SRCTOP}/sys/dev/isl
+KMOD = isl
+SRCS = isl.c device_if.h bus_if.h iicbus_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/isl12xx/Makefile b/sys/modules/i2c/isl12xx/Makefile
new file mode 100644
index 000000000000..be0b409eeff2
--- /dev/null
+++ b/sys/modules/i2c/isl12xx/Makefile
@@ -0,0 +1,6 @@
+
+.PATH: ${SRCTOP}/sys/dev/iicbus/rtc
+KMOD = isl12xx
+SRCS = isl12xx.c bus_if.h clock_if.h device_if.h iicbus_if.h ofw_bus_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/jedec_dimm/Makefile b/sys/modules/i2c/jedec_dimm/Makefile
new file mode 100644
index 000000000000..15d4034aec91
--- /dev/null
+++ b/sys/modules/i2c/jedec_dimm/Makefile
@@ -0,0 +1,6 @@
+
+.PATH: ${.CURDIR}/../../../dev/jedec_dimm
+KMOD = jedec_dimm
+SRCS = jedec_dimm.c jedec_dimm.h bus_if.h device_if.h smbus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/max44009/Makefile b/sys/modules/i2c/max44009/Makefile
new file mode 100644
index 000000000000..c4342b5819aa
--- /dev/null
+++ b/sys/modules/i2c/max44009/Makefile
@@ -0,0 +1,16 @@
+
+.PATH: ${SRCTOP}/sys/dev/iicbus/sensor
+KMOD= max44009
+SRCS= max44009.c
+
+SRCS+= \
+ bus_if.h \
+ device_if.h \
+ iicbus_if.h \
+ opt_platform.h
+
+.if !empty(OPT_FDT)
+SRCS+= ofw_bus_if.h
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/mux/Makefile b/sys/modules/i2c/mux/Makefile
new file mode 100644
index 000000000000..e197793e5d86
--- /dev/null
+++ b/sys/modules/i2c/mux/Makefile
@@ -0,0 +1,11 @@
+
+SUBDIR = \
+ iicmux \
+ ltc430x \
+ pca954x \
+
+.if !empty(OPT_FDT)
+SUBDIR+= iic_gpiomux
+.endif
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/i2c/mux/iic_gpiomux/Makefile b/sys/modules/i2c/mux/iic_gpiomux/Makefile
new file mode 100644
index 000000000000..7c26dd89e20e
--- /dev/null
+++ b/sys/modules/i2c/mux/iic_gpiomux/Makefile
@@ -0,0 +1,19 @@
+
+.PATH: ${SRCTOP}/sys/dev/iicbus/mux
+
+KMOD= iic_gpiomux
+SRCS= iic_gpiomux.c
+
+SRCS+= \
+ bus_if.h \
+ device_if.h \
+ gpio_if.h \
+ iicbus_if.h \
+ iicmux_if.h \
+ opt_platform.h \
+
+.if !empty(OPT_FDT)
+SRCS+= ofw_bus_if.h
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/mux/iicmux/Makefile b/sys/modules/i2c/mux/iicmux/Makefile
new file mode 100644
index 000000000000..b8bbad587bcd
--- /dev/null
+++ b/sys/modules/i2c/mux/iicmux/Makefile
@@ -0,0 +1,20 @@
+
+.PATH: ${SRCTOP}/sys/dev/iicbus/mux
+
+KMOD= iicmux
+SRCS= iicmux.c iicmux_if.c
+
+SRCS+= \
+ bus_if.h \
+ device_if.h \
+ iicbus_if.h \
+ iicmux_if.h \
+ opt_platform.h \
+
+.if !empty(OPT_FDT)
+SRCS+= ofw_bus_if.h
+.endif
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/mux/ltc430x/Makefile b/sys/modules/i2c/mux/ltc430x/Makefile
new file mode 100644
index 000000000000..3fd5838d5ad4
--- /dev/null
+++ b/sys/modules/i2c/mux/ltc430x/Makefile
@@ -0,0 +1,19 @@
+
+.PATH: ${SRCTOP}/sys/dev/iicbus/mux
+
+KMOD= ltc430x
+SRCS= ltc430x.c
+
+SRCS+= \
+ bus_if.h \
+ device_if.h \
+ iicbus_if.h \
+ iicmux_if.h \
+ opt_platform.h \
+
+.if !empty(OPT_FDT)
+SRCS+= ofw_bus_if.h
+.endif
+
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/mux/pca954x/Makefile b/sys/modules/i2c/mux/pca954x/Makefile
new file mode 100644
index 000000000000..b70802b43bcc
--- /dev/null
+++ b/sys/modules/i2c/mux/pca954x/Makefile
@@ -0,0 +1,19 @@
+
+.PATH: ${SRCTOP}/sys/dev/iicbus/mux
+
+KMOD= pca954x
+SRCS= pca954x.c
+
+SRCS+= \
+ bus_if.h \
+ device_if.h \
+ iicbus_if.h \
+ iicmux_if.h \
+ opt_platform.h \
+
+.if !empty(OPT_FDT)
+SRCS+= ofw_bus_if.h
+.endif
+
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/nxprtc/Makefile b/sys/modules/i2c/nxprtc/Makefile
new file mode 100644
index 000000000000..3501909f6ea4
--- /dev/null
+++ b/sys/modules/i2c/nxprtc/Makefile
@@ -0,0 +1,6 @@
+
+.PATH: ${SRCTOP}/sys/dev/iicbus/rtc
+KMOD = nxprtc
+SRCS = nxprtc.c bus_if.h clock_if.h device_if.h iicbus_if.h ofw_bus_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/pcf8574/Makefile b/sys/modules/i2c/pcf8574/Makefile
new file mode 100644
index 000000000000..53290fb8cce3
--- /dev/null
+++ b/sys/modules/i2c/pcf8574/Makefile
@@ -0,0 +1,17 @@
+
+.PATH: ${SRCTOP}/sys/dev/iicbus/gpio/
+KMOD = pcf8574
+SRCS = pcf8574.c
+
+SRCS+= \
+ bus_if.h \
+ device_if.h \
+ gpio_if.h \
+ iicbus_if.h \
+ opt_platform.h \
+
+.if !empty(OPT_FDT)
+SRCS+= ofw_bus_if.h
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/pcf8591/Makefile b/sys/modules/i2c/pcf8591/Makefile
new file mode 100644
index 000000000000..8f17f3dc3ae1
--- /dev/null
+++ b/sys/modules/i2c/pcf8591/Makefile
@@ -0,0 +1,16 @@
+
+.PATH: ${SRCTOP}/sys/dev/iicbus/adc
+KMOD= pcf8591
+SRCS= pcf8591.c
+
+SRCS+= \
+ bus_if.h \
+ device_if.h \
+ iicbus_if.h \
+ opt_platform.h
+
+.if !empty(OPT_FDT)
+SRCS+= ofw_bus_if.h
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/rtc8583/Makefile b/sys/modules/i2c/rtc8583/Makefile
new file mode 100644
index 000000000000..a474da20685e
--- /dev/null
+++ b/sys/modules/i2c/rtc8583/Makefile
@@ -0,0 +1,18 @@
+
+.PATH: ${SRCTOP}/sys/dev/iicbus/rtc
+KMOD = rtc8583
+SRCS = rtc8583.c
+
+# Generated files...
+SRCS+= \
+ bus_if.h \
+ clock_if.h \
+ device_if.h \
+ iicbus_if.h \
+ opt_platform.h \
+
+.if !empty(OPT_FDT)
+SRCS+= ofw_bus_if.h
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/rv3032/Makefile b/sys/modules/i2c/rv3032/Makefile
new file mode 100644
index 000000000000..7d3f8ac47aa6
--- /dev/null
+++ b/sys/modules/i2c/rv3032/Makefile
@@ -0,0 +1,13 @@
+
+.PATH: ${SRCTOP}/sys/dev/iicbus/rtc
+KMOD= rv3032
+SRCS= rv3032.c
+
+SRCS+= bus_if.h \
+ clock_if.h \
+ device_if.h \
+ iicbus_if.h \
+ opt_platform.h \
+ ofw_bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/rx8803/Makefile b/sys/modules/i2c/rx8803/Makefile
new file mode 100644
index 000000000000..a2b30582cabb
--- /dev/null
+++ b/sys/modules/i2c/rx8803/Makefile
@@ -0,0 +1,15 @@
+
+.PATH: ${SRCTOP}/sys/dev/iicbus/rtc/
+KMOD = rx8803
+SRCS = rx8803.c
+
+# Generated files...
+SRCS+= \
+ bus_if.h \
+ clock_if.h \
+ device_if.h \
+ iicbus_if.h \
+ opt_platform.h \
+ ofw_bus_if.h \
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/s35390a/Makefile b/sys/modules/i2c/s35390a/Makefile
new file mode 100644
index 000000000000..e12ddeece2ec
--- /dev/null
+++ b/sys/modules/i2c/s35390a/Makefile
@@ -0,0 +1,6 @@
+
+.PATH: ${SRCTOP}/sys/dev/iicbus/rtc
+KMOD = s35390a
+SRCS = s35390a.c bus_if.h clock_if.h device_if.h iicbus_if.h ofw_bus_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/smb/Makefile b/sys/modules/i2c/smb/Makefile
new file mode 100644
index 000000000000..99cf77514267
--- /dev/null
+++ b/sys/modules/i2c/smb/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/smbus
+KMOD = smb
+SRCS = device_if.h bus_if.h smbus_if.h \
+ smb.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/smbus/Makefile b/sys/modules/i2c/smbus/Makefile
new file mode 100644
index 000000000000..530d576ba805
--- /dev/null
+++ b/sys/modules/i2c/smbus/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/smbus
+KMOD = smbus
+SRCS = device_if.h bus_if.h smbus_if.h smbus_if.c \
+ smbconf.h smbconf.c smbus.h smbus.c
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/tca6416/Makefile b/sys/modules/i2c/tca6416/Makefile
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/sys/modules/i2c/tca6416/Makefile
diff --git a/sys/modules/i2c/tca64xx/Makefile b/sys/modules/i2c/tca64xx/Makefile
new file mode 100644
index 000000000000..68162234de36
--- /dev/null
+++ b/sys/modules/i2c/tca64xx/Makefile
@@ -0,0 +1,5 @@
+.PATH: ${SRCTOP}/sys/dev/iicbus/gpio/
+KMOD = tca64xx
+SRCS = tca64xx.c opt_platform.h gpio_if.h device_if.h bus_if.h ofw_bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/i2c/tmp461/Makefile b/sys/modules/i2c/tmp461/Makefile
new file mode 100644
index 000000000000..9c4d6518d596
--- /dev/null
+++ b/sys/modules/i2c/tmp461/Makefile
@@ -0,0 +1,6 @@
+
+.PATH: ${SRCTOP}/sys/dev/iicbus/sensor
+KMOD = tmp461
+SRCS = tmp461.c bus_if.h device_if.h iicbus_if.h ofw_bus_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iavf/Makefile b/sys/modules/iavf/Makefile
new file mode 100644
index 000000000000..d572c79d544a
--- /dev/null
+++ b/sys/modules/iavf/Makefile
@@ -0,0 +1,20 @@
+
+.PATH: ${SRCTOP}/sys/dev/iavf
+
+KMOD = if_iavf
+SRCS = device_if.h bus_if.h pci_if.h ifdi_if.h
+SRCS += opt_inet.h opt_inet6.h opt_rss.h opt_iflib.h
+SRCS += if_iavf_iflib.c iavf_lib.c iavf_osdep.c iavf_txrx_iflib.c
+SRCS += iavf_vc_common.c iavf_vc_iflib.c
+
+# Shared source
+SRCS += iavf_adminq.c iavf_common.c
+
+# Debug messages / sysctls
+# CFLAGS += -DIAVF_DEBUG
+# Enable asserts and other debugging facilities
+# CFLAGS += -DINVARIANTS -DINVARIANTS_SUPPORT -DWITNESS
+
+SYMLINKS= ${KMOD}.ko ${KMODDIR}/if_ixlv.ko
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ibcore/Makefile b/sys/modules/ibcore/Makefile
new file mode 100644
index 000000000000..3846a176b226
--- /dev/null
+++ b/sys/modules/ibcore/Makefile
@@ -0,0 +1,59 @@
+.PATH: ${SRCTOP}/sys/ofed/drivers/infiniband/core
+
+KMOD= ibcore
+SRCS= \
+ ib_addr.c \
+ ib_agent.c \
+ ib_cache.c \
+ ib_cm.c \
+ ib_cma.c \
+ ib_core_uverbs.c \
+ ib_cq.c \
+ ib_device.c \
+ ib_fmr_pool.c \
+ ib_iwcm.c \
+ ib_iwpm_msg.c \
+ ib_iwpm_util.c \
+ ib_mad.c \
+ ib_mad_rmpp.c \
+ ib_multicast.c \
+ ib_packer.c \
+ ib_rdma_core.c \
+ ib_roce_gid_mgmt.c \
+ ib_sa_query.c \
+ ib_smi.c \
+ ib_sysfs.c \
+ ib_ucm.c \
+ ib_ucma.c \
+ ib_ud_header.c \
+ ib_umem.c \
+ ib_user_mad.c \
+ ib_uverbs_cmd.c \
+ ib_uverbs_ioctl.c \
+ ib_uverbs_main.c \
+ ib_uverbs_marshall.c \
+ ib_uverbs_std_types.c \
+ ib_uverbs_std_types_async_fd.c \
+ ib_uverbs_std_types_counters.c \
+ ib_uverbs_std_types_cq.c \
+ ib_uverbs_std_types_device.c \
+ ib_uverbs_std_types_dm.c \
+ ib_uverbs_std_types_flow_action.c \
+ ib_uverbs_std_types_mr.c \
+ ib_uverbs_uapi.c \
+ ib_verbs.c
+
+SRCS+= ${LINUXKPI_GENSRCS}
+SRCS+= opt_inet.h opt_inet6.h
+
+CFLAGS+= -I${SRCTOP}/sys/ofed/include
+CFLAGS+= -I${SRCTOP}/sys/ofed/include/uapi
+CFLAGS+= ${LINUXKPI_INCLUDES}
+CFLAGS+= -DINET6 -DINET -DCONFIG_INFINIBAND_USER_MEM
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
+
+CWARNFLAGS+= -Wno-cast-qual -Wno-pointer-arith
+CWARNFLAGS+= ${NO_WUNUSED_BUT_SET_VARIABLE}
diff --git a/sys/modules/ice/Makefile b/sys/modules/ice/Makefile
new file mode 100644
index 000000000000..54f824894164
--- /dev/null
+++ b/sys/modules/ice/Makefile
@@ -0,0 +1,28 @@
+
+.PATH: ${SRCTOP}/sys/dev/ice
+
+KMOD = if_ice
+
+# Interface headers
+SRCS = device_if.h bus_if.h pci_if.h ifdi_if.h
+SRCS += irdma_di_if.h irdma_if.h
+
+# Option headers
+SRCS += opt_inet.h opt_inet6.h opt_rss.h opt_iflib.h
+
+# Core source
+SRCS += ice_lib.c ice_osdep.c ice_resmgr.c ice_strings.c
+SRCS += ice_iflib_recovery_txrx.c ice_iflib_txrx.c if_ice_iflib.c
+SRCS += ice_fw_logging.c ice_ddp_common.c
+
+# RDMA Client interface
+# TODO: Is this the right way to compile this?
+SRCS += ice_rdma.c irdma_di_if.c irdma_if.c
+CFLAGS.irdma_di_if.c += -I${SRCTOP}/sys/dev/ice
+CFLAGS.irdma_if.c += -I${SRCTOP}/sys/dev/ice
+
+# Shared source
+SRCS += ice_common.c ice_controlq.c ice_dcb.c ice_flex_pipe.c ice_flow.c
+SRCS += ice_nvm.c ice_sched.c ice_switch.c ice_vlan_mode.c ice_fwlog.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ice_ddp/Makefile b/sys/modules/ice_ddp/Makefile
new file mode 100644
index 000000000000..ad85bc2a9935
--- /dev/null
+++ b/sys/modules/ice_ddp/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= ice_ddp
+FIRMWS= ${SRCTOP}/sys/contrib/dev/ice/ice-1.3.35.0.pkg:ice_ddp:0x01032300
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ichwd/Makefile b/sys/modules/ichwd/Makefile
new file mode 100644
index 000000000000..5a136c180f2a
--- /dev/null
+++ b/sys/modules/ichwd/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/ichwd
+
+KMOD= ichwd
+SRCS= ichwd.c device_if.h bus_if.h pci_if.h isa_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ida/Makefile b/sys/modules/ida/Makefile
new file mode 100644
index 000000000000..4e67e16a10b8
--- /dev/null
+++ b/sys/modules/ida/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ida
+
+KMOD= ida
+SRCS= ida.c ida_disk.c ida_pci.c \
+ device_if.h bus_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/if_bridge/Makefile b/sys/modules/if_bridge/Makefile
new file mode 100644
index 000000000000..0835d1a383a8
--- /dev/null
+++ b/sys/modules/if_bridge/Makefile
@@ -0,0 +1,6 @@
+
+.PATH: ${SRCTOP}/sys/net
+KMOD= if_bridge
+SRCS= if_bridge.c opt_inet.h opt_inet6.h opt_carp.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/if_cgem/Makefile b/sys/modules/if_cgem/Makefile
new file mode 100644
index 000000000000..d1b792e8c720
--- /dev/null
+++ b/sys/modules/if_cgem/Makefile
@@ -0,0 +1,7 @@
+.PATH: ${SRCTOP}/sys/dev/cadence
+
+KMOD= if_cgem
+SRCS= if_cgem.c
+SRCS+= bus_if.h device_if.h miibus_if.h ofw_bus_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/if_disc/Makefile b/sys/modules/if_disc/Makefile
new file mode 100644
index 000000000000..53b9ab146dad
--- /dev/null
+++ b/sys/modules/if_disc/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/net
+
+KMOD= if_disc
+SRCS= if_disc.c opt_inet.h opt_inet6.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/if_edsc/Makefile b/sys/modules/if_edsc/Makefile
new file mode 100644
index 000000000000..5a72f3951d86
--- /dev/null
+++ b/sys/modules/if_edsc/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/net
+
+KMOD= if_edsc
+SRCS= if_edsc.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/if_enc/Makefile b/sys/modules/if_enc/Makefile
new file mode 100644
index 000000000000..be57d3114d31
--- /dev/null
+++ b/sys/modules/if_enc/Makefile
@@ -0,0 +1,10 @@
+
+SYSDIR?=${SRCTOP}/sys
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+.PATH: ${SYSDIR}/net
+
+KMOD= if_enc
+SRCS= if_enc.c opt_inet.h opt_inet6.h opt_ipsec.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/if_epair/Makefile b/sys/modules/if_epair/Makefile
new file mode 100644
index 000000000000..bb4be21c7126
--- /dev/null
+++ b/sys/modules/if_epair/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/net
+
+KMOD= if_epair
+SRCS= bus_if.h device_if.h if_epair.c opt_rss.h opt_inet.h opt_inet6.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/if_gif/Makefile b/sys/modules/if_gif/Makefile
new file mode 100644
index 000000000000..fb13f7af32f4
--- /dev/null
+++ b/sys/modules/if_gif/Makefile
@@ -0,0 +1,14 @@
+
+SYSDIR?=${SRCTOP}/sys
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+.PATH: ${SYSDIR}/net ${SYSDIR}/netinet ${SYSDIR}/netinet6
+
+KMOD= if_gif
+SRCS= if_gif.c opt_inet.h opt_inet6.h
+SRCS.INET=in_gif.c
+SRCS.INET6=in6_gif.c
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/if_gre/Makefile b/sys/modules/if_gre/Makefile
new file mode 100644
index 000000000000..44643e5f0979
--- /dev/null
+++ b/sys/modules/if_gre/Makefile
@@ -0,0 +1,11 @@
+
+SYSDIR?=${SRCTOP}/sys
+.PATH: ${SYSDIR}/net ${SYSDIR}/netinet ${SYSDIR}/netinet6
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+KMOD= if_gre
+SRCS= if_gre.c opt_inet.h opt_inet6.h opt_rss.h
+SRCS.INET= ip_gre.c
+SRCS.INET6= ip6_gre.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/if_infiniband/Makefile b/sys/modules/if_infiniband/Makefile
new file mode 100644
index 000000000000..ac191c143292
--- /dev/null
+++ b/sys/modules/if_infiniband/Makefile
@@ -0,0 +1,11 @@
+
+.PATH: ${SRCTOP}/sys/net
+
+KMOD= if_infiniband
+SRCS= if_infiniband.c \
+ opt_inet.h \
+ opt_inet6.h
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/if_lagg/Makefile b/sys/modules/if_lagg/Makefile
new file mode 100644
index 000000000000..7952fa836a8e
--- /dev/null
+++ b/sys/modules/if_lagg/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/net
+KMOD= if_lagg
+SRCS= if_lagg.c ieee8023ad_lacp.c opt_inet.h opt_inet6.h opt_kern_tls.h
+SRCS+= opt_ratelimit.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/if_me/Makefile b/sys/modules/if_me/Makefile
new file mode 100644
index 000000000000..c9b045cf7341
--- /dev/null
+++ b/sys/modules/if_me/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/net
+
+KMOD= if_me
+SRCS= if_me.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/if_ovpn/Makefile b/sys/modules/if_ovpn/Makefile
new file mode 100644
index 000000000000..976ff7369c5a
--- /dev/null
+++ b/sys/modules/if_ovpn/Makefile
@@ -0,0 +1,6 @@
+.PATH: ${SRCTOP}/sys/net
+
+KMOD= if_ovpn
+SRCS= if_ovpn.c opt_inet.h opt_inet6.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/if_stf/Makefile b/sys/modules/if_stf/Makefile
new file mode 100644
index 000000000000..6cac98219a47
--- /dev/null
+++ b/sys/modules/if_stf/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/net
+
+KMOD= if_stf
+SRCS= if_stf.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/if_tuntap/Makefile b/sys/modules/if_tuntap/Makefile
new file mode 100644
index 000000000000..22ca9a144c1d
--- /dev/null
+++ b/sys/modules/if_tuntap/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/net
+
+KMOD= if_tuntap
+SRCS= if_tuntap.c opt_inet.h opt_inet6.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/if_vlan/Makefile b/sys/modules/if_vlan/Makefile
new file mode 100644
index 000000000000..a9eb44e25278
--- /dev/null
+++ b/sys/modules/if_vlan/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/net
+
+KMOD= if_vlan
+SRCS= if_vlan.c
+SRCS+= opt_inet.h opt_inet6.h opt_kern_tls.h opt_vlan.h opt_ratelimit.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/if_vxlan/Makefile b/sys/modules/if_vxlan/Makefile
new file mode 100644
index 000000000000..60d38d4d1855
--- /dev/null
+++ b/sys/modules/if_vxlan/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/net
+
+KMOD= if_vxlan
+SRCS= if_vxlan.c
+SRCS+= opt_inet.h opt_inet6.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/if_wg/Makefile b/sys/modules/if_wg/Makefile
new file mode 100644
index 000000000000..b47a87472116
--- /dev/null
+++ b/sys/modules/if_wg/Makefile
@@ -0,0 +1,10 @@
+.PATH: ${SRCTOP}/sys/dev/wg
+
+KMOD= if_wg
+
+SRCS= if_wg.c wg_cookie.c wg_crypto.c wg_noise.c
+SRCS+= opt_inet.h opt_inet6.h device_if.h bus_if.h
+
+.include <bsd.kmod.mk>
+
+CFLAGS+= -include ${SRCTOP}/sys/dev/wg/compat.h
diff --git a/sys/modules/iflib/Makefile b/sys/modules/iflib/Makefile
new file mode 100644
index 000000000000..5d30b5fdad91
--- /dev/null
+++ b/sys/modules/iflib/Makefile
@@ -0,0 +1,14 @@
+
+.PATH: ${SRCTOP}/sys/net
+
+KMOD= iflib
+SRCS= \
+ iflib.c \
+ mp_ring.c
+SRCS+= ifdi_if.c
+SRCS+= device_if.h bus_if.h pci_if.h pci_iov_if.h ifdi_if.h
+SRCS+= opt_acpi.h opt_inet.h opt_inet6.h opt_sched.h
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/igc/Makefile b/sys/modules/igc/Makefile
new file mode 100644
index 000000000000..54cdbee3242e
--- /dev/null
+++ b/sys/modules/igc/Makefile
@@ -0,0 +1,10 @@
+
+.PATH: ${SRCTOP}/sys/dev/igc
+
+KMOD = if_igc
+SRCS = device_if.h bus_if.h pci_if.h ifdi_if.h
+SRCS += opt_ddb.h opt_inet.h opt_inet6.h opt_rss.h
+SRCS += if_igc.c igc_api.c igc_base.c igc_i225.c igc_mac.c igc_nvm.c
+SRCS += igc_phy.c igc_txrx.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/imgact_binmisc/Makefile b/sys/modules/imgact_binmisc/Makefile
new file mode 100644
index 000000000000..a77f79dfeaa9
--- /dev/null
+++ b/sys/modules/imgact_binmisc/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/kern
+
+KMOD= imgact_binmisc
+SRCS= vnode_if.h imgact_binmisc.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/imx/Makefile b/sys/modules/imx/Makefile
new file mode 100644
index 000000000000..09de5774ef88
--- /dev/null
+++ b/sys/modules/imx/Makefile
@@ -0,0 +1,11 @@
+# Build modules specific to freescale/nxp imx-family SoCs.
+
+SUBDIR = \
+ ../ffec \
+ imx6_ahci \
+ imx6_snvs \
+ imx_i2c \
+ imx_spi \
+ imx_wdog \
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/imx/imx6_ahci/Makefile b/sys/modules/imx/imx6_ahci/Makefile
new file mode 100644
index 000000000000..5d7ad5c6786e
--- /dev/null
+++ b/sys/modules/imx/imx6_ahci/Makefile
@@ -0,0 +1,13 @@
+
+.PATH: ${SRCTOP}/sys/arm/freescale/imx
+
+KMOD= imx6_ahci
+SRCS= imx6_ahci.c
+
+# Generated files...
+SRCS+= \
+ bus_if.h \
+ device_if.h \
+ ofw_bus_if.h \
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/imx/imx6_snvs/Makefile b/sys/modules/imx/imx6_snvs/Makefile
new file mode 100644
index 000000000000..1c0d5c1accf0
--- /dev/null
+++ b/sys/modules/imx/imx6_snvs/Makefile
@@ -0,0 +1,15 @@
+
+.PATH: ${SRCTOP}/sys/arm/freescale/imx
+
+KMOD= imx6_snvs
+SRCS= imx6_snvs.c
+
+# Generated files...
+SRCS+= \
+ bus_if.h \
+ clock_if.h \
+ device_if.h \
+ ofw_bus_if.h \
+ syscon_if.h \
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/imx/imx_i2c/Makefile b/sys/modules/imx/imx_i2c/Makefile
new file mode 100644
index 000000000000..b089d587489f
--- /dev/null
+++ b/sys/modules/imx/imx_i2c/Makefile
@@ -0,0 +1,16 @@
+
+.PATH: ${SRCTOP}/sys/arm/freescale/imx
+
+KMOD= imx_i2c
+SRCS= imx_i2c.c
+
+SRCS+= \
+ bus_if.h \
+ device_if.h \
+ fdt_pinctrl_if.h \
+ gpio_if.h \
+ iicbus_if.h \
+ ofw_bus_if.h \
+ opt_platform.h \
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/imx/imx_spi/Makefile b/sys/modules/imx/imx_spi/Makefile
new file mode 100644
index 000000000000..5dc6cd65076e
--- /dev/null
+++ b/sys/modules/imx/imx_spi/Makefile
@@ -0,0 +1,16 @@
+
+.PATH: ${SRCTOP}/sys/arm/freescale/imx
+
+KMOD= imx_spi
+SRCS= imx_spi.c
+
+# Generated files...
+SRCS+= \
+ bus_if.h \
+ device_if.h \
+ gpio_if.h \
+ ofw_bus_if.h \
+ opt_platform.h \
+ spibus_if.h \
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/imx/imx_wdog/Makefile b/sys/modules/imx/imx_wdog/Makefile
new file mode 100644
index 000000000000..ef6ca0854764
--- /dev/null
+++ b/sys/modules/imx/imx_wdog/Makefile
@@ -0,0 +1,13 @@
+
+.PATH: ${SRCTOP}/sys/arm/freescale/imx
+
+KMOD= imx_wdog
+SRCS= imx_wdog.c
+
+# Generated files...
+SRCS+= \
+ bus_if.h \
+ device_if.h \
+ ofw_bus_if.h \
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/intelspi/Makefile b/sys/modules/intelspi/Makefile
new file mode 100644
index 000000000000..ec97b0a6edec
--- /dev/null
+++ b/sys/modules/intelspi/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/intel
+KMOD= intelspi
+SRCS= spi.c spi_acpi.c spi_pci.c
+SRCS+= acpi_if.h pci_if.h device_if.h bus_if.h opt_acpi.h opt_pci.h spibus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/io/Makefile b/sys/modules/io/Makefile
new file mode 100644
index 000000000000..ed0f1f1643e7
--- /dev/null
+++ b/sys/modules/io/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/io
+.PATH: ${SRCTOP}/sys/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}
+
+KMOD= io
+SRCS= iodev.c io.c
+SRCS+= bus_if.h device_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ioat/Makefile b/sys/modules/ioat/Makefile
new file mode 100644
index 000000000000..432c48a3a96e
--- /dev/null
+++ b/sys/modules/ioat/Makefile
@@ -0,0 +1,15 @@
+# ioat Loadable Kernel Module
+#
+
+IOAT_SRC_PATH = ${SRCTOP}/sys
+
+.PATH: ${IOAT_SRC_PATH}/dev/ioat
+
+KMOD= ioat
+SRCS= ioat.c ioat_test.c
+SRCS+= device_if.h bus_if.h pci_if.h
+SRCS+= opt_ddb.h
+
+CFLAGS+= -I${IOAT_SRC_PATH}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ip6_mroute_mod/Makefile b/sys/modules/ip6_mroute_mod/Makefile
new file mode 100644
index 000000000000..9772c1ed0ea5
--- /dev/null
+++ b/sys/modules/ip6_mroute_mod/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/netinet6
+
+KMOD= ip6_mroute
+
+SRCS= ip6_mroute.c
+SRCS+= opt_inet6.h opt_mrouting.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ip_mroute_mod/Makefile b/sys/modules/ip_mroute_mod/Makefile
new file mode 100644
index 000000000000..2c1364539d98
--- /dev/null
+++ b/sys/modules/ip_mroute_mod/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/netinet ${SRCTOP}/sys/netinet6
+
+KMOD= ip_mroute
+
+SRCS= ip_mroute.c
+SRCS+= opt_inet.h opt_mrouting.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ipdivert/Makefile b/sys/modules/ipdivert/Makefile
new file mode 100644
index 000000000000..981d1559fcee
--- /dev/null
+++ b/sys/modules/ipdivert/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/netinet
+
+KMOD= ipdivert
+SRCS= ip_divert.c opt_inet.h opt_inet6.h opt_sctp.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ipfilter/Makefile b/sys/modules/ipfilter/Makefile
new file mode 100644
index 000000000000..d2f32538b68b
--- /dev/null
+++ b/sys/modules/ipfilter/Makefile
@@ -0,0 +1,32 @@
+
+.PATH: ${SRCTOP}/sys/netpfil/ipfilter/netinet
+
+KMOD= ipl
+SRCS= mlfk_ipl.c ip_nat.c ip_frag.c ip_state.c ip_proxy.c ip_auth.c \
+ ip_log.c ip_fil_freebsd.c fil.c ip_lookup.c ip_pool.c ip_htable.c \
+ ip_sync.c \
+ ip_nat6.c ip_rules.c ip_scan.c ip_dstlist.c radix_ipf.c
+SRCS+= opt_bpf.h opt_inet6.h opt_kern_tls.h
+
+CFLAGS+= -I${SRCTOP}/sys/netpfil/ipfilter
+CFLAGS+= -DIPFILTER=1 -DIPFILTER_LKM -DIPFILTER_LOG -DIPFILTER_LOOKUP
+#
+# If you don't want log functionality remove -DIPFILTER_LOG
+#
+
+.include <bsd.kmod.mk>
+
+CWARNFLAGS.fil.c= ${NO_WSELF_ASSIGN} -Wno-unused
+CWARNFLAGS.ip_auth.c= -Wno-unused
+CWARNFLAGS.ip_fil_freebsd.c= -Wno-unused
+CWARNFLAGS.ip_frag.c= -Wno-unused
+CWARNFLAGS.ip_htable.c= -Wno-unused ${NO_WTAUTOLOGICAL_POINTER_COMPARE}
+CWARNFLAGS.ip_dstlist.c= -Wno-unused
+CWARNFLAGS.ip_lookup.c= ${NO_WSELF_ASSIGN} -Wno-unused
+CWARNFLAGS.ip_nat.c= -Wno-unused
+CWARNFLAGS.ip_nat6.c= -Wno-unused
+CWARNFLAGS.ip_pool.c= -Wno-unused
+CWARNFLAGS.ip_proxy.c= ${NO_WSELF_ASSIGN} -Wno-unused
+CWARNFLAGS.ip_scan.c= -Wno-unused
+CWARNFLAGS.ip_state.c= -Wno-unused
+CWARNFLAGS.ip_sync.c= -Wno-unused
diff --git a/sys/modules/ipfw/Makefile b/sys/modules/ipfw/Makefile
new file mode 100644
index 000000000000..35723925d121
--- /dev/null
+++ b/sys/modules/ipfw/Makefile
@@ -0,0 +1,23 @@
+
+.PATH: ${SRCTOP}/sys/netpfil/ipfw
+
+KMOD= ipfw
+SRCS= ip_fw2.c ip_fw_pfil.c ip_fw_bpf.c
+SRCS+= ip_fw_dynamic.c ip_fw_log.c ip_fw_eaction.c
+SRCS+= ip_fw_sockopt.c ip_fw_table.c ip_fw_table_algo.c ip_fw_iface.c
+SRCS+= ip_fw_table_value.c
+SRCS+= opt_inet.h opt_inet6.h opt_ipdivert.h opt_ipfw.h opt_kern_tls.h
+
+CFLAGS+= -DIPFIREWALL -I${SRCTOP}/sys/contrib/ck/include
+#
+#If you want it verbose
+#CFLAGS+= -DIPFIREWALL_VERBOSE
+#CFLAGS+= -DIPFIREWALL_VERBOSE_LIMIT=100
+#
+#If you want it to pass all packets by default
+#CFLAGS+= -DIPFIREWALL_DEFAULT_TO_ACCEPT
+#
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ipfw_nat/Makefile b/sys/modules/ipfw_nat/Makefile
new file mode 100644
index 000000000000..0ebc25f95be0
--- /dev/null
+++ b/sys/modules/ipfw_nat/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/netpfil/ipfw
+
+KMOD= ipfw_nat
+SRCS= ip_fw_nat.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ipfw_nat64/Makefile b/sys/modules/ipfw_nat64/Makefile
new file mode 100644
index 000000000000..4beffc8426cc
--- /dev/null
+++ b/sys/modules/ipfw_nat64/Makefile
@@ -0,0 +1,13 @@
+
+.PATH: ${SRCTOP}/sys/netpfil/ipfw/nat64
+
+KMOD= ipfw_nat64
+SRCS= ip_fw_nat64.c nat64_translate.c
+SRCS+= nat64clat.c nat64clat_control.c
+SRCS+= nat64lsn.c nat64lsn_control.c
+SRCS+= nat64stl.c nat64stl_control.c
+SRCS+= opt_ipstealth.h
+
+CFLAGS+= -I${SRCTOP}/sys/contrib/ck/include
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ipfw_nptv6/Makefile b/sys/modules/ipfw_nptv6/Makefile
new file mode 100644
index 000000000000..7b49d72027e4
--- /dev/null
+++ b/sys/modules/ipfw_nptv6/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/netpfil/ipfw/nptv6
+
+KMOD= ipfw_nptv6
+SRCS= ip_fw_nptv6.c nptv6.c opt_ipfw.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ipfw_pmod/Makefile b/sys/modules/ipfw_pmod/Makefile
new file mode 100644
index 000000000000..d2473573ee2b
--- /dev/null
+++ b/sys/modules/ipfw_pmod/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/netpfil/ipfw/pmod
+
+KMOD= ipfw_pmod
+SRCS= ip_fw_pmod.c tcpmod.c opt_inet.h opt_inet6.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ipmi/Makefile b/sys/modules/ipmi/Makefile
new file mode 100644
index 000000000000..41c4d5285314
--- /dev/null
+++ b/sys/modules/ipmi/Makefile
@@ -0,0 +1,29 @@
+
+.PATH: ${SRCTOP}/sys/dev/ipmi
+
+# XXX - ipmi_smbus and ipmi_ssif depend on smbus
+# XXX - ipmi_acpi depends on acpi
+KMOD= ipmi
+SRCS= ipmi.c
+SRCS+= bus_if.h device_if.h
+
+.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" || \
+ ${MACHINE_CPUARCH} == "aarch64"
+SRCS+= ipmi_kcs.c ipmi_smic.c ipmi_bt.c
+SRCS+= ipmi_acpi.c
+SRCS+= opt_acpi.h
+SRCS+= acpi_if.h
+.endif
+
+.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
+SRCS+= ipmi_smbios.c ipmi_ssif.c
+SRCS+= ipmi_isa.c ipmi_pci.c ipmi_smbus.c
+SRCS+= isa_if.h pci_if.h smbus_if.h
+
+SUBDIR+= ipmi_linux
+
+.elif ${MACHINE_ARCH:Mpowerpc64*} != ""
+SRCS+= ipmi_opal.c ofw_bus_if.h
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ipmi/ipmi_linux/Makefile b/sys/modules/ipmi/ipmi_linux/Makefile
new file mode 100644
index 000000000000..50e918db8045
--- /dev/null
+++ b/sys/modules/ipmi/ipmi_linux/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/ipmi
+
+KMOD= ipmi_linux
+SRCS= ipmi_linux.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ipoib/Makefile b/sys/modules/ipoib/Makefile
new file mode 100644
index 000000000000..18a72bb02993
--- /dev/null
+++ b/sys/modules/ipoib/Makefile
@@ -0,0 +1,16 @@
+.PATH: ${SRCTOP}/sys/ofed/drivers/infiniband/ulp/ipoib
+
+KMOD= ipoib
+SRCS= ipoib_cm.c ipoib_ib.c ipoib_main.c \
+ ipoib_multicast.c ipoib_verbs.c
+SRCS+= ${LINUXKPI_GENSRCS}
+SRCS+= opt_inet.h opt_inet6.h opt_ofed.h
+
+CFLAGS+= -I${SRCTOP}/sys/ofed/drivers/infiniband/ulp/ipoib
+CFLAGS+= -I${SRCTOP}/sys/ofed/include
+CFLAGS+= -I${SRCTOP}/sys/ofed/include/uapi
+CFLAGS+= ${LINUXKPI_INCLUDES}
+
+.include <bsd.kmod.mk>
+
+CFLAGS+= -Wno-cast-qual -Wno-pointer-arith
diff --git a/sys/modules/ips/Makefile b/sys/modules/ips/Makefile
new file mode 100644
index 000000000000..b505e7d62b65
--- /dev/null
+++ b/sys/modules/ips/Makefile
@@ -0,0 +1,10 @@
+
+.PATH: ${SRCTOP}/sys/dev/ips
+KMOD = ips
+SRCS = ips.c ips_pci.c ips.h ips_disk.c ips_disk.h ips_commands.c \
+ ips_ioctl.h ips_ioctl.c device_if.h bus_if.h pci_if.h
+
+.include <bsd.kmod.mk>
+
+# XXX Work around clang warning, until maintainer approves fix.
+CWARNFLAGS.ips.c= ${NO_WSOMETIMES_UNINITIALIZED}
diff --git a/sys/modules/ipsec/Makefile b/sys/modules/ipsec/Makefile
new file mode 100644
index 000000000000..7aaac6f79525
--- /dev/null
+++ b/sys/modules/ipsec/Makefile
@@ -0,0 +1,10 @@
+
+.PATH: ${SRCTOP}/sys/net ${SRCTOP}/sys/netipsec
+
+KMOD= ipsec
+SRCS= if_ipsec.c ipsec.c ipsec_input.c ipsec_mbuf.c ipsec_mod.c \
+ ipsec_output.c xform_ah.c xform_esp.c xform_ipcomp.c \
+ opt_inet.h opt_inet6.h opt_ipsec.h opt_kern_tls.h opt_sctp.h
+SRCS.INET= udpencap.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ipw/Makefile b/sys/modules/ipw/Makefile
new file mode 100644
index 000000000000..b91464b894d0
--- /dev/null
+++ b/sys/modules/ipw/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/ipw
+
+KMOD = if_ipw
+SRCS = if_ipw.c device_if.h bus_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ipwfw/Makefile b/sys/modules/ipwfw/Makefile
new file mode 100644
index 000000000000..59ff2c4face3
--- /dev/null
+++ b/sys/modules/ipwfw/Makefile
@@ -0,0 +1,6 @@
+
+SUBDIR= ipw_bss \
+ ipw_ibss \
+ ipw_monitor
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/ipwfw/ipw_bss/Makefile b/sys/modules/ipwfw/ipw_bss/Makefile
new file mode 100644
index 000000000000..2e7fcd9e45ad
--- /dev/null
+++ b/sys/modules/ipwfw/ipw_bss/Makefile
@@ -0,0 +1,14 @@
+
+.PATH: ${SRCTOP}/sys/contrib/dev/ipw
+
+KMOD= ipw_bss
+FIRMWS= ipw_bss:ipw_bss:130
+FIRMWARE_LICENSE= intel_ipw
+
+CLEANFILES= ipw_bss
+
+ipw_bss: ipw2100-1.3.fw.uu
+ uudecode -p ${.ALLSRC} > ${.TARGET}
+
+.include <bsd.kmod.mk>
+
diff --git a/sys/modules/ipwfw/ipw_ibss/Makefile b/sys/modules/ipwfw/ipw_ibss/Makefile
new file mode 100644
index 000000000000..75788b756ffa
--- /dev/null
+++ b/sys/modules/ipwfw/ipw_ibss/Makefile
@@ -0,0 +1,14 @@
+
+.PATH: ${SRCTOP}/sys/contrib/dev/ipw
+
+KMOD= ipw_ibss
+FIRMWS= ipw_ibss:ipw_ibss:130
+FIRMWARE_LICENSE= intel_ipw
+
+CLEANFILES= ipw_ibss
+
+ipw_ibss: ipw2100-1.3-i.fw.uu
+ uudecode -p ${.ALLSRC} > ${.TARGET}
+
+.include <bsd.kmod.mk>
+
diff --git a/sys/modules/ipwfw/ipw_monitor/Makefile b/sys/modules/ipwfw/ipw_monitor/Makefile
new file mode 100644
index 000000000000..39179ab231e3
--- /dev/null
+++ b/sys/modules/ipwfw/ipw_monitor/Makefile
@@ -0,0 +1,14 @@
+
+.PATH: ${SRCTOP}/sys/contrib/dev/ipw
+
+KMOD= ipw_monitor
+FIRMWS= ipw_monitor:ipw_monitor:130
+FIRMWARE_LICENSE= intel_ipw
+
+CLEANFILES= ipw_monitor
+
+ipw_monitor: ipw2100-1.3-p.fw.uu
+ uudecode -p ${.ALLSRC} > ${.TARGET}
+
+.include <bsd.kmod.mk>
+
diff --git a/sys/modules/irdma/Makefile b/sys/modules/irdma/Makefile
new file mode 100644
index 000000000000..b2ffb67ca66f
--- /dev/null
+++ b/sys/modules/irdma/Makefile
@@ -0,0 +1,23 @@
+.include <bsd.own.mk>
+
+OFED_INC_DIR = ${.CURDIR}/../../ofed/include
+ICE_DIR = ${.CURDIR}/../../dev/ice
+.PATH: ${.CURDIR}/../../dev/irdma
+
+KMOD= irdma
+SRCS= icrdma.c
+SRCS+= fbsd_kcompat.c irdma_hw.c irdma_verbs.c irdma_utils.c
+SRCS+= irdma_cm.c irdma_kcompat.c
+SRCS+= irdma_if.h irdma_di_if.h ice_rdma.h vnode_if.h device_if.h bus_if.h opt_inet.h pci_if.h opt_inet6.h
+# Shared source
+SRCS+= irdma_ctrl.c irdma_hmc.c icrdma_hw.c irdma_pble.c irdma_puda.c irdma_uda.c irdma_uk.c irdma_ws.c
+
+CFLAGS+= -I${ICE_DIR} -I${OFED_INC_DIR}
+CFLAGS+= -I${OFED_INC_DIR}/uapi
+CFLAGS+= ${LINUXKPI_INCLUDES}
+CFLAGS+= -DCONFIG_INFINIBAND_USER_MEM
+
+ice_rdma.h:
+ cp $(ICE_DIR)/ice_rdma.h .
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/isci/Makefile b/sys/modules/isci/Makefile
new file mode 100644
index 000000000000..51c2b6cdd76a
--- /dev/null
+++ b/sys/modules/isci/Makefile
@@ -0,0 +1,91 @@
+# isci driver Makefile
+#
+
+ISCI_SRC_PATH = ${SRCTOP}/sys
+
+.PATH: ${ISCI_SRC_PATH}/dev/isci ${ISCI_SRC_PATH}/dev/isci/scil
+
+KMOD = isci
+SRCS = isci.c isci_oem_parameters.c \
+ isci_controller.c isci_domain.c isci_io_request.c \
+ isci_timer.c isci_remote_device.c isci_logger.c \
+ isci_task_request.c isci_sysctl.c isci_interrupt.c
+
+SRCS += \
+ sci_base_controller.c \
+ sci_base_domain.c \
+ sci_base_iterator.c \
+ sci_base_library.c \
+ sci_base_logger.c \
+ sci_base_memory_descriptor_list.c \
+ sci_base_memory_descriptor_list_decorator.c \
+ sci_base_object.c \
+ sci_base_observer.c \
+ sci_base_phy.c \
+ sci_base_port.c \
+ sci_base_remote_device.c \
+ sci_base_request.c \
+ sci_base_state_machine.c \
+ sci_base_state_machine_logger.c \
+ sci_base_state_machine_observer.c \
+ sci_base_subject.c
+
+SRCS += \
+ sci_abstract_list.c \
+ sci_util.c
+
+SRCS += \
+ scic_sds_controller.c \
+ scic_sds_library.c scic_sds_pci.c \
+ scic_sds_phy.c scic_sds_port.c \
+ scic_sds_port_configuration_agent.c \
+ scic_sds_remote_device.c scic_sds_remote_node_context.c \
+ scic_sds_remote_node_table.c scic_sds_request.c \
+ scic_sds_sgpio.c scic_sds_smp_remote_device.c \
+ scic_sds_smp_request.c scic_sds_ssp_request.c \
+ scic_sds_stp_packet_request.c scic_sds_stp_remote_device.c \
+ scic_sds_stp_request.c scic_sds_unsolicited_frame_control.c
+
+SRCS += \
+ scif_sas_controller.c \
+ scif_sas_controller_state_handlers.c \
+ scif_sas_controller_states.c scif_sas_domain.c \
+ scif_sas_domain_state_handlers.c scif_sas_domain_states.c \
+ scif_sas_high_priority_request_queue.c \
+ scif_sas_internal_io_request.c scif_sas_io_request.c \
+ scif_sas_io_request_state_handlers.c \
+ scif_sas_io_request_states.c scif_sas_library.c \
+ scif_sas_remote_device.c \
+ scif_sas_remote_device_ready_substate_handlers.c \
+ scif_sas_remote_device_ready_substates.c \
+ scif_sas_remote_device_starting_substate_handlers.c \
+ scif_sas_remote_device_starting_substates.c \
+ scif_sas_remote_device_state_handlers.c \
+ scif_sas_remote_device_states.c scif_sas_request.c \
+ scif_sas_smp_activity_clear_affiliation.c \
+ scif_sas_smp_io_request.c scif_sas_smp_phy.c \
+ scif_sas_smp_remote_device.c scif_sas_stp_io_request.c \
+ scif_sas_stp_remote_device.c scif_sas_stp_task_request.c \
+ scif_sas_task_request.c scif_sas_task_request_state_handlers.c \
+ scif_sas_task_request_states.c scif_sas_timer.c
+
+SRCS += \
+ sati.c \
+ sati_abort_task_set.c sati_atapi.c \
+ sati_device.c sati_inquiry.c sati_log_sense.c \
+ sati_lun_reset.c sati_mode_pages.c sati_mode_select.c \
+ sati_mode_sense.c sati_mode_sense_6.c sati_mode_sense_10.c \
+ sati_move.c sati_passthrough.c sati_read.c sati_read_buffer.c \
+ sati_read_capacity.c \
+ sati_report_luns.c sati_request_sense.c sati_reassign_blocks.c \
+ sati_start_stop_unit.c sati_synchronize_cache.c \
+ sati_test_unit_ready.c sati_unmap.c sati_util.c \
+ sati_verify.c sati_write.c \
+ sati_write_buffer.c sati_write_long.c sati_write_and_verify.c
+
+SRCS += opt_scsi.h opt_cam.h opt_isci.h
+SRCS += device_if.h bus_if.h pci_if.h
+
+.include <bsd.kmod.mk>
+
+CWARNFLAGS+= ${NO_WUNUSED_BUT_SET_VARIABLE}
diff --git a/sys/modules/iscsi/Makefile b/sys/modules/iscsi/Makefile
new file mode 100644
index 000000000000..c80f32d19da4
--- /dev/null
+++ b/sys/modules/iscsi/Makefile
@@ -0,0 +1,26 @@
+
+SYSDIR?=${SRCTOP}/sys
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+.PATH: ${SRCTOP}/sys/dev/iscsi
+KMOD= iscsi
+
+SRCS= iscsi.c
+SRCS+= icl.c
+SRCS+= icl_soft.c
+SRCS+= icl_soft_proxy.c
+SRCS+= opt_cam.h
+SRCS+= bus_if.h
+SRCS+= device_if.h
+SRCS+= icl_conn_if.c
+SRCS+= icl_conn_if.h
+
+.if ${MK_OFED} != "no" || defined(ALL_MODULES)
+CFLAGS+=-DICL_KERNEL_PROXY
+.endif
+
+MFILES= kern/bus_if.m kern/device_if.m dev/iscsi/icl_conn_if.m
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iser/Makefile b/sys/modules/iser/Makefile
new file mode 100644
index 000000000000..d0db499e6fde
--- /dev/null
+++ b/sys/modules/iser/Makefile
@@ -0,0 +1,29 @@
+
+SYSDIR?=${SRCTOP}/sys
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+.PATH: ${SYSDIR}/dev/iser/
+
+KMOD= iser
+
+SRCS= icl_iser.c
+SRCS+= iser_initiator.c
+SRCS+= iser_memory.c
+SRCS+= iser_verbs.c
+
+SRCS+= ${LINUXKPI_GENSRCS}
+SRCS+= opt_inet.h opt_inet6.h opt_cam.h icl_conn_if.h
+
+CFLAGS+= -I${SYSDIR}/
+CFLAGS+= -I${SYSDIR}/ofed/include
+CFLAGS+= -I${SYSDIR}/ofed/include/uapi
+CFLAGS+= ${LINUXKPI_INCLUDES}
+CFLAGS+= -DCONFIG_INFINIBAND_USER_MEM
+CFLAGS+= -DINET6 -DINET
+CFLAGS+= -fms-extensions
+
+CFLAGS+=-DICL_KERNEL_PROXY
+
+MFILES= kern/bus_if.m kern/device_if.m dev/iscsi/icl_conn_if.m
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/isp/Makefile b/sys/modules/isp/Makefile
new file mode 100644
index 000000000000..d203b8f464cb
--- /dev/null
+++ b/sys/modules/isp/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/isp
+
+KMOD= isp
+SRCS= bus_if.h device_if.h pci_if.h \
+ opt_cam.h opt_ddb.h opt_isp.h \
+ isp.c isp_library.c isp_target.c isp_freebsd.c isp_pci.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ispfw/Makefile b/sys/modules/ispfw/Makefile
new file mode 100644
index 000000000000..8f0634a2a638
--- /dev/null
+++ b/sys/modules/ispfw/Makefile
@@ -0,0 +1,32 @@
+#-
+# Copyright (c) 2006 by Matthew Jacob
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice immediately at the beginning of the file, without modification,
+# this list of conditions, and the following disclaimer.
+# 2. The name of the author may not be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+
+SUBDIR = ispfw
+SUBDIR += isp_2400
+SUBDIR += isp_2500
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/ispfw/isp_2400/Makefile b/sys/modules/ispfw/isp_2400/Makefile
new file mode 100644
index 000000000000..76488bd2cf37
--- /dev/null
+++ b/sys/modules/ispfw/isp_2400/Makefile
@@ -0,0 +1,34 @@
+#-
+# Copyright (c) 2006 by Matthew Jacob
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice immediately at the beginning of the file, without modification,
+# this list of conditions, and the following disclaimer.
+# 2. The name of the author may not be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+.PATH: ${SRCTOP}/sys/dev/ispfw
+
+KMOD= isp_2400
+SRCS= ispfw.c
+
+CFLAGS += -DISP_2400 -DMODULE_NAME=\"${KMOD}\"
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ispfw/isp_2500/Makefile b/sys/modules/ispfw/isp_2500/Makefile
new file mode 100644
index 000000000000..7264a3089fd0
--- /dev/null
+++ b/sys/modules/ispfw/isp_2500/Makefile
@@ -0,0 +1,35 @@
+#-
+# Copyright (c) 2009 by Matthew Jacob
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice immediately at the beginning of the file, without modification,
+# this list of conditions, and the following disclaimer.
+# 2. The name of the author may not be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+
+.PATH: ${SRCTOP}/sys/dev/ispfw
+
+KMOD= isp_2500
+SRCS= ispfw.c
+
+CFLAGS += -DISP_2500 -DMODULE_NAME=\"${KMOD}\"
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ispfw/ispfw/Makefile b/sys/modules/ispfw/ispfw/Makefile
new file mode 100644
index 000000000000..12ab881edc93
--- /dev/null
+++ b/sys/modules/ispfw/ispfw/Makefile
@@ -0,0 +1,34 @@
+#-
+# Copyright (c) 2006 by Matthew Jacob
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice immediately at the beginning of the file, without modification,
+# this list of conditions, and the following disclaimer.
+# 2. The name of the author may not be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+.PATH: ${SRCTOP}/sys/dev/ispfw
+
+KMOD= ispfw
+SRCS= ispfw.c
+
+CFLAGS += -DISP_ALL
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/itwd/Makefile b/sys/modules/itwd/Makefile
new file mode 100644
index 000000000000..02a5959387d0
--- /dev/null
+++ b/sys/modules/itwd/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/itwd
+
+KMOD= itwd
+SRCS= itwd.c
+SRCS+= device_if.h bus_if.h isa_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwi/Makefile b/sys/modules/iwi/Makefile
new file mode 100644
index 000000000000..3994161da39c
--- /dev/null
+++ b/sys/modules/iwi/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/iwi
+
+KMOD = if_iwi
+SRCS = if_iwi.c device_if.h bus_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwifw/Makefile b/sys/modules/iwifw/Makefile
new file mode 100644
index 000000000000..6d5ab036cd34
--- /dev/null
+++ b/sys/modules/iwifw/Makefile
@@ -0,0 +1,6 @@
+
+SUBDIR= iwi_bss \
+ iwi_ibss \
+ iwi_monitor
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/iwifw/iwi_bss/Makefile b/sys/modules/iwifw/iwi_bss/Makefile
new file mode 100644
index 000000000000..6452289898fa
--- /dev/null
+++ b/sys/modules/iwifw/iwi_bss/Makefile
@@ -0,0 +1,14 @@
+
+.PATH: ${SRCTOP}/sys/contrib/dev/iwi
+
+KMOD= iwi_bss
+FIRMWS= iwi_bss:iwi_bss:300
+FIRMWARE_LICENSE= intel_iwi
+
+CLEANFILES= iwi_bss
+
+iwi_bss: ipw2200-bss.fw.uu
+ uudecode -p ${.ALLSRC} > ${.TARGET}
+
+.include <bsd.kmod.mk>
+
diff --git a/sys/modules/iwifw/iwi_ibss/Makefile b/sys/modules/iwifw/iwi_ibss/Makefile
new file mode 100644
index 000000000000..ad4e76706620
--- /dev/null
+++ b/sys/modules/iwifw/iwi_ibss/Makefile
@@ -0,0 +1,14 @@
+
+.PATH: ${SRCTOP}/sys/contrib/dev/iwi
+
+KMOD= iwi_ibss
+FIRMWS= iwi_ibss:iwi_ibss:300
+FIRMWARE_LICENSE= intel_iwi
+
+CLEANFILES= iwi_fw
+
+iwi_ibss: ipw2200-ibss.fw.uu
+ uudecode -p ${.ALLSRC} > ${.TARGET}
+
+.include <bsd.kmod.mk>
+
diff --git a/sys/modules/iwifw/iwi_monitor/Makefile b/sys/modules/iwifw/iwi_monitor/Makefile
new file mode 100644
index 000000000000..91dc7f33b07f
--- /dev/null
+++ b/sys/modules/iwifw/iwi_monitor/Makefile
@@ -0,0 +1,13 @@
+
+.PATH: ${SRCTOP}/sys/contrib/dev/iwi
+
+KMOD= iwi_monitor
+FIRMWS= iwi_monitor:iwi_monitor:300
+FIRMWARE_LICENSE= intel_iwi
+
+CLEANFILES= iwi_monitor
+
+iwi_monitor: ipw2200-sniffer.fw.uu
+ uudecode -p ${.ALLSRC} > ${.TARGET}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwifi/Makefile b/sys/modules/iwlwifi/Makefile
new file mode 100644
index 000000000000..679490fdf774
--- /dev/null
+++ b/sys/modules/iwlwifi/Makefile
@@ -0,0 +1,69 @@
+
+DEVIWLWIFIDIR= ${SRCTOP}/sys/contrib/dev/iwlwifi
+
+.PATH: ${DEVIWLWIFIDIR}
+
+WITH_DEBUGFS= 0
+
+KMOD= if_iwlwifi
+
+SRCS= iwl-drv.c
+SRCS+= iwl-dbg-tlv.c iwl-debug.c
+SRCS+= iwl-eeprom-parse.c iwl-eeprom-read.c
+SRCS+= iwl-io.c iwl-nvm-parse.c iwl-phy-db.c iwl-trans.c
+SRCS+= cfg/7000.c cfg/8000.c cfg/9000.c cfg/22000.c
+SRCS+= cfg/ax210.c cfg/bz.c cfg/sc.c
+SRCS+= fw/dbg.c fw/dump.c fw/img.c fw/notif-wait.c
+SRCS+= fw/paging.c fw/pnvm.c fw/rs.c fw/smem.c fw/init.c
+#SRCS+= fw/uefi.c
+SRCS+= mvm/rs.c mvm/binding.c mvm/coex.c mvm/ftm-initiator.c
+SRCS+= mvm/ftm-responder.c mvm/fw.c mvm/mac-ctxt.c
+SRCS+= mvm/mac80211.c mvm/nvm.c mvm/offloading.c mvm/ops.c
+SRCS+= mvm/phy-ctxt.c mvm/power.c mvm/quota.c mvm/rs-fw.c mvm/rfi.c
+SRCS+= mvm/rx.c mvm/rxmq.c mvm/scan.c mvm/sf.c mvm/sta.c mvm/tdls.c
+SRCS+= mvm/time-event.c mvm/tt.c mvm/tx.c mvm/utils.c
+SRCS+= mvm/link.c
+SRCS+= mvm/mld-key.c mvm/mld-mac.c mvm/mld-mac80211.c mvm/mld-sta.c
+SRCS+= mvm/ptp.c mvm/time-sync.c
+#SRCS+= mvm/led.c
+SRCS+= pcie/ctxt-info-gen3.c pcie/ctxt-info.c
+SRCS+= pcie/drv.c pcie/rx.c pcie/trans-gen2.c pcie/trans.c
+SRCS+= pcie/tx-gen2.c pcie/tx.c
+SRCS+= queue/tx.c
+
+.if defined(WITH_DEBUGFS) && ${WITH_DEBUGFS} > 0
+SRCS+= fw/debugfs.c mvm/debugfs.c mvm/debugfs-vif.c
+CFLAGS+= -DCONFIG_IWLWIFI_DEBUGFS=${WITH_DEBUGFS}
+CFLAGS+= -DCONFIG_MAC80211_DEBUGFS=${WITH_DEBUGFS}
+.endif
+
+SRCS+= iwl-devtrace.c
+
+# Other
+SRCS+= ${LINUXKPI_GENSRCS}
+SRCS+= opt_wlan.h opt_inet6.h opt_inet.h opt_acpi.h
+
+CFLAGS+= -DKBUILD_MODNAME='"iwlwifi"'
+
+CFLAGS+= -I${DEVIWLWIFIDIR}
+CFLAGS+= ${LINUXKPI_INCLUDES}
+CFLAGS+= -DCONFIG_IWLDVM=0
+CFLAGS+= -DCONFIG_IWLMVM=1
+# Helpful after fresh imports.
+#CFLAGS+= -ferror-limit=0
+
+#CFLAGS+= -DCONFIG_ACPI=1
+#CFLAGS+= -DCONFIG_INET=1 # Need LKPI TSO implementation.
+#CFLAGS+= -DCONFIG_IPV6=1
+CFLAGS+= -DCONFIG_IWLWIFI_DEBUG=1
+#CFLAGS+= -DCONFIG_IWLWIFI_LEDS=1
+#CFLAGS+= -DCONFIG_IWLWIFI_OPMODE_MODULAR=1
+CFLAGS+= -DCONFIG_IWLWIFI_DEVICE_TRACING=1
+#CFLAGS+= -DCONFIG_LOCKDEP=1
+#CFLAGS+= -DCONFIG_NL80211_TESTMODE=1
+#CFLAGS+= -DCONFIG_PM=1
+#CFLAGS+= -DCONFIG_PM_SLEEP=1
+#CFLAGS+= -DCONFIG_THERMAL=1
+#CFLAGS+= -DCONFIG_EFI=1
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/Makefile b/sys/modules/iwlwififw/Makefile
new file mode 100644
index 000000000000..aa3873880b19
--- /dev/null
+++ b/sys/modules/iwlwififw/Makefile
@@ -0,0 +1,28 @@
+
+SUBDIR= \
+ iwlwifi-3160-fw \
+ iwlwifi-3168-fw \
+ iwlwifi-7260-fw \
+ iwlwifi-7265-fw \
+ iwlwifi-7265D-fw \
+ iwlwifi-8000C-fw \
+ iwlwifi-8265-fw \
+ iwlwifi-9000-pu-b0-jf-b0-fw \
+ iwlwifi-9260-th-b0-jf-b0-fw \
+ iwlwifi-Qu-b0-hr-b0-fw \
+ iwlwifi-Qu-b0-jf-b0-fw \
+ iwlwifi-Qu-c0-hr-b0-fw \
+ iwlwifi-Qu-c0-jf-b0-fw \
+ iwlwifi-QuZ-a0-hr-b0-fw \
+ iwlwifi-QuZ-a0-jf-b0-fw \
+ iwlwifi-cc-a0-fw \
+ iwlwifi-so-a0-gf-a0-fw \
+ iwlwifi-so-a0-gf4-a0-fw \
+ iwlwifi-so-a0-hr-b0-fw \
+ iwlwifi-so-a0-jf-b0-fw \
+ iwlwifi-ty-a0-gf-a0-fw \
+ iwlwifi-so-a0-gf-a0-pnvm \
+ iwlwifi-so-a0-gf4-a0-pnvm \
+ iwlwifi-ty-a0-gf-a0-pnvm
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/iwlwififw/Makefile.inc b/sys/modules/iwlwififw/Makefile.inc
new file mode 100644
index 000000000000..ea3e88783809
--- /dev/null
+++ b/sys/modules/iwlwififw/Makefile.inc
@@ -0,0 +1,19 @@
+
+# Common rules for building iwlwifi firmware.
+
+EXT?= ucode
+_NAME?= iwlwifi-${NAME}-${FWVERSION}.${EXT}
+
+IMG= ${_NAME}
+KMOD= ${_NAME}
+
+CLEANFILES+= ${IMG}
+
+FIRMWS= ${IMG}:${IMG}:${FWVERSION}
+
+# License ack is not needed for iwlwifi (same as iwn/iwm).
+#FIRMWARE_LICENSE=
+
+${IMG}: ${SRCTOP}/sys/contrib/dev/iwlwififw/${IMG}
+ cp ${.ALLSRC} ${.TARGET}
+
diff --git a/sys/modules/iwlwififw/iwlwifi-3160-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-3160-fw/Makefile
new file mode 100644
index 000000000000..69d537c89754
--- /dev/null
+++ b/sys/modules/iwlwififw/iwlwifi-3160-fw/Makefile
@@ -0,0 +1,5 @@
+
+FWVERSION= 17
+NAME= 3160
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-3168-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-3168-fw/Makefile
new file mode 100644
index 000000000000..2e98c2148a79
--- /dev/null
+++ b/sys/modules/iwlwififw/iwlwifi-3168-fw/Makefile
@@ -0,0 +1,5 @@
+
+FWVERSION= 29
+NAME= 3168
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-7260-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-7260-fw/Makefile
new file mode 100644
index 000000000000..befd607a269e
--- /dev/null
+++ b/sys/modules/iwlwififw/iwlwifi-7260-fw/Makefile
@@ -0,0 +1,5 @@
+
+FWVERSION= 17
+NAME= 7260
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-7265-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-7265-fw/Makefile
new file mode 100644
index 000000000000..42d7c508dd1b
--- /dev/null
+++ b/sys/modules/iwlwififw/iwlwifi-7265-fw/Makefile
@@ -0,0 +1,5 @@
+
+FWVERSION= 17
+NAME= 7265
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-7265D-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-7265D-fw/Makefile
new file mode 100644
index 000000000000..37af2799e1eb
--- /dev/null
+++ b/sys/modules/iwlwififw/iwlwifi-7265D-fw/Makefile
@@ -0,0 +1,5 @@
+
+FWVERSION= 29
+NAME= 7265D
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-8000C-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-8000C-fw/Makefile
new file mode 100644
index 000000000000..0b3efe221d08
--- /dev/null
+++ b/sys/modules/iwlwififw/iwlwifi-8000C-fw/Makefile
@@ -0,0 +1,5 @@
+
+FWVERSION= 36
+NAME= 8000C
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-8265-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-8265-fw/Makefile
new file mode 100644
index 000000000000..5f238c8aa619
--- /dev/null
+++ b/sys/modules/iwlwififw/iwlwifi-8265-fw/Makefile
@@ -0,0 +1,5 @@
+
+FWVERSION= 36
+NAME= 8265
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-9000-pu-b0-jf-b0-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-9000-pu-b0-jf-b0-fw/Makefile
new file mode 100644
index 000000000000..03b5d5d142d2
--- /dev/null
+++ b/sys/modules/iwlwififw/iwlwifi-9000-pu-b0-jf-b0-fw/Makefile
@@ -0,0 +1,5 @@
+
+FWVERSION= 46
+NAME= 9000-pu-b0-jf-b0
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-9260-th-b0-jf-b0-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-9260-th-b0-jf-b0-fw/Makefile
new file mode 100644
index 000000000000..37ae25a4a836
--- /dev/null
+++ b/sys/modules/iwlwififw/iwlwifi-9260-th-b0-jf-b0-fw/Makefile
@@ -0,0 +1,5 @@
+
+FWVERSION= 46
+NAME= 9260-th-b0-jf-b0
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-Qu-b0-hr-b0-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-Qu-b0-hr-b0-fw/Makefile
new file mode 100644
index 000000000000..e781e790a048
--- /dev/null
+++ b/sys/modules/iwlwififw/iwlwifi-Qu-b0-hr-b0-fw/Makefile
@@ -0,0 +1,5 @@
+
+FWVERSION= 77
+NAME= Qu-b0-hr-b0
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-Qu-b0-jf-b0-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-Qu-b0-jf-b0-fw/Makefile
new file mode 100644
index 000000000000..ac8b13cd1777
--- /dev/null
+++ b/sys/modules/iwlwififw/iwlwifi-Qu-b0-jf-b0-fw/Makefile
@@ -0,0 +1,5 @@
+
+FWVERSION= 77
+NAME= Qu-b0-jf-b0
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-Qu-c0-hr-b0-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-Qu-c0-hr-b0-fw/Makefile
new file mode 100644
index 000000000000..15389b3c3e2f
--- /dev/null
+++ b/sys/modules/iwlwififw/iwlwifi-Qu-c0-hr-b0-fw/Makefile
@@ -0,0 +1,5 @@
+
+FWVERSION= 77
+NAME= Qu-c0-hr-b0
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-Qu-c0-jf-b0-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-Qu-c0-jf-b0-fw/Makefile
new file mode 100644
index 000000000000..bd9cd5077021
--- /dev/null
+++ b/sys/modules/iwlwififw/iwlwifi-Qu-c0-jf-b0-fw/Makefile
@@ -0,0 +1,5 @@
+
+FWVERSION= 77
+NAME= Qu-c0-jf-b0
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-QuZ-a0-hr-b0-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-QuZ-a0-hr-b0-fw/Makefile
new file mode 100644
index 000000000000..d15ee3643679
--- /dev/null
+++ b/sys/modules/iwlwififw/iwlwifi-QuZ-a0-hr-b0-fw/Makefile
@@ -0,0 +1,5 @@
+
+FWVERSION= 77
+NAME= QuZ-a0-hr-b0
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-QuZ-a0-jf-b0-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-QuZ-a0-jf-b0-fw/Makefile
new file mode 100644
index 000000000000..ac0f398a10d6
--- /dev/null
+++ b/sys/modules/iwlwififw/iwlwifi-QuZ-a0-jf-b0-fw/Makefile
@@ -0,0 +1,5 @@
+
+FWVERSION= 77
+NAME= QuZ-a0-jf-b0
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-cc-a0-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-cc-a0-fw/Makefile
new file mode 100644
index 000000000000..645e3c94684a
--- /dev/null
+++ b/sys/modules/iwlwififw/iwlwifi-cc-a0-fw/Makefile
@@ -0,0 +1,5 @@
+
+FWVERSION= 77
+NAME= cc-a0
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-so-a0-gf-a0-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-so-a0-gf-a0-fw/Makefile
new file mode 100644
index 000000000000..4106eedfa339
--- /dev/null
+++ b/sys/modules/iwlwififw/iwlwifi-so-a0-gf-a0-fw/Makefile
@@ -0,0 +1,5 @@
+
+FWVERSION= 83
+NAME= so-a0-gf-a0
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-so-a0-gf-a0-pnvm/Makefile b/sys/modules/iwlwififw/iwlwifi-so-a0-gf-a0-pnvm/Makefile
new file mode 100644
index 000000000000..56b5cbde6c26
--- /dev/null
+++ b/sys/modules/iwlwififw/iwlwifi-so-a0-gf-a0-pnvm/Makefile
@@ -0,0 +1,7 @@
+
+FWVERSION= 83
+NAME= so-a0-gf-a0
+EXT= pnvm
+_NAME= iwlwifi-${NAME}.${EXT}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-so-a0-gf4-a0-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-so-a0-gf4-a0-fw/Makefile
new file mode 100644
index 000000000000..f89756193b89
--- /dev/null
+++ b/sys/modules/iwlwififw/iwlwifi-so-a0-gf4-a0-fw/Makefile
@@ -0,0 +1,5 @@
+
+FWVERSION= 83
+NAME= so-a0-gf4-a0
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-so-a0-gf4-a0-pnvm/Makefile b/sys/modules/iwlwififw/iwlwifi-so-a0-gf4-a0-pnvm/Makefile
new file mode 100644
index 000000000000..a13ba593b628
--- /dev/null
+++ b/sys/modules/iwlwififw/iwlwifi-so-a0-gf4-a0-pnvm/Makefile
@@ -0,0 +1,7 @@
+
+FWVERSION= 83
+NAME= so-a0-gf4-a0
+EXT= pnvm
+_NAME= iwlwifi-${NAME}.${EXT}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-so-a0-hr-b0-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-so-a0-hr-b0-fw/Makefile
new file mode 100644
index 000000000000..ae908c41376a
--- /dev/null
+++ b/sys/modules/iwlwififw/iwlwifi-so-a0-hr-b0-fw/Makefile
@@ -0,0 +1,5 @@
+
+FWVERSION= 81
+NAME= so-a0-hr-b0
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-so-a0-jf-b0-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-so-a0-jf-b0-fw/Makefile
new file mode 100644
index 000000000000..372a04314cf7
--- /dev/null
+++ b/sys/modules/iwlwififw/iwlwifi-so-a0-jf-b0-fw/Makefile
@@ -0,0 +1,5 @@
+
+FWVERSION= 77
+NAME= so-a0-jf-b0
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-ty-a0-gf-a0-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-ty-a0-gf-a0-fw/Makefile
new file mode 100644
index 000000000000..3bb0931b5248
--- /dev/null
+++ b/sys/modules/iwlwififw/iwlwifi-ty-a0-gf-a0-fw/Makefile
@@ -0,0 +1,5 @@
+
+FWVERSION= 83
+NAME= ty-a0-gf-a0
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwififw/iwlwifi-ty-a0-gf-a0-pnvm/Makefile b/sys/modules/iwlwififw/iwlwifi-ty-a0-gf-a0-pnvm/Makefile
new file mode 100644
index 000000000000..1dcb41414755
--- /dev/null
+++ b/sys/modules/iwlwififw/iwlwifi-ty-a0-gf-a0-pnvm/Makefile
@@ -0,0 +1,7 @@
+
+FWVERSION= 83
+NAME= ty-a0-gf-a0
+EXT= pnvm
+_NAME= iwlwifi-${NAME}.${EXT}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwm/Makefile b/sys/modules/iwm/Makefile
new file mode 100644
index 000000000000..a115c4a807bb
--- /dev/null
+++ b/sys/modules/iwm/Makefile
@@ -0,0 +1,17 @@
+
+.PATH: ${SRCTOP}/sys/dev/iwm
+
+KMOD= if_iwm
+# Main driver
+SRCS= if_iwm.c if_iwm_binding.c if_iwm_util.c if_iwm_phy_db.c
+SRCS+= if_iwm_mac_ctxt.c if_iwm_phy_ctxt.c if_iwm_time_event.c
+SRCS+= if_iwm_power.c if_iwm_scan.c if_iwm_led.c if_iwm_notif_wait.c
+SRCS+= if_iwm_7000.c if_iwm_8000.c if_iwm_9000.c if_iwm_fw.c if_iwm_9260.c
+SRCS+= if_iwm_sta.c if_iwm_sf.c
+# bus layer
+SRCS+= if_iwm_pcie_trans.c
+SRCS+= device_if.h bus_if.h pci_if.h opt_wlan.h opt_iwm.h
+
+CFLAGS+= -DIWM_DEBUG
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwmfw/Makefile b/sys/modules/iwmfw/Makefile
new file mode 100644
index 000000000000..1ff62d2ab3bf
--- /dev/null
+++ b/sys/modules/iwmfw/Makefile
@@ -0,0 +1,12 @@
+
+SUBDIR= iwm3160fw \
+ iwm3168fw \
+ iwm7260fw \
+ iwm7265fw \
+ iwm7265Dfw \
+ iwm8000Cfw \
+ iwm8265fw \
+ iwm9000fw \
+ iwm9260fw
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/iwmfw/Makefile.inc b/sys/modules/iwmfw/Makefile.inc
new file mode 100644
index 000000000000..3354a001533b
--- /dev/null
+++ b/sys/modules/iwmfw/Makefile.inc
@@ -0,0 +1,17 @@
+#
+# Common rules for building firmware. Note this gets auto-included
+# by the subdir Makefile's as a consequence of included bsd.kmod.mk.
+
+_FIRM= ${IMG}.fw
+
+CLEANFILES+= ${_FIRM}
+
+FIRMWS= ${_FIRM}:${KMOD}
+
+#
+# Note that a license ack is not needed for iwn.
+#
+#FIRMWARE_LICENSE=
+
+${_FIRM}: ${SRCTOP}/sys/contrib/dev/iwm/${_FIRM}.uu
+ uudecode -p ${.ALLSRC} > ${.TARGET}
diff --git a/sys/modules/iwmfw/iwm3160fw/Makefile b/sys/modules/iwmfw/iwm3160fw/Makefile
new file mode 100644
index 000000000000..42701d1d58d9
--- /dev/null
+++ b/sys/modules/iwmfw/iwm3160fw/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= iwm3160fw
+IMG= iwm-3160-17
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwmfw/iwm3168fw/Makefile b/sys/modules/iwmfw/iwm3168fw/Makefile
new file mode 100644
index 000000000000..2ee4ff4292bc
--- /dev/null
+++ b/sys/modules/iwmfw/iwm3168fw/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= iwm3168fw
+IMG= iwm-3168-22
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwmfw/iwm7260fw/Makefile b/sys/modules/iwmfw/iwm7260fw/Makefile
new file mode 100644
index 000000000000..5d22c2343030
--- /dev/null
+++ b/sys/modules/iwmfw/iwm7260fw/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= iwm7260fw
+IMG= iwm-7260-17
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwmfw/iwm7265Dfw/Makefile b/sys/modules/iwmfw/iwm7265Dfw/Makefile
new file mode 100644
index 000000000000..e3f8af5cbcf2
--- /dev/null
+++ b/sys/modules/iwmfw/iwm7265Dfw/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= iwm7265Dfw
+IMG= iwm-7265D-22
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwmfw/iwm7265fw/Makefile b/sys/modules/iwmfw/iwm7265fw/Makefile
new file mode 100644
index 000000000000..9be31560ccca
--- /dev/null
+++ b/sys/modules/iwmfw/iwm7265fw/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= iwm7265fw
+IMG= iwm-7265-17
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwmfw/iwm8000Cfw/Makefile b/sys/modules/iwmfw/iwm8000Cfw/Makefile
new file mode 100644
index 000000000000..3ba360d4040d
--- /dev/null
+++ b/sys/modules/iwmfw/iwm8000Cfw/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= iwm8000Cfw
+IMG= iwm-8000C-22
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwmfw/iwm8265fw/Makefile b/sys/modules/iwmfw/iwm8265fw/Makefile
new file mode 100644
index 000000000000..1a4930c5e774
--- /dev/null
+++ b/sys/modules/iwmfw/iwm8265fw/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= iwm8265fw
+IMG= iwm-8265-22
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwmfw/iwm9000fw/Makefile b/sys/modules/iwmfw/iwm9000fw/Makefile
new file mode 100644
index 000000000000..d78dce7be8a7
--- /dev/null
+++ b/sys/modules/iwmfw/iwm9000fw/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= iwm9000fw
+IMG= iwm-9000-34
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwmfw/iwm9260fw/Makefile b/sys/modules/iwmfw/iwm9260fw/Makefile
new file mode 100644
index 000000000000..a8693d2b6d61
--- /dev/null
+++ b/sys/modules/iwmfw/iwm9260fw/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= iwm9260fw
+IMG= iwm-9260-34
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwn/Makefile b/sys/modules/iwn/Makefile
new file mode 100644
index 000000000000..5a219ffa5c6d
--- /dev/null
+++ b/sys/modules/iwn/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/iwn
+
+KMOD = if_iwn
+SRCS = if_iwn.c device_if.h bus_if.h pci_if.h opt_iwn.h opt_wlan.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwnfw/Makefile b/sys/modules/iwnfw/Makefile
new file mode 100644
index 000000000000..487009a027a8
--- /dev/null
+++ b/sys/modules/iwnfw/Makefile
@@ -0,0 +1,16 @@
+
+SUBDIR= iwn100 \
+ iwn105 \
+ iwn135 \
+ iwn1000 \
+ iwn2000 \
+ iwn2030 \
+ iwn4965 \
+ iwn5000 \
+ iwn5150 \
+ iwn6000 \
+ iwn6000g2a \
+ iwn6000g2b \
+ iwn6050
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/iwnfw/Makefile.inc b/sys/modules/iwnfw/Makefile.inc
new file mode 100644
index 000000000000..703e5ece3a9b
--- /dev/null
+++ b/sys/modules/iwnfw/Makefile.inc
@@ -0,0 +1,17 @@
+#
+# Common rules for building firmware. Note this gets auto-included
+# by the subdir Makefile's as a consequence of included bsd.kmod.mk.
+
+_FIRM= ${IMG}.fw
+
+CLEANFILES+= ${_FIRM}
+
+FIRMWS= ${_FIRM}:${KMOD}
+
+#
+# Note that a license ack is not needed for iwn.
+#
+#FIRMWARE_LICENSE=
+
+${_FIRM}: ${SRCTOP}/sys/contrib/dev/iwn/${_FIRM}.uu
+ uudecode -p ${.ALLSRC} > ${.TARGET}
diff --git a/sys/modules/iwnfw/iwn100/Makefile b/sys/modules/iwnfw/iwn100/Makefile
new file mode 100644
index 000000000000..24a3943934a6
--- /dev/null
+++ b/sys/modules/iwnfw/iwn100/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= iwn100fw
+IMG= iwlwifi-100-39.31.5.1
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwnfw/iwn1000/Makefile b/sys/modules/iwnfw/iwn1000/Makefile
new file mode 100644
index 000000000000..4107d5a69a28
--- /dev/null
+++ b/sys/modules/iwnfw/iwn1000/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= iwn1000fw
+IMG= iwlwifi-1000-39.31.5.1
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwnfw/iwn105/Makefile b/sys/modules/iwnfw/iwn105/Makefile
new file mode 100644
index 000000000000..71a93d240db4
--- /dev/null
+++ b/sys/modules/iwnfw/iwn105/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= iwn105fw
+IMG= iwlwifi-105-6-18.168.6.1
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwnfw/iwn135/Makefile b/sys/modules/iwnfw/iwn135/Makefile
new file mode 100644
index 000000000000..24f6cf7cf9cf
--- /dev/null
+++ b/sys/modules/iwnfw/iwn135/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= iwn135fw
+IMG= iwlwifi-135-6-18.168.6.1
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwnfw/iwn2000/Makefile b/sys/modules/iwnfw/iwn2000/Makefile
new file mode 100644
index 000000000000..72a676886b03
--- /dev/null
+++ b/sys/modules/iwnfw/iwn2000/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= iwn2000fw
+IMG= iwlwifi-2000-18.168.6.1
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwnfw/iwn2030/Makefile b/sys/modules/iwnfw/iwn2030/Makefile
new file mode 100644
index 000000000000..c11fa66fe9c2
--- /dev/null
+++ b/sys/modules/iwnfw/iwn2030/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= iwn2030fw
+IMG= iwnwifi-2030-18.168.6.1
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwnfw/iwn4965/Makefile b/sys/modules/iwnfw/iwn4965/Makefile
new file mode 100644
index 000000000000..f3bad9ecbf2f
--- /dev/null
+++ b/sys/modules/iwnfw/iwn4965/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= iwn4965fw
+IMG= iwlwifi-4965-228.61.2.24
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwnfw/iwn5000/Makefile b/sys/modules/iwnfw/iwn5000/Makefile
new file mode 100644
index 000000000000..7c79e86c3f9d
--- /dev/null
+++ b/sys/modules/iwnfw/iwn5000/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= iwn5000fw
+IMG= iwlwifi-5000-8.83.5.1
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwnfw/iwn5150/Makefile b/sys/modules/iwnfw/iwn5150/Makefile
new file mode 100644
index 000000000000..c4616797b018
--- /dev/null
+++ b/sys/modules/iwnfw/iwn5150/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= iwn5150fw
+IMG= iwlwifi-5150-8.24.2.2
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwnfw/iwn6000/Makefile b/sys/modules/iwnfw/iwn6000/Makefile
new file mode 100644
index 000000000000..76164ed97f89
--- /dev/null
+++ b/sys/modules/iwnfw/iwn6000/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= iwn6000fw
+IMG= iwlwifi-6000-9.221.4.1
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwnfw/iwn6000g2a/Makefile b/sys/modules/iwnfw/iwn6000g2a/Makefile
new file mode 100644
index 000000000000..61375d6708aa
--- /dev/null
+++ b/sys/modules/iwnfw/iwn6000g2a/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= iwn6000g2afw
+IMG= iwlwifi-6000g2a-18.168.6.1
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwnfw/iwn6000g2b/Makefile b/sys/modules/iwnfw/iwn6000g2b/Makefile
new file mode 100644
index 000000000000..d9020b807d43
--- /dev/null
+++ b/sys/modules/iwnfw/iwn6000g2b/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= iwn6000g2bfw
+IMG= iwlwifi-6000g2b-18.168.6.1
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/iwnfw/iwn6050/Makefile b/sys/modules/iwnfw/iwn6050/Makefile
new file mode 100644
index 000000000000..742a96ca65c9
--- /dev/null
+++ b/sys/modules/iwnfw/iwn6050/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= iwn6050fw
+IMG= iwlwifi-6050-41.28.5.1
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ix/Makefile b/sys/modules/ix/Makefile
new file mode 100644
index 000000000000..2c71371b88f9
--- /dev/null
+++ b/sys/modules/ix/Makefile
@@ -0,0 +1,14 @@
+
+.PATH: ${SRCTOP}/sys/dev/ixgbe
+
+KMOD = if_ix
+SRCS = device_if.h bus_if.h pci_if.h pci_iov_if.h ifdi_if.h
+SRCS += opt_inet.h opt_inet6.h opt_rss.h
+SRCS += if_ix.c if_bypass.c if_fdir.c if_sriov.c ix_txrx.c ixgbe_osdep.c
+# Shared source
+SRCS += ixgbe_common.c ixgbe_api.c ixgbe_phy.c ixgbe_mbx.c ixgbe_vf.c
+SRCS += ixgbe_dcb.c ixgbe_dcb_82598.c ixgbe_dcb_82599.c
+SRCS += ixgbe_82598.c ixgbe_82599.c ixgbe_x540.c ixgbe_x550.c
+CFLAGS+= -I${SRCTOP}/sys/dev/ixgbe
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ixl/Makefile b/sys/modules/ixl/Makefile
new file mode 100644
index 000000000000..32f000734c9a
--- /dev/null
+++ b/sys/modules/ixl/Makefile
@@ -0,0 +1,26 @@
+
+.PATH: ${SRCTOP}/sys/dev/ixl
+
+KMOD = if_ixl
+SRCS = device_if.h bus_if.h pci_if.h ifdi_if.h
+SRCS += opt_inet.h opt_inet6.h opt_rss.h opt_ixl.h opt_iflib.h
+SRCS += ixl_pf_main.c ixl_pf_qmgr.c ixl_txrx.c ixl_pf_i2c.c i40e_osdep.c
+SRCS += if_ixl.c ixl_pf_iflib.c
+SRCS.PCI_IOV += pci_iov_if.h ixl_pf_iov.c
+
+# Shared source
+SRCS += i40e_common.c i40e_nvm.c i40e_adminq.c i40e_lan_hmc.c i40e_hmc.c i40e_dcb.c
+
+# Debug messages / sysctls
+# CFLAGS += -DIXL_DEBUG
+
+# Enable asserts and other debugging facilities
+# CFLAGS += -DINVARIANTS -DINVARIANTS_SUPPORT -DWITNESS
+
+# Enable iWARP client interface
+# CFLAGS += -DIXL_IW
+# SRCS += ixl_iw.c
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ixv/Makefile b/sys/modules/ixv/Makefile
new file mode 100644
index 000000000000..e2616e2cfd5a
--- /dev/null
+++ b/sys/modules/ixv/Makefile
@@ -0,0 +1,14 @@
+
+.PATH: ${SRCTOP}/sys/dev/ixgbe
+
+KMOD = if_ixv
+SRCS = device_if.h bus_if.h pci_if.h pci_iov_if.h ifdi_if.h
+SRCS += opt_inet.h opt_inet6.h opt_rss.h
+SRCS += if_ixv.c if_fdir.c ix_txrx.c ixgbe_osdep.c
+# Shared source
+SRCS += ixgbe_common.c ixgbe_api.c ixgbe_phy.c ixgbe_mbx.c ixgbe_vf.c
+SRCS += ixgbe_dcb.c ixgbe_dcb_82598.c ixgbe_dcb_82599.c
+SRCS += ixgbe_82598.c ixgbe_82599.c ixgbe_x540.c ixgbe_x550.c
+CFLAGS+= -I${SRCTOP}/sys/dev/ixgbe
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/jme/Makefile b/sys/modules/jme/Makefile
new file mode 100644
index 000000000000..414b579e06d8
--- /dev/null
+++ b/sys/modules/jme/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/jme
+
+KMOD= if_jme
+SRCS= if_jme.c device_if.h bus_if.h pci_if.h miibus_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/kbdmux/Makefile b/sys/modules/kbdmux/Makefile
new file mode 100644
index 000000000000..8469d2867a70
--- /dev/null
+++ b/sys/modules/kbdmux/Makefile
@@ -0,0 +1,14 @@
+# $Id: Makefile,v 1.1 2005/06/23 00:30:50 max Exp $
+
+.PATH: ${SRCTOP}/sys/dev/kbdmux
+
+KMOD= kbdmux
+SRCS= kbdmux.c opt_evdev.h opt_kbd.h opt_kbdmux.h bus_if.h \
+ device_if.h
+
+.if !defined(KERNBUILDDIR)
+opt_kbd.h:
+ echo "#define KBD_INSTALL_CDEV 1" > ${.TARGET}
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/kgssapi/Makefile b/sys/modules/kgssapi/Makefile
new file mode 100644
index 000000000000..a3eb812fd6e6
--- /dev/null
+++ b/sys/modules/kgssapi/Makefile
@@ -0,0 +1,56 @@
+
+.PATH: ${SRCTOP}/sys/kgssapi ${SRCTOP}/sys/rpc/rpcsec_gss
+KMOD= kgssapi
+
+SRCS= gss_accept_sec_context.c \
+ gss_add_oid_set_member.c \
+ gss_acquire_cred.c \
+ gss_canonicalize_name.c \
+ gss_create_empty_oid_set.c \
+ gss_delete_sec_context.c \
+ gss_display_status.c \
+ gss_export_name.c \
+ gss_get_mic.c \
+ gss_init_sec_context.c \
+ gss_impl.c \
+ gss_import_name.c \
+ gss_ip_to_dns.c \
+ gss_names.c \
+ gss_pname_to_uid.c \
+ gss_release_buffer.c \
+ gss_release_cred.c \
+ gss_release_name.c \
+ gss_release_oid_set.c \
+ gss_set_cred_option.c \
+ gss_test_oid_set_member.c \
+ gss_unwrap.c \
+ gss_verify_mic.c \
+ gss_wrap.c \
+ gss_wrap_size_limit.c \
+ gssd_prot.c
+
+SRCS+= rpcsec_gss.c \
+ rpcsec_gss_conf.c \
+ rpcsec_gss_misc.c \
+ rpcsec_gss_prot.c \
+ svc_rpcsec_gss.c
+
+SRCS+= kgss_if.h kgss_if.c
+
+SRCS+= gssd.h gssd_xdr.c gssd_clnt.c
+CLEANFILES= gssd.h gssd_xdr.c gssd_clnt.c
+
+S= ${SRCTOP}/sys
+
+gssd.h: $S/kgssapi/gssd.x
+ RPCGEN_CPP=${CPP:Q} rpcgen -hM $S/kgssapi/gssd.x | grep -v pthread.h > gssd.h
+
+gssd_xdr.c: $S/kgssapi/gssd.x
+ RPCGEN_CPP=${CPP:Q} rpcgen -c $S/kgssapi/gssd.x -o gssd_xdr.c
+
+gssd_clnt.c: $S/kgssapi/gssd.x
+ RPCGEN_CPP=${CPP:Q} rpcgen -lM $S/kgssapi/gssd.x | grep -v string.h > gssd_clnt.c
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/kgssapi_krb5/Makefile b/sys/modules/kgssapi_krb5/Makefile
new file mode 100644
index 000000000000..a540e9a74015
--- /dev/null
+++ b/sys/modules/kgssapi_krb5/Makefile
@@ -0,0 +1,18 @@
+
+.PATH: ${SRCTOP}/sys/kgssapi/krb5
+KMOD= kgssapi_krb5
+
+SRCS= krb5_mech.c \
+ kcrypto.c \
+ kcrypto_aes.c \
+ opt_inet6.h
+
+SRCS+= kgss_if.h gssd.h
+CLEANFILES= gssd.h
+
+S= ${SRCTOP}/sys
+
+gssd.h: $S/kgssapi/gssd.x
+ RPCGEN_CPP=${CPP:Q} rpcgen -hM $S/kgssapi/gssd.x | grep -v pthread.h > gssd.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/khelp/Makefile b/sys/modules/khelp/Makefile
new file mode 100644
index 000000000000..173ba679bfcf
--- /dev/null
+++ b/sys/modules/khelp/Makefile
@@ -0,0 +1,12 @@
+
+SUBDIR=
+
+# Do we have the TCP_HHOOK symbol defined? If not, there is no point in
+# building this modules by default.
+# We will default to building this module if $OPT_GLOBAL does contain
+# the TCP_HHOOK option.
+.if defined(ALL_MODULES) || ${OPT_GLOBAL:UTCP_HHOOK:MTCP_HHOOK} != ""
+SUBDIR+= h_ertt
+.endif
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/khelp/h_ertt/Makefile b/sys/modules/khelp/h_ertt/Makefile
new file mode 100644
index 000000000000..d149cf254b60
--- /dev/null
+++ b/sys/modules/khelp/h_ertt/Makefile
@@ -0,0 +1,6 @@
+
+.PATH: ${SRCTOP}/sys/netinet/khelp
+KMOD= h_ertt
+SRCS= h_ertt.c opt_kern_tls.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/krpc/Makefile b/sys/modules/krpc/Makefile
new file mode 100644
index 000000000000..168d1a3fc623
--- /dev/null
+++ b/sys/modules/krpc/Makefile
@@ -0,0 +1,59 @@
+
+.PATH: ${SRCTOP}/sys/rpc ${SRCTOP}/sys/rpc/rpcsec_tls
+KMOD= krpc
+SRCS= auth_none.c \
+ auth_unix.c \
+ authunix_prot.c \
+ clnt_bck.c \
+ clnt_dg.c \
+ clnt_rc.c \
+ clnt_vc.c \
+ getnetconfig.c \
+ rpc_callmsg.c \
+ rpc_generic.c \
+ rpc_prot.c \
+ rpcb_clnt.c \
+ rpcb_prot.c \
+ replay.c \
+ svc.c \
+ svc_auth.c \
+ svc_auth_unix.c \
+ svc_dg.c \
+ svc_generic.c \
+ svc_vc.c
+
+SRCS+= rpctls_impl.c auth_tls.c
+
+SRCS+= opt_inet6.h opt_kern_tls.h
+
+SRCS+= rpctlscd.h rpctlscd_xdr.c rpctlscd_clnt.c
+CLEANFILES= rpctlscd.h rpctlscd_xdr.c rpctlscd_clnt.c
+
+S= ${SRCTOP}/sys
+
+rpctlscd.h: $S/rpc/rpcsec_tls/rpctlscd.x
+ RPCGEN_CPP=${CPP:Q} rpcgen -hM $S/rpc/rpcsec_tls/rpctlscd.x | grep -v pthread.h > rpctlscd.h
+
+rpctlscd_xdr.c: $S/rpc/rpcsec_tls/rpctlscd.x
+ RPCGEN_CPP=${CPP:Q} rpcgen -c $S/rpc/rpcsec_tls/rpctlscd.x -o rpctlscd_xdr.c
+
+rpctlscd_clnt.c: $S/rpc/rpcsec_tls/rpctlscd.x
+ RPCGEN_CPP=${CPP:Q} rpcgen -lM $S/rpc/rpcsec_tls/rpctlscd.x | grep -v string.h > rpctlscd_clnt.c
+
+SRCS+= rpctlssd.h rpctlssd_xdr.c rpctlssd_clnt.c
+CLEANFILES= rpctlssd.h rpctlssd_xdr.c rpctlssd_clnt.c
+
+S= ${SRCTOP}/sys
+
+rpctlssd.h: $S/rpc/rpcsec_tls/rpctlssd.x
+ RPCGEN_CPP=${CPP:Q} rpcgen -hM $S/rpc/rpcsec_tls/rpctlssd.x | grep -v pthread.h > rpctlssd.h
+
+rpctlssd_xdr.c: $S/rpc/rpcsec_tls/rpctlssd.x
+ RPCGEN_CPP=${CPP:Q} rpcgen -c $S/rpc/rpcsec_tls/rpctlssd.x -o rpctlssd_xdr.c
+
+rpctlssd_clnt.c: $S/rpc/rpcsec_tls/rpctlssd.x
+ RPCGEN_CPP=${CPP:Q} rpcgen -lM $S/rpc/rpcsec_tls/rpctlssd.x | grep -v string.h > rpctlssd_clnt.c
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ksyms/Makefile b/sys/modules/ksyms/Makefile
new file mode 100644
index 000000000000..bf5f5fec89d4
--- /dev/null
+++ b/sys/modules/ksyms/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/ksyms
+
+KMOD= ksyms
+SRCS= ksyms.c linker_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ktest/Makefile b/sys/modules/ktest/Makefile
new file mode 100644
index 000000000000..151db53417df
--- /dev/null
+++ b/sys/modules/ktest/Makefile
@@ -0,0 +1,8 @@
+SYSDIR?=${SRCTOP}/sys
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+SUBDIR= ktest \
+ ktest_example \
+ ktest_netlink_message_writer
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/ktest/ktest/Makefile b/sys/modules/ktest/ktest/Makefile
new file mode 100644
index 000000000000..264eb7b9f443
--- /dev/null
+++ b/sys/modules/ktest/ktest/Makefile
@@ -0,0 +1,12 @@
+
+PACKAGE= tests
+
+SYSDIR?=${SRCTOP}/sys
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+.PATH: ${SYSDIR}/tests
+
+KMOD= ktest
+SRCS= ktest.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ktest/ktest_example/Makefile b/sys/modules/ktest/ktest_example/Makefile
new file mode 100644
index 000000000000..a5fe6d6d7843
--- /dev/null
+++ b/sys/modules/ktest/ktest_example/Makefile
@@ -0,0 +1,12 @@
+
+PACKAGE= tests
+
+SYSDIR?=${SRCTOP}/sys
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+.PATH: ${SYSDIR}/tests
+
+KMOD= ktest_example
+SRCS= ktest_example.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ktest/ktest_netlink_message_writer/Makefile b/sys/modules/ktest/ktest_netlink_message_writer/Makefile
new file mode 100644
index 000000000000..2f84b2fecd72
--- /dev/null
+++ b/sys/modules/ktest/ktest_netlink_message_writer/Makefile
@@ -0,0 +1,13 @@
+
+PACKAGE= tests
+
+SYSDIR?=${SRCTOP}/sys
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+.PATH: ${SYSDIR}/netlink
+
+KMOD= ktest_netlink_message_writer
+SRCS= ktest_netlink_message_writer.c
+
+.include <bsd.kmod.mk>
+
diff --git a/sys/modules/le/Makefile b/sys/modules/le/Makefile
new file mode 100644
index 000000000000..4364a4fc660e
--- /dev/null
+++ b/sys/modules/le/Makefile
@@ -0,0 +1,13 @@
+
+.PATH: ${SRCTOP}/sys/dev/le
+
+KMOD= if_le
+SRCS= am7990.c am79900.c ${if_le_isa} if_le_pci.c lance.c
+SRCS+= bus_if.h device_if.h ${isa_if} pci_if.h
+
+.if ${MACHINE_CPUARCH} == "i386"
+if_le_isa= if_le_isa.c
+isa_if= isa_if.h
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/lge/Makefile b/sys/modules/lge/Makefile
new file mode 100644
index 000000000000..45869c039454
--- /dev/null
+++ b/sys/modules/lge/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/lge
+
+KMOD= if_lge
+SRCS= if_lge.c miibus_if.h device_if.h bus_if.h pci_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/libalias/Makefile b/sys/modules/libalias/Makefile
new file mode 100644
index 000000000000..02fd37c62a1c
--- /dev/null
+++ b/sys/modules/libalias/Makefile
@@ -0,0 +1,4 @@
+
+SUBDIR= libalias modules
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/libalias/libalias/Makefile b/sys/modules/libalias/libalias/Makefile
new file mode 100644
index 000000000000..e72e8e0e1290
--- /dev/null
+++ b/sys/modules/libalias/libalias/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/netinet/libalias
+
+KMOD= libalias
+SRCS= alias.c alias_db.c alias_proxy.c alias_util.c alias_mod.c alias_sctp.c
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/libalias/modules/Makefile b/sys/modules/libalias/modules/Makefile
new file mode 100644
index 000000000000..a2c945965ca2
--- /dev/null
+++ b/sys/modules/libalias/modules/Makefile
@@ -0,0 +1,6 @@
+
+.include "${.CURDIR}/modules.inc"
+
+SUBDIR= ${MODULES}
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/libalias/modules/Makefile.inc b/sys/modules/libalias/modules/Makefile.inc
new file mode 100644
index 000000000000..86228d56da8f
--- /dev/null
+++ b/sys/modules/libalias/modules/Makefile.inc
@@ -0,0 +1,2 @@
+
+.PATH: ${SRCTOP}/sys/netinet/libalias
diff --git a/sys/modules/libalias/modules/dummy/Makefile b/sys/modules/libalias/modules/dummy/Makefile
new file mode 100644
index 000000000000..77f54c6e393d
--- /dev/null
+++ b/sys/modules/libalias/modules/dummy/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= alias_dummy
+SRCS= alias_dummy.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/libalias/modules/ftp/Makefile b/sys/modules/libalias/modules/ftp/Makefile
new file mode 100644
index 000000000000..b3297081b2d7
--- /dev/null
+++ b/sys/modules/libalias/modules/ftp/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= alias_ftp
+SRCS= alias_ftp.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/libalias/modules/irc/Makefile b/sys/modules/libalias/modules/irc/Makefile
new file mode 100644
index 000000000000..b2bd99ca88cc
--- /dev/null
+++ b/sys/modules/libalias/modules/irc/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= alias_irc
+SRCS= alias_irc.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/libalias/modules/modules.inc b/sys/modules/libalias/modules/modules.inc
new file mode 100644
index 000000000000..20f1a020d5ff
--- /dev/null
+++ b/sys/modules/libalias/modules/modules.inc
@@ -0,0 +1,9 @@
+
+MODULES =
+MODULES += dummy
+MODULES += ftp
+MODULES += irc
+MODULES += nbt
+MODULES += pptp
+MODULES += skinny
+MODULES += smedia
diff --git a/sys/modules/libalias/modules/nbt/Makefile b/sys/modules/libalias/modules/nbt/Makefile
new file mode 100644
index 000000000000..3de4a9a1e0af
--- /dev/null
+++ b/sys/modules/libalias/modules/nbt/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= alias_nbt
+SRCS= alias_nbt.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/libalias/modules/pptp/Makefile b/sys/modules/libalias/modules/pptp/Makefile
new file mode 100644
index 000000000000..379cc180d539
--- /dev/null
+++ b/sys/modules/libalias/modules/pptp/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= alias_pptp
+SRCS= alias_pptp.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/libalias/modules/skinny/Makefile b/sys/modules/libalias/modules/skinny/Makefile
new file mode 100644
index 000000000000..d62ba63b2f04
--- /dev/null
+++ b/sys/modules/libalias/modules/skinny/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= alias_skinny
+SRCS= alias_skinny.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/libalias/modules/smedia/Makefile b/sys/modules/libalias/modules/smedia/Makefile
new file mode 100644
index 000000000000..e0a7e7747c5c
--- /dev/null
+++ b/sys/modules/libalias/modules/smedia/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= alias_smedia
+SRCS= alias_smedia.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/libiconv/Makefile b/sys/modules/libiconv/Makefile
new file mode 100644
index 000000000000..0100bd707cfe
--- /dev/null
+++ b/sys/modules/libiconv/Makefile
@@ -0,0 +1,20 @@
+
+.PATH: ${SRCTOP}/sys/libkern ${SRCTOP}/sys/sys
+
+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
+
+EXPORT_SYMS= iconv_add \
+ iconv_open \
+ iconv_close \
+ iconv_conv \
+ iconv_conv_case \
+ iconv_convchr \
+ iconv_convchr_case \
+ iconv_convstr \
+ iconv_convmem \
+ iconv_vfs_refcount
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/libmchain/Makefile b/sys/modules/libmchain/Makefile
new file mode 100644
index 000000000000..aabaa311ac45
--- /dev/null
+++ b/sys/modules/libmchain/Makefile
@@ -0,0 +1,43 @@
+
+.PATH: ${SRCTOP}/sys/kern
+
+KMOD= libmchain
+SRCS= subr_mchain.c
+
+EXPORT_SYMS= mb_init \
+ mb_initm \
+ mb_done \
+ mb_detach \
+ mb_fixhdr \
+ mb_reserve \
+ mb_put_padbyte \
+ mb_put_uint8 \
+ mb_put_uint16be \
+ mb_put_uint16le \
+ mb_put_uint32be \
+ mb_put_uint32le \
+ mb_put_int64be \
+ mb_put_int64le \
+ mb_put_mem \
+ mb_put_mbuf \
+ mb_put_uio \
+ md_init \
+ md_initm \
+ md_done \
+ md_append_record \
+ md_next_record \
+ md_get_uint8 \
+ md_get_uint16 \
+ md_get_uint16le \
+ md_get_uint16be \
+ md_get_uint32 \
+ md_get_uint32be \
+ md_get_uint32le \
+ md_get_int64 \
+ md_get_int64be \
+ md_get_int64le \
+ md_get_mem \
+ md_get_mbuf \
+ md_get_uio \
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/lindebugfs/Makefile b/sys/modules/lindebugfs/Makefile
new file mode 100644
index 000000000000..542a2fb7b6da
--- /dev/null
+++ b/sys/modules/lindebugfs/Makefile
@@ -0,0 +1,10 @@
+
+.PATH: ${SRCTOP}/sys/compat/lindebugfs
+
+KMOD= lindebugfs
+SRCS= lindebugfs.c
+SRCS+= ${LINUXKPI_GENSRCS}
+
+CFLAGS+= ${LINUXKPI_INCLUDES}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/linprocfs/Makefile b/sys/modules/linprocfs/Makefile
new file mode 100644
index 000000000000..df282d7eef31
--- /dev/null
+++ b/sys/modules/linprocfs/Makefile
@@ -0,0 +1,13 @@
+
+.PATH: ${SRCTOP}/sys/compat/linprocfs
+
+KMOD= linprocfs
+SRCS= vnode_if.h \
+ device_if.h bus_if.h opt_inet.h \
+ linprocfs.c
+
+.if !defined(KERNBUILDDIR)
+.warning Building Linuxulator outside of a kernel does not make sense
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/linsysfs/Makefile b/sys/modules/linsysfs/Makefile
new file mode 100644
index 000000000000..a9741d13cfee
--- /dev/null
+++ b/sys/modules/linsysfs/Makefile
@@ -0,0 +1,13 @@
+
+.PATH: ${SRCTOP}/sys/compat/linsysfs
+
+KMOD= linsysfs
+SRCS= vnode_if.h \
+ device_if.h bus_if.h pci_if.h \
+ linsysfs.c linsysfs_net.c
+
+.if !defined(KERNBUILDDIR)
+.warning Building Linuxulator outside of a kernel does not make sense
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/linux/Makefile b/sys/modules/linux/Makefile
new file mode 100644
index 000000000000..d1035445ccfb
--- /dev/null
+++ b/sys/modules/linux/Makefile
@@ -0,0 +1,146 @@
+
+.if ${MACHINE_CPUARCH} == "amd64"
+SFX= 32
+CFLAGS+=-DCOMPAT_FREEBSD32 -DCOMPAT_LINUX32
+.endif
+
+.PATH: ${SRCTOP}/sys/compat/linux ${SRCTOP}/sys/${MACHINE_CPUARCH}/linux${SFX}
+.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
+.PATH: ${SRCTOP}/sys/x86/linux
+.endif
+
+KMOD= linux
+SRCS= linux${SFX}_dummy_machdep.c \
+ linux_elf32.c \
+ linux_event.c \
+ linux_file.c \
+ linux_fork.c \
+ linux_futex.c \
+ linux_getcwd.c \
+ linux_ioctl.c \
+ linux_ipc.c \
+ linux${SFX}_machdep.c \
+ linux_misc.c \
+ linux_rseq.c \
+ linux_signal.c \
+ linux_socket.c \
+ linux_stats.c \
+ linux${SFX}_syscalls.c \
+ linux_sysctl.c \
+ linux${SFX}_sysent.c \
+ linux${SFX}_sysvec.c \
+ linux_time.c \
+ linux_timer.c \
+ linux_uid16.c \
+ linux_vdso.c \
+ linux_xattr.c \
+ opt_inet6.h \
+ opt_ktrace.h \
+ opt_posix.h \
+ bus_if.h \
+ device_if.h \
+ vnode_if.h
+.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
+SRCS+= linux_dummy_x86.c
+VDSODEPS=linux_vdso_gettc_x86.inc
+.endif
+.if ${MACHINE_CPUARCH} == "amd64"
+SRCS+= linux${SFX}_support.S
+.endif
+DPSRCS= assym.inc linux${SFX}_genassym.c
+
+# XXX: for assym.inc
+SRCS+= opt_kstack_pages.h opt_nfs.h opt_hwpmc_hooks.h
+.if ${MACHINE_CPUARCH} == "i386"
+SRCS+= opt_apic.h opt_cpu.h
+.endif
+
+OBJS= linux${SFX}_vdso.so
+
+.if ${MACHINE_CPUARCH} == "i386"
+SRCS+= imgact_linux.c \
+ linux.c \
+ linux_dummy.c \
+ linux_emul.c \
+ linux_errno.c \
+ linux_mib.c \
+ linux_mmap.c \
+ linux_ptrace_machdep.c \
+ linux_util.c \
+ linux_vdso_selector_x86.c \
+ linux_x86.c \
+ linux_copyout.c \
+ linux_netlink.c
+.endif
+
+.if ${MACHINE_CPUARCH} == "i386"
+EXPORT_SYMS=
+EXPORT_SYMS+= linux_get_osname
+EXPORT_SYMS+= linux_get_osrelease
+EXPORT_SYMS+= linux_ioctl_register_handler
+EXPORT_SYMS+= linux_ioctl_unregister_handler
+.endif
+
+CLEANFILES= linux${SFX}_assym.h linux${SFX}_genassym.o linux${SFX}_locore.o \
+ genassym.o linux${SFX}_vdso_gtod.o linux${SFX}_vdso.so.o
+
+linux${SFX}_assym.h: linux${SFX}_genassym.o
+ sh ${SYSDIR}/kern/genassym.sh linux${SFX}_genassym.o > ${.TARGET}
+
+.if ${MACHINE_CPUARCH} == "amd64"
+VDSOFLAGS=-DCOMPAT_FREEBSD32 -DCOMPAT_LINUX32 -m32
+.else
+VDSOFLAGS=-mregparm=0
+.endif
+
+linux${SFX}_locore.o: linux${SFX}_assym.h assym.inc
+ ${CC} -c -x assembler-with-cpp -DLOCORE -fPIC -pipe -O2 -Werror \
+ -msoft-float \
+ -fno-common -nostdinc -fasynchronous-unwind-tables \
+ -fno-omit-frame-pointer -foptimize-sibling-calls ${VDSOFLAGS} \
+ -fno-stack-protector -I. -I${SYSDIR} -I${SRCTOP}/include \
+ ${.IMPSRC} -o ${.TARGET}
+
+linux${SFX}_vdso_gtod.o: linux_vdso_gtod.inc ${VDSODEPS}
+ ${CC} -c -fPIC -pipe -O2 -Werror -msoft-float \
+ -fno-common -nostdinc -fasynchronous-unwind-tables \
+ -fno-omit-frame-pointer -foptimize-sibling-calls ${VDSOFLAGS} \
+ -fno-stack-protector -I. -I${SYSDIR} -I${SRCTOP}/include \
+ ${.IMPSRC} -o ${.TARGET}
+
+linux${SFX}_vdso.so.o: linux${SFX}_locore.o linux${SFX}_vdso_gtod.o
+ ${LD} -m elf_i386 --shared --eh-frame-hdr -soname=linux-gate.so.1 \
+ --no-undefined --hash-style=both -warn-common -nostdlib \
+ --strip-debug -s --build-id=sha1 --Bsymbolic \
+ -T${SRCTOP}/sys/${MACHINE}/linux${SFX}/linux${SFX}_vdso.lds.s \
+ -o ${.TARGET} ${.ALLSRC:M*.o}
+
+.if ${MACHINE_CPUARCH} == "amd64"
+OBJCOPY_TARGET=--output-target elf64-x86-64-freebsd --binary-architecture i386
+.elif ${MACHINE_CPUARCH} == "i386"
+OBJCOPY_TARGET=--output-target elf32-i386-freebsd --binary-architecture i386
+.else
+.error ${MACHINE_CPUARCH} not yet supported by linux
+.endif
+
+linux${SFX}_vdso.so: linux${SFX}_vdso.so.o
+ ${OBJCOPY} --input-target binary ${OBJCOPY_TARGET} \
+ linux${SFX}_vdso.so.o ${.TARGET}
+ ${STRIPBIN} -N _binary_linux${SFX}_vdso_so_o_size ${.TARGET}
+
+.if ${MACHINE_CPUARCH} == "amd64"
+linux${SFX}_support.o: linux${SFX}_support.S linux${SFX}_assym.h assym.inc
+ ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \
+ ${.ALLSRC:M*.S:u} -o ${.TARGET}
+.endif
+
+linux${SFX}_genassym.o: offset.inc
+ ${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon ${.IMPSRC}
+
+.if !defined(KERNBUILDDIR)
+.warning Building Linuxulator outside of a kernel does not make sense
+.endif
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/linux64/Makefile b/sys/modules/linux64/Makefile
new file mode 100644
index 000000000000..05fe76ba6a51
--- /dev/null
+++ b/sys/modules/linux64/Makefile
@@ -0,0 +1,112 @@
+
+.PATH: ${SRCTOP}/sys/compat/linux ${SRCTOP}/sys/${MACHINE}/linux
+.if ${MACHINE_CPUARCH} == "amd64"
+.PATH: ${SRCTOP}/sys/x86/linux
+.endif
+
+KMOD= linux64
+SRCS= linux_dummy_machdep.c \
+ linux_elf64.c \
+ linux_event.c \
+ linux_file.c \
+ linux_fork.c \
+ linux_futex.c \
+ linux_getcwd.c \
+ linux_ioctl.c \
+ linux_ipc.c \
+ linux_machdep.c \
+ linux_misc.c \
+ linux_ptrace.c \
+ linux_rseq.c \
+ linux_signal.c \
+ linux_socket.c \
+ linux_stats.c \
+ linux_syscalls.c \
+ linux_sysctl.c \
+ linux_sysent.c \
+ linux_sysvec.c \
+ linux_time.c \
+ linux_vdso.c \
+ linux_timer.c \
+ linux_xattr.c \
+ opt_ktrace.h \
+ opt_inet6.h \
+ opt_posix.h \
+ bus_if.h \
+ device_if.h \
+ vnode_if.h \
+ linux_support.S
+.if ${MACHINE_CPUARCH} == "amd64"
+SRCS+= linux_dummy_x86.c
+.endif
+DPSRCS= assym.inc linux_genassym.c
+
+# XXX: for assym.inc
+SRCS+= opt_kstack_pages.h opt_nfs.h opt_hwpmc_hooks.h
+
+CLEANFILES= linux_assym.h linux_genassym.o linux_locore.o \
+ genassym.o linux_vdso_gtod.o linux_vdso.so.o
+
+OBJS= linux_vdso.so
+
+linux_assym.h: linux_genassym.o
+ sh ${SYSDIR}/kern/genassym.sh linux_genassym.o > ${.TARGET}
+
+.if ${MACHINE_CPUARCH} == "amd64"
+VDSOFLAGS=-mcmodel=small -msoft-float
+VDSODEPS=linux_vdso_gettc_x86.inc
+.elif ${MACHINE_CPUARCH} == "aarch64"
+# The Linux uses tiny memory model, but our ld does not know about
+# some of relocation types which is generated by cc
+VDSOFLAGS=-mgeneral-regs-only -mcmodel=small -ffixed-x18
+.endif
+
+linux_locore.o: linux_assym.h assym.inc
+ ${CC} -c -x assembler-with-cpp -DLOCORE \
+ -fPIC -pipe -O2 -Werror ${VDSOFLAGS} \
+ -nostdinc -fasynchronous-unwind-tables \
+ -fno-omit-frame-pointer -foptimize-sibling-calls \
+ -fno-stack-protector -I. -I${SYSDIR} -I${SRCTOP}/include \
+ ${.IMPSRC} -o ${.TARGET}
+
+linux_vdso_gtod.o: linux_vdso_gtod.inc ${VDSODEPS}
+ ${CC} -c -fPIC -pipe -O2 -Werror ${VDSOFLAGS} \
+ -nostdinc -fasynchronous-unwind-tables \
+ -fno-omit-frame-pointer -foptimize-sibling-calls \
+ -fno-stack-protector -I. -I${SYSDIR} -I${SRCTOP}/include \
+ ${.IMPSRC} -o ${.TARGET}
+
+linux_vdso.so.o: linux_locore.o linux_vdso_gtod.o
+ ${LD} --shared --eh-frame-hdr -soname=linux-vdso.so.1 \
+ --no-undefined --hash-style=both -warn-common -nostdlib \
+ --strip-debug -s --build-id=sha1 -Bsymbolic \
+ -T${SRCTOP}/sys/${MACHINE}/linux/linux_vdso.lds.s \
+ -o ${.TARGET} ${.ALLSRC:M*.o}
+
+.if ${MACHINE_CPUARCH} == "aarch64"
+OBJCOPY_TARGET=--output-target elf64-littleaarch64 --binary-architecture aarch64
+.elif ${MACHINE_CPUARCH} == "amd64"
+OBJCOPY_TARGET=--output-target elf64-x86-64 --binary-architecture i386:x86-64
+.else
+.error ${MACHINE_CPUARCH} not yet supported by linux64
+.endif
+
+linux_vdso.so: linux_vdso.so.o
+ ${OBJCOPY} --input-target binary ${OBJCOPY_TARGET} \
+ linux_vdso.so.o ${.TARGET}
+ ${STRIPBIN} -N _binary_linux_vdso_so_o_size ${.TARGET}
+
+linux_support.o: linux_support.S assym.inc linux_assym.h
+ ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \
+ ${.ALLSRC:M*.S:u} -o ${.TARGET}
+
+linux_genassym.o: offset.inc
+ ${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon ${.IMPSRC}
+
+.if !defined(KERNBUILDDIR)
+.warning Building Linuxulator outside of a kernel does not make sense
+.endif
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/linux_common/Makefile b/sys/modules/linux_common/Makefile
new file mode 100644
index 000000000000..374bc32215a2
--- /dev/null
+++ b/sys/modules/linux_common/Makefile
@@ -0,0 +1,27 @@
+
+.PATH: ${SRCTOP}/sys/compat/linux
+.if ${MACHINE_CPUARCH} == "amd64"
+.PATH: ${SRCTOP}/sys/x86/linux
+.endif
+
+KMOD= linux_common
+SRCS= linux_common.c linux_mib.c linux_mmap.c linux_util.c linux_emul.c \
+ linux_dummy.c linux_errno.c linux_netlink.c \
+ linux.c device_if.h vnode_if.h bus_if.h opt_inet6.h opt_inet.h
+
+.if ${MACHINE_CPUARCH} == "amd64"
+SRCS+= linux_x86.c linux_vdso_selector_x86.c
+.endif
+
+EXPORT_SYMS=
+EXPORT_SYMS+= linux_get_osname
+EXPORT_SYMS+= linux_get_osrelease
+EXPORT_SYMS+= linux_use_real_ifname
+
+.if !defined(KERNBUILDDIR)
+.warning Building Linuxulator outside of a kernel does not make sense
+.endif
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/linuxkpi/Makefile b/sys/modules/linuxkpi/Makefile
new file mode 100644
index 000000000000..bf40d64de9df
--- /dev/null
+++ b/sys/modules/linuxkpi/Makefile
@@ -0,0 +1,53 @@
+.PATH: ${SRCTOP}/sys/compat/linuxkpi/common/src
+
+KMOD= linuxkpi
+SRCS= linux_compat.c \
+ linux_current.c \
+ linux_devres.c \
+ linux_dmi.c \
+ linux_domain.c \
+ linux_firmware.c \
+ linux_fpu.c \
+ linux_hrtimer.c \
+ linux_idr.c \
+ linux_interrupt.c \
+ linux_i2c.c \
+ linux_i2cbb.c \
+ linux_kmod.c \
+ linux_kthread.c \
+ linux_lock.c \
+ linux_netdev.c \
+ linux_page.c \
+ linux_pci.c \
+ linux_radix.c \
+ linux_rcu.c \
+ linux_schedule.c \
+ linux_seq_file.c \
+ linux_shmemfs.c \
+ linux_shrinker.c \
+ linux_simple_attr.c \
+ linux_skbuff.c \
+ linux_slab.c \
+ linux_tasklet.c \
+ linux_usb.c \
+ linux_work.c \
+ linux_xarray.c
+
+.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
+ ${MACHINE_CPUARCH} == "i386"
+SRCS+= opt_acpi.h acpi_if.h linux_acpi.c
+.endif
+
+.if ${MACHINE_CPUARCH} == "i386"
+SRCS+= opt_apic.h
+.endif
+
+SRCS+= opt_ddb.h
+SRCS+= ${LINUXKPI_GENSRCS}
+
+CFLAGS+= ${LINUXKPI_INCLUDES}
+CFLAGS+= -I${SRCTOP}/sys/contrib/ck/include
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/linuxkpi_hdmi/Makefile b/sys/modules/linuxkpi_hdmi/Makefile
new file mode 100644
index 000000000000..ef843c726dac
--- /dev/null
+++ b/sys/modules/linuxkpi_hdmi/Makefile
@@ -0,0 +1,13 @@
+.PATH: ${SRCTOP}/sys/compat/linuxkpi/common/src
+
+KMOD= linuxkpi_hdmi
+SRCS= linux_hdmi.c \
+
+SRCS+= ${LINUXKPI_GENSRCS}
+
+CFLAGS+= ${LINUXKPI_INCLUDES}
+CFLAGS.linux_hdmi.c= -Wno-cast-qual
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/linuxkpi_wlan/Makefile b/sys/modules/linuxkpi_wlan/Makefile
new file mode 100644
index 000000000000..bafeb2d5d22a
--- /dev/null
+++ b/sys/modules/linuxkpi_wlan/Makefile
@@ -0,0 +1,17 @@
+.PATH: ${SRCTOP}/sys/compat/linuxkpi/common/src
+
+KMOD= linuxkpi_wlan
+SRCS= linux_80211.c \
+ linux_80211_macops.c
+
+# QCA ath11k support.
+SRCS+= linux_mhi.c
+
+SRCS+= opt_wlan.h
+SRCS+= ${LINUXKPI_GENSRCS}
+
+CFLAGS+= ${LINUXKPI_INCLUDES}
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/lio/Makefile b/sys/modules/lio/Makefile
new file mode 100644
index 000000000000..3f8b5e04ec3e
--- /dev/null
+++ b/sys/modules/lio/Makefile
@@ -0,0 +1,25 @@
+
+#.PATH: ${.CURDIR}
+.PATH: ${.CURDIR}/../../dev/liquidio
+.PATH: ${.CURDIR}/../../dev/liquidio/base
+
+KMOD = if_lio
+CFLAGS += -I${.CURDIR}/../../dev/liquidio
+CFLAGS += -I${.CURDIR}/../../dev/liquidio/base
+
+SRCS = device_if.h bus_if.h pci_if.h vnode_if.h opt_inet.h opt_inet6.h
+SRCS += vnode_if_newproto.h vnode_if_typedef.h
+SRCS += lio_main.c lio_sysctl.c lio_ioctl.c lio_core.c
+SRCS += lio_rxtx.c lio_rss.c
+SRCS += lio_device.c lio_ctrl.c
+SRCS += lio_console.c cn23xx_pf_device.c
+SRCS += lio_mem_ops.c lio_droq.c
+SRCS += lio_response_manager.c lio_request_manager.c
+
+FIRMWS = lio_23xx_nic.bin.fw:lio_23xx_nic.bin
+CLEANFILES+= lio_23xx_nic.bin.fw
+
+lio_23xx_nic.bin.fw: ${.CURDIR}/../../contrib/dev/liquidio/lio_23xx_nic.bin.uu
+ uudecode -p ${.CURDIR}/../../contrib/dev/liquidio/lio_23xx_nic.bin.uu > ${.TARGET}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/lpt/Makefile b/sys/modules/lpt/Makefile
new file mode 100644
index 000000000000..74b5a9c90faa
--- /dev/null
+++ b/sys/modules/lpt/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ppbus
+KMOD= lpt
+SRCS= bus_if.h device_if.h ppbus_if.h \
+ opt_lpt.h \
+ lpt.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mac_biba/Makefile b/sys/modules/mac_biba/Makefile
new file mode 100644
index 000000000000..21a85dc19601
--- /dev/null
+++ b/sys/modules/mac_biba/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/security/mac_biba
+
+KMOD= mac_biba
+SRCS= vnode_if.h \
+ mac_biba.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mac_bsdextended/Makefile b/sys/modules/mac_bsdextended/Makefile
new file mode 100644
index 000000000000..5921ac70dcbc
--- /dev/null
+++ b/sys/modules/mac_bsdextended/Makefile
@@ -0,0 +1,11 @@
+
+.PATH: ${SRCTOP}/sys/security/mac_bsdextended
+
+KMOD= mac_bsdextended
+SRCS= vnode_if.h \
+ mac_bsdextended.h \
+ mac_bsdextended.c \
+ ugidfw_system.c \
+ ugidfw_vnode.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mac_ddb/Makefile b/sys/modules/mac_ddb/Makefile
new file mode 100644
index 000000000000..2aa542d77e7d
--- /dev/null
+++ b/sys/modules/mac_ddb/Makefile
@@ -0,0 +1,6 @@
+.PATH: ${SRCTOP}/sys/security/mac_ddb
+
+KMOD= mac_ddb
+SRCS= mac_ddb.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mac_ifoff/Makefile b/sys/modules/mac_ifoff/Makefile
new file mode 100644
index 000000000000..b7f8806352b0
--- /dev/null
+++ b/sys/modules/mac_ifoff/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/security/mac_ifoff
+
+KMOD= mac_ifoff
+SRCS= vnode_if.h \
+ mac_ifoff.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mac_ipacl/Makefile b/sys/modules/mac_ipacl/Makefile
new file mode 100644
index 000000000000..17059e145081
--- /dev/null
+++ b/sys/modules/mac_ipacl/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/security/mac_ipacl
+
+KMOD= mac_ipacl
+SRCS= mac_ipacl.c
+SRCS+= opt_inet.h opt_inet6.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mac_lomac/Makefile b/sys/modules/mac_lomac/Makefile
new file mode 100644
index 000000000000..9172d35ddf13
--- /dev/null
+++ b/sys/modules/mac_lomac/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/security/mac_lomac
+
+KMOD= mac_lomac
+SRCS= vnode_if.h \
+ mac_lomac.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mac_mls/Makefile b/sys/modules/mac_mls/Makefile
new file mode 100644
index 000000000000..7169ba304205
--- /dev/null
+++ b/sys/modules/mac_mls/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/security/mac_mls
+
+KMOD= mac_mls
+SRCS= vnode_if.h \
+ mac_mls.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mac_none/Makefile b/sys/modules/mac_none/Makefile
new file mode 100644
index 000000000000..9a015aaff12c
--- /dev/null
+++ b/sys/modules/mac_none/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/security/mac_none
+
+KMOD= mac_none
+SRCS= vnode_if.h \
+ mac_none.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mac_ntpd/Makefile b/sys/modules/mac_ntpd/Makefile
new file mode 100644
index 000000000000..edd4ff70717a
--- /dev/null
+++ b/sys/modules/mac_ntpd/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/security/mac_ntpd
+
+KMOD= mac_ntpd
+SRCS= mac_ntpd.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mac_partition/Makefile b/sys/modules/mac_partition/Makefile
new file mode 100644
index 000000000000..26fae45e6cdc
--- /dev/null
+++ b/sys/modules/mac_partition/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/security/mac_partition
+
+KMOD= mac_partition
+SRCS= vnode_if.h \
+ mac_partition.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mac_pimd/Makefile b/sys/modules/mac_pimd/Makefile
new file mode 100644
index 000000000000..5e2ba5188654
--- /dev/null
+++ b/sys/modules/mac_pimd/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/security/mac_pimd
+
+KMOD= mac_pimd
+SRCS= mac_pimd.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mac_portacl/Makefile b/sys/modules/mac_portacl/Makefile
new file mode 100644
index 000000000000..e2ab1da0a2ef
--- /dev/null
+++ b/sys/modules/mac_portacl/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/security/mac_portacl
+
+KMOD= mac_portacl
+SRCS= mac_portacl.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mac_priority/Makefile b/sys/modules/mac_priority/Makefile
new file mode 100644
index 000000000000..727af9d44fd9
--- /dev/null
+++ b/sys/modules/mac_priority/Makefile
@@ -0,0 +1,6 @@
+.PATH: ${SRCTOP}/sys/security/mac_priority
+
+KMOD= mac_priority
+SRCS= mac_priority.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mac_seeotheruids/Makefile b/sys/modules/mac_seeotheruids/Makefile
new file mode 100644
index 000000000000..adf50d946c63
--- /dev/null
+++ b/sys/modules/mac_seeotheruids/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/security/mac_seeotheruids
+
+KMOD= mac_seeotheruids
+SRCS= vnode_if.h \
+ mac_seeotheruids.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mac_stub/Makefile b/sys/modules/mac_stub/Makefile
new file mode 100644
index 000000000000..19b9a2fbd842
--- /dev/null
+++ b/sys/modules/mac_stub/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/security/mac_stub
+
+KMOD= mac_stub
+SRCS= vnode_if.h \
+ mac_stub.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mac_test/Makefile b/sys/modules/mac_test/Makefile
new file mode 100644
index 000000000000..a96aa12c08bb
--- /dev/null
+++ b/sys/modules/mac_test/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/security/mac_test
+
+KMOD= mac_test
+SRCS= vnode_if.h \
+ mac_test.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mac_veriexec/Makefile b/sys/modules/mac_veriexec/Makefile
new file mode 100644
index 000000000000..82cf468fec50
--- /dev/null
+++ b/sys/modules/mac_veriexec/Makefile
@@ -0,0 +1,39 @@
+
+.PATH: ${.PARSEDIR:H:H}/security/mac_veriexec
+
+KMOD = mac_veriexec
+SRCS = \
+ bus_if.h \
+ device_if.h \
+ vnode_if.h
+SRCS += \
+ opt_capsicum.h \
+ opt_global.h \
+ opt_mac.h \
+ opt_veriexec.h
+SRCS += \
+ mac_veriexec.c \
+ veriexec_fingerprint.c \
+ veriexec_metadata.c
+
+EXPORT_SYMS+= ve_mutex \
+ mac_veriexec_in_state \
+ mac_veriexec_metadata_get_executable_flags
+
+.if defined(KERNBUILDDIR)
+MKDEP= -include ${KERNBUILDDIR}/opt_global.h
+.else
+CFLAGS+= -include opt_global.h
+MKDEP= -include opt_global.h
+opt_mac.h:
+ echo "#define MAC_DEBUG 1" >> ${.TARGET}
+opt_global.h:
+ echo "#define MAC 1" > ${.TARGET}
+.endif
+
+.ifndef WITHOUT_VERIEXEC_DEBUG
+CFLAGS+= -DVERIFIED_EXEC_DEBUG
+.endif
+
+.include <bsd.kmod.mk>
+
diff --git a/sys/modules/mac_veriexec_sha1/Makefile b/sys/modules/mac_veriexec_sha1/Makefile
new file mode 100644
index 000000000000..a8c16f179b8f
--- /dev/null
+++ b/sys/modules/mac_veriexec_sha1/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${.PARSEDIR:H:H}/security/mac_veriexec
+.PATH: ${.PARSEDIR:H:H}/crypto
+
+KMOD= mac_veriexec_sha1
+SRCS= mac_veriexec_sha1.c sha1.c
+
+.include <bsd.kmod.mk>
+
diff --git a/sys/modules/mac_veriexec_sha256/Makefile b/sys/modules/mac_veriexec_sha256/Makefile
new file mode 100644
index 000000000000..c09b0ac29548
--- /dev/null
+++ b/sys/modules/mac_veriexec_sha256/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${.CURDIR}/../../security/mac_veriexec
+.PATH: ${.CURDIR}/../../crypto/sha2
+
+KMOD= mac_veriexec_sha256
+SRCS= mac_veriexec_sha256.c sha256c.c
+
+.include <bsd.kmod.mk>
+
diff --git a/sys/modules/mac_veriexec_sha384/Makefile b/sys/modules/mac_veriexec_sha384/Makefile
new file mode 100644
index 000000000000..55ecabbac735
--- /dev/null
+++ b/sys/modules/mac_veriexec_sha384/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${.CURDIR}/../../security/mac_veriexec
+.PATH: ${.CURDIR}/../../crypto/sha2
+
+KMOD= mac_veriexec_sha384
+SRCS= mac_veriexec_sha384.c sha512c.c
+
+.include <bsd.kmod.mk>
+
diff --git a/sys/modules/mac_veriexec_sha512/Makefile b/sys/modules/mac_veriexec_sha512/Makefile
new file mode 100644
index 000000000000..f201ea696d37
--- /dev/null
+++ b/sys/modules/mac_veriexec_sha512/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${.CURDIR}/../../security/mac_veriexec
+.PATH: ${.CURDIR}/../../crypto/sha2
+
+KMOD= mac_veriexec_sha512
+SRCS= mac_veriexec_sha512.c sha512c.c
+
+.include <bsd.kmod.mk>
+
diff --git a/sys/modules/malo/Makefile b/sys/modules/malo/Makefile
new file mode 100644
index 000000000000..628d30aa0642
--- /dev/null
+++ b/sys/modules/malo/Makefile
@@ -0,0 +1,11 @@
+
+.PATH: ${SRCTOP}/sys/dev/malo
+
+KMOD = if_malo
+SRCS = if_malo.c if_malohal.c if_malo_pci.c
+SRCS+= device_if.h bus_if.h pci_if.h opt_malo.h
+
+opt_malo.h:
+ echo '#define MALO_DEBUG 1'> $@
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mana/Makefile b/sys/modules/mana/Makefile
new file mode 100644
index 000000000000..6b37c209e9c7
--- /dev/null
+++ b/sys/modules/mana/Makefile
@@ -0,0 +1,11 @@
+
+.PATH: ${SRCTOP}/sys/dev/mana
+
+KMOD = if_mana
+SRCS = gdma_main.c mana_sysctl.c shm_channel.c
+SRCS += mana_en.c gdma_util.c hw_channel.c
+SRCS += device_if.h bus_if.h pci_if.h
+
+CFLAGS += -I${SRCTOP}/sys/dev/mana
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/md/Makefile b/sys/modules/md/Makefile
new file mode 100644
index 000000000000..2473e3715bd2
--- /dev/null
+++ b/sys/modules/md/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/md
+
+KMOD= geom_md
+SRCS= md.c opt_md.h opt_geom.h opt_rootdevname.h vnode_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mdio/Makefile b/sys/modules/mdio/Makefile
new file mode 100644
index 000000000000..6decada89386
--- /dev/null
+++ b/sys/modules/mdio/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/mdio
+
+KMOD= mdio
+SRCS= mdio.c
+SRCS+= mdio_if.c mdio_if.h
+SRCS+= device_if.h bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mem/Makefile b/sys/modules/mem/Makefile
new file mode 100644
index 000000000000..6ba998923d0d
--- /dev/null
+++ b/sys/modules/mem/Makefile
@@ -0,0 +1,19 @@
+
+.PATH: ${SRCTOP}/sys/dev/mem
+.PATH: ${SRCTOP}/sys/${MACHINE}/${MACHINE}
+.PATH: ${SRCTOP}/sys/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}
+.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
+.PATH: ${SRCTOP}/sys/x86/x86
+.endif
+
+KMOD= mem
+SRCS= mem.c memdev.c memutil.c
+.if ${MACHINE_CPUARCH} == "i386"
+SRCS+= x86_mem.c k6_mem.c
+.endif
+.if ${MACHINE_CPUARCH} == "amd64"
+SRCS+= x86_mem.c
+.endif
+SRCS+= bus_if.h device_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mfi/Makefile b/sys/modules/mfi/Makefile
new file mode 100644
index 000000000000..a7541ab85e2f
--- /dev/null
+++ b/sys/modules/mfi/Makefile
@@ -0,0 +1,19 @@
+
+.PATH: ${SRCTOP}/sys/dev/mfi
+
+SUBDIR= mfip
+
+.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
+SUBDIR+= mfi_linux
+.endif
+
+KMOD= mfi
+SRCS= mfi.c mfi_pci.c mfi_disk.c mfi_debug.c mfi_syspd.c mfi_tbolt.c
+SRCS+= opt_mfi.h opt_cam.h
+SRCS+= device_if.h bus_if.h pci_if.h
+
+#CFLAGS += -DMFI_DEBUG
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mfi/mfi_linux/Makefile b/sys/modules/mfi/mfi_linux/Makefile
new file mode 100644
index 000000000000..f685ea699a3b
--- /dev/null
+++ b/sys/modules/mfi/mfi_linux/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/mfi
+
+KMOD= mfi_linux
+SRCS= mfi_linux.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mfi/mfip/Makefile b/sys/modules/mfi/mfip/Makefile
new file mode 100644
index 000000000000..c3f8111dd60f
--- /dev/null
+++ b/sys/modules/mfi/mfip/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/mfi
+
+KMOD= mfip
+SRCS= mfi_cam.c
+SRCS+= opt_mfi.h opt_cam.h
+SRCS+= device_if.h bus_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mgb/Makefile b/sys/modules/mgb/Makefile
new file mode 100644
index 000000000000..e45ac034a1ab
--- /dev/null
+++ b/sys/modules/mgb/Makefile
@@ -0,0 +1,13 @@
+
+.PATH: ${SRCTOP}/sys/dev/mgb
+
+KMOD = if_mgb
+SRCS = if_mgb.c
+SRCS += device_if.h bus_if.h pci_if.h
+SRCS += ifdi_if.h opt_platform.h
+SRCS += miibus_if.h
+
+#CFLAGS+= -DIFLIB
+
+.include <bsd.kmod.mk>
+
diff --git a/sys/modules/mii/Makefile b/sys/modules/mii/Makefile
new file mode 100644
index 000000000000..2413959cc67f
--- /dev/null
+++ b/sys/modules/mii/Makefile
@@ -0,0 +1,23 @@
+
+.PATH: ${SRCTOP}/sys/dev/mii
+
+KMOD= miibus
+SRCS= acphy.c amphy.c atphy.c axphy.c bmtphy.c brgphy.c
+SRCS+= ciphy.c dp83822phy.c dp83867phy.c
+SRCS+= e1000phy.c gentbi.c icsphy.c ip1000phy.c jmphy.c lxtphy.c
+SRCS+= miibus_if.c mii.c mii_bitbang.c mii_physubr.c
+SRCS+= nsgphy.c nsphy.c nsphyter.c pnaphy.c qsphy.c
+SRCS+= rdcphy.c rgephy.c rlphy.c smcphy.c
+SRCS+= smscphy.c tdkphy.c truephy.c
+SRCS+= ukphy.c ukphy_subr.c
+SRCS+= vscphy.c xmphy.c
+SRCS+= bus_if.h device_if.h miibus_if.h miidevs.h opt_platform.h pci_if.h
+
+.if !empty(OPT_FDT)
+SRCS+= micphy.c mii_fdt.c
+SRCS+= ofw_bus_if.h
+.endif
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mlx/Makefile b/sys/modules/mlx/Makefile
new file mode 100644
index 000000000000..0f19a48f7332
--- /dev/null
+++ b/sys/modules/mlx/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/mlx
+
+KMOD= mlx
+SRCS= mlx.c mlx_pci.c mlx_disk.c device_if.h bus_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mlx4/Makefile b/sys/modules/mlx4/Makefile
new file mode 100644
index 000000000000..3560b8a6e872
--- /dev/null
+++ b/sys/modules/mlx4/Makefile
@@ -0,0 +1,36 @@
+.PATH: ${SRCTOP}/sys/dev/mlx4/mlx4_core
+
+KMOD= mlx4
+SRCS= \
+ mlx4_alloc.c \
+ mlx4_catas.c \
+ mlx4_cmd.c \
+ mlx4_cq.c \
+ mlx4_eq.c \
+ mlx4_fw.c \
+ mlx4_fw_qos.c \
+ mlx4_icm.c \
+ mlx4_intf.c \
+ mlx4_main.c \
+ mlx4_mcg.c \
+ mlx4_mr.c \
+ mlx4_pd.c \
+ mlx4_port.c \
+ mlx4_profile.c \
+ mlx4_qp.c \
+ mlx4_reset.c \
+ mlx4_sense.c \
+ mlx4_srq.c \
+ mlx4_resource_tracker.c
+SRCS+= ${LINUXKPI_GENSRCS}
+SRCS+= opt_inet.h opt_inet6.h
+
+CFLAGS+= -I${SRCTOP}/sys/ofed/include
+CFLAGS+= -I${SRCTOP}/sys/ofed/include/uapi
+CFLAGS+= ${LINUXKPI_INCLUDES}
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
+
+CFLAGS+= -Wno-cast-qual -Wno-pointer-arith
diff --git a/sys/modules/mlx4en/Makefile b/sys/modules/mlx4en/Makefile
new file mode 100644
index 000000000000..7eef5a790861
--- /dev/null
+++ b/sys/modules/mlx4en/Makefile
@@ -0,0 +1,18 @@
+.PATH: ${SRCTOP}/sys/dev/mlx4/mlx4_en
+
+KMOD= mlx4en
+SRCS= \
+ mlx4_en_cq.c \
+ mlx4_en_main.c \
+ mlx4_en_netdev.c \
+ mlx4_en_port.c \
+ mlx4_en_resources.c \
+ mlx4_en_rx.c \
+ mlx4_en_tx.c
+SRCS+= ${LINUXKPI_GENSRCS}
+SRCS+= opt_inet.h opt_inet6.h
+
+CFLAGS+= -I${SRCTOP}/sys/ofed/include
+CFLAGS+= ${LINUXKPI_INCLUDES}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mlx4ib/Makefile b/sys/modules/mlx4ib/Makefile
new file mode 100644
index 000000000000..f24a45b0586e
--- /dev/null
+++ b/sys/modules/mlx4ib/Makefile
@@ -0,0 +1,29 @@
+.PATH: ${SRCTOP}/sys/dev/mlx4/mlx4_ib
+
+KMOD= mlx4ib
+SRCS= \
+ mlx4_ib_alias_GUID.c \
+ mlx4_ib_mcg.c \
+ mlx4_ib_sysfs.c \
+ mlx4_ib_ah.c \
+ mlx4_ib_cq.c \
+ mlx4_ib_doorbell.c \
+ mlx4_ib_mad.c \
+ mlx4_ib_main.c \
+ mlx4_ib_mr.c \
+ mlx4_ib_qp.c \
+ mlx4_ib_srq.c \
+ mlx4_ib_wc.c \
+ mlx4_ib_cm.c
+SRCS+= ${LINUXKPI_GENSRCS}
+SRCS+= opt_inet.h opt_inet6.h
+
+CFLAGS+= -I${SRCTOP}/sys/ofed/include
+CFLAGS+= -I${SRCTOP}/sys/ofed/include/uapi
+CFLAGS+= ${LINUXKPI_INCLUDES}
+CFLAGS+= -DCONFIG_INFINIBAND_USER_MEM
+CFLAGS+= -DINET6 -DINET
+
+.include <bsd.kmod.mk>
+
+CFLAGS+= -Wno-cast-qual -Wno-pointer-arith
diff --git a/sys/modules/mlx5/Makefile b/sys/modules/mlx5/Makefile
new file mode 100644
index 000000000000..10e11d6c8594
--- /dev/null
+++ b/sys/modules/mlx5/Makefile
@@ -0,0 +1,59 @@
+.PATH: ${SRCTOP}/sys/dev/mlx5/mlx5_core \
+ ${SRCTOP}/sys/dev/mlx5/mlx5_lib \
+ ${SRCTOP}/sys/dev/mlx5/mlx5_fpga
+
+KMOD=mlx5
+SRCS= \
+mlx5_alloc.c \
+mlx5_cmd.c \
+mlx5_cq.c \
+mlx5_diag_cnt.c \
+mlx5_diagnostics.c \
+mlx5_eq.c \
+mlx5_eswitch.c \
+mlx5_fs_cmd.c \
+mlx5_fs_tcp.c \
+mlx5_fs_tree.c \
+mlx5_fw.c \
+mlx5_fwdump.c \
+mlx5_health.c \
+mlx5_mad.c \
+mlx5_main.c \
+mlx5_mcg.c \
+mlx5_mpfs.c \
+mlx5_mr.c \
+mlx5_pagealloc.c \
+mlx5_pd.c \
+mlx5_port.c \
+mlx5_qp.c \
+mlx5_rl.c \
+mlx5_srq.c \
+mlx5_tls.c \
+mlx5_transobj.c \
+mlx5_uar.c \
+mlx5_vport.c \
+mlx5_vsc.c \
+mlx5_wq.c \
+mlx5_gid.c
+SRCS+= ${LINUXKPI_GENSRCS}
+SRCS+= opt_inet.h opt_inet6.h opt_rss.h opt_ratelimit.h
+
+CFLAGS+= -I${SRCTOP}/sys/ofed/include
+CFLAGS+= -I${SRCTOP}/sys/ofed/include/uapi
+CFLAGS+= ${LINUXKPI_INCLUDES}
+
+.if defined(CONFIG_BUILD_FPGA)
+SRCS+= \
+ mlx5fpga_cmd.c \
+ mlx5fpga_core.c \
+ mlx5fpga_sdk.c \
+ mlx5fpga_trans.c \
+ mlx5fpga_xfer.c \
+ mlx5fpga_ipsec.c
+.endif
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
+
+CFLAGS+= -Wno-cast-qual -Wno-pointer-arith ${GCC_MS_EXTENSIONS}
diff --git a/sys/modules/mlx5en/Makefile b/sys/modules/mlx5en/Makefile
new file mode 100644
index 000000000000..03bf174e33b0
--- /dev/null
+++ b/sys/modules/mlx5en/Makefile
@@ -0,0 +1,38 @@
+.PATH: ${SRCTOP}/sys/dev/mlx5/mlx5_en
+
+KMOD=mlx5en
+SRCS= \
+mlx5_en_dim.c \
+mlx5_en_ethtool.c \
+mlx5_en_main.c \
+mlx5_en_tx.c \
+mlx5_en_flow_table.c \
+mlx5_en_hw_tls.c \
+mlx5_en_hw_tls_rx.c \
+mlx5_en_iq.c \
+mlx5_en_rx.c \
+mlx5_en_rl.c \
+mlx5_en_txrx.c \
+mlx5_en_port_buffer.c
+SRCS+= ${LINUXKPI_GENSRCS}
+SRCS+= opt_inet.h opt_inet6.h opt_rss.h opt_ratelimit.h opt_kern_tls.h
+
+.if defined(HAVE_PER_CQ_EVENT_PACKET)
+CFLAGS+= -DHAVE_PER_CQ_EVENT_PACKET
+.endif
+
+.if defined(HAVE_TCP_LRO_RX)
+CFLAGS+= -DHAVE_TCP_LRO_RX
+.endif
+
+.if defined(CONFIG_BUILD_FPGA)
+CFLAGS+= -DCONFIG_MLX5_FPGA
+.endif
+
+CFLAGS+= -I${SRCTOP}/sys/ofed/include
+CFLAGS+= -I${SRCTOP}/sys/ofed/include/uapi
+CFLAGS+= ${LINUXKPI_INCLUDES}
+
+.include <bsd.kmod.mk>
+
+CFLAGS+= -Wno-cast-qual -Wno-pointer-arith ${GCC_MS_EXTENSIONS}
diff --git a/sys/modules/mlx5fpga_tools/Makefile b/sys/modules/mlx5fpga_tools/Makefile
new file mode 100644
index 000000000000..1c85feacfe66
--- /dev/null
+++ b/sys/modules/mlx5fpga_tools/Makefile
@@ -0,0 +1,18 @@
+.PATH: ${SRCTOP}/sys/dev/mlx5/mlx5_fpga_tools
+
+KMOD=mlx5fpga_tools
+SRCS= \
+ mlx5fpga_tools_main.c \
+ mlx5fpga_tools_char.c
+
+SRCS+= ${LINUXKPI_GENSRCS}
+SRCS+= opt_inet.h opt_inet6.h opt_rss.h opt_ratelimit.h
+
+CFLAGS+= -I${SRCTOP}/sys/ofed/include
+CFLAGS+= -I${SRCTOP}/sys/ofed/include/uapi
+CFLAGS+= ${LINUXKPI_INCLUDES}
+
+.include <bsd.kmod.mk>
+
+CFLAGS+= -Wno-cast-qual -Wno-pointer-arith ${GCC_MS_EXTENSIONS}
+CFLAGS+= -DCONFIG_MLX5_FPGA -DCONFIG_MLX5_ACCEL
diff --git a/sys/modules/mlx5ib/Makefile b/sys/modules/mlx5ib/Makefile
new file mode 100644
index 000000000000..2175e02127a3
--- /dev/null
+++ b/sys/modules/mlx5ib/Makefile
@@ -0,0 +1,32 @@
+.PATH: ${SRCTOP}/sys/dev/mlx5/mlx5_ib
+
+KMOD=mlx5ib
+SRCS= \
+mlx5_ib_ah.c \
+mlx5_ib_cong.c \
+mlx5_ib_cq.c \
+mlx5_ib_devx.c \
+mlx5_ib_doorbell.c \
+mlx5_ib_gsi.c \
+mlx5_ib_mad.c \
+mlx5_ib_main.c \
+mlx5_ib_mem.c \
+mlx5_ib_mr.c \
+mlx5_ib_qp.c \
+mlx5_ib_srq.c \
+mlx5_ib_virt.c
+SRCS+= ${LINUXKPI_GENSRCS}
+SRCS+= opt_inet.h opt_inet6.h opt_ratelimit.h opt_rss.h
+
+CFLAGS+= -I${SRCTOP}/sys/ofed/include
+CFLAGS+= -I${SRCTOP}/sys/ofed/include/uapi
+CFLAGS+= ${LINUXKPI_INCLUDES}
+CFLAGS+= -DCONFIG_INFINIBAND_USER_MEM
+
+.if defined(CONFIG_BUILD_FPGA)
+CFLAGS+= -DCONFIG_MLX5_FPGA
+.endif
+
+.include <bsd.kmod.mk>
+
+CFLAGS+= -Wno-cast-qual -Wno-pointer-arith ${GCC_MS_EXTENSIONS}
diff --git a/sys/modules/mlxfw/Makefile b/sys/modules/mlxfw/Makefile
new file mode 100644
index 000000000000..ae7bd04b1a0b
--- /dev/null
+++ b/sys/modules/mlxfw/Makefile
@@ -0,0 +1,19 @@
+.PATH: ${SRCTOP}/sys/dev/mlxfw
+
+KMOD=mlxfw
+SRCS= \
+mlxfw_fsm.c \
+mlxfw_mfa2.c \
+mlxfw_mfa2_tlv_multi.c
+SRCS+= ${LINUXKPI_GENSRCS}
+
+CFLAGS+= \
+ -I${SRCTOP}/sys/ofed/include \
+ -I${SRCTOP}/sys/ofed/include/uapi \
+ ${LINUXKPI_INCLUDES} \
+ -I${SRCTOP}/sys/contrib/xz-embedded/freebsd \
+ -I${SRCTOP}/sys/contrib/xz-embedded/linux/lib/xz
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mmc/Makefile b/sys/modules/mmc/Makefile
new file mode 100644
index 000000000000..b626eba0a102
--- /dev/null
+++ b/sys/modules/mmc/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/mmc
+
+KMOD= mmc
+SRCS= bus_if.h device_if.h mmc_subr.c mmc.c mmcbr_if.h mmcbus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mmcnull/Makefile b/sys/modules/mmcnull/Makefile
new file mode 100644
index 000000000000..0aeea797444a
--- /dev/null
+++ b/sys/modules/mmcnull/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${.CURDIR}/../../dev/mmcnull
+
+KMOD= mmcnull
+SRCS= mmcnull.c device_if.h bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mmcsd/Makefile b/sys/modules/mmcsd/Makefile
new file mode 100644
index 000000000000..4fdeaf88024e
--- /dev/null
+++ b/sys/modules/mmcsd/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/mmc
+
+KMOD= mmcsd
+SRCS= bus_if.h device_if.h mmcbr_if.h mmcbus_if.h mmcsd.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mpi3mr/Makefile b/sys/modules/mpi3mr/Makefile
new file mode 100644
index 000000000000..3f1f63a94ac3
--- /dev/null
+++ b/sys/modules/mpi3mr/Makefile
@@ -0,0 +1,12 @@
+
+.PATH: ${SRCTOP}/sys/dev/mpi3mr
+
+KMOD= mpi3mr
+SRCS= mpi3mr_pci.c mpi3mr.c mpi3mr_cam.c mpi3mr_app.c
+SRCS+= opt_cam.h
+SRCS+= device_if.h bus_if.h pci_if.h
+
+.include <bsd.kmod.mk>
+
+CWARNFLAGS.mpi3mr_sas.c= ${NO_WUNNEEDED_INTERNAL_DECL}
+CWARNFLAGS.mpi3mr_mapping.c= ${NO_WSOMETIMES_UNINITIALIZED}
diff --git a/sys/modules/mpr/Makefile b/sys/modules/mpr/Makefile
new file mode 100644
index 000000000000..f2ca7bb7e1b3
--- /dev/null
+++ b/sys/modules/mpr/Makefile
@@ -0,0 +1,16 @@
+
+.PATH: ${SRCTOP}/sys/dev/mpr
+
+KMOD= mpr
+SRCS= mpr_pci.c mpr.c mpr_sas.c mpr_table.c mpr_user.c
+SRCS+= mpr_config.c mpr_mapping.c mpr_sas_lsi.c
+SRCS+= opt_cam.h
+SRCS+= device_if.h bus_if.h pci_if.h
+
+#CFLAGS += -DMPR_DEBUG
+
+.include <bsd.kmod.mk>
+
+CWARNFLAGS.mpr_sas.c= ${NO_WUNNEEDED_INTERNAL_DECL}
+# XXX Work around clang warning, until maintainer approves fix.
+CWARNFLAGS.mpr_mapping.c= ${NO_WSOMETIMES_UNINITIALIZED}
diff --git a/sys/modules/mps/Makefile b/sys/modules/mps/Makefile
new file mode 100644
index 000000000000..af844fbe1a2b
--- /dev/null
+++ b/sys/modules/mps/Makefile
@@ -0,0 +1,16 @@
+
+.PATH: ${SRCTOP}/sys/dev/mps
+
+KMOD= mps
+SRCS= mps_pci.c mps.c mps_sas.c mps_table.c mps_user.c
+SRCS+= mps_config.c mps_mapping.c mps_sas_lsi.c
+SRCS+= opt_cam.h
+SRCS+= device_if.h bus_if.h pci_if.h
+
+#CFLAGS += -DMPS_DEBUG
+
+.include <bsd.kmod.mk>
+
+CWARNFLAGS.mps_sas.c= ${NO_WUNNEEDED_INTERNAL_DECL}
+# XXX Work around clang warning, until maintainer approves fix.
+CWARNFLAGS.mps_mapping.c= ${NO_WSOMETIMES_UNINITIALIZED}
diff --git a/sys/modules/mpt/Makefile b/sys/modules/mpt/Makefile
new file mode 100644
index 000000000000..9a6b5251ceed
--- /dev/null
+++ b/sys/modules/mpt/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/mpt
+
+KMOD= mpt
+SRCS= bus_if.h device_if.h pci_if.h \
+ opt_cam.h opt_ddb.h \
+ mpt.c mpt_cam.c mpt_debug.c mpt_pci.c mpt_raid.c mpt_user.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mqueue/Makefile b/sys/modules/mqueue/Makefile
new file mode 100644
index 000000000000..b929c6b84ad1
--- /dev/null
+++ b/sys/modules/mqueue/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/kern
+
+KMOD= mqueuefs
+SRCS= uipc_mqueue.c \
+ vnode_if.h \
+ opt_posix.h opt_capsicum.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mrsas/Makefile b/sys/modules/mrsas/Makefile
new file mode 100644
index 000000000000..5704c3d0298f
--- /dev/null
+++ b/sys/modules/mrsas/Makefile
@@ -0,0 +1,27 @@
+# Makefile for mrsas driver
+
+KMOD=mrsas
+.PATH: ${SRCTOP}/sys/dev/${KMOD}
+
+.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
+SUBDIR+= mrsas_linux
+.endif
+
+SRCS=mrsas.c mrsas_cam.c mrsas_ioctl.c mrsas_fp.c
+SRCS+= device_if.h bus_if.h pci_if.h opt_cam.h opt_scsi.h
+
+#CFLAGS+= -MRSAS_DEBUG
+.include <bsd.kmod.mk>
+CFLAGS+= -fgnu89-inline
+
+.if ${MACHINE_ARCH} == "amd64"
+CFLAGS+= -DCOMPAT_FREEBSD32
+.endif
+
+clean_cscope:
+ rm -f cscope*
+
+cscope: clean_cscope
+ /usr/local/bin/cscope -b *.[ch]
+
+cleanall: clean clean_cscope
diff --git a/sys/modules/mrsas/mrsas_linux/Makefile b/sys/modules/mrsas/mrsas_linux/Makefile
new file mode 100644
index 000000000000..5bfb4eaf9947
--- /dev/null
+++ b/sys/modules/mrsas/mrsas_linux/Makefile
@@ -0,0 +1,9 @@
+# Makefile for mrsas driver
+
+.PATH: ${SRCTOP}/sys/dev/mrsas
+
+KMOD= mrsas_linux
+SRCS= mrsas_linux.c
+SRCS+= device_if.h bus_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/msdosfs/Makefile b/sys/modules/msdosfs/Makefile
new file mode 100644
index 000000000000..794e7ba3d180
--- /dev/null
+++ b/sys/modules/msdosfs/Makefile
@@ -0,0 +1,10 @@
+
+.PATH: ${SRCTOP}/sys/fs/msdosfs
+
+KMOD= msdosfs
+SRCS= vnode_if.h \
+ msdosfs_conv.c msdosfs_denode.c msdosfs_fat.c \
+ msdosfs_lookup.c msdosfs_vfsops.c msdosfs_vnops.c
+EXPORT_SYMS= msdosfs_iconv
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/msdosfs_iconv/Makefile b/sys/modules/msdosfs_iconv/Makefile
new file mode 100644
index 000000000000..7bf6442b3122
--- /dev/null
+++ b/sys/modules/msdosfs_iconv/Makefile
@@ -0,0 +1,6 @@
+
+.PATH: ${SRCTOP}/sys/fs/msdosfs
+KMOD= msdosfs_iconv
+SRCS= msdosfs_iconv.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/msk/Makefile b/sys/modules/msk/Makefile
new file mode 100644
index 000000000000..4e898a85b70a
--- /dev/null
+++ b/sys/modules/msk/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/msk
+
+KMOD= if_msk
+SRCS= if_msk.c device_if.h bus_if.h pci_if.h
+SRCS+= miibus_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mt76/Makefile b/sys/modules/mt76/Makefile
new file mode 100644
index 000000000000..95d6e10a6991
--- /dev/null
+++ b/sys/modules/mt76/Makefile
@@ -0,0 +1,7 @@
+
+SUBDIR= core
+SUBDIR+= mt7915
+SUBDIR+= mt7921
+SUBDIR+= mt7996
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/mt76/Makefile.inc b/sys/modules/mt76/Makefile.inc
new file mode 100644
index 000000000000..f1aa69f1bc8e
--- /dev/null
+++ b/sys/modules/mt76/Makefile.inc
@@ -0,0 +1,29 @@
+
+# Common information shared by all submodule builds.
+
+COMMONDIR= ${SRCTOP}/sys/contrib/dev/mediatek/mt76
+
+.PATH: ${COMMONDIR}
+
+WITH_CONFIG_PM= 0
+WITH_DEBUGFS= 0
+
+# Other
+SRCS+= ${LINUXKPI_GENSRCS}
+SRCS+= opt_wlan.h opt_inet6.h opt_inet.h
+
+# Helpful after fresh imports.
+#CFLAGS+= -ferror-limit=0
+
+.if defined(WITH_CONFIG_PM) && ${WITH_CONFIG_PM} > 0
+CFLAGS+= -DCONFIG_PM=${WITH_CONFIG_PM}
+.endif
+
+.if defined(WITH_DEBUGFS) && ${WITH_DEBUGFS} > 0
+CFLAGS+= -DCONFIG_MAC80211_DEBUGFS=${WITH_DEBUGFS}
+.endif
+
+CFLAGS+= -I${COMMONDIR}
+CFLAGS+= ${LINUXKPI_INCLUDES}
+
+# end
diff --git a/sys/modules/mt76/core/Makefile b/sys/modules/mt76/core/Makefile
new file mode 100644
index 000000000000..9e915fc5f965
--- /dev/null
+++ b/sys/modules/mt76/core/Makefile
@@ -0,0 +1,41 @@
+
+KMOD= mt76_core
+
+# Basic stuff.
+SRCS= mac80211.c mmio.c util.c dma.c eeprom.c tx.c agg-rx.c mcu.c
+#SRCS+= trace.c
+
+# Bus stuff.
+SRCS+= pci.c
+.if defined(WITH_USB) && ${WITH_USB} > 0
+SRCS+= usb.c # usb_trace.c
+.endif
+#SRCS+= sdio.c sdio_txrx.c
+
+# Connac-Lib stuff.
+SRCS+= mt76_connac_mac.c mt76_connac_mcu.c mt76_connac3_mac.c
+
+# MT76x02-Lib stuff (we don't need; that's for older chipsets not yet supported)
+
+# XXX should this be a separate module?
+# MT792X-LIB stuff.
+SRCS+= mt792x_core.c mt792x_mac.c mt792x_dma.c
+#SRCS+= mt792x_trace.c
+.if defined(WITH_ACPI) && ${WITH_ACPI} > 0
+SRCS+= mt792x_acpi_sar.c
+.endif
+.if defined(WITH_USB) && ${WITH_USB} > 0
+SRCS+= mt792x_usb.c
+.endif
+.if defined(WITH_DEBUGFS) && ${WITH_DEBUGFS} > 0
+SRCS+= mt792x_debugfs.c
+.endif
+
+.if defined(WITH_DEBUGFS) && ${WITH_DEBUGFS} > 0
+SRCS+= debugfs.c
+.endif
+
+CFLAGS+= -DKBUILD_MODNAME='"mt76_core"'
+CFLAGS+= -DCONFIG_MAC80211_DEBUGFS=${WITH_DEBUGFS}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mt76/mt7915/Makefile b/sys/modules/mt76/mt7915/Makefile
new file mode 100644
index 000000000000..8d5b17dbac1a
--- /dev/null
+++ b/sys/modules/mt76/mt7915/Makefile
@@ -0,0 +1,31 @@
+
+DEVDIR= ${SRCTOP}/sys/contrib/dev/mediatek/mt76/mt7915
+
+.PATH: ${DEVDIR}
+
+WITH_DEBUGFS= 0
+WITH_DEV_COREDUMP= 1
+
+KMOD= if_mt7915
+
+# Common stuff.
+SRCS= init.c main.c mac.c mcu.c mmio.c eeprom.c
+SRCS+= pci.c dma.c
+
+# SOC+6E stuff.
+#SRCS+= soc.c
+
+.if defined(WITH_DEBUGFS) && ${WITH_DEBUGFS} > 0
+SRCS+= debugfs.c
+CFLAGS+= -DCONFIG_MT7915_DEBUGFS=${WITH_DEBUGFS}
+.endif
+
+.if defined(WITH_DEV_COREDUMP) && ${WITH_DEV_COREDUMP} > 0
+SRCS+= coredump.c
+CFLAGS+= -DCONFIG_DEV_COREDUMP=${WITH_DEV_COREDUMP}
+.endif
+
+CFLAGS+= -DKBUILD_MODNAME='"mt7915"'
+CFLAGS+= -I${DEVDIR}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mt76/mt7921/Makefile b/sys/modules/mt76/mt7921/Makefile
new file mode 100644
index 000000000000..0fb5f0c26fb1
--- /dev/null
+++ b/sys/modules/mt76/mt7921/Makefile
@@ -0,0 +1,28 @@
+
+DEVDIR= ${SRCTOP}/sys/contrib/dev/mediatek/mt76/mt7921
+
+.PATH: ${DEVDIR}
+
+KMOD= if_mt7921
+
+# Common stuff.
+SRCS= init.c main.c mac.c mcu.c
+
+# PCI stuff.
+SRCS+= pci.c pci_mac.c pci_mcu.c
+
+# USB stuff.
+#SRCS+= usb.c
+
+# SDIO stuff.
+#SRCS+= sdio.c sdio_mac.c sdio_mcu.c
+
+.if defined(WITH_DEBUGFS) && ${WITH_DEBUGFS} > 0
+SRCS+= debugfs.c
+CFLAGS+= -DCONFIG_MT7921_DEBUGFS=${WITH_DEBUGFS}
+.endif
+
+CFLAGS+= -DKBUILD_MODNAME='"mt7921"'
+CFLAGS+= -I${DEVDIR}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mt76/mt7996/Makefile b/sys/modules/mt76/mt7996/Makefile
new file mode 100644
index 000000000000..a43721b6079e
--- /dev/null
+++ b/sys/modules/mt76/mt7996/Makefile
@@ -0,0 +1,27 @@
+DEVDIR= ${SRCTOP}/sys/contrib/dev/mediatek/mt76/mt7996
+
+.PATH: ${DEVDIR}
+
+WITH_DEBUGFS= 0
+WITH_DEV_COREDUMP= 1
+
+KMOD= if_mt7996
+
+# Common stuff.
+SRCS= init.c main.c mac.c mcu.c mmio.c eeprom.c
+SRCS+= pci.c dma.c
+
+.if defined(WITH_DEBUGFS) && ${WITH_DEBUGFS} > 0
+SRCS+= debugfs.c
+CFLAGS+= -DCONFIG_MT7996_DEBUGFS=${WITH_DEBUGFS}
+.endif
+
+.if defined(WITH_DEV_COREDUMP) && ${WITH_DEV_COREDUMP} > 0
+SRCS+= coredump.c
+CFLAGS+= -DCONFIG_DEV_COREDUMP=${WITH_DEV_COREDUMP}
+.endif
+
+CFLAGS+= -DKBUILD_MODNAME='"mt7996"'
+CFLAGS+= -I${DEVDIR}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mthca/Makefile b/sys/modules/mthca/Makefile
new file mode 100644
index 000000000000..a1996d03d30c
--- /dev/null
+++ b/sys/modules/mthca/Makefile
@@ -0,0 +1,34 @@
+.PATH: ${SRCTOP}/sys/dev/mthca
+
+KMOD= mthca
+SRCS= \
+mthca_allocator.c \
+mthca_av.c \
+mthca_catas.c \
+mthca_cmd.c \
+mthca_cq.c \
+mthca_eq.c \
+mthca_mad.c \
+mthca_main.c \
+mthca_mcg.c \
+mthca_memfree.c \
+mthca_mr.c \
+mthca_pd.c \
+mthca_profile.c \
+mthca_provider.c \
+mthca_qp.c \
+mthca_reset.c \
+mthca_srq.c \
+mthca_uar.c
+SRCS+= ${LINUXKPI_GENSRCS}
+SRCS+= opt_inet.h opt_inet6.h
+
+CFLAGS+= -I${SRCTOP}/sys/ofed/include
+CFLAGS+= -I${SRCTOP}/sys/ofed/include/uapi
+CFLAGS+= ${LINUXKPI_INCLUDES}
+CFLAGS+= -DCONFIG_INFINIBAND_USER_MEM
+CFLAGS+= -DINET6 -DINET
+
+.include <bsd.kmod.mk>
+
+CFLAGS+= -Wno-cast-qual -Wno-pointer-arith
diff --git a/sys/modules/mvs/Makefile b/sys/modules/mvs/Makefile
new file mode 100644
index 000000000000..512a885a55c0
--- /dev/null
+++ b/sys/modules/mvs/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/mvs
+
+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
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mwl/Makefile b/sys/modules/mwl/Makefile
new file mode 100644
index 000000000000..3e00e6d49be7
--- /dev/null
+++ b/sys/modules/mwl/Makefile
@@ -0,0 +1,40 @@
+#
+# Copyright (c) 2007-2009 Sam Leffler, Errno Consulting
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer,
+# without modification.
+# 2. Redistributions in binary form must reproduce at minimum a disclaimer
+# similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
+# redistribution must be conditioned upon including a substantially
+# similar Disclaimer requirement for further binary redistribution.
+#
+# NO WARRANTY
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
+# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+# THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
+# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGES.
+#
+#
+
+.PATH: ${SRCTOP}/sys/dev/mwl
+
+KMOD= if_mwl
+SRCS= if_mwl.c if_mwl_pci.c mwlhal.c
+SRCS+= device_if.h bus_if.h pci_if.h opt_inet.h opt_mwl.h opt_wlan.h
+
+opt_mwl.h:
+ echo '#define MWL_DEBUG 1'> $@
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mwlfw/Makefile b/sys/modules/mwlfw/Makefile
new file mode 100644
index 000000000000..c4b9c046d098
--- /dev/null
+++ b/sys/modules/mwlfw/Makefile
@@ -0,0 +1,13 @@
+
+KMOD= mw88W8363fw
+FIRMWS= mw88W8363.fw:mw88W8363fw mwlboot.fw:mwlboot
+
+CLEANFILES+= mw88W8363.fw mwlboot.fw
+
+mw88W8363.fw: ${SRCTOP}/sys/contrib/dev/mwl/mw88W8363.fw.uu
+ uudecode -p ${.ALLSRC} > ${.TARGET}
+
+mwlboot.fw: ${SRCTOP}/sys/contrib/dev/mwl/mwlboot.fw.uu
+ uudecode -p ${.ALLSRC} > ${.TARGET}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mxge/Makefile b/sys/modules/mxge/Makefile
new file mode 100644
index 000000000000..358adf109d18
--- /dev/null
+++ b/sys/modules/mxge/Makefile
@@ -0,0 +1,8 @@
+
+SUBDIR= mxge
+SUBDIR+=mxge_eth_z8e
+SUBDIR+=mxge_ethp_z8e
+SUBDIR+=mxge_rss_eth_z8e
+SUBDIR+=mxge_rss_ethp_z8e
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/mxge/mxge/Makefile b/sys/modules/mxge/mxge/Makefile
new file mode 100644
index 000000000000..b1b079b41adc
--- /dev/null
+++ b/sys/modules/mxge/mxge/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/mxge
+
+KMOD= if_mxge
+SRCS= if_mxge.c device_if.h bus_if.h pci_if.h opt_inet.h opt_inet6.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mxge/mxge_eth_z8e/Makefile b/sys/modules/mxge/mxge_eth_z8e/Makefile
new file mode 100644
index 000000000000..9870ff5f4e60
--- /dev/null
+++ b/sys/modules/mxge/mxge_eth_z8e/Makefile
@@ -0,0 +1,6 @@
+
+.PATH: ${SRCTOP}/sys/dev/mxge
+KMOD= mxge_eth_z8e
+SRCS= mxge_eth_z8e.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mxge/mxge_ethp_z8e/Makefile b/sys/modules/mxge/mxge_ethp_z8e/Makefile
new file mode 100644
index 000000000000..28752de996f0
--- /dev/null
+++ b/sys/modules/mxge/mxge_ethp_z8e/Makefile
@@ -0,0 +1,6 @@
+
+.PATH: ${SRCTOP}/sys/dev/mxge
+KMOD= mxge_ethp_z8e
+SRCS= mxge_ethp_z8e.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mxge/mxge_rss_eth_z8e/Makefile b/sys/modules/mxge/mxge_rss_eth_z8e/Makefile
new file mode 100644
index 000000000000..90b88931bf0d
--- /dev/null
+++ b/sys/modules/mxge/mxge_rss_eth_z8e/Makefile
@@ -0,0 +1,6 @@
+
+.PATH: ${SRCTOP}/sys/dev/mxge
+KMOD= mxge_rss_eth_z8e
+SRCS= mxge_rss_eth_z8e.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/mxge/mxge_rss_ethp_z8e/Makefile b/sys/modules/mxge/mxge_rss_ethp_z8e/Makefile
new file mode 100644
index 000000000000..668d37273749
--- /dev/null
+++ b/sys/modules/mxge/mxge_rss_ethp_z8e/Makefile
@@ -0,0 +1,6 @@
+
+.PATH: ${SRCTOP}/sys/dev/mxge
+KMOD= mxge_rss_ethp_z8e
+SRCS= mxge_rss_ethp_z8e.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/my/Makefile b/sys/modules/my/Makefile
new file mode 100644
index 000000000000..f3d192fbcc25
--- /dev/null
+++ b/sys/modules/my/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/my
+
+KMOD= if_my
+SRCS= if_my.c device_if.h bus_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/nctgpio/Makefile b/sys/modules/nctgpio/Makefile
new file mode 100644
index 000000000000..b48a11f1f899
--- /dev/null
+++ b/sys/modules/nctgpio/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/nctgpio
+KMOD= nctgpio
+SRCS= nctgpio.c
+SRCS+= device_if.h bus_if.h isa_if.h gpio_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ncthwm/Makefile b/sys/modules/ncthwm/Makefile
new file mode 100644
index 000000000000..266a476b6b73
--- /dev/null
+++ b/sys/modules/ncthwm/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/ncthwm
+KMOD= ncthwm
+SRCS= ncthwm.c
+SRCS+= device_if.h bus_if.h isa_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/neta/Makefile b/sys/modules/neta/Makefile
new file mode 100644
index 000000000000..635b15c2d61e
--- /dev/null
+++ b/sys/modules/neta/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/neta
+
+CFLAGS+= -DFDT
+
+KMOD= if_mvneta
+SRCS= if_mvneta.c if_mvneta_fdt.c if_mvnetavar.h
+SRCS+= bus_if.h device_if.h mdio_if.h miibus_if.h ofw_bus_if.h clknode_if.h opt_platform.h
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/Makefile b/sys/modules/netgraph/Makefile
new file mode 100644
index 000000000000..94560d5c51d7
--- /dev/null
+++ b/sys/modules/netgraph/Makefile
@@ -0,0 +1,64 @@
+# $Whistle: Makefile,v 1.5 1999/01/24 06:48:37 archie Exp $
+
+SYSDIR?=${SRCTOP}/sys
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+SUBDIR= async \
+ ${_bluetooth} \
+ bpf \
+ bridge \
+ car \
+ checksum \
+ cisco \
+ deflate \
+ device \
+ echo \
+ eiface \
+ etf \
+ ether \
+ ether_echo \
+ frame_relay \
+ gif \
+ gif_demux \
+ hole \
+ hub \
+ iface \
+ ip_input \
+ ipfw \
+ ksocket \
+ l2tp \
+ lmi \
+ macfilter \
+ ${_mppc} \
+ nat \
+ netflow \
+ netgraph \
+ one2many \
+ patch \
+ pipe \
+ ppp \
+ pppoe \
+ pptpgre \
+ pred1 \
+ rfc1490 \
+ socket \
+ source \
+ split \
+ tag \
+ tcpmss \
+ tee \
+ tty \
+ UI \
+ vjc \
+ vlan \
+ vlan_rotate
+
+.if ${MK_BLUETOOTH} != "no" || defined(ALL_MODULES)
+_bluetooth= bluetooth
+.endif
+
+.if ${MK_CRYPT} != "no" && exists(${SYSDIR}/crypto/rc4/rc4.c)
+_mppc= mppc
+.endif
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/netgraph/Makefile.inc b/sys/modules/netgraph/Makefile.inc
new file mode 100644
index 000000000000..99a84c395852
--- /dev/null
+++ b/sys/modules/netgraph/Makefile.inc
@@ -0,0 +1,7 @@
+# $Whistle: Makefile.inc,v 1.4 1999/01/19 23:46:16 archie Exp $
+
+.PATH: ${SRCTOP}/sys/netgraph
+
+SRCS+= opt_netgraph.h
+
+.include "../Makefile.inc"
diff --git a/sys/modules/netgraph/UI/Makefile b/sys/modules/netgraph/UI/Makefile
new file mode 100644
index 000000000000..725f1ee4db6f
--- /dev/null
+++ b/sys/modules/netgraph/UI/Makefile
@@ -0,0 +1,6 @@
+# $Whistle: Makefile,v 1.2 1999/01/19 19:39:20 archie Exp $
+
+KMOD= ng_UI
+SRCS= ng_UI.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/async/Makefile b/sys/modules/netgraph/async/Makefile
new file mode 100644
index 000000000000..e14bae855bce
--- /dev/null
+++ b/sys/modules/netgraph/async/Makefile
@@ -0,0 +1,6 @@
+# $Whistle: Makefile,v 1.2 1999/01/19 19:39:20 archie Exp $
+
+KMOD= ng_async
+SRCS= ng_async.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/bluetooth/Makefile b/sys/modules/netgraph/bluetooth/Makefile
new file mode 100644
index 000000000000..2587dac65150
--- /dev/null
+++ b/sys/modules/netgraph/bluetooth/Makefile
@@ -0,0 +1,11 @@
+# $Id: Makefile,v 1.2 2003/04/27 00:22:11 max Exp $
+
+SUBDIR= \
+ bluetooth \
+ hci \
+ l2cap \
+ socket \
+ ubt \
+ ubtbcmfw
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/netgraph/bluetooth/Makefile.inc b/sys/modules/netgraph/bluetooth/Makefile.inc
new file mode 100644
index 000000000000..d3b5cbd3a79b
--- /dev/null
+++ b/sys/modules/netgraph/bluetooth/Makefile.inc
@@ -0,0 +1,2 @@
+
+.include "../Makefile.inc"
diff --git a/sys/modules/netgraph/bluetooth/bluetooth/Makefile b/sys/modules/netgraph/bluetooth/bluetooth/Makefile
new file mode 100644
index 000000000000..b24bec15ca57
--- /dev/null
+++ b/sys/modules/netgraph/bluetooth/bluetooth/Makefile
@@ -0,0 +1,12 @@
+# $Id: Makefile,v 1.1 2002/11/24 20:39:57 max Exp $
+
+.PATH: ${SRCTOP}/sys/netgraph/bluetooth/common
+
+CFLAGS+= -I${SRCTOP}/sys/netgraph/bluetooth/include
+
+KMOD= ng_bluetooth
+SRCS= ng_bluetooth.c
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/bluetooth/hci/Makefile b/sys/modules/netgraph/bluetooth/hci/Makefile
new file mode 100644
index 000000000000..7d648106a393
--- /dev/null
+++ b/sys/modules/netgraph/bluetooth/hci/Makefile
@@ -0,0 +1,12 @@
+# $Id: Makefile,v 1.1 2002/11/24 20:40:05 max Exp $
+
+.PATH: ${SRCTOP}/sys/netgraph/bluetooth/hci
+
+CFLAGS+= -I${SRCTOP}/sys/netgraph/bluetooth/include \
+ -I${SRCTOP}/sys/netgraph/bluetooth/hci
+
+KMOD= ng_hci
+SRCS= ng_hci_main.c ng_hci_cmds.c ng_hci_evnt.c \
+ ng_hci_ulpi.c ng_hci_misc.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/bluetooth/l2cap/Makefile b/sys/modules/netgraph/bluetooth/l2cap/Makefile
new file mode 100644
index 000000000000..2008e953a108
--- /dev/null
+++ b/sys/modules/netgraph/bluetooth/l2cap/Makefile
@@ -0,0 +1,12 @@
+# $Id: Makefile,v 1.1 2002/11/24 20:40:11 max Exp $
+
+.PATH: ${SRCTOP}/sys/netgraph/bluetooth/l2cap
+
+CFLAGS+= -I${SRCTOP}/sys/netgraph/bluetooth/include \
+ -I${SRCTOP}/sys/netgraph/bluetooth/l2cap
+
+KMOD= ng_l2cap
+SRCS= ng_l2cap_main.c ng_l2cap_cmds.c ng_l2cap_evnt.c \
+ ng_l2cap_ulpi.c ng_l2cap_llpi.c ng_l2cap_misc.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/bluetooth/socket/Makefile b/sys/modules/netgraph/bluetooth/socket/Makefile
new file mode 100644
index 000000000000..2abfdc8b9d86
--- /dev/null
+++ b/sys/modules/netgraph/bluetooth/socket/Makefile
@@ -0,0 +1,17 @@
+# $Id: Makefile,v 1.2 2003/01/12 23:37:31 max Exp $
+
+.PATH: ${SRCTOP}/sys/netgraph/bluetooth/socket
+
+CFLAGS+= -I${SRCTOP}/sys/netgraph/bluetooth/include
+
+KMOD= ng_btsocket
+SRCS= ng_btsocket.c \
+ ng_btsocket_hci_raw.c \
+ ng_btsocket_l2cap_raw.c \
+ ng_btsocket_l2cap.c \
+ ng_btsocket_rfcomm.c \
+ ng_btsocket_sco.c
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/bluetooth/ubt/Makefile b/sys/modules/netgraph/bluetooth/ubt/Makefile
new file mode 100644
index 000000000000..6ef7da5fbfb2
--- /dev/null
+++ b/sys/modules/netgraph/bluetooth/ubt/Makefile
@@ -0,0 +1,12 @@
+# $Id: Makefile,v 1.2 2003/03/22 23:44:34 max Exp $
+
+.PATH: ${SRCTOP}/sys/netgraph/bluetooth/drivers/ubt
+
+CFLAGS+= -I${SRCTOP}/sys/netgraph/bluetooth/include \
+ -I${SRCTOP}/sys/netgraph/bluetooth/drivers/ubt
+
+KMOD= ng_ubt
+SRCS= ng_ubt.c ng_ubt_intel.c opt_bus.h opt_usb.h device_if.h \
+ bus_if.h usb_if.h usbdevs.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/bluetooth/ubtbcmfw/Makefile b/sys/modules/netgraph/bluetooth/ubtbcmfw/Makefile
new file mode 100644
index 000000000000..1387bcc5a875
--- /dev/null
+++ b/sys/modules/netgraph/bluetooth/ubtbcmfw/Makefile
@@ -0,0 +1,12 @@
+# $Id: Makefile,v 1.1 2003/04/27 00:22:12 max Exp $
+
+.PATH: ${SRCTOP}/sys/netgraph/bluetooth/drivers/ubtbcmfw
+
+CFLAGS+= -I${SRCTOP}/sys/netgraph/bluetooth/include \
+ -I${SRCTOP}/sys/netgraph/bluetooth/drivers/ubtbcmfw
+
+KMOD= ubtbcmfw
+SRCS= ubtbcmfw.c opt_bus.h opt_usb.h device_if.h bus_if.h \
+ usb_if.h vnode_if.h usbdevs.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/bpf/Makefile b/sys/modules/netgraph/bpf/Makefile
new file mode 100644
index 000000000000..ec77a9af604e
--- /dev/null
+++ b/sys/modules/netgraph/bpf/Makefile
@@ -0,0 +1,8 @@
+# $Whistle: Makefile,v 1.1 1999/12/03 01:44:28 archie Exp $
+
+.PATH: ${SRCTOP}/sys/net
+
+KMOD= ng_bpf
+SRCS= opt_bpf.h ng_bpf.c bpf_filter.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/bridge/Makefile b/sys/modules/netgraph/bridge/Makefile
new file mode 100644
index 000000000000..77ed20d85ce9
--- /dev/null
+++ b/sys/modules/netgraph/bridge/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= ng_bridge
+SRCS= ng_bridge.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/car/Makefile b/sys/modules/netgraph/car/Makefile
new file mode 100644
index 000000000000..b3ca9ab9d3b4
--- /dev/null
+++ b/sys/modules/netgraph/car/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= ng_car
+SRCS= ng_car.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/checksum/Makefile b/sys/modules/netgraph/checksum/Makefile
new file mode 100644
index 000000000000..4b41bce3bc58
--- /dev/null
+++ b/sys/modules/netgraph/checksum/Makefile
@@ -0,0 +1,8 @@
+
+SYSDIR?=${SRCTOP}/sys
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+KMOD= ng_checksum
+SRCS= ng_checksum.c opt_inet.h opt_inet6.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/cisco/Makefile b/sys/modules/netgraph/cisco/Makefile
new file mode 100644
index 000000000000..4f14df40cca0
--- /dev/null
+++ b/sys/modules/netgraph/cisco/Makefile
@@ -0,0 +1,6 @@
+# $Whistle: Makefile,v 1.2 1999/01/19 19:39:20 archie Exp $
+
+KMOD= ng_cisco
+SRCS= ng_cisco.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/deflate/Makefile b/sys/modules/netgraph/deflate/Makefile
new file mode 100644
index 000000000000..b6f505fc8b8d
--- /dev/null
+++ b/sys/modules/netgraph/deflate/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= ng_deflate
+SRCS= ng_deflate.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/device/Makefile b/sys/modules/netgraph/device/Makefile
new file mode 100644
index 000000000000..23be18bd6c18
--- /dev/null
+++ b/sys/modules/netgraph/device/Makefile
@@ -0,0 +1,6 @@
+KMOD= ng_device
+SRCS= ng_device.c
+
+SRCS+= device_if.h vnode_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/echo/Makefile b/sys/modules/netgraph/echo/Makefile
new file mode 100644
index 000000000000..f84a17d7a32b
--- /dev/null
+++ b/sys/modules/netgraph/echo/Makefile
@@ -0,0 +1,6 @@
+# $Whistle: Makefile,v 1.2 1999/01/19 19:39:20 archie Exp $
+
+KMOD= ng_echo
+SRCS= ng_echo.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/eiface/Makefile b/sys/modules/netgraph/eiface/Makefile
new file mode 100644
index 000000000000..5c7b4fe46b34
--- /dev/null
+++ b/sys/modules/netgraph/eiface/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= ng_eiface
+SRCS= ng_eiface.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/etf/Makefile b/sys/modules/netgraph/etf/Makefile
new file mode 100644
index 000000000000..2bec0d6b2bf0
--- /dev/null
+++ b/sys/modules/netgraph/etf/Makefile
@@ -0,0 +1,6 @@
+# Ethertype filter
+
+KMOD= ng_etf
+SRCS= ng_etf.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/ether/Makefile b/sys/modules/netgraph/ether/Makefile
new file mode 100644
index 000000000000..7bfa7b1c0630
--- /dev/null
+++ b/sys/modules/netgraph/ether/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= ng_ether
+SRCS= ng_ether.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/ether_echo/Makefile b/sys/modules/netgraph/ether_echo/Makefile
new file mode 100644
index 000000000000..b8a2bcb555ff
--- /dev/null
+++ b/sys/modules/netgraph/ether_echo/Makefile
@@ -0,0 +1,6 @@
+# $Whistle: Makefile,v 1.2 1999/01/19 19:39:20 archie Exp $
+
+KMOD= ng_ether_echo
+SRCS= ng_ether_echo.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/frame_relay/Makefile b/sys/modules/netgraph/frame_relay/Makefile
new file mode 100644
index 000000000000..9a7e21cad64c
--- /dev/null
+++ b/sys/modules/netgraph/frame_relay/Makefile
@@ -0,0 +1,6 @@
+# $Whistle: Makefile,v 1.1 1999/01/19 19:39:21 archie Exp $
+
+KMOD= ng_frame_relay
+SRCS= ng_frame_relay.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/gif/Makefile b/sys/modules/netgraph/gif/Makefile
new file mode 100644
index 000000000000..e7897492fa2c
--- /dev/null
+++ b/sys/modules/netgraph/gif/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= ng_gif
+SRCS= ng_gif.c opt_inet.h opt_inet6.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/gif_demux/Makefile b/sys/modules/netgraph/gif_demux/Makefile
new file mode 100644
index 000000000000..d95bf3d2d66e
--- /dev/null
+++ b/sys/modules/netgraph/gif_demux/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= ng_gif_demux
+SRCS= ng_gif_demux.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/hole/Makefile b/sys/modules/netgraph/hole/Makefile
new file mode 100644
index 000000000000..3259e37dceb7
--- /dev/null
+++ b/sys/modules/netgraph/hole/Makefile
@@ -0,0 +1,6 @@
+# $Whistle: Makefile,v 1.2 1999/01/19 19:39:21 archie Exp $
+
+KMOD= ng_hole
+SRCS= ng_hole.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/hub/Makefile b/sys/modules/netgraph/hub/Makefile
new file mode 100644
index 000000000000..5829c1609b32
--- /dev/null
+++ b/sys/modules/netgraph/hub/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= ng_hub
+SRCS= ng_hub.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/iface/Makefile b/sys/modules/netgraph/iface/Makefile
new file mode 100644
index 000000000000..78a9e0cfcf08
--- /dev/null
+++ b/sys/modules/netgraph/iface/Makefile
@@ -0,0 +1,6 @@
+# $Whistle: Makefile,v 1.2 1999/01/19 19:39:21 archie Exp $
+
+KMOD= ng_iface
+SRCS= ng_iface.c opt_inet.h opt_inet6.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/ip_input/Makefile b/sys/modules/netgraph/ip_input/Makefile
new file mode 100644
index 000000000000..7aa3009ee8c7
--- /dev/null
+++ b/sys/modules/netgraph/ip_input/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= ng_ip_input
+SRCS= ng_ip_input.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/ipfw/Makefile b/sys/modules/netgraph/ipfw/Makefile
new file mode 100644
index 000000000000..bdc23e7039ea
--- /dev/null
+++ b/sys/modules/netgraph/ipfw/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= ng_ipfw
+SRCS= ng_ipfw.c opt_inet.h opt_inet6.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/ksocket/Makefile b/sys/modules/netgraph/ksocket/Makefile
new file mode 100644
index 000000000000..5e05eb1cc620
--- /dev/null
+++ b/sys/modules/netgraph/ksocket/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= ng_ksocket
+SRCS= ng_ksocket.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/l2tp/Makefile b/sys/modules/netgraph/l2tp/Makefile
new file mode 100644
index 000000000000..7ff128ef6bc7
--- /dev/null
+++ b/sys/modules/netgraph/l2tp/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= ng_l2tp
+SRCS= ng_l2tp.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/lmi/Makefile b/sys/modules/netgraph/lmi/Makefile
new file mode 100644
index 000000000000..cba330b1626c
--- /dev/null
+++ b/sys/modules/netgraph/lmi/Makefile
@@ -0,0 +1,6 @@
+# $Whistle: Makefile,v 1.1 1999/01/19 19:39:21 archie Exp $
+
+KMOD= ng_lmi
+SRCS= ng_lmi.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/macfilter/Makefile b/sys/modules/netgraph/macfilter/Makefile
new file mode 100644
index 000000000000..c52a66dc0c2a
--- /dev/null
+++ b/sys/modules/netgraph/macfilter/Makefile
@@ -0,0 +1,8 @@
+
+KMOD= ng_macfilter
+SRCS= ng_macfilter.c
+
+.include <bsd.kmod.mk>
+
+#CFLAGS+= -DNG_MACFILTER_DEBUG
+#CFLAGS+= -DNG_MACFILTER_DEBUG_RECVDATA
diff --git a/sys/modules/netgraph/mppc/Makefile b/sys/modules/netgraph/mppc/Makefile
new file mode 100644
index 000000000000..58110592aa14
--- /dev/null
+++ b/sys/modules/netgraph/mppc/Makefile
@@ -0,0 +1,30 @@
+# $Whistle: Makefile,v 1.1 1999/12/08 20:20:39 archie Exp $
+
+KMOD= ng_mppc
+SRCS= ng_mppc.c opt_netgraph.h
+
+NETGRAPH_MPPC_COMPRESSION?= 1
+NETGRAPH_MPPC_ENCRYPTION?= 1
+
+.if ${NETGRAPH_MPPC_COMPRESSION} > 0
+.PATH: ${SRCTOP}/sys/net
+SRCS+= mppcc.c mppcd.c
+.endif
+
+.if ${NETGRAPH_MPPC_ENCRYPTION} > 0
+.PATH: ${SRCTOP}/sys/crypto
+SRCS+= sha1.c
+.endif
+
+.if !defined(KERNBUILDDIR)
+opt_netgraph.h:
+ :> ${.TARGET}
+.if ${NETGRAPH_MPPC_COMPRESSION} > 0
+ echo "#define NETGRAPH_MPPC_COMPRESSION 1" >> ${.TARGET}
+.endif
+.if ${NETGRAPH_MPPC_ENCRYPTION} > 0
+ echo "#define NETGRAPH_MPPC_ENCRYPTION 1" >> ${.TARGET}
+.endif
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/nat/Makefile b/sys/modules/netgraph/nat/Makefile
new file mode 100644
index 000000000000..4569cfddfbe5
--- /dev/null
+++ b/sys/modules/netgraph/nat/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= ng_nat
+SRCS= ng_nat.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/netflow/Makefile b/sys/modules/netgraph/netflow/Makefile
new file mode 100644
index 000000000000..c73e9ac41680
--- /dev/null
+++ b/sys/modules/netgraph/netflow/Makefile
@@ -0,0 +1,10 @@
+#
+# Author: Gleb Smirnoff <glebius@freebsd.org>
+#
+
+.PATH: ${SRCTOP}/sys/netgraph/netflow
+
+KMOD= ng_netflow
+SRCS= ng_netflow.c netflow.c netflow_v9.c opt_inet.h opt_inet6.h opt_route.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/netgraph/Makefile b/sys/modules/netgraph/netgraph/Makefile
new file mode 100644
index 000000000000..7da7ce9d320a
--- /dev/null
+++ b/sys/modules/netgraph/netgraph/Makefile
@@ -0,0 +1,8 @@
+# $Whistle: Makefile,v 1.2 1999/01/19 19:39:22 archie Exp $
+
+KMOD= netgraph
+SRCS= ng_base.c ng_parse.c
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/one2many/Makefile b/sys/modules/netgraph/one2many/Makefile
new file mode 100644
index 000000000000..07596a73114c
--- /dev/null
+++ b/sys/modules/netgraph/one2many/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= ng_one2many
+SRCS= ng_one2many.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/patch/Makefile b/sys/modules/netgraph/patch/Makefile
new file mode 100644
index 000000000000..ebbae47cf0ab
--- /dev/null
+++ b/sys/modules/netgraph/patch/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= ng_patch
+SRCS= ng_patch.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/pipe/Makefile b/sys/modules/netgraph/pipe/Makefile
new file mode 100644
index 000000000000..68b5d1a7c1eb
--- /dev/null
+++ b/sys/modules/netgraph/pipe/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= ng_pipe
+SRCS= ng_pipe.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/ppp/Makefile b/sys/modules/netgraph/ppp/Makefile
new file mode 100644
index 000000000000..7ab2b8d90750
--- /dev/null
+++ b/sys/modules/netgraph/ppp/Makefile
@@ -0,0 +1,6 @@
+# $Whistle: Makefile,v 1.1 1999/01/24 02:52:12 archie Exp $
+
+KMOD= ng_ppp
+SRCS= ng_ppp.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/pppoe/Makefile b/sys/modules/netgraph/pppoe/Makefile
new file mode 100644
index 000000000000..26aa4dd0fa6d
--- /dev/null
+++ b/sys/modules/netgraph/pppoe/Makefile
@@ -0,0 +1,6 @@
+# $Whistle: Makefile,v 1.1 1999/01/19 19:39:21 archie Exp $
+
+KMOD= ng_pppoe
+SRCS= ng_pppoe.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/pptpgre/Makefile b/sys/modules/netgraph/pptpgre/Makefile
new file mode 100644
index 000000000000..75931e902feb
--- /dev/null
+++ b/sys/modules/netgraph/pptpgre/Makefile
@@ -0,0 +1,6 @@
+# $Whistle: Makefile,v 1.1 1999/11/29 23:14:33 archie Exp $
+
+KMOD= ng_pptpgre
+SRCS= ng_pptpgre.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/pred1/Makefile b/sys/modules/netgraph/pred1/Makefile
new file mode 100644
index 000000000000..a4c95fdbb97e
--- /dev/null
+++ b/sys/modules/netgraph/pred1/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= ng_pred1
+SRCS= ng_pred1.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/rfc1490/Makefile b/sys/modules/netgraph/rfc1490/Makefile
new file mode 100644
index 000000000000..77f22bb449bc
--- /dev/null
+++ b/sys/modules/netgraph/rfc1490/Makefile
@@ -0,0 +1,6 @@
+# $Whistle: Makefile,v 1.2 1999/01/19 19:39:22 archie Exp $
+
+KMOD= ng_rfc1490
+SRCS= ng_rfc1490.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/sample/Makefile b/sys/modules/netgraph/sample/Makefile
new file mode 100644
index 000000000000..d675a8b84441
--- /dev/null
+++ b/sys/modules/netgraph/sample/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= ng_sample
+SRCS= ng_sample.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/socket/Makefile b/sys/modules/netgraph/socket/Makefile
new file mode 100644
index 000000000000..9f91e9300579
--- /dev/null
+++ b/sys/modules/netgraph/socket/Makefile
@@ -0,0 +1,6 @@
+# $Whistle: Makefile,v 1.2 1999/01/19 19:39:22 archie Exp $
+
+KMOD= ng_socket
+SRCS= ng_socket.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/source/Makefile b/sys/modules/netgraph/source/Makefile
new file mode 100644
index 000000000000..603a6b05bee1
--- /dev/null
+++ b/sys/modules/netgraph/source/Makefile
@@ -0,0 +1,7 @@
+
+KMOD= ng_source
+SRCS= ng_source.c
+# 4.x only
+#KMODDEPS= netgraph
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/split/Makefile b/sys/modules/netgraph/split/Makefile
new file mode 100644
index 000000000000..9e1977d730c8
--- /dev/null
+++ b/sys/modules/netgraph/split/Makefile
@@ -0,0 +1,6 @@
+#
+
+KMOD= ng_split
+SRCS= ng_split.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/tag/Makefile b/sys/modules/netgraph/tag/Makefile
new file mode 100644
index 000000000000..cdc19325d096
--- /dev/null
+++ b/sys/modules/netgraph/tag/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= ng_tag
+SRCS= ng_tag.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/tcpmss/Makefile b/sys/modules/netgraph/tcpmss/Makefile
new file mode 100644
index 000000000000..3ed465b2dd2f
--- /dev/null
+++ b/sys/modules/netgraph/tcpmss/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= ng_tcpmss
+SRCS= ng_tcpmss.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/tee/Makefile b/sys/modules/netgraph/tee/Makefile
new file mode 100644
index 000000000000..4d60bb9f8e4b
--- /dev/null
+++ b/sys/modules/netgraph/tee/Makefile
@@ -0,0 +1,6 @@
+# $Whistle: Makefile,v 1.2 1999/01/19 19:39:22 archie Exp $
+
+KMOD= ng_tee
+SRCS= ng_tee.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/tty/Makefile b/sys/modules/netgraph/tty/Makefile
new file mode 100644
index 000000000000..383792a19f83
--- /dev/null
+++ b/sys/modules/netgraph/tty/Makefile
@@ -0,0 +1,6 @@
+# $Whistle: Makefile,v 1.2 1999/01/19 19:39:22 archie Exp $
+
+KMOD= ng_tty
+SRCS= ng_tty.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/vjc/Makefile b/sys/modules/netgraph/vjc/Makefile
new file mode 100644
index 000000000000..bd0bf6a0967c
--- /dev/null
+++ b/sys/modules/netgraph/vjc/Makefile
@@ -0,0 +1,8 @@
+# $Whistle: Makefile,v 1.1 1999/01/24 06:48:07 archie Exp $
+
+.PATH: ${SRCTOP}/sys/net
+
+KMOD= ng_vjc
+SRCS= ng_vjc.c slcompress.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/vlan/Makefile b/sys/modules/netgraph/vlan/Makefile
new file mode 100644
index 000000000000..2f6708de3747
--- /dev/null
+++ b/sys/modules/netgraph/vlan/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= ng_vlan
+SRCS= ng_vlan.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netgraph/vlan_rotate/Makefile b/sys/modules/netgraph/vlan_rotate/Makefile
new file mode 100644
index 000000000000..619b5b432ad7
--- /dev/null
+++ b/sys/modules/netgraph/vlan_rotate/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= ng_vlan_rotate
+SRCS= ng_vlan_rotate.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netlink/Makefile b/sys/modules/netlink/Makefile
new file mode 100644
index 000000000000..6835be6e7bd7
--- /dev/null
+++ b/sys/modules/netlink/Makefile
@@ -0,0 +1,20 @@
+.PATH: ${SRCTOP}/sys/netlink
+KMOD= netlink
+
+SRCS = netlink_module.c netlink_domain.c netlink_io.c \
+ netlink_message_writer.c netlink_generic.c \
+ netlink_route.c route/iface.c route/iface_drivers.c route/neigh.c \
+ route/nexthop.c route/rt.c
+SRCS+= opt_inet.h opt_inet6.h opt_route.h
+
+CFLAGS+= -DNETLINK_MODULE
+
+EXPORT_SYMS=
+EXPORT_SYMS+= nlmsg_get_chain_writer
+EXPORT_SYMS+= nlmsg_refill_buffer
+EXPORT_SYMS+= nlmsg_end
+EXPORT_SYMS+= nlmsg_flush
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/netmap/Makefile b/sys/modules/netmap/Makefile
new file mode 100644
index 000000000000..17b52aec1893
--- /dev/null
+++ b/sys/modules/netmap/Makefile
@@ -0,0 +1,29 @@
+#
+# Compile netmap as a module, useful if you want a netmap bridge
+# or loadable drivers.
+
+.include <bsd.own.mk> # FreeBSD 10 and earlier
+# .include "${SYSDIR}/conf/kern.opts.mk"
+
+.PATH: ${.CURDIR}/../../dev/netmap
+.PATH.h: ${.CURDIR}/../../net
+CFLAGS += -I${.CURDIR}/../../ -D INET -D VIMAGE
+KMOD = netmap
+SRCS = device_if.h bus_if.h pci_if.h opt_netmap.h
+SRCS += netmap.c netmap.h netmap_kern.h
+SRCS += netmap_mem2.c netmap_mem2.h
+SRCS += netmap_generic.c
+SRCS += netmap_mbq.c netmap_mbq.h
+SRCS += netmap_vale.c
+SRCS += netmap_freebsd.c
+SRCS += netmap_offloadings.c
+SRCS += netmap_pipe.c
+SRCS += netmap_monitor.c
+SRCS += netmap_kloop.c
+SRCS += netmap_legacy.c
+SRCS += netmap_bdg.c
+SRCS += netmap_null.c
+SRCS += if_ptnet.c
+SRCS += opt_inet.h opt_inet6.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/nfe/Makefile b/sys/modules/nfe/Makefile
new file mode 100644
index 000000000000..c7361ac97aeb
--- /dev/null
+++ b/sys/modules/nfe/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/nfe
+
+KMOD= if_nfe
+SRCS= if_nfe.c device_if.h bus_if.h pci_if.h miibus_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/nfscl/Makefile b/sys/modules/nfscl/Makefile
new file mode 100644
index 000000000000..6394d0fba753
--- /dev/null
+++ b/sys/modules/nfscl/Makefile
@@ -0,0 +1,45 @@
+
+.PATH: ${SRCTOP}/sys/fs/nfsclient ${SRCTOP}/sys/nfs
+KMOD= nfscl
+SRCS= vnode_if.h \
+ nfs_clrpcops.c \
+ nfs_clkrpc.c \
+ nfs_clstate.c \
+ nfs_clcomsubs.c \
+ nfs_clport.c \
+ nfs_clbio.c \
+ nfs_clnfsiod.c \
+ nfs_clnode.c \
+ nfs_clsubs.c \
+ nfs_clvfsops.c \
+ nfs_clvnops.c \
+ opt_bootp.h \
+ opt_inet.h \
+ opt_inet6.h \
+ opt_kern_tls.h \
+ opt_kgssapi.h \
+ opt_nfs.h \
+ opt_nfsroot.h \
+ opt_ufs.h
+
+.if !defined(KERNBUILDDIR)
+NFS_ROOT?= 1 # 0/1 - requires NFS_ROOT to be configured in kernel
+
+.if ${NFS_ROOT} > 0
+opt_nfsroot.h:
+ echo "#define NFS_ROOT 1" > ${.TARGET}
+.endif
+.else
+OPT_NFS_ROOT!= cat ${KERNBUILDDIR}/opt_nfsroot.h
+.if empty(OPT_NFS_ROOT)
+NFS_ROOT= 0
+.else
+NFS_ROOT= 1
+.endif
+.endif
+
+.if ${NFS_ROOT} > 0
+SRCS+= nfs_diskless.c
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/nfscommon/Makefile b/sys/modules/nfscommon/Makefile
new file mode 100644
index 000000000000..7f03ba5a2b4f
--- /dev/null
+++ b/sys/modules/nfscommon/Makefile
@@ -0,0 +1,18 @@
+
+.PATH: ${SRCTOP}/sys/fs/nfs
+KMOD= nfscommon
+SRCS= vnode_if.h \
+ nfs_commonacl.c \
+ nfs_commonkrpc.c \
+ nfs_commonport.c \
+ nfs_commonsubs.c \
+ opt_inet.h \
+ opt_inet6.h \
+ opt_kern_tls.h \
+ opt_kgssapi.h \
+ opt_nfs.h \
+ opt_ufs.h
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/nfsd/Makefile b/sys/modules/nfsd/Makefile
new file mode 100644
index 000000000000..5ec7717e3f12
--- /dev/null
+++ b/sys/modules/nfsd/Makefile
@@ -0,0 +1,20 @@
+
+.PATH: ${SRCTOP}/sys/fs/nfsserver
+KMOD= nfsd
+SRCS= vnode_if.h \
+ nfs_fha_new.c \
+ nfs_nfsdserv.c \
+ nfs_nfsdcache.c \
+ nfs_nfsdkrpc.c \
+ nfs_nfsdsocket.c \
+ nfs_nfsdstate.c \
+ nfs_nfsdsubs.c \
+ nfs_nfsdport.c \
+ opt_ufs.h \
+ opt_nfs.h \
+ opt_inet.h \
+ opt_inet6.h \
+ opt_kern_tls.h \
+ opt_kgssapi.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/nfslockd/Makefile b/sys/modules/nfslockd/Makefile
new file mode 100644
index 000000000000..310b9e3611bd
--- /dev/null
+++ b/sys/modules/nfslockd/Makefile
@@ -0,0 +1,14 @@
+
+.PATH: ${SRCTOP}/sys/nlm ${SRCTOP}/sys/rpc
+KMOD= nfslockd
+SRCS= vnode_if.h \
+ nlm_advlock.c \
+ nlm_prot_clnt.c \
+ nlm_prot_impl.c \
+ nlm_prot_server.c \
+ nlm_prot_svc.c \
+ nlm_prot_xdr.c \
+ sm_inter_xdr.c
+SRCS+= opt_inet6.h opt_nfs.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/nfssvc/Makefile b/sys/modules/nfssvc/Makefile
new file mode 100644
index 000000000000..04bbf910eea0
--- /dev/null
+++ b/sys/modules/nfssvc/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/nfs
+KMOD= nfssvc
+SRCS= nfs_nfssvc.c \
+ opt_nfs.h
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/nge/Makefile b/sys/modules/nge/Makefile
new file mode 100644
index 000000000000..ea8d1ed2b355
--- /dev/null
+++ b/sys/modules/nge/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/nge
+
+KMOD= if_nge
+SRCS= if_nge.c miibus_if.h device_if.h bus_if.h pci_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/nlsysevent/Makefile b/sys/modules/nlsysevent/Makefile
new file mode 100644
index 000000000000..be9b985409b6
--- /dev/null
+++ b/sys/modules/nlsysevent/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/netlink/
+
+KMOD= nlsysevent
+SRCS= netlink_sysevent.c
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/nmdm/Makefile b/sys/modules/nmdm/Makefile
new file mode 100644
index 000000000000..d9d2fc8523ef
--- /dev/null
+++ b/sys/modules/nmdm/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/nmdm
+
+KMOD= nmdm
+SRCS= nmdm.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ntb/Makefile b/sys/modules/ntb/Makefile
new file mode 100644
index 000000000000..a1374f3d0f7c
--- /dev/null
+++ b/sys/modules/ntb/Makefile
@@ -0,0 +1,4 @@
+
+SUBDIR= ntb ntb_hw_amd ntb_hw_intel ntb_hw_plx ntb_transport ntb_tool if_ntb
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/ntb/if_ntb/Makefile b/sys/modules/ntb/if_ntb/Makefile
new file mode 100644
index 000000000000..fb99668e2d12
--- /dev/null
+++ b/sys/modules/ntb/if_ntb/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ntb/if_ntb
+
+KMOD = if_ntb
+SRCS = if_ntb.c
+SRCS += device_if.h bus_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ntb/ntb/Makefile b/sys/modules/ntb/ntb/Makefile
new file mode 100644
index 000000000000..97f54fff3688
--- /dev/null
+++ b/sys/modules/ntb/ntb/Makefile
@@ -0,0 +1,10 @@
+
+.PATH: ${SRCTOP}/sys/dev/ntb
+
+KMOD = ntb
+SRCS = ntb.c ntb_if.c
+SRCS += device_if.h bus_if.h ntb_if.h
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ntb/ntb_hw_amd/Makefile b/sys/modules/ntb/ntb_hw_amd/Makefile
new file mode 100644
index 000000000000..59693dbec299
--- /dev/null
+++ b/sys/modules/ntb/ntb_hw_amd/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ntb/ntb_hw
+
+KMOD = ntb_hw_amd
+SRCS = ntb_hw_amd.c
+SRCS += device_if.h bus_if.h pci_if.h ntb_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ntb/ntb_hw_intel/Makefile b/sys/modules/ntb/ntb_hw_intel/Makefile
new file mode 100644
index 000000000000..688eeeb17e7a
--- /dev/null
+++ b/sys/modules/ntb/ntb_hw_intel/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ntb/ntb_hw
+
+KMOD = ntb_hw_intel
+SRCS = ntb_hw_intel.c
+SRCS += device_if.h bus_if.h pci_if.h ntb_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ntb/ntb_hw_plx/Makefile b/sys/modules/ntb/ntb_hw_plx/Makefile
new file mode 100644
index 000000000000..08075af35fc7
--- /dev/null
+++ b/sys/modules/ntb/ntb_hw_plx/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ntb/ntb_hw
+
+KMOD = ntb_hw_plx
+SRCS = ntb_hw_plx.c
+SRCS += device_if.h bus_if.h pci_if.h ntb_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ntb/ntb_tool/Makefile b/sys/modules/ntb/ntb_tool/Makefile
new file mode 100644
index 000000000000..5fa4b1cfc7c8
--- /dev/null
+++ b/sys/modules/ntb/ntb_tool/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ntb/test
+
+KMOD = ntb_tool
+SRCS = ntb_tool.c
+SRCS += device_if.h bus_if.h pci_if.h ntb_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ntb/ntb_transport/Makefile b/sys/modules/ntb/ntb_transport/Makefile
new file mode 100644
index 000000000000..47af0b4ff21e
--- /dev/null
+++ b/sys/modules/ntb/ntb_transport/Makefile
@@ -0,0 +1,10 @@
+
+.PATH: ${SRCTOP}/sys/dev/ntb
+
+KMOD = ntb_transport
+SRCS = ntb_transport.c
+SRCS += device_if.h bus_if.h ntb_if.h
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/nullfs/Makefile b/sys/modules/nullfs/Makefile
new file mode 100644
index 000000000000..3f5d1aef3f87
--- /dev/null
+++ b/sys/modules/nullfs/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/fs/nullfs
+
+KMOD= nullfs
+SRCS= vnode_if.h \
+ null_subr.c null_vfsops.c null_vnops.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/nvd/Makefile b/sys/modules/nvd/Makefile
new file mode 100644
index 000000000000..2a1c49024fb0
--- /dev/null
+++ b/sys/modules/nvd/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/nvd
+
+KMOD= nvd
+SRCS= nvd.c opt_geom.h device_if.h bus_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/nvdimm/Makefile b/sys/modules/nvdimm/Makefile
new file mode 100644
index 000000000000..043c1d287a75
--- /dev/null
+++ b/sys/modules/nvdimm/Makefile
@@ -0,0 +1,20 @@
+
+.PATH: ${SRCTOP}/sys/dev/nvdimm
+
+KMOD= nvdimm
+SRCS= nvdimm.c \
+ nvdimm_acpi.c \
+ nvdimm_e820.c \
+ nvdimm_nfit.c \
+ nvdimm_ns.c \
+ nvdimm_spa.c
+
+SRCS+= acpi_if.h bus_if.h device_if.h
+SRCS+= opt_acpi.h opt_ddb.h
+
+.include <bsd.kmod.mk>
+
+# Mute spurious Clang warning.
+.if ${COMPILER_TYPE} == "clang"
+CWARNFLAGS.nvdimm_e820.c+= -Wno-missing-braces
+.endif
diff --git a/sys/modules/nvme/Makefile b/sys/modules/nvme/Makefile
new file mode 100644
index 000000000000..9b7003bdea69
--- /dev/null
+++ b/sys/modules/nvme/Makefile
@@ -0,0 +1,27 @@
+
+.PATH: ${SRCTOP}/sys/dev/nvme
+
+KMOD = nvme
+
+SRCS = nvme.c \
+ nvme_ahci.c \
+ nvme_ctrlr.c \
+ nvme_ctrlr_cmd.c \
+ nvme_ns.c \
+ nvme_ns_cmd.c \
+ nvme_pci.c \
+ nvme_qpair.c \
+ nvme_sim.c \
+ nvme_sysctl.c \
+ nvme_test.c \
+ nvme_util.c \
+ \
+ bus_if.h \
+ device_if.h \
+ opt_cam.h \
+ opt_nvme.h \
+ pci_if.h
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/nvram/Makefile b/sys/modules/nvram/Makefile
new file mode 100644
index 000000000000..5f6ab7b244b0
--- /dev/null
+++ b/sys/modules/nvram/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/nvram
+
+KMOD= nvram
+SRCS= nvram.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/oce/Makefile b/sys/modules/oce/Makefile
new file mode 100644
index 000000000000..0b9cb6eaf1fe
--- /dev/null
+++ b/sys/modules/oce/Makefile
@@ -0,0 +1,14 @@
+#
+#
+
+.PATH: ${SRCTOP}/sys/dev/oce
+KMOD = if_oce
+SRCS = oce_if.c oce_hw.c oce_mbox.c oce_util.c oce_queue.c oce_sysctl.c
+SRCS += bus_if.h device_if.h pci_if.h opt_inet.h opt_inet6.h
+
+CFLAGS+= -I${SRCTOP}/sys/dev/oce
+
+# uncomment for lock profiling statistics
+#CFLAGS += -DLOCK_PROFILING
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ocs_fc/Makefile b/sys/modules/ocs_fc/Makefile
new file mode 100644
index 000000000000..24abff9eccc7
--- /dev/null
+++ b/sys/modules/ocs_fc/Makefile
@@ -0,0 +1,46 @@
+
+.PATH: ${SRCTOP}/sys/dev/ocs_fc
+KMOD = ocs_fc
+
+SRCS = \
+ device_if.h \
+ bus_if.h \
+ pci_if.h \
+ opt_scsi.h \
+ opt_stack.h \
+ opt_cam.h
+
+# OS
+SRCS += ocs_pci.c ocs_ioctl.c ocs_os.c ocs_utils.c
+
+# hw
+SRCS += ocs_hw.c ocs_hw_queues.c
+
+# SLI
+SRCS += sli4.c ocs_sm.c
+
+# Transport
+SRCS += \
+ ocs_device.c \
+ ocs_xport.c \
+ ocs_domain.c \
+ ocs_sport.c \
+ ocs_els.c \
+ ocs_fabric.c \
+ ocs_io.c \
+ ocs_node.c \
+ ocs_scsi.c \
+ ocs_unsol.c \
+ ocs_ddump.c \
+ ocs_mgmt.c \
+ ocs_gendump.c
+
+
+# CAM initiator/target
+SRCS += ocs_cam.c
+
+CINCS = -I.
+
+CLEANFILES += ${PROG}.debug ${PROG}.symbols cscope.*
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/opal_nvram/Makefile b/sys/modules/opal_nvram/Makefile
new file mode 100644
index 000000000000..8898dbb4629c
--- /dev/null
+++ b/sys/modules/opal_nvram/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/powerpc/powernv
+
+KMOD= opal_nvram
+SRCS= opal_nvram.c
+SRCS+= bus_if.h device_if.h
+SRCS+= ofw_bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/opensolaris/Makefile b/sys/modules/opensolaris/Makefile
new file mode 100644
index 000000000000..42702d0c685d
--- /dev/null
+++ b/sys/modules/opensolaris/Makefile
@@ -0,0 +1,35 @@
+
+SYSDIR?= ${SRCTOP}/sys
+
+.PATH: ${SYSDIR}/cddl/compat/opensolaris/kern
+.PATH: ${SYSDIR}/contrib/openzfs/module/os/freebsd/spl
+
+KMOD= opensolaris
+SRCS= vnode_if.h \
+ opensolaris.c \
+ opensolaris_proc.c \
+ spl_cmn_err.c \
+ spl_kmem.c \
+ spl_misc.c \
+ spl_sunddi.c
+
+_A=${SYSDIR}/cddl/contrib/opensolaris/common/atomic
+.if exists(${_A}/${MACHINE_CPUARCH}/opensolaris_atomic.S)
+.PATH: ${_A}/${MACHINE_CPUARCH}
+SRCS+= opensolaris_atomic.S
+.elif exists(${_A}/${MACHINE_ARCH}/opensolaris_atomic.S)
+.PATH: ${_A}/${MACHINE_ARCH}
+SRCS+= opensolaris_atomic.S
+.else
+SRCS+= opensolaris_atomic.c
+.endif
+
+CFLAGS+= ${OPENZFS_CFLAGS}
+
+EXPORT_SYMS= YES
+
+IGNORE_PRAGMA= 1
+
+.include <bsd.kmod.mk>
+
+CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
diff --git a/sys/modules/ossl/Makefile b/sys/modules/ossl/Makefile
new file mode 100644
index 000000000000..7f70f19db76c
--- /dev/null
+++ b/sys/modules/ossl/Makefile
@@ -0,0 +1,65 @@
+
+.PATH: ${SRCTOP}/sys/crypto/openssl
+.PATH: ${SRCTOP}/sys/crypto/openssl/${MACHINE_CPUARCH}
+
+KMOD= ossl
+OBJS+= ${OBJS.${MACHINE_CPUARCH}}
+SRCS= bus_if.h \
+ cryptodev_if.h \
+ device_if.h \
+ ossl.c \
+ ossl_aes.c \
+ ossl_chacha20.c \
+ ossl_poly1305.c \
+ ossl_sha1.c \
+ ossl_sha256.c \
+ ossl_sha512.c \
+ ${SRCS.${MACHINE_CPUARCH}}
+
+SRCS.aarch64= \
+ chacha-armv8.S \
+ poly1305-armv8.S \
+ sha1-armv8.S \
+ sha256-armv8.S \
+ sha512-armv8.S \
+ vpaes-armv8.S \
+ ossl_aarch64.c
+
+SRCS.amd64= \
+ aes-gcm-avx512.S \
+ aesni-x86_64.S \
+ aesni-gcm-x86_64.S \
+ chacha-x86_64.S \
+ ghash-x86_64.S \
+ poly1305-x86_64.S \
+ sha1-x86_64.S \
+ sha256-x86_64.S \
+ sha512-x86_64.S \
+ ossl_aes_gcm.c \
+ ossl_x86.c
+
+SRCS.i386= \
+ aesni-x86.S \
+ chacha-x86.S \
+ poly1305-x86.S \
+ sha1-586.S \
+ sha256-586.S \
+ sha512-586.S \
+ ossl_x86.c
+
+# For arm64, we are forced to rewrite the compiler invocation for the assembly
+# files, to remove -mgeneral-regs-only.
+${SRCS.aarch64:M*.S:S/S/o/}: ${.TARGET:R}.S
+ ${CC} -c ${CFLAGS:N-mgeneral-regs-only} ${WERROR} ${PROF} ${.IMPSRC}
+ ${CTFCONVERT_CMD}
+
+# Based on modules/armv8crypto/Makefile.
+# Clang doesn't recognize "aes*" instructions without -march set.
+aesv8-armx.o: aesv8-armx.S
+ ${CC} -c ${CFLAGS:N-mgeneral-regs-only} ${WERROR} ${PROF} \
+ -march=armv8-a+crypto ${.IMPSRC}
+ ${CTFCONVERT_CMD}
+
+OBJS.aarch64= aesv8-armx.o
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/otus/Makefile b/sys/modules/otus/Makefile
new file mode 100644
index 000000000000..8c0c322429b8
--- /dev/null
+++ b/sys/modules/otus/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/otus
+
+KMOD = if_otus
+SRCS = if_otus.c if_otusreg.h \
+ bus_if.h device_if.h \
+ opt_bus.h opt_usb.h opt_wlan.h usb_if.h usbdevs.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/otusfw/Makefile b/sys/modules/otusfw/Makefile
new file mode 100644
index 000000000000..f55b73d06f5a
--- /dev/null
+++ b/sys/modules/otusfw/Makefile
@@ -0,0 +1,4 @@
+
+SUBDIR=otusfw_init otusfw_main
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/otusfw/otusfw_init/Makefile b/sys/modules/otusfw/otusfw_init/Makefile
new file mode 100644
index 000000000000..d3acbc16beea
--- /dev/null
+++ b/sys/modules/otusfw/otusfw_init/Makefile
@@ -0,0 +1,10 @@
+
+KMOD= otusfw_init
+FIRMWS= otusfw_init:otusfw_init:1
+
+CLEANFILES= otus_init
+
+otusfw_init: ${SRCTOP}/sys/contrib/dev/otus/otus-init
+ cp ${.ALLSRC} ${.TARGET}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/otusfw/otusfw_main/Makefile b/sys/modules/otusfw/otusfw_main/Makefile
new file mode 100644
index 000000000000..cd563b3ed1dd
--- /dev/null
+++ b/sys/modules/otusfw/otusfw_main/Makefile
@@ -0,0 +1,10 @@
+
+KMOD= otusfw_main
+FIRMWS= otusfw_main:otusfw_main:1
+
+CLEANFILES= otusfw_main
+
+otusfw_main: ${SRCTOP}/sys/contrib/dev/otus/otus-main
+ cp ${.ALLSRC} ${.TARGET}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ow/Makefile b/sys/modules/ow/Makefile
new file mode 100644
index 000000000000..498dd15a0328
--- /dev/null
+++ b/sys/modules/ow/Makefile
@@ -0,0 +1,7 @@
+
+SYSDIR?=${SRCTOP}/sys
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+SUBDIR = ow owc ow_temp
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/ow/ow/Makefile b/sys/modules/ow/ow/Makefile
new file mode 100644
index 000000000000..fbfbd1b5d58e
--- /dev/null
+++ b/sys/modules/ow/ow/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ow
+
+KMOD= ow
+SRCS= ow.c
+SRCS+= own_if.c own_if.h owll_if.c owll_if.h bus_if.h device_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ow/ow_temp/Makefile b/sys/modules/ow/ow_temp/Makefile
new file mode 100644
index 000000000000..6c6d2df47808
--- /dev/null
+++ b/sys/modules/ow/ow_temp/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ow
+
+KMOD= ow_temp
+SRCS= ow_temp.c
+SRCS+= own_if.h bus_if.h device_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ow/owc/Makefile b/sys/modules/ow/owc/Makefile
new file mode 100644
index 000000000000..5c98574c0711
--- /dev/null
+++ b/sys/modules/ow/owc/Makefile
@@ -0,0 +1,11 @@
+
+.PATH: ${SRCTOP}/sys/dev/ow
+
+KMOD= owc
+SRCS= owc_gpiobus.c
+SRCS+= gpio_if.h gpiobus_if.h owll_if.h ofw_bus_if.h bus_if.h device_if.h
+SRCS+= opt_platform.h
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/p2sb/Makefile b/sys/modules/p2sb/Makefile
new file mode 100644
index 000000000000..8dc643240d27
--- /dev/null
+++ b/sys/modules/p2sb/Makefile
@@ -0,0 +1,7 @@
+.PATH: ${.CURDIR}/../../dev/p2sb
+
+KMOD= p2sb
+SRCS= p2sb.c lewisburg_gpio.c lewisburg_gpiocm.c
+SRCS+= device_if.h bus_if.h pci_if.h gpio_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/padlock/Makefile b/sys/modules/padlock/Makefile
new file mode 100644
index 000000000000..167282c99ff7
--- /dev/null
+++ b/sys/modules/padlock/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/crypto/via
+
+KMOD= padlock
+SRCS= padlock.c padlock_cipher.c padlock_hash.c
+SRCS += device_if.h bus_if.h opt_bus.h cryptodev_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/padlock_rng/Makefile b/sys/modules/padlock_rng/Makefile
new file mode 100644
index 000000000000..fe224a7c8124
--- /dev/null
+++ b/sys/modules/padlock_rng/Makefile
@@ -0,0 +1,10 @@
+
+.PATH: ${SRCTOP}/sys/dev/random
+
+KMOD= padlock_rng
+SRCS= nehemiah.c
+SRCS+= bus_if.h device_if.h
+
+CFLAGS+= -I${SRCTOP}/sys
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/pcfclock/Makefile b/sys/modules/pcfclock/Makefile
new file mode 100644
index 000000000000..60f71e7b217c
--- /dev/null
+++ b/sys/modules/pcfclock/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ppbus
+
+KMOD= pcfclock
+SRCS= pcfclock.c opt_pcfclock.h
+SRCS+= bus_if.h device_if.h ppbus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/pchtherm/Makefile b/sys/modules/pchtherm/Makefile
new file mode 100644
index 000000000000..eb69b508f86e
--- /dev/null
+++ b/sys/modules/pchtherm/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/intel
+KMOD= pchtherm
+SRCS= pchtherm.c
+SRCS+= device_if.h bus_if.h pci_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/pf/Makefile b/sys/modules/pf/Makefile
new file mode 100644
index 000000000000..6158943139cf
--- /dev/null
+++ b/sys/modules/pf/Makefile
@@ -0,0 +1,27 @@
+
+.PATH: ${SRCTOP}/sys/netpfil/pf
+
+KMOD= pf
+SRCS= pf.c pf_if.c pf_lb.c pf_osfp.c pf_ioctl.c pf_norm.c pf_table.c \
+ pf_ruleset.c pf_nl.c pf_nv.c pf_syncookies.c in4_cksum.c \
+ bus_if.h device_if.h \
+ opt_pf.h opt_inet.h opt_inet6.h opt_bpf.h opt_sctp.h opt_global.h \
+ opt_kern_tls.h
+
+.if !defined(KERNBUILDDIR)
+# pflog can be loaded as a module, have the additional checks turned on
+# pfsync can be loaded as a module, have the additional checks turned on
+opt_pf.h:
+ echo "#define DEV_PF 1" > ${.TARGET}
+ echo "#define DEV_PFLOG 1" >> ${.TARGET}
+ echo "#define DEV_PFSYNC 1" >> ${.TARGET}
+
+.if defined(VIMAGE)
+opt_global.h:
+ echo "#define VIMAGE 1" >> ${.TARGET}
+.endif
+.endif
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/pflog/Makefile b/sys/modules/pflog/Makefile
new file mode 100644
index 000000000000..8352a6c16cef
--- /dev/null
+++ b/sys/modules/pflog/Makefile
@@ -0,0 +1,17 @@
+
+.PATH: ${SRCTOP}/sys/netpfil/pf
+
+KMOD= pflog
+SRCS= if_pflog.c \
+ opt_pf.h opt_inet.h opt_inet6.h opt_bpf.h opt_global.h
+SRCS+= bus_if.h device_if.h
+
+.if !defined(KERNBUILDDIR)
+.if defined(VIMAGE)
+opt_global.h:
+ echo "#define VIMAGE 1" >> ${.TARGET}
+CFLAGS+= -include opt_global.h
+.endif
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/pfsync/Makefile b/sys/modules/pfsync/Makefile
new file mode 100644
index 000000000000..fc2cdbf4ba85
--- /dev/null
+++ b/sys/modules/pfsync/Makefile
@@ -0,0 +1,17 @@
+
+.PATH: ${SRCTOP}/sys/netpfil/pf
+
+KMOD= pfsync
+SRCS= if_pfsync.c pfsync_nv.c \
+ opt_pf.h opt_inet.h opt_inet6.h opt_global.h
+SRCS+= bus_if.h device_if.h
+
+.if !defined(KERNBUILDDIR)
+.if defined(VIMAGE)
+opt_global.h:
+ echo "#define VIMAGE 1" >> ${.TARGET}
+CFLAGS+= -include opt_global.h
+.endif
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/plip/Makefile b/sys/modules/plip/Makefile
new file mode 100644
index 000000000000..dab5d4c64d8d
--- /dev/null
+++ b/sys/modules/plip/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ppbus
+KMOD= plip
+SRCS= bus_if.h device_if.h ppbus_if.h \
+ opt_plip.h \
+ if_plip.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/pms/Makefile b/sys/modules/pms/Makefile
new file mode 100644
index 000000000000..8bd21fc4b502
--- /dev/null
+++ b/sys/modules/pms/Makefile
@@ -0,0 +1,57 @@
+# 5/31/2012
+#PATH shall include all directories
+
+.PATH: ${SRCTOP}/sys/dev/pms/freebsd/driver/ini/src \
+ ${SRCTOP}/sys/dev/pms/RefTisa/sallsdk/api \
+ ${SRCTOP}/sys/dev/pms/RefTisa/sallsdk/spc \
+ ${SRCTOP}/sys/dev/pms/RefTisa/sallsdk/hda/64k \
+ ${SRCTOP}/sys/dev/pms/RefTisa/discovery/api \
+ ${SRCTOP}/sys/dev/pms/RefTisa/discovery/dm \
+ ${SRCTOP}/sys/dev/pms/RefTisa/sat/api \
+ ${SRCTOP}/sys/dev/pms/RefTisa/sat/src \
+ ${SRCTOP}/sys/dev/pms/RefTisa/tisa/api \
+ ${SRCTOP}/sys/dev/pms/RefTisa/tisa/sassata/common \
+ ${SRCTOP}/sys/dev/pms/RefTisa/tisa/sassata/sas/common \
+ ${SRCTOP}/sys/dev/pms/RefTisa/tisa/sassata/sas/ini \
+ ${SRCTOP}/sys/dev/pms/RefTisa/tisa/sassata/sata/host \
+ ${SRCTOP}/sys/dev/pms/freebsd/driver/common
+
+CFLAGS+=-fno-builtin
+CFLAGS+=-fms-extensions
+
+CFLAGS+=-Wredundant-decls
+CFLAGS+=-Wunused-variable
+CFLAGS+=-Woverflow
+CFLAGS+=-Wmissing-prototypes
+CFLAGS+=-Wparentheses
+CFLAGS+=-w
+
+#CFLAGS+=-g
+
+
+#SUBDIR= tisa tisa/drivers tisa/drivers/FreeBSD tisa/drivers/FreeBSD/ini tisa/drivers/FreeBSD/ini/src
+#SUBDIR= Hialeah_driver Hialeah_driver/freebsd Hialeah_driver/freebsd/ini Hialeah_driver/freebsd/ini/src
+
+KMOD= pmspcv
+#OS files
+SRCS=agtiapi.c
+
+#LL files
+SRCS+= sadisc.c mpi.c saframe.c sahw.c sainit.c saint.c sampicmd.c sampirsp.c saphy.c saport.c
+SRCS+= sasata.c sasmp.c sassp.c satimer.c sautil.c saioctlcmd.c mpidebug.c
+#DM files
+SRCS+= dminit.c dmsmp.c dmdisc.c dmport.c dmtimer.c dmmisc.c
+#SM files
+SRCS+= sminit.c smmisc.c smsat.c smsatcb.c smsathw.c smtimer.c
+#TD files
+SRCS+= tdinit.c tdmisc.c tdesgl.c tdport.c tdint.c tdioctl.c tdhw.c ossacmnapi.c tddmcmnapi.c tdsmcmnapi.c
+SRCS+= tdtimers.c itdio.c itdcb.c itdinit.c itddisc.c sat.c ossasat.c sathw.c
+
+#header files
+SRCS+= agtiapi.h agtiproto.h agdef.h
+#
+SRCS+= osenv.h ostypes.h
+SRCS+= opt_scsi.h opt_cam.h
+SRCS+= device_if.h bus_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/pms/Makefile.inc b/sys/modules/pms/Makefile.inc
new file mode 100644
index 000000000000..d3b5cbd3a79b
--- /dev/null
+++ b/sys/modules/pms/Makefile.inc
@@ -0,0 +1,2 @@
+
+.include "../Makefile.inc"
diff --git a/sys/modules/powermac_nvram/Makefile b/sys/modules/powermac_nvram/Makefile
new file mode 100644
index 000000000000..06e3b66e3e10
--- /dev/null
+++ b/sys/modules/powermac_nvram/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/powermac_nvram
+
+KMOD= powermac_nvram
+SRCS= powermac_nvram.c powermac_nvramvar.h
+SRCS+= bus_if.h device_if.h
+SRCS+= ofw_bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ppbus/Makefile b/sys/modules/ppbus/Makefile
new file mode 100644
index 000000000000..37ce59ea9c25
--- /dev/null
+++ b/sys/modules/ppbus/Makefile
@@ -0,0 +1,23 @@
+
+.PATH: ${SRCTOP}/sys/dev/ppbus
+KMOD= ppbus
+SRCS= bus_if.h device_if.h ppbus_if.h ppbus_if.c \
+ opt_ppb_1284.h \
+ ppb_1284.c ppb_base.c ppb_msq.c ppbconf.c
+
+EXPORT_SYMS= \
+ ppb_request_bus \
+ ppb_release_bus \
+ ppb_get_status \
+ ppb_poll_bus \
+ ppb_reset_epp_timeout \
+ ppb_ecp_sync \
+ ppb_get_epp_protocol \
+ ppb_set_mode \
+ ppb_get_mode \
+ ppb_write \
+ ppb_lock
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ppc/Makefile b/sys/modules/ppc/Makefile
new file mode 100644
index 000000000000..8537acae9b3f
--- /dev/null
+++ b/sys/modules/ppc/Makefile
@@ -0,0 +1,12 @@
+
+.PATH: ${SRCTOP}/sys/dev/ppc
+KMOD= ppc
+SRCS= bus_if.h device_if.h ppbus_if.h isa_if.h pci_if.h serdev_if.h \
+ opt_ppc.h opt_isa.h \
+ ppc.c ppc_pci.c ppc_puc.c
+
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
+SRCS+= ppc_acpi.c ppc_isa.c
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ppi/Makefile b/sys/modules/ppi/Makefile
new file mode 100644
index 000000000000..5875e6e57dd9
--- /dev/null
+++ b/sys/modules/ppi/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ppbus
+KMOD= ppi
+SRCS= bus_if.h device_if.h ppbus_if.h \
+ opt_ppb_1284.h \
+ ppi.c ppb_1284.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/pps/Makefile b/sys/modules/pps/Makefile
new file mode 100644
index 000000000000..59979e4b11a3
--- /dev/null
+++ b/sys/modules/pps/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/ppbus
+KMOD= pps
+SRCS= bus_if.h device_if.h ppbus_if.h \
+ pps.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/procfs/Makefile b/sys/modules/procfs/Makefile
new file mode 100644
index 000000000000..65708288a523
--- /dev/null
+++ b/sys/modules/procfs/Makefile
@@ -0,0 +1,27 @@
+
+.PATH: ${SRCTOP}/sys/fs/procfs
+
+KMOD= procfs
+SRCS=
+SRCS+= vnode_if.h
+SRCS+= procfs_dbregs.c
+SRCS+= procfs_fpregs.c
+SRCS+= procfs_map.c
+SRCS+= procfs_mem.c
+SRCS+= procfs_note.c
+SRCS+= procfs_osrel.c
+SRCS+= procfs_regs.c
+SRCS+= procfs_rlimit.c
+SRCS+= procfs_status.c
+SRCS+= procfs_type.c
+SRCS+= procfs.c
+
+EXPORT_SYMS=
+EXPORT_SYMS+= procfs_candebug
+EXPORT_SYMS+= procfs_docurproc
+EXPORT_SYMS+= procfs_doprocfile
+EXPORT_SYMS+= procfs_doprocmem
+EXPORT_SYMS+= procfs_notsystem
+EXPORT_SYMS+= procfs_attr_rw
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/proto/Makefile b/sys/modules/proto/Makefile
new file mode 100644
index 000000000000..fd9ea1b51dd8
--- /dev/null
+++ b/sys/modules/proto/Makefile
@@ -0,0 +1,17 @@
+
+.PATH: ${SRCTOP}/sys/dev/proto
+
+KMOD= proto
+SRCS= \
+ proto_bus_isa.c \
+ proto_bus_pci.c \
+ proto_busdma.c \
+ proto_core.c
+
+SRCS+= \
+ bus_if.h \
+ device_if.h \
+ isa_if.h \
+ pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/pseudofs/Makefile b/sys/modules/pseudofs/Makefile
new file mode 100644
index 000000000000..52c01d1859c9
--- /dev/null
+++ b/sys/modules/pseudofs/Makefile
@@ -0,0 +1,30 @@
+
+.PATH: ${SRCTOP}/sys/fs/pseudofs
+
+KMOD= pseudofs
+SRCS= opt_pseudofs.h \
+ vnode_if.h \
+ pseudofs.c \
+ pseudofs_fileno.c \
+ pseudofs_vncache.c \
+ pseudofs_vnops.c
+
+EXPORT_SYMS= pfs_cmount \
+ pfs_mount \
+ pfs_unmount \
+ pfs_root \
+ pfs_statfs \
+ pfs_init \
+ pfs_uninit \
+ pfs_create_dir \
+ pfs_create_file \
+ pfs_create_link \
+ pfs_destroy
+
+.if !defined(KERNBUILDDIR)
+.if defined(PSEUDOFS_TRACE)
+CFLAGS+=-DPSEUDOFS_TRACE
+.endif
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/pst/Makefile b/sys/modules/pst/Makefile
new file mode 100644
index 000000000000..2fd5f4a356f6
--- /dev/null
+++ b/sys/modules/pst/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/pst
+
+KMOD= pst
+SRCS= pst-pci.c pst-iop.c pst-raid.c
+SRCS+= device_if.h bus_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/pty/Makefile b/sys/modules/pty/Makefile
new file mode 100644
index 000000000000..63f8c8f50ee3
--- /dev/null
+++ b/sys/modules/pty/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/pty
+
+KMOD= pty
+SRCS= pty.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/puc/Makefile b/sys/modules/puc/Makefile
new file mode 100644
index 000000000000..6e14ce0ed268
--- /dev/null
+++ b/sys/modules/puc/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/puc
+
+KMOD= puc
+SRCS= puc.c puc_cfg.c puc_pci.c
+SRCS+= bus_if.h device_if.h serdev_if.c serdev_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/pwm/Makefile b/sys/modules/pwm/Makefile
new file mode 100644
index 000000000000..9b18a0be3908
--- /dev/null
+++ b/sys/modules/pwm/Makefile
@@ -0,0 +1,14 @@
+
+# Modules for dev/pwm drivers.
+
+SUBDIR = \
+ pwmbus \
+ pwmc \
+
+.if ${MACHINE_ARCH} == "armv7" || ${MACHINE_ARCH} == "aarch64"
+.if !empty(OPT_FDT)
+SUBDIR += pwm_backlight
+.endif
+.endif
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/pwm/pwm_backlight/Makefile b/sys/modules/pwm/pwm_backlight/Makefile
new file mode 100644
index 000000000000..b15ba296a133
--- /dev/null
+++ b/sys/modules/pwm/pwm_backlight/Makefile
@@ -0,0 +1,15 @@
+
+.PATH: ${SRCTOP}/sys/dev/pwm
+KMOD= pwm_backlight
+SRCS= pwm_backlight.c
+
+SRCS+= \
+ backlight_if.h \
+ bus_if.h \
+ device_if.h \
+ opt_platform.h \
+ pwmbus_if.h \
+ regnode_if.h \
+ ofw_bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/pwm/pwmbus/Makefile b/sys/modules/pwm/pwmbus/Makefile
new file mode 100644
index 000000000000..3c0acecdf327
--- /dev/null
+++ b/sys/modules/pwm/pwmbus/Makefile
@@ -0,0 +1,21 @@
+
+.PATH: ${SRCTOP}/sys/dev/pwm
+
+KMOD= pwmbus
+SRCS= pwmbus.c
+
+.if !empty(OPT_FDT)
+SRCS+= ofw_pwm.c ofw_pwmbus.c ofw_bus_if.h
+.endif
+
+# Generated files...
+SRCS+= \
+ bus_if.h \
+ device_if.h \
+ opt_platform.h \
+ pwmbus_if.c \
+ pwmbus_if.h \
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/pwm/pwmc/Makefile b/sys/modules/pwm/pwmc/Makefile
new file mode 100644
index 000000000000..3ba120f51502
--- /dev/null
+++ b/sys/modules/pwm/pwmc/Makefile
@@ -0,0 +1,17 @@
+
+.PATH: ${SRCTOP}/sys/dev/pwm
+KMOD= pwmc
+SRCS= pwmc.c
+
+# Generated files...
+SRCS+= \
+ bus_if.h \
+ device_if.h \
+ opt_platform.h \
+ pwmbus_if.h \
+
+.if !empty(OPT_FDT)
+SRCS+= ofw_bus_if.h
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/qat/Makefile b/sys/modules/qat/Makefile
new file mode 100644
index 000000000000..e32a9495f7bc
--- /dev/null
+++ b/sys/modules/qat/Makefile
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2007-2022 Intel Corporation
+SUBDIR= qat_common \
+ qat_api \
+ qat_hw \
+ qat
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/qat/qat/Makefile b/sys/modules/qat/qat/Makefile
new file mode 100644
index 000000000000..14f3a566063f
--- /dev/null
+++ b/sys/modules/qat/qat/Makefile
@@ -0,0 +1,28 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2007-2022 Intel Corporation
+.PATH: ${SRCTOP}/sys/dev/qat/qat
+
+KMOD= qat
+SRCS+= qat_ocf.c qat_ocf_mem_pool.c qat_ocf_utils.c
+SRCS+= device_if.h bus_if.h vnode_if.h pci_if.h cryptodev_if.h
+
+CFLAGS+= ${LINUXKPI_INCLUDES}
+CFLAGS+= -I${SRCTOP}/sys/dev/qat/include
+CFLAGS+= -I${SRCTOP}/sys/dev/qat/include/common
+CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/include
+CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/common/include
+CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/include/lac
+CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/qat_utils/include
+CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/qat_direct/include
+CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/firmware/include
+CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/common/crypto/sym/include
+
+.include <bsd.kmod.mk>
+
+.if ${COMPILER_TYPE} == "clang"
+CWARNFLAGS.qat_ocf.c += -Wno-incompatible-pointer-types-discards-qualifiers
+CWARNFLAGS.qat_ocf_utils.c += -Wno-incompatible-pointer-types-discards-qualifiers
+.elif ${COMPILER_TYPE} == "gcc"
+CWARNFLAGS.qat_ocf.c += -Wno-discarded-qualifiers
+CWARNFLAGS.qat_ocf_utils.c += -Wno-discarded-qualifiers
+.endif
diff --git a/sys/modules/qat/qat_api/Makefile b/sys/modules/qat/qat_api/Makefile
new file mode 100644
index 000000000000..f30d49cd8269
--- /dev/null
+++ b/sys/modules/qat/qat_api/Makefile
@@ -0,0 +1,79 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2007-2022 Intel Corporation
+.PATH: ${SRCTOP}/sys/dev/qat/qat_api
+
+KMOD= qat_api
+
+SRCS+= freebsd_module.c
+SRCS+= common/compression/dc_datapath.c
+SRCS+= common/compression/dc_header_footer.c
+SRCS+= common/compression/dc_session.c
+SRCS+= common/compression/dc_stats.c
+SRCS+= common/compression/dc_buffers.c
+SRCS+= common/compression/dc_dp.c
+SRCS+= common/compression/icp_sal_dc_err.c
+SRCS+= common/compression/dc_chain.c
+SRCS+= common/compression/dc_ns_datapath.c
+SRCS+= common/compression/dc_ns_header_footer.c
+SRCS+= common/utils/lac_buffer_desc.c
+SRCS+= common/utils/lac_mem.c
+SRCS+= common/utils/lac_mem_pools.c
+SRCS+= common/utils/lac_sync.c
+SRCS+= common/utils/sal_service_state.c
+SRCS+= common/utils/sal_statistics.c
+SRCS+= common/utils/sal_string_parse.c
+SRCS+= common/utils/sal_versions.c
+SRCS+= common/utils/sal_user_process.c
+SRCS+= common/ctrl/sal_list.c
+SRCS+= common/ctrl/sal_compression.c
+SRCS+= common/ctrl/sal_ctrl_services.c
+SRCS+= common/ctrl/sal_create_services.c
+SRCS+= common/ctrl/sal_crypto.c
+SRCS+= common/ctrl/sal_get_instances.c
+SRCS+= common/qat_comms/sal_qat_cmn_msg.c
+SRCS+= common/crypto/sym/lac_sym_api.c
+SRCS+= common/crypto/sym/lac_sym_cb.c
+SRCS+= common/crypto/sym/lac_sym_queue.c
+SRCS+= common/crypto/sym/lac_sym_cipher.c
+SRCS+= common/crypto/sym/lac_sym_alg_chain.c
+SRCS+= common/crypto/sym/lac_sym_auth_enc.c
+SRCS+= common/crypto/sym/lac_sym_hash.c
+SRCS+= common/crypto/sym/lac_sym_hash_sw_precomputes.c
+SRCS+= common/crypto/sym/lac_sym_stats.c
+SRCS+= common/crypto/sym/lac_sym_compile_check.c
+SRCS+= common/crypto/sym/lac_sym_partial.c
+SRCS+= common/crypto/sym/lac_sym_dp.c
+SRCS+= common/crypto/sym/qat/lac_sym_qat.c
+SRCS+= common/crypto/sym/qat/lac_sym_qat_hash.c
+SRCS+= common/crypto/sym/qat/lac_sym_qat_hash_defs_lookup.c
+SRCS+= common/crypto/sym/qat/lac_sym_qat_cipher.c
+SRCS+= common/crypto/sym/qat/lac_sym_qat_constants_table.c
+SRCS+= common/crypto/sym/qat/lac_sym_qat_key.c
+SRCS+= common/crypto/sym/key/lac_sym_key.c
+SRCS+= common/stubs/lac_stubs.c
+SRCS+= device/dev_info.c
+SRCS+= qat_kernel/src/lac_adf_interface_freebsd.c
+SRCS+= qat_kernel/src/qat_transport.c
+SRCS+= qat_kernel/src/lac_symbols.c
+SRCS+= qat_utils/src/QatUtilsServices.c
+SRCS+= qat_utils/src/QatUtilsSemaphore.c
+SRCS+= qat_utils/src/QatUtilsSpinLock.c
+SRCS+= qat_utils/src/QatUtilsAtomic.c
+SRCS+= qat_utils/src/QatUtilsCrypto.c
+SRCS+= bus_if.h cryptodev_if.h device_if.h pci_if.h vnode_if.h
+
+CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/include
+CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/include/lac
+CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/include/dc
+CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/qat_direct/include
+CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/qat_utils/include
+CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/common/include
+CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/common/compression/include
+CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/common/crypto/sym/include
+CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/firmware/include
+CFLAGS+= -I${SRCTOP}/sys/dev/qat/include/common
+CFLAGS+= ${LINUXKPI_INCLUDES}
+
+.include <bsd.kmod.mk>
+
+CWARNFLAGS+= -Wno-cast-qual
diff --git a/sys/modules/qat/qat_common/Makefile b/sys/modules/qat/qat_common/Makefile
new file mode 100644
index 000000000000..b0f847ae9a96
--- /dev/null
+++ b/sys/modules/qat/qat_common/Makefile
@@ -0,0 +1,32 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2007-2022 Intel Corporation
+.PATH: ${SRCTOP}/sys/dev/qat/qat_common
+
+KMOD= qat_common
+
+SRCS+= adf_accel_engine.c adf_freebsd_admin.c adf_aer.c adf_cfg.c qat_common_module.c
+SRCS+= adf_heartbeat.c adf_freebsd_heartbeat_dbg.c
+SRCS+= adf_freebsd_dev_processes.c adf_freebsd_uio.c adf_freebsd_uio_cleanup.c
+SRCS+= adf_ctl_drv.c adf_dev_mgr.c adf_hw_arbiter.c
+SRCS+= adf_init.c adf_transport.c adf_isr.c adf_fw_counters.c adf_dev_err.c
+SRCS+= adf_gen2_hw_data.c
+SRCS+= adf_gen4_hw_data.c
+SRCS+= qat_freebsd.c
+SRCS+= adf_freebsd_cfg_dev_dbg.c adf_freebsd_ver_dbg.c
+SRCS+= adf_cfg_device.c adf_cfg_section.c adf_cfg_instance.c adf_cfg_bundle.c adf_cfg_sysctl.c
+SRCS+= qat_hal.c qat_uclo.c
+SRCS+= adf_vf_isr.c
+SRCS+= adf_gen4_pfvf.c
+SRCS+= adf_gen4_timer.c
+SRCS+= adf_pfvf_utils.c adf_pfvf_vf_msg.c adf_pfvf_vf_proto.c
+SRCS+= adf_gen4vf_hw_csr_data.c
+SRCS+= adf_freebsd_transport_debug.c adf_clock.c
+SRCS+= adf_freebsd_cnvnr_ctrs_dbg.c
+SRCS+= adf_freebsd_pfvf_ctrs_dbg.c
+SRCS+= bus_if.h device_if.h pci_if.h vnode_if.h
+
+CFLAGS+= -I${SRCTOP}/sys/dev/qat/include
+CFLAGS+= -I${SRCTOP}/sys/dev/qat/include/common
+CFLAGS+= ${LINUXKPI_INCLUDES}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/qat/qat_hw/Makefile b/sys/modules/qat/qat_hw/Makefile
new file mode 100644
index 000000000000..2a51640bd327
--- /dev/null
+++ b/sys/modules/qat/qat_hw/Makefile
@@ -0,0 +1,28 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2007-2022 Intel Corporation
+.PATH: ${SRCTOP}/sys/dev/qat/qat_hw
+
+KMOD= qat_hw
+SRCS+= qat_c62x/adf_c62x_hw_data.c qat_c62x/adf_drv.c
+SRCS+= qat_200xx/adf_200xx_hw_data.c qat_200xx/adf_drv.c
+SRCS+= qat_4xxx/adf_4xxx_hw_data.c qat_4xxx/adf_drv.c
+SRCS+= qat_4xxxvf/adf_4xxxvf_hw_data.c qat_4xxxvf/adf_drv.c
+SRCS+= qat_c3xxx/adf_c3xxx_hw_data.c qat_c3xxx/adf_drv.c
+SRCS+= qat_dh895xcc/adf_dh895xcc_hw_data.c qat_dh895xcc/adf_drv.c
+SRCS+= qat_c4xxx/adf_c4xxx_hw_data.c qat_c4xxx/adf_drv.c qat_c4xxx/adf_c4xxx_ae_config.c qat_c4xxx/adf_c4xxx_misc_error_stats.c
+SRCS+= qat_c4xxx/adf_c4xxx_pke_replay_stats.c qat_c4xxx/adf_c4xxx_ras.c qat_c4xxx/adf_c4xxx_res_part.c
+SRCS+= qat_c4xxx/adf_c4xxx_reset.c
+SRCS+= device_if.h bus_if.h vnode_if.h pci_if.h cryptodev_if.h
+
+CFLAGS+= ${LINUXKPI_INCLUDES}
+CFLAGS+= -I${SRCTOP}/sys/dev/qat/include
+CFLAGS+= -I${SRCTOP}/sys/dev/qat/include/common
+CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/include
+CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/common/include
+CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/include/lac
+CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/qat_utils/include
+CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/qat_direct/include
+CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/firmware/include
+CFLAGS+= -I${SRCTOP}/sys/dev/qat/qat_api/common/crypto/sym/include
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/qat_c2xxx/Makefile b/sys/modules/qat_c2xxx/Makefile
new file mode 100644
index 000000000000..950566d8146b
--- /dev/null
+++ b/sys/modules/qat_c2xxx/Makefile
@@ -0,0 +1,13 @@
+
+.PATH: ${SRCTOP}/sys/dev/qat_c2xxx
+
+KMOD= qat_c2xxx
+
+SRCS= qat.c \
+ qat_ae.c \
+ qat_c2xxx.c \
+ qat_hw15.c
+
+SRCS+= bus_if.h cryptodev_if.h device_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/qat_c2xxxfw/Makefile b/sys/modules/qat_c2xxxfw/Makefile
new file mode 100644
index 000000000000..d8284907ce4f
--- /dev/null
+++ b/sys/modules/qat_c2xxxfw/Makefile
@@ -0,0 +1,10 @@
+
+.PATH: ${SRCTOP}/sys/contrib/dev/qat_c2xxx
+
+KMOD= qat_c2xxxfw
+IMG1= mof_firmware_c2xxx
+IMG2= mmp_firmware_c2xxx
+
+FIRMWS= ${IMG1}.bin:${KMOD}:111 ${IMG2}.bin:${IMG2}:111
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/qatfw/Makefile b/sys/modules/qatfw/Makefile
new file mode 100644
index 000000000000..b135fd2d95dc
--- /dev/null
+++ b/sys/modules/qatfw/Makefile
@@ -0,0 +1,10 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2007-2022 Intel Corporation
+SUBDIR= qat_c62x \
+ qat_200xx \
+ qat_c3xxx \
+ qat_c4xxx \
+ qat_dh895xcc \
+ qat_4xxx
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/qatfw/qat_200xx/Makefile b/sys/modules/qatfw/qat_200xx/Makefile
new file mode 100644
index 000000000000..ce80b75f78fd
--- /dev/null
+++ b/sys/modules/qatfw/qat_200xx/Makefile
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2007-2022 Intel Corporation
+.PATH: ${SRCTOP}/sys/contrib/dev/qat
+
+KMOD= qat_200xx_fw
+
+FIRMWS= ${SRCTOP}/sys/contrib/dev/qat/qat_200xx.bin:qat_200xx_fw:111 ${SRCTOP}/sys/contrib/dev/qat/qat_200xx_mmp.bin:qat_200xx_mmp_fw:111
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/qatfw/qat_4xxx/Makefile b/sys/modules/qatfw/qat_4xxx/Makefile
new file mode 100644
index 000000000000..e4d3ed495f8a
--- /dev/null
+++ b/sys/modules/qatfw/qat_4xxx/Makefile
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2007-2022 Intel Corporation
+.PATH: ${SRCTOP}/sys/contrib/dev/qat
+
+KMOD= qat_4xxx_fw
+
+FIRMWS= ${SRCTOP}/sys/contrib/dev/qat/qat_4xxx.bin:qat_4xxx_fw:111 ${SRCTOP}/sys/contrib/dev/qat/qat_4xxx_mmp.bin:qat_4xxx_mmp_fw:111
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/qatfw/qat_c3xxx/Makefile b/sys/modules/qatfw/qat_c3xxx/Makefile
new file mode 100644
index 000000000000..e0759fe3a99b
--- /dev/null
+++ b/sys/modules/qatfw/qat_c3xxx/Makefile
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2007-2022 Intel Corporation
+.PATH: ${SRCTOP}/sys/contrib/dev/qat
+
+KMOD= qat_c3xxx_fw
+
+FIRMWS= ${SRCTOP}/sys/contrib/dev/qat/qat_c3xxx.bin:qat_c3xxx_fw:111 ${SRCTOP}/sys/contrib/dev/qat/qat_c3xxx_mmp.bin:qat_c3xxx_mmp_fw:111
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/qatfw/qat_c4xxx/Makefile b/sys/modules/qatfw/qat_c4xxx/Makefile
new file mode 100644
index 000000000000..7e859dcbd989
--- /dev/null
+++ b/sys/modules/qatfw/qat_c4xxx/Makefile
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2007-2022 Intel Corporation
+.PATH: ${SRCTOP}/sys/contrib/dev/qat
+
+KMOD= qat_c4xxx_fw
+
+FIRMWS= ${SRCTOP}/sys/contrib/dev/qat/qat_c4xxx.bin:qat_c4xxx_fw:111 ${SRCTOP}/sys/contrib/dev/qat/qat_c4xxx_mmp.bin:qat_c4xxx_mmp_fw:111
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/qatfw/qat_c62x/Makefile b/sys/modules/qatfw/qat_c62x/Makefile
new file mode 100644
index 000000000000..ac1636b81e56
--- /dev/null
+++ b/sys/modules/qatfw/qat_c62x/Makefile
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2007-2022 Intel Corporation
+.PATH: ${SRCTOP}/sys/contrib/dev/qat
+
+KMOD= qat_c62x_fw
+
+FIRMWS= ${SRCTOP}/sys/contrib/dev/qat/qat_c62x.bin:qat_c62x_fw:111 ${SRCTOP}/sys/contrib/dev/qat/qat_c62x_mmp.bin:qat_c62x_mmp_fw:111
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/qatfw/qat_dh895xcc/Makefile b/sys/modules/qatfw/qat_dh895xcc/Makefile
new file mode 100644
index 000000000000..7a377c088081
--- /dev/null
+++ b/sys/modules/qatfw/qat_dh895xcc/Makefile
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2007-2022 Intel Corporation
+.PATH: ${SRCTOP}/sys/contrib/dev/qat
+
+KMOD= qat_dh895xcc_fw
+
+FIRMWS= ${SRCTOP}/sys/contrib/dev/qat/qat_895xcc.bin:qat_dh895xcc_fw:111 ${SRCTOP}/sys/contrib/dev/qat/qat_895xcc_mmp.bin:qat_dh895xcc_mmp_fw:111
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/qlnx/Makefile b/sys/modules/qlnx/Makefile
new file mode 100644
index 000000000000..2121f9d586a6
--- /dev/null
+++ b/sys/modules/qlnx/Makefile
@@ -0,0 +1,41 @@
+#/*
+# * Copyright (c) 2017-2018 Cavium, Inc.
+# * All rights reserved.
+# *
+# * Redistribution and use in source and binary forms, with or without
+# * modification, are permitted provided that the following conditions
+# * are met:
+# *
+# * 1. Redistributions of source code must retain the above copyright
+# * notice, this list of conditions and the following disclaimer.
+# * 2. Redistributions in binary form must reproduce the above copyright
+# * notice, this list of conditions and the following disclaimer in the
+# * documentation and/or other materials provided with the distribution.
+# *
+# * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# * POSSIBILITY OF SUCH DAMAGE.
+# */
+#/*
+# * File : Makefile
+# * Author : David C Somayajulu, Cavium, Inc., San Jose, CA 95131.
+# */
+#
+#
+
+SYSDIR?=${SRCTOP}/sys
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+SUBDIR=qlnxe
+SUBDIR+=qlnxev
+SUBDIR+=qlnxr
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/qlnx/qlnxe/Makefile b/sys/modules/qlnx/qlnxe/Makefile
new file mode 100644
index 000000000000..3d8415cf0e57
--- /dev/null
+++ b/sys/modules/qlnx/qlnxe/Makefile
@@ -0,0 +1,90 @@
+#/*
+# * Copyright (c) 2017-2018 Cavium, Inc.
+# * All rights reserved.
+# *
+# * Redistribution and use in source and binary forms, with or without
+# * modification, are permitted provided that the following conditions
+# * are met:
+# *
+# * 1. Redistributions of source code must retain the above copyright
+# * notice, this list of conditions and the following disclaimer.
+# * 2. Redistributions in binary form must reproduce the above copyright
+# * notice, this list of conditions and the following disclaimer in the
+# * documentation and/or other materials provided with the distribution.
+# *
+# * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# * POSSIBILITY OF SUCH DAMAGE.
+# */
+#/*
+# * File : Makefile
+# * Author : David C Somayajulu, Cavium, Inc., San Jose, CA 95131.
+# */
+#
+#
+
+.PATH: ${SRCTOP}/sys/dev/qlnx/qlnxe
+
+#.PATH: ${.CURDIR}
+
+KMOD=if_qlnxe
+
+SRCS=ecore_cxt.c ecore_dcbx.c ecore_dev.c ecore_hw.c
+SRCS+=ecore_init_fw_funcs.c ecore_int.c ecore_mcp.c
+SRCS+=ecore_sp_commands.c ecore_spq.c ecore_l2.c
+SRCS+=ecore_init_ops.c ecore_dbg_fw_funcs.c
+SRCS+=ecore_mng_tlv.c
+
+SRCS+=ecore_sriov.c
+SRCS+=ecore_vf.c
+
+#roce/iwarp files. Compilation can be turned off roce/iwarp are not required.
+# In other words if you don't need RDMA please comment out SRCS adds for
+# ecore_rdma.c ecore_roce.c ecore_iwarp.c ecore_ooo.c ecore_ll2.c qlnx_rdma.c
+SRCS+=ecore_rdma.c
+SRCS+=ecore_roce.c
+SRCS+=ecore_iwarp.c
+SRCS+=ecore_ooo.c
+SRCS+=ecore_ll2.c
+SRCS+=qlnx_rdma.c
+
+SRCS+=qlnx_ioctl.c
+SRCS+=qlnx_os.c
+
+SRCS+= ${LINUXKPI_GENSRCS}
+
+.include <bsd.kmod.mk>
+
+#CFLAGS += -DQLNX_DEBUG
+CFLAGS += -DCONFIG_ECORE_L2
+CFLAGS += -DECORE_CONFIG_DIRECT_HWFN
+
+CFLAGS+= ${LINUXKPI_INCLUDES}
+
+#CFLAGS += -g
+#CFLAGS += -fno-inline
+
+#CFLAGS += -DQLNX_SOFT_LRO
+#CFLAGS += -DQLNX_QSORT_LRO
+#CFLAGS += -DQLNX_MAX_COALESCE
+#CFLAGS += -DQLNX_USER_LLDP
+
+CFLAGS += -DCONFIG_ECORE_SRIOV
+
+# For roce/iwarp files. Compilation can be turned off if roce/iwarp are not required.
+# In other words if you don't need RDMA please comment out the CFLAGS which define
+# CONFIG_ECORE_LL2 CONFIG_ECORE_ROCE CONFIG_ECORE_IWARP QLNX_ENABLE_IWARP
+CFLAGS += -DCONFIG_ECORE_LL2
+CFLAGS += -DCONFIG_ECORE_ROCE
+CFLAGS += -DCONFIG_ECORE_IWARP
+CFLAGS += -DCONFIG_ECORE_RDMA
+CFLAGS += -DQLNX_ENABLE_IWARP
+
diff --git a/sys/modules/qlnx/qlnxev/Makefile b/sys/modules/qlnx/qlnxev/Makefile
new file mode 100644
index 000000000000..ed62f1f1dd40
--- /dev/null
+++ b/sys/modules/qlnx/qlnxev/Makefile
@@ -0,0 +1,75 @@
+#/*
+# * Copyright (c) 2017-2018 Cavium, Inc.
+# * All rights reserved.
+# *
+# * Redistribution and use in source and binary forms, with or without
+# * modification, are permitted provided that the following conditions
+# * are met:
+# *
+# * 1. Redistributions of source code must retain the above copyright
+# * notice, this list of conditions and the following disclaimer.
+# * 2. Redistributions in binary form must reproduce the above copyright
+# * notice, this list of conditions and the following disclaimer in the
+# * documentation and/or other materials provided with the distribution.
+# *
+# * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# * POSSIBILITY OF SUCH DAMAGE.
+# */
+# /*
+# * File : Makefile
+# * Author : David C Somayajulu, Cavium, Inc., San Jose, CA 95131.
+# */
+#
+#
+
+.PATH: ${SRCTOP}/sys/dev/qlnx/qlnxe
+
+#.PATH: ${.CURDIR}/../qlnxe
+
+KMOD=if_qlnxev
+
+SRCS=ecore_cxt.c ecore_dcbx.c ecore_dev.c ecore_hw.c
+SRCS+=ecore_init_fw_funcs.c ecore_int.c ecore_mcp.c
+SRCS+=ecore_sp_commands.c ecore_spq.c ecore_l2.c
+SRCS+=ecore_init_ops.c ecore_dbg_fw_funcs.c
+SRCS+=ecore_mng_tlv.c
+
+#SRIOV related
+SRCS+=ecore_sriov.c
+SRCS+=ecore_vf.c
+
+SRCS+=qlnx_ioctl.c
+SRCS+=qlnx_os.c
+
+SRCS+= ${LINUXKPI_GENSRCS}
+
+.include <bsd.kmod.mk>
+
+CFLAGS += -DQLNX_DEBUG
+CFLAGS += -DECORE_PACKAGE
+CFLAGS += -DCONFIG_ECORE_L2
+CFLAGS += -DECORE_CONFIG_DIRECT_HWFN
+
+CFLAGS+= ${LINUXKPI_INCLUDES}
+
+CFLAGS += -g
+CFLAGS += -fno-inline
+
+#CFLAGS += -DQLNX_SOFT_LRO
+#CFLAGS += -DQLNX_QSORT_LRO
+#CFLAGS += -DQLNX_MAX_COALESCE
+
+#SRIOV related
+CFLAGS += -DCONFIG_ECORE_SRIOV
+CFLAGS += -DQLNX_VF
+
+CWARNFLAGS+= -Wno-cast-qual
diff --git a/sys/modules/qlnx/qlnxr/Makefile b/sys/modules/qlnx/qlnxr/Makefile
new file mode 100644
index 000000000000..fe33d43f0963
--- /dev/null
+++ b/sys/modules/qlnx/qlnxr/Makefile
@@ -0,0 +1,87 @@
+#/*
+# * Copyright (c) 2017-2018 Cavium, Inc.
+# * All rights reserved.
+# *
+# * Redistribution and use in source and binary forms, with or without
+# * modification, are permitted provided that the following conditions
+# * are met:
+# *
+# * 1. Redistributions of source code must retain the above copyright
+# * notice, this list of conditions and the following disclaimer.
+# * 2. Redistributions in binary form must reproduce the above copyright
+# * notice, this list of conditions and the following disclaimer in the
+# * documentation and/or other materials provided with the distribution.
+# *
+# * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# * POSSIBILITY OF SUCH DAMAGE.
+# */
+#/*
+# * File : Makefile
+# * Author : David C Somayajulu, Cavium, Inc., San Jose, CA 95131.
+# */
+#
+#
+
+#.PATH: ${.CURDIR}
+#OFEDDIR= /usr/src/sys
+#ETHDRVR=${.CURDIR}/../qlnxe
+
+.PATH: ${SRCTOP}/sys/dev/qlnx/qlnxr
+OFEDDIR=${SRCTOP}/sys
+ETHDRVR=${SRCTOP}/sys/dev/qlnx/qlnxe
+
+KMOD= qlnxr
+SRCS= \
+ qlnxr_os.c\
+ qlnxr_cm.c\
+ qlnxr_verbs.c
+SRCS+= ${LINUXKPI_GENSRCS}
+SRCS+= opt_inet.h opt_inet6.h
+
+.include <bsd.kmod.mk>
+
+CFLAGS+= -I${.CURDIR}
+CFLAGS+= -I${ETHDRVR}
+CFLAGS+= -I${OFEDDIR}/ofed/include
+CFLAGS+= -I${OFEDDIR}/ofed/include/uapi
+CFLAGS+= ${LINUXKPI_INCLUDES}
+
+CFLAGS+= -DLINUX_TYPES_DEFINED
+CFLAGS+= -DCONFIG_INFINIBAND_USER_MEM
+CFLAGS+= -DINET6 -DINET
+#CFLAGS+= -DDEFINE_NO_IP_BASED_GIDS
+
+CWARNEXTRA += -Wno-cast-qual
+CWARNEXTRA += -Wno-unused-function
+.if ${COMPILER_TYPE} == "clang"
+CWARNEXTRA += -Wno-gnu-variable-sized-type-not-at-end
+.endif
+CWARNEXTRA += -Wno-missing-prototypes
+CWARNEXTRA += ${NO_WCONSTANT_CONVERSION}
+CWARNEXTRA += -Wno-format
+
+CWARNEXTRA += ${NO_WSHIFT_COUNT_OVERFLOW}
+CWARNEXTRA += -Wno-empty-body
+
+CFLAGS += -DQLNX_DEBUG
+CFLAGS += -DECORE_PACKAGE
+CFLAGS += -DCONFIG_ECORE_L2
+CFLAGS += -DCONFIG_ECORE_LL2
+CFLAGS += -DCONFIG_ECORE_ROCE
+CFLAGS += -DCONFIG_ECORE_IWARP
+CFLAGS += -DCONFIG_ECORE_RDMA
+CFLAGS += -DECORE_CONFIG_DIRECT_HWFN
+CFLAGS += -g -fno-inline
+CFLAGS += -DQLNX_RDMA
+
+CFLAGS+= -Wno-cast-qual -Wno-pointer-arith
+
diff --git a/sys/modules/qlxgb/Makefile b/sys/modules/qlxgb/Makefile
new file mode 100644
index 000000000000..053316bc2ca8
--- /dev/null
+++ b/sys/modules/qlxgb/Makefile
@@ -0,0 +1,37 @@
+#-
+# Copyright (c) 2010-2011 Qlogic Corporation
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+# File : Makefile
+# Author : David C Somayajulu, Qlogic Corporation, Aliso Viejo, CA 92656.
+#
+#
+
+.PATH: ${SRCTOP}/sys/dev/qlxgb
+
+KMOD= if_qlxgb
+SRCS= qla_os.c qla_dbg.c qla_hw.c qla_misc.c qla_isr.c qla_ioctl.c
+SRCS+= device_if.h bus_if.h pci_if.h opt_inet.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/qlxgbe/Makefile b/sys/modules/qlxgbe/Makefile
new file mode 100644
index 000000000000..3f49c1b1b679
--- /dev/null
+++ b/sys/modules/qlxgbe/Makefile
@@ -0,0 +1,55 @@
+#/*
+# * Copyright (c) 2011-2016 Qlogic Corporation
+# * All rights reserved.
+# *
+# * Redistribution and use in source and binary forms, with or without
+# * modification, are permitted provided that the following conditions
+# * are met:
+# *
+# * 1. Redistributions of source code must retain the above copyright
+# * notice, this list of conditions and the following disclaimer.
+# * 2. Redistributions in binary form must reproduce the above copyright
+# * notice, this list of conditions and the following disclaimer in the
+# * documentation and/or other materials provided with the distribution.
+# *
+# * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# * POSSIBILITY OF SUCH DAMAGE.
+# */
+#/*
+# * File : Makefile
+# * Author : David C Somayajulu, Qlogic Corporation, Aliso Viejo, CA 92656.
+# */
+#
+#
+
+.PATH: ${SRCTOP}/sys/dev/qlxgbe
+#.PATH: ${.CURDIR}
+
+KMOD=if_qlxgbe
+SRCS=ql_os.c ql_dbg.c ql_hw.c ql_misc.c ql_isr.c ql_ioctl.c
+SRCS+= ql_reset.c
+SRCS+= ql_fw.c
+SRCS+= ql_boot.c
+SRCS+= ql_minidump.c
+
+SRCS+= device_if.h bus_if.h pci_if.h opt_inet.h
+
+CFLAGS += -DQLA_LOCK_NO_SLEEP=1
+#CFLAGS += -DQL_DBG -g
+# Please turn off QL_LDFLASH_FW when you enable QL_ENABLE_ISCSI_TLV
+# You may comment out both QL_LDFLASH_FW and QL_ENABLE_ISCSI_TLV if you like
+# the firmware and boot loader compiled into the driver
+#CFLAGS += -DQL_ENABLE_ISCSI_TLV
+#CFLAGS += -DQL_LDFLASH_FW
+
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/qlxge/Makefile b/sys/modules/qlxge/Makefile
new file mode 100644
index 000000000000..82fc52d4d211
--- /dev/null
+++ b/sys/modules/qlxge/Makefile
@@ -0,0 +1,44 @@
+#/*
+# * Copyright (c) 2013-2014 Qlogic Corporation
+# * All rights reserved.
+# *
+# * Redistribution and use in source and binary forms, with or without
+# * modification, are permitted provided that the following conditions
+# * are met:
+# *
+# * 1. Redistributions of source code must retain the above copyright
+# * notice, this list of conditions and the following disclaimer.
+# * 2. Redistributions in binary form must reproduce the above copyright
+# * notice, this list of conditions and the following disclaimer in the
+# * documentation and/or other materials provided with the distribution.
+# *
+# * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# * POSSIBILITY OF SUCH DAMAGE.
+# */
+#/*
+# * File : Makefile
+# * Author : David C Somayajulu, Qlogic Corporation, Aliso Viejo, CA 92656.
+# */
+#
+#
+
+.PATH: ${SRCTOP}/sys/dev/qlxge
+
+KMOD=if_qlxge
+SRCS=qls_os.c qls_dbg.c qls_hw.c qls_isr.c qls_dump.c
+SRCS+=qls_ioctl.c
+SRCS+= device_if.h bus_if.h pci_if.h opt_inet.h
+
+CFLAGS += -DQL_DBG
+
+.include <bsd.kmod.mk>
+
diff --git a/sys/modules/ral/Makefile b/sys/modules/ral/Makefile
new file mode 100644
index 000000000000..4b26a3414c78
--- /dev/null
+++ b/sys/modules/ral/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ral
+
+KMOD= if_ral
+SRCS= rt2560.c rt2661.c rt2860.c if_ral_pci.c
+SRCS+= device_if.h bus_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ralfw/Makefile b/sys/modules/ralfw/Makefile
new file mode 100644
index 000000000000..e8c74240cb1b
--- /dev/null
+++ b/sys/modules/ralfw/Makefile
@@ -0,0 +1,4 @@
+
+SUBDIR= rt2561 rt2561s rt2661 rt2860
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/ralfw/Makefile.inc b/sys/modules/ralfw/Makefile.inc
new file mode 100644
index 000000000000..5cf040ba5450
--- /dev/null
+++ b/sys/modules/ralfw/Makefile.inc
@@ -0,0 +1,14 @@
+
+#
+# Common rules for building firmware. Note this gets auto-included
+# by the subdir Makefile's as a consequence of included bsd.kmod.mk.
+#
+KMOD= ${IMG}fw
+_FIRM= ${IMG}.fw
+
+CLEANFILES+= ${_FIRM}
+
+FIRMWS= ${_FIRM}:${KMOD}
+
+${_FIRM}: ${SRCTOP}/sys/contrib/dev/ral/${_FIRM}.uu
+ uudecode -p ${.ALLSRC} > ${.TARGET}
diff --git a/sys/modules/ralfw/rt2561/Makefile b/sys/modules/ralfw/rt2561/Makefile
new file mode 100644
index 000000000000..3f5ba22d61b4
--- /dev/null
+++ b/sys/modules/ralfw/rt2561/Makefile
@@ -0,0 +1,4 @@
+
+IMG= rt2561
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ralfw/rt2561s/Makefile b/sys/modules/ralfw/rt2561s/Makefile
new file mode 100644
index 000000000000..660d98d26ae3
--- /dev/null
+++ b/sys/modules/ralfw/rt2561s/Makefile
@@ -0,0 +1,4 @@
+
+IMG= rt2561s
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ralfw/rt2661/Makefile b/sys/modules/ralfw/rt2661/Makefile
new file mode 100644
index 000000000000..576d3b6c41f6
--- /dev/null
+++ b/sys/modules/ralfw/rt2661/Makefile
@@ -0,0 +1,5 @@
+
+IMG= rt2661
+
+.include <bsd.kmod.mk>
+
diff --git a/sys/modules/ralfw/rt2860/Makefile b/sys/modules/ralfw/rt2860/Makefile
new file mode 100644
index 000000000000..9fee45718f8f
--- /dev/null
+++ b/sys/modules/ralfw/rt2860/Makefile
@@ -0,0 +1,4 @@
+
+IMG= rt2860
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/random_fortuna/Makefile b/sys/modules/random_fortuna/Makefile
new file mode 100644
index 000000000000..854085d6452e
--- /dev/null
+++ b/sys/modules/random_fortuna/Makefile
@@ -0,0 +1,10 @@
+
+.PATH: ${SRCTOP}/sys/dev/random
+
+KMOD = random_fortuna
+SRCS = randomdev.c hash.c fortuna.c
+SRCS += opt_param.h bus_if.h device_if.h
+SRCS += opt_ddb.h
+CFLAGS += -DRANDOM_LOADABLE
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/random_other/Makefile b/sys/modules/random_other/Makefile
new file mode 100644
index 000000000000..2add4bfe048c
--- /dev/null
+++ b/sys/modules/random_other/Makefile
@@ -0,0 +1,10 @@
+
+.PATH: ${SRCTOP}/sys/dev/random
+
+KMOD = random_OTHER
+SRCS = randomdev.c hash.c other_algorithm.c
+SRCS += opt_param.h bus_if.h device_if.h
+SRCS += opt_ddb.h
+CFLAGS += -DRANDOM_LOADABLE
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rc4/Makefile b/sys/modules/rc4/Makefile
new file mode 100644
index 000000000000..5643ed40cb92
--- /dev/null
+++ b/sys/modules/rc4/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/crypto/rc4
+
+KMOD= rc4
+SRCS= rc4.c
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rccgpio/Makefile b/sys/modules/rccgpio/Makefile
new file mode 100644
index 000000000000..47e8a7915eaf
--- /dev/null
+++ b/sys/modules/rccgpio/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/rccgpio
+KMOD= rccgpio
+SRCS= rccgpio.c
+SRCS+= device_if.h bus_if.h isa_if.h gpio_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rdma/Makefile b/sys/modules/rdma/Makefile
new file mode 100644
index 000000000000..81ddf6e71bf5
--- /dev/null
+++ b/sys/modules/rdma/Makefile
@@ -0,0 +1,4 @@
+
+SUBDIR+= krping
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/rdma/krping/Makefile b/sys/modules/rdma/krping/Makefile
new file mode 100644
index 000000000000..95e96b781435
--- /dev/null
+++ b/sys/modules/rdma/krping/Makefile
@@ -0,0 +1,11 @@
+.PATH: ${SRCTOP}/sys/contrib/rdma/krping
+
+KMOD= krping
+SRCS= krping.c krping_dev.c getopt.c
+SRCS+= ${LINUXKPI_GENSRCS}
+SRCS+= opt_inet.h opt_inet6.h
+CFLAGS+= -I${SRCTOP}/sys/ofed/include
+CFLAGS+= -I${SRCTOP}/sys/ofed/include/uapi
+CFLAGS+= ${LINUXKPI_INCLUDES}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rdrand_rng/Makefile b/sys/modules/rdrand_rng/Makefile
new file mode 100644
index 000000000000..601bfcab51eb
--- /dev/null
+++ b/sys/modules/rdrand_rng/Makefile
@@ -0,0 +1,15 @@
+
+.PATH: ${SRCTOP}/sys/dev/random
+
+KMOD= rdrand_rng
+SRCS= ivy.c
+SRCS+= bus_if.h device_if.h
+
+CFLAGS+= -I${SRCTOP}/sys
+
+# ld.bfd doesn't support ifuncs invoked non-PIC
+.if ${MACHINE_CPUARCH} == "i386"
+CFLAGS.gcc= -fPIC
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/re/Makefile b/sys/modules/re/Makefile
new file mode 100644
index 000000000000..6923d8d631c6
--- /dev/null
+++ b/sys/modules/re/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/re
+
+KMOD= if_re
+SRCS= if_re.c device_if.h bus_if.h pci_if.h
+SRCS+= miibus_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rl/Makefile b/sys/modules/rl/Makefile
new file mode 100644
index 000000000000..e615ec364829
--- /dev/null
+++ b/sys/modules/rl/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/rl
+
+KMOD= if_rl
+SRCS= if_rl.c device_if.h bus_if.h pci_if.h
+SRCS+= miibus_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rndtest/Makefile b/sys/modules/rndtest/Makefile
new file mode 100644
index 000000000000..cb0f13492644
--- /dev/null
+++ b/sys/modules/rndtest/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/rndtest
+KMOD = rndtest
+SRCS = rndtest.c
+SRCS += device_if.h bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rockchip/Makefile b/sys/modules/rockchip/Makefile
new file mode 100644
index 000000000000..3463f2538b19
--- /dev/null
+++ b/sys/modules/rockchip/Makefile
@@ -0,0 +1,10 @@
+# Build modules specific to RockChip.
+
+SUBDIR = \
+ rk_i2c \
+ rk805 \
+ rk808 \
+ rk_dwmmc \
+ rk_spi
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/rockchip/rk805/Makefile b/sys/modules/rockchip/rk805/Makefile
new file mode 100644
index 000000000000..a5529531d14a
--- /dev/null
+++ b/sys/modules/rockchip/rk805/Makefile
@@ -0,0 +1,20 @@
+
+.PATH: ${SRCTOP}/sys/dev/iicbus/pmic/rockchip
+
+KMOD= rk805
+SRCS= rk8xx.c \
+ rk805.c \
+ rk8xx_clocks.c \
+ rk8xx_rtc.c \
+ rk8xx_regulators.c
+
+SRCS+= \
+ bus_if.h \
+ device_if.h \
+ iicbus_if.h \
+ regnode_if.h \
+ regdev_if.h \
+ ofw_bus_if.h \
+ opt_platform.h \
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rockchip/rk808/Makefile b/sys/modules/rockchip/rk808/Makefile
new file mode 100644
index 000000000000..6cf48cb40546
--- /dev/null
+++ b/sys/modules/rockchip/rk808/Makefile
@@ -0,0 +1,20 @@
+
+.PATH: ${SRCTOP}/sys/dev/iicbus/pmic/rockchip
+
+KMOD= rk808
+SRCS= rk8xx.c \
+ rk808.c \
+ rk8xx_clocks.c \
+ rk8xx_rtc.c \
+ rk8xx_regulators.c
+
+SRCS+= \
+ bus_if.h \
+ device_if.h \
+ iicbus_if.h \
+ regnode_if.h \
+ regdev_if.h \
+ ofw_bus_if.h \
+ opt_platform.h \
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rockchip/rk_dwmmc/Makefile b/sys/modules/rockchip/rk_dwmmc/Makefile
new file mode 100644
index 000000000000..b5641675db38
--- /dev/null
+++ b/sys/modules/rockchip/rk_dwmmc/Makefile
@@ -0,0 +1,13 @@
+
+.PATH: ${SRCTOP}/sys/dev/mmc/host/
+
+KMOD= rk_dwmmc
+SRCS= dwmmc.c dwmmc_rockchip.c
+
+SRCS+= \
+ bus_if.h \
+ clknode_if.h \
+ device_if.h \
+ ofw_bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rockchip/rk_i2c/Makefile b/sys/modules/rockchip/rk_i2c/Makefile
new file mode 100644
index 000000000000..b90b65f1410d
--- /dev/null
+++ b/sys/modules/rockchip/rk_i2c/Makefile
@@ -0,0 +1,15 @@
+
+.PATH: ${SRCTOP}/sys/arm64/rockchip
+
+KMOD= rk_i2c
+SRCS= rk_i2c.c
+
+SRCS+= \
+ bus_if.h \
+ clknode_if.h \
+ device_if.h \
+ iicbus_if.h \
+ ofw_bus_if.h \
+ opt_platform.h \
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rockchip/rk_spi/Makefile b/sys/modules/rockchip/rk_spi/Makefile
new file mode 100644
index 000000000000..614ea680ce56
--- /dev/null
+++ b/sys/modules/rockchip/rk_spi/Makefile
@@ -0,0 +1,14 @@
+
+.PATH: ${SRCTOP}/sys/arm64/rockchip
+
+KMOD= rk_spi
+SRCS= rk_spi.c
+
+SRCS+= \
+ bus_if.h \
+ clknode_if.h \
+ device_if.h \
+ ofw_bus_if.h \
+ spibus_if.h \
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rpi_ft5406/Makefile b/sys/modules/rpi_ft5406/Makefile
new file mode 100644
index 000000000000..052886cc3c2a
--- /dev/null
+++ b/sys/modules/rpi_ft5406/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/arm/broadcom/bcm2835/
+
+KMOD= rpi_ft5406
+SRCS= bcm2835_ft5406.c
+
+SRCS+= bus_if.h device_if.h mbox_if.h ofw_bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rtsx/Makefile b/sys/modules/rtsx/Makefile
new file mode 100644
index 000000000000..5cf75b0c719e
--- /dev/null
+++ b/sys/modules/rtsx/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/rtsx
+
+KMOD= rtsx
+SRCS= rtsx.c
+SRCS+= device_if.h bus_if.h pci_if.h mmcbr_if.h opt_mmccam.h opt_cam.h mmc_sim_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rtw88/Makefile b/sys/modules/rtw88/Makefile
new file mode 100644
index 000000000000..da4233b7c79e
--- /dev/null
+++ b/sys/modules/rtw88/Makefile
@@ -0,0 +1,42 @@
+
+DEVRTW88DIR= ${SRCTOP}/sys/contrib/dev/rtw88
+
+.PATH: ${DEVRTW88DIR}
+
+WITH_CONFIG_PM= 0
+
+KMOD= if_rtw88
+
+# Core parts.
+SRCS= main.c
+SRCS+= bf.c coex.c debug.c efuse.c fw.c mac.c mac80211.c
+SRCS+= phy.c ps.c regd.c
+SRCS+= rx.c sar.c sec.c tx.c util.c
+
+.if defined(WITH_CONFIG_PM) && ${WITH_CONFIG_PM} > 0
+SRCS+= wow.c
+CFLAGS+= -DCONFIG_PM=${WITH_CONFIG_PM}
+.endif
+
+# PCI parts.
+SRCS+= pci.c
+SRCS+= rtw8723d.c rtw8723d_table.c rtw8723de.c # 11n
+SRCS+= rtw8821c.c rtw8821c_table.c rtw8821ce.c # 11ac
+SRCS+= rtw8822b.c rtw8822b_table.c rtw8822be.c # 11ac
+SRCS+= rtw8822c.c rtw8822c_table.c rtw8822ce.c # 11ac
+
+# Other
+SRCS+= ${LINUXKPI_GENSRCS}
+SRCS+= opt_wlan.h opt_inet6.h opt_inet.h
+
+# Helpful after fresh imports.
+#CFLAGS+= -ferror-limit=0
+
+CFLAGS+= -DKBUILD_MODNAME='"rtw88"'
+
+CFLAGS+= -I${DEVRTW88DIR}
+CFLAGS+= ${LINUXKPI_INCLUDES}
+CFLAGS+= -DCONFIG_RTW88_DEBUG
+#CFLAGS+= -DCONFIG_RTW88_DEBUGFS
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rtw88fw/Makefile b/sys/modules/rtw88fw/Makefile
new file mode 100644
index 000000000000..1b92f28e024e
--- /dev/null
+++ b/sys/modules/rtw88fw/Makefile
@@ -0,0 +1,9 @@
+
+SUBDIR= \
+ rtw8723d \
+ rtw8821c \
+ rtw8822b \
+ rtw8822c \
+ rtw8822c_wow
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/rtw88fw/Makefile.inc b/sys/modules/rtw88fw/Makefile.inc
new file mode 100644
index 000000000000..b03298a7d563
--- /dev/null
+++ b/sys/modules/rtw88fw/Makefile.inc
@@ -0,0 +1,16 @@
+#
+# Common rules for building firmware. Note this gets auto-included
+# by the subdir Makefile's as a consequence of included bsd.kmod.mk.
+
+_NAME= rtw${NAME}_fw.bin
+
+IMG= ${_NAME}
+KMOD= ${_NAME}
+
+CLEANFILES+= ${IMG}
+
+FIRMWS= ${IMG}:${IMG}:${VERSION}
+
+${IMG}: ${SRCTOP}/sys/contrib/dev/rtw88fw/${IMG}
+ cp ${.ALLSRC} ${.TARGET}
+
diff --git a/sys/modules/rtw88fw/rtw8723d/Makefile b/sys/modules/rtw88fw/rtw8723d/Makefile
new file mode 100644
index 000000000000..50a14fce3d21
--- /dev/null
+++ b/sys/modules/rtw88fw/rtw8723d/Makefile
@@ -0,0 +1,5 @@
+
+VERSION= 48
+NAME= 8723d
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rtw88fw/rtw8821c/Makefile b/sys/modules/rtw88fw/rtw8821c/Makefile
new file mode 100644
index 000000000000..875dbb2628d6
--- /dev/null
+++ b/sys/modules/rtw88fw/rtw8821c/Makefile
@@ -0,0 +1,5 @@
+
+VERSION= 2408
+NAME= 8821c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rtw88fw/rtw8822b/Makefile b/sys/modules/rtw88fw/rtw8822b/Makefile
new file mode 100644
index 000000000000..709ef82cd725
--- /dev/null
+++ b/sys/modules/rtw88fw/rtw8822b/Makefile
@@ -0,0 +1,5 @@
+
+VERSION= 0
+NAME= 8822b
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rtw88fw/rtw8822c/Makefile b/sys/modules/rtw88fw/rtw8822c/Makefile
new file mode 100644
index 000000000000..5fad1210b57f
--- /dev/null
+++ b/sys/modules/rtw88fw/rtw8822c/Makefile
@@ -0,0 +1,5 @@
+
+VERSION= 9910
+NAME= 8822c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rtw88fw/rtw8822c_wow/Makefile b/sys/modules/rtw88fw/rtw8822c_wow/Makefile
new file mode 100644
index 000000000000..f1061a4aa151
--- /dev/null
+++ b/sys/modules/rtw88fw/rtw8822c_wow/Makefile
@@ -0,0 +1,5 @@
+
+VERSION= 994
+NAME= 8822c_wow
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rtw89/Makefile b/sys/modules/rtw89/Makefile
new file mode 100644
index 000000000000..9f81912a762d
--- /dev/null
+++ b/sys/modules/rtw89/Makefile
@@ -0,0 +1,44 @@
+
+DEVRTW89DIR= ${SRCTOP}/sys/contrib/dev/rtw89
+
+.PATH: ${DEVRTW89DIR}
+
+WITH_CONFIG_PM= 0
+
+KMOD= if_rtw89
+
+SRCS= core.c
+SRCS+= pci.c
+SRCS+= chan.c mac80211.c mac.c phy.c fw.c
+SRCS+= rtw8852a.c rtw8852a_rfk.c rtw8852a_rfk_table.c rtw8852a_table.c
+SRCS+= rtw8852ae.c
+SRCS+= rtw8852c.c rtw8852c_rfk.c rtw8852c_rfk_table.c rtw8852c_table.c
+SRCS+= rtw8852ce.c
+SRCS+= rtw8851b.c rtw8851b_rfk.c rtw8851b_rfk_table.c rtw8851b_table.c
+SRCS+= rtw8851be.c
+SRCS+= rtw8852b.c rtw8852b_rfk.c rtw8852b_rfk_table.c rtw8852b_table.c
+SRCS+= rtw8852be.c
+SRCS+= acpi.c cam.c efuse.c regd.c sar.c coex.c ps.c ser.c
+
+# CONFIG_RTW89_DEBUG (always on for now)
+SRCS+= debug.c
+
+.if defined(WITH_CONFIG_PM) && ${WITH_CONFIG_PM} > 0
+CFLAGS+= -DCONFIG_PM=${WITH_CONFIG_PM}
+SRCS+= wow.c
+.endif
+
+# Other
+SRCS+= ${LINUXKPI_GENSRCS}
+SRCS+= opt_wlan.h opt_inet6.h opt_inet.h opt_acpi.h
+
+CFLAGS+= -DKBUILD_MODNAME='"rtw89"'
+
+CFLAGS+= -I${DEVRTW89DIR}
+CFLAGS+= ${LINUXKPI_INCLUDES}
+CFLAGS+= -DCONFIG_RTW89_DEBUGMSG
+#CFLAGS+= -DCONFIG_RTW89_DEBUGFS
+
+#CFLAGS+= -ferror-limit=0
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rtw89fw/Makefile b/sys/modules/rtw89fw/Makefile
new file mode 100644
index 000000000000..7732d9d868ff
--- /dev/null
+++ b/sys/modules/rtw89fw/Makefile
@@ -0,0 +1,6 @@
+
+SUBDIR= \
+ rtw8852a \
+ rtw8852c
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/rtw89fw/Makefile.inc b/sys/modules/rtw89fw/Makefile.inc
new file mode 100644
index 000000000000..349041ea5fff
--- /dev/null
+++ b/sys/modules/rtw89fw/Makefile.inc
@@ -0,0 +1,16 @@
+#
+# Common rules for building firmware. Note this gets auto-included
+# by the subdir Makefile's as a consequence of included bsd.kmod.mk.
+
+_NAME= rtw${NAME}_fw.bin
+
+IMG= ${_NAME}
+KMOD= ${_NAME}
+
+CLEANFILES+= ${IMG}
+
+FIRMWS= ${IMG}:${IMG}:${VERSION}
+
+${IMG}: ${SRCTOP}/sys/contrib/dev/rtw89fw/${IMG}
+ cp ${.ALLSRC} ${.TARGET}
+
diff --git a/sys/modules/rtw89fw/rtw8852a/Makefile b/sys/modules/rtw89fw/rtw8852a/Makefile
new file mode 100644
index 000000000000..910468870e78
--- /dev/null
+++ b/sys/modules/rtw89fw/rtw8852a/Makefile
@@ -0,0 +1,5 @@
+
+VERSION= 013360
+NAME= 8852a
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rtw89fw/rtw8852c/Makefile b/sys/modules/rtw89fw/rtw8852c/Makefile
new file mode 100644
index 000000000000..b051945017e5
--- /dev/null
+++ b/sys/modules/rtw89fw/rtw8852c/Makefile
@@ -0,0 +1,5 @@
+
+VERSION= 027200
+NAME= 8852c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rtwn/Makefile b/sys/modules/rtwn/Makefile
new file mode 100644
index 000000000000..07a128a9968c
--- /dev/null
+++ b/sys/modules/rtwn/Makefile
@@ -0,0 +1,51 @@
+
+.PATH: ${SRCTOP}/sys/dev/rtwn
+
+SYSDIR?=${SRCTOP}/sys
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+KMOD = rtwn
+SRCS = if_rtwn.c if_rtwn_tx.c if_rtwn_rx.c if_rtwn_beacon.c \
+ if_rtwn_calib.c if_rtwn_cam.c if_rtwn_task.c if_rtwn_efuse.c \
+ if_rtwn_fw.c if_rtwn_nop.h if_rtwnreg.h if_rtwnvar.h if_rtwn_tx.h \
+ if_rtwn_rx.h if_rtwn_beacon.h if_rtwn_calib.h if_rtwn_cam.h \
+ if_rtwn_task.h if_rtwn_efuse.h if_rtwn_fw.h \
+ bus_if.h device_if.h \
+ opt_bus.h opt_rtwn.h opt_wlan.h
+
+.PATH: ${SRCTOP}/sys/dev/rtwn/rtl8192c
+SRCS += r92c_attach.c r92c_beacon.c r92c_calib.c r92c_chan.c r92c_fw.c \
+ r92c_init.c r92c_llt.c r92c_rf.c r92c_rom.c r92c_rx.c r92c_tx.c \
+ r92c.h r92c_priv.h r92c_reg.h r92c_var.h r92c_rom_defs.h \
+ r92c_rom_image.h r92c_fw_cmd.h r92c_rx_desc.h r92c_tx_desc.h
+
+.PATH: ${SRCTOP}/sys/dev/rtwn/rtl8188e
+SRCS += r88e_beacon.c r88e_calib.c r88e_chan.c r88e_fw.c r88e_init.c \
+ r88e_led.c r88e_rf.c r88e_rom.c r88e_rx.c r88e_tx.c r88e.h \
+ r88e_priv.h r88e_reg.h r88e_rom_defs.h r88e_rom_image.h \
+ r88e_fw_cmd.h r88e_rx_desc.h r88e_tx_desc.h
+
+.PATH: ${SRCTOP}/sys/dev/rtwn/rtl8192e
+SRCS += r92e_chan.c r92e_fw.c r92e_init.c r92e_led.c r92e_rf.c \
+ r92e_rom.c r92e_rx.c r92e.h r92e_priv.h r92e_reg.h \
+ r92e_rom_image.h r92e_rom_defs.h
+
+.PATH: ${SRCTOP}/sys/dev/rtwn/rtl8812a
+SRCS += r12a_beacon.c r12a_calib.c r12a_caps.c r12a_chan.c r12a_fw.c \
+ r12a_init.c r12a_led.c r12a_rf.c r12a_rom.c r12a_rx.c r12a_tx.c \
+ r12a.h r12a_priv.h r12a_reg.h r12a_var.h r12a_rom_defs.h \
+ r12a_rom_image.h r12a_fw_cmd.h r12a_rx_desc.h r12a_tx_desc.h
+
+.PATH: ${SRCTOP}/sys/dev/rtwn/rtl8821a
+SRCS += r21a_beacon.c r21a_calib.c r21a_chan.c r21a_fw.c r21a_init.c \
+ r21a_led.c r21a_rom.c r21a_rx.c r21a.h r21a_priv.h r21a_reg.h
+
+opt_rtwn.h:
+ @echo "#define RTWN_DEBUG 1" > ${.TARGET}
+.if ${MK_SOURCELESS_UCODE} == "no"
+ @echo "#define RTWN_WITHOUT_UCODE 1" >> ${.TARGET}
+.endif
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rtwn_pci/Makefile b/sys/modules/rtwn_pci/Makefile
new file mode 100644
index 000000000000..2d6650238c22
--- /dev/null
+++ b/sys/modules/rtwn_pci/Makefile
@@ -0,0 +1,29 @@
+
+.PATH: ${SRCTOP}/sys/dev/rtwn/pci
+
+SYSDIR?=${SRCTOP}/sys
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+KMOD = if_rtwn_pci
+SRCS = rtwn_pci_attach.c rtwn_pci_reg.c rtwn_pci_rx.c rtwn_pci_tx.c \
+ rtwn_pci_attach.h rtwn_pci_reg.h rtwn_pci_rx.h rtwn_pci_tx.h \
+ rtwn_pci_var.h \
+ device_if.h bus_if.h pci_if.h \
+ opt_bus.h opt_rtwn.h opt_wlan.h
+
+.PATH: ${SRCTOP}/sys/dev/rtwn/rtl8192c/pci
+SRCS += r92ce_attach.c r92ce_calib.c r92ce_fw.c r92ce_init.c r92ce_led.c \
+ r92ce_rx.c r92ce_tx.c \
+ r92ce.h r92ce_priv.h r92ce_reg.h r92ce_rx_desc.h r92ce_tx_desc.h
+
+.PATH: ${SRCTOP}/sys/dev/rtwn/rtl8188e/pci
+SRCS += r88ee_attach.c r88ee_init.c r88ee_rx.c \
+ r88ee.h r88ee_reg.h
+
+opt_rtwn.h:
+ @echo "#define RTWN_DEBUG 1" > ${.TARGET}
+.if ${MK_SOURCELESS_UCODE} == "no"
+ @echo "#define RTWN_WITHOUT_UCODE 1" >> ${.TARGET}
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rtwn_usb/Makefile b/sys/modules/rtwn_usb/Makefile
new file mode 100644
index 000000000000..a599f13095e5
--- /dev/null
+++ b/sys/modules/rtwn_usb/Makefile
@@ -0,0 +1,39 @@
+
+.PATH: ${SRCTOP}/sys/dev/rtwn/usb
+
+SYSDIR?=${SRCTOP}/sys
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+KMOD = if_rtwn_usb
+SRCS = rtwn_usb_attach.c rtwn_usb_ep.c rtwn_usb_reg.c rtwn_usb_rx.c \
+ rtwn_usb_tx.c rtwn_usb_attach.h rtwn_usb_ep.h rtwn_usb_reg.h \
+ rtwn_usb_rx.h rtwn_usb_tx.h rtwn_usb_var.h \
+ bus_if.h device_if.h \
+ opt_bus.h opt_rtwn.h opt_usb.h opt_wlan.h usb_if.h usbdevs.h
+
+.PATH: ${SRCTOP}/sys/dev/rtwn/rtl8188e/usb
+SRCS += r88eu_attach.c r88eu_init.c \
+ r88eu.h r88eu_reg.h
+
+.PATH: ${SRCTOP}/sys/dev/rtwn/rtl8192c/usb
+SRCS += r92cu_attach.c r92cu_init.c r92cu_led.c r92cu_rx.c r92cu_tx.c \
+ r92cu.h r92cu_priv.h r92cu_reg.h r92cu_tx_desc.h
+
+.PATH: ${SRCTOP}/sys/dev/rtwn/rtl8192e/usb
+SRCS += r92eu_attach.c r92eu_init.c r92eu.h r92eu_reg.h
+
+.PATH: ${SRCTOP}/sys/dev/rtwn/rtl8812a/usb
+SRCS += r12au_attach.c r12au_init.c r12au_rx.c r12au_tx.c \
+ r12au.h r12au_reg.h r12au_tx_desc.h
+
+.PATH: ${SRCTOP}/sys/dev/rtwn/rtl8821a/usb
+SRCS += r21au_attach.c r21au_init.c r21au_dfs.c \
+ r21au.h r21au_reg.h
+
+opt_rtwn.h:
+ @echo "#define RTWN_DEBUG 1" > ${.TARGET}
+.if ${MK_SOURCELESS_UCODE} == "no"
+ @echo "#define RTWN_WITHOUT_UCODE 1" >> ${.TARGET}
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rtwnfw/Makefile b/sys/modules/rtwnfw/Makefile
new file mode 100644
index 000000000000..f747612c7526
--- /dev/null
+++ b/sys/modules/rtwnfw/Makefile
@@ -0,0 +1,5 @@
+
+SUBDIR= rtwnrtl8188eu rtwnrtl8192cT rtwnrtl8192cU rtwnrtl8192eu rtwnrtl8812au \
+ rtwnrtl8821au rtwnrtl8192cE rtwnrtl8192cEB rtwnrtl8188ee
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/rtwnfw/Makefile.inc b/sys/modules/rtwnfw/Makefile.inc
new file mode 100644
index 000000000000..7ee2183a23db
--- /dev/null
+++ b/sys/modules/rtwnfw/Makefile.inc
@@ -0,0 +1,14 @@
+#
+# Common rules for building firmware. Note this gets auto-included
+# by the subdir Makefile's as a consequence of included bsd.kmod.mk.
+
+_FIRM= ${IMG}.fw
+
+CLEANFILES+= ${_FIRM}
+
+FIRMWS= ${_FIRM}:${KMOD}:111
+
+# FIRMWARE_LICENSE= realtek
+
+${_FIRM}: ${SRCTOP}/sys/contrib/dev/rtwn/${_FIRM}.uu
+ uudecode -p ${.ALLSRC} > ${.TARGET}
diff --git a/sys/modules/rtwnfw/rtwnrtl8188ee/Makefile b/sys/modules/rtwnfw/rtwnrtl8188ee/Makefile
new file mode 100644
index 000000000000..4d3ed50d557d
--- /dev/null
+++ b/sys/modules/rtwnfw/rtwnrtl8188ee/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= rtwn-rtl8188eefw
+IMG= rtwn-rtl8188eefw
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rtwnfw/rtwnrtl8188eu/Makefile b/sys/modules/rtwnfw/rtwnrtl8188eu/Makefile
new file mode 100644
index 000000000000..df896ca7dcc6
--- /dev/null
+++ b/sys/modules/rtwnfw/rtwnrtl8188eu/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= rtwn-rtl8188eufw
+IMG= rtwn-rtl8188eufw
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rtwnfw/rtwnrtl8192cE/Makefile b/sys/modules/rtwnfw/rtwnrtl8192cE/Makefile
new file mode 100644
index 000000000000..8b6ddb2a119d
--- /dev/null
+++ b/sys/modules/rtwnfw/rtwnrtl8192cE/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= rtwn-rtl8192cfwE
+IMG= rtwn-rtl8192cfwE
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rtwnfw/rtwnrtl8192cEB/Makefile b/sys/modules/rtwnfw/rtwnrtl8192cEB/Makefile
new file mode 100644
index 000000000000..15412322d527
--- /dev/null
+++ b/sys/modules/rtwnfw/rtwnrtl8192cEB/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= rtwn-rtl8192cfwE_B
+IMG= rtwn-rtl8192cfwE_B
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rtwnfw/rtwnrtl8192cT/Makefile b/sys/modules/rtwnfw/rtwnrtl8192cT/Makefile
new file mode 100644
index 000000000000..98349e9b7ca6
--- /dev/null
+++ b/sys/modules/rtwnfw/rtwnrtl8192cT/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= rtwn-rtl8192cfwT
+IMG= rtwn-rtl8192cfwT
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rtwnfw/rtwnrtl8192cU/Makefile b/sys/modules/rtwnfw/rtwnrtl8192cU/Makefile
new file mode 100644
index 000000000000..84a2e1c69c68
--- /dev/null
+++ b/sys/modules/rtwnfw/rtwnrtl8192cU/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= rtwn-rtl8192cfwU
+IMG= rtwn-rtl8192cfwU
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rtwnfw/rtwnrtl8192eu/Makefile b/sys/modules/rtwnfw/rtwnrtl8192eu/Makefile
new file mode 100644
index 000000000000..30cfd185c763
--- /dev/null
+++ b/sys/modules/rtwnfw/rtwnrtl8192eu/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= rtwn-rtl8192eufw
+IMG= rtwn-rtl8192eufw
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rtwnfw/rtwnrtl8812au/Makefile b/sys/modules/rtwnfw/rtwnrtl8812au/Makefile
new file mode 100644
index 000000000000..cb69e8a17850
--- /dev/null
+++ b/sys/modules/rtwnfw/rtwnrtl8812au/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= rtwn-rtl8812aufw
+IMG= rtwn-rtl8812aufw
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/rtwnfw/rtwnrtl8821au/Makefile b/sys/modules/rtwnfw/rtwnrtl8821au/Makefile
new file mode 100644
index 000000000000..c874a7b93568
--- /dev/null
+++ b/sys/modules/rtwnfw/rtwnrtl8821au/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= rtwn-rtl8821aufw
+IMG= rtwn-rtl8821aufw
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/s3/Makefile b/sys/modules/s3/Makefile
new file mode 100644
index 000000000000..153b41332aa3
--- /dev/null
+++ b/sys/modules/s3/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/fb
+
+KMOD= s3
+SRCS= device_if.h bus_if.h isa_if.h pci_if.h \
+ s3_pci.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/safe/Makefile b/sys/modules/safe/Makefile
new file mode 100644
index 000000000000..5e79ddfe203f
--- /dev/null
+++ b/sys/modules/safe/Makefile
@@ -0,0 +1,39 @@
+#-
+# Copyright (c) 2003 Sam Leffler, Errno Consulting
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+#
+
+.PATH: ${SRCTOP}/sys/dev/safe
+KMOD = safe
+SRCS = safe.c opt_safe.h
+SRCS += device_if.h bus_if.h pci_if.h
+SRCS += opt_bus.h cryptodev_if.h
+
+.if !defined(KERNBUILDDIR)
+opt_safe.h:
+ echo "#define SAFE_DEBUG 1" > ${.TARGET}
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/safexcel/Makefile b/sys/modules/safexcel/Makefile
new file mode 100644
index 000000000000..ce1d1ba6fa56
--- /dev/null
+++ b/sys/modules/safexcel/Makefile
@@ -0,0 +1,8 @@
+.PATH: ${SRCTOP}/sys/dev/safexcel
+
+KMOD= safexcel
+SRCS= safexcel.c
+
+SRCS+= bus_if.h cryptodev_if.h device_if.h ofw_bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sbni/Makefile b/sys/modules/sbni/Makefile
new file mode 100644
index 000000000000..5f43f4ed289a
--- /dev/null
+++ b/sys/modules/sbni/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/sbni
+
+KMOD= if_sbni
+SRCS= if_sbni.c if_sbni_isa.c if_sbni_pci.c
+
+SRCS+= bus_if.h device_if.h isa_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/scc/Makefile b/sys/modules/scc/Makefile
new file mode 100644
index 000000000000..cd9e5b774224
--- /dev/null
+++ b/sys/modules/scc/Makefile
@@ -0,0 +1,13 @@
+
+.PATH: ${SRCTOP}/sys/dev/scc
+
+.if ${MACHINE_CPUARCH} == "powerpc"
+scc_bfe= scc_bfe_macio.c scc_bfe_quicc.c scc_dev_quicc.c
+.endif
+
+KMOD= scc
+SRCS= ${scc_bfe} scc_core.c scc_if.c scc_if.h \
+ scc_dev_z8530.c
+SRCS+= bus_if.h device_if.h ofw_bus_if.h serdev_if.c serdev_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sctp/Makefile b/sys/modules/sctp/Makefile
new file mode 100644
index 000000000000..4e91d7572ab0
--- /dev/null
+++ b/sys/modules/sctp/Makefile
@@ -0,0 +1,30 @@
+
+.PATH: ${SRCTOP}/sys/netinet
+.PATH: ${SRCTOP}/sys/netinet6
+
+KMOD= sctp
+SRCS= sctp_asconf.c \
+ sctp_auth.c \
+ sctp_bsd_addr.c \
+ sctp_cc_functions.c \
+ sctp_crc32.c \
+ sctp_indata.c \
+ sctp_input.c \
+ sctp_kdtrace.c \
+ sctp_module.c \
+ sctp_output.c \
+ sctp_pcb.c \
+ sctp_peeloff.c \
+ sctp_ss_functions.c \
+ sctp_syscalls.c \
+ sctp_sysctl.c \
+ sctp_timer.c \
+ sctp_usrreq.c \
+ sctp6_usrreq.c \
+ sctputil.c
+
+SRCS+= device_if.h bus_if.h vnode_if.h
+SRCS+= opt_capsicum.h opt_ktrace.h opt_inet.h opt_inet6.h opt_kern_tls.h \
+ opt_sctp.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sdhci/Makefile b/sys/modules/sdhci/Makefile
new file mode 100644
index 000000000000..cbd58d891a6e
--- /dev/null
+++ b/sys/modules/sdhci/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/sdhci
+
+KMOD= sdhci
+SRCS= sdhci.c sdhci.h sdhci_if.c sdhci_if.h device_if.h bus_if.h mmcbr_if.h opt_mmccam.h opt_cam.h
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sdhci_acpi/Makefile b/sys/modules/sdhci_acpi/Makefile
new file mode 100644
index 000000000000..597471eccefe
--- /dev/null
+++ b/sys/modules/sdhci_acpi/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/sdhci
+
+KMOD= sdhci_acpi
+SRCS= sdhci_acpi.c sdhci.h sdhci_if.h
+SRCS+= acpi_if.h device_if.h bus_if.h pci_if.h mmcbr_if.h
+SRCS+= opt_acpi.h opt_mmccam.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sdhci_fdt/Makefile b/sys/modules/sdhci_fdt/Makefile
new file mode 100644
index 000000000000..12b4af37f6e5
--- /dev/null
+++ b/sys/modules/sdhci_fdt/Makefile
@@ -0,0 +1,8 @@
+#
+
+.PATH: ${SRCTOP}/sys/dev/sdhci
+
+KMOD= sdhci_fdt
+SRCS= sdhci_fdt.c sdhci_fdt_gpio.c sdhci_if.h device_if.h bus_if.h mmcbr_if.h opt_mmccam.h opt_cam.h gpio_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sdhci_pci/Makefile b/sys/modules/sdhci_pci/Makefile
new file mode 100644
index 000000000000..b06299193056
--- /dev/null
+++ b/sys/modules/sdhci_pci/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/sdhci
+
+KMOD= sdhci_pci
+SRCS= sdhci_pci.c sdhci.h sdhci_if.h device_if.h bus_if.h pci_if.h mmcbr_if.h
+SRCS+= opt_mmccam.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sdio/Makefile b/sys/modules/sdio/Makefile
new file mode 100644
index 000000000000..7f5bcb78a845
--- /dev/null
+++ b/sys/modules/sdio/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${.CURDIR}/../../dev/sdio
+
+KMOD= sdio
+SRCS= sdiob.c sdio_subr.c
+SRCS+= sdio_if.c
+SRCS+= device_if.h bus_if.h sdio_if.h opt_cam.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sem/Makefile b/sys/modules/sem/Makefile
new file mode 100644
index 000000000000..1d3a88e09ebc
--- /dev/null
+++ b/sys/modules/sem/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/kern
+
+KMOD= sem
+SRCS= uipc_sem.c opt_posix.h vnode_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/send/Makefile b/sys/modules/send/Makefile
new file mode 100644
index 000000000000..d90affc7b9fd
--- /dev/null
+++ b/sys/modules/send/Makefile
@@ -0,0 +1,6 @@
+.PATH: ${SRCTOP}/sys/netinet6
+
+KMOD= send
+SRCS= send.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sff/Makefile b/sys/modules/sff/Makefile
new file mode 100644
index 000000000000..96832070de63
--- /dev/null
+++ b/sys/modules/sff/Makefile
@@ -0,0 +1,13 @@
+.PATH: ${SRCTOP}/sys/dev/sff
+
+KMOD= sff
+
+SRCS+= sff_if.c sff_if.h
+SRCS+= bus_if.h device_if.h
+
+.if !empty(OPT_FDT)
+SRCS+= sfp_fdt.c \
+ ofw_bus_if.h
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sfxge/Makefile b/sys/modules/sfxge/Makefile
new file mode 100644
index 000000000000..e4d2a44d827e
--- /dev/null
+++ b/sys/modules/sfxge/Makefile
@@ -0,0 +1,50 @@
+
+KMOD= sfxge
+
+SFXGE= ${SRCTOP}/sys/dev/sfxge
+
+SRCS= device_if.h bus_if.h pci_if.h
+SRCS+= opt_inet.h opt_inet6.h opt_rss.h
+
+.PATH: ${SRCTOP}/sys/dev/sfxge
+SRCS+= sfxge.c sfxge_dma.c sfxge_ev.c
+SRCS+= sfxge_intr.c sfxge_mcdi.c sfxge_nvram.c
+SRCS+= sfxge_port.c sfxge_rx.c sfxge_tx.c
+SRCS+= sfxge.h sfxge_rx.h sfxge_tx.h sfxge_version.h
+
+.PATH: ${SRCTOP}/sys/dev/sfxge/common
+SRCS+= efx_bootcfg.c efx_crc32.c efx_ev.c efx_intr.c efx_lic.c efx_mac.c
+SRCS+= efx_mcdi.c efx_mon.c efx_nic.c
+SRCS+= efx_nvram.c efx_phy.c efx_port.c efx_rx.c efx_sram.c efx_tunnel.c
+SRCS+= efx_tx.c efx_vpd.c efx_filter.c efx_hash.c
+SRCS+= efsys.h
+SRCS+= efx.h efx_annote.h efx_check.h efx_impl.h efx_mcdi.h
+SRCS+= efx_regs.h efx_regs_ef10.h
+SRCS+= efx_regs_mcdi.h efx_regs_mcdi_aoe.h efx_regs_mcdi_strs.h
+SRCS+= efx_regs_pci.h efx_types.h
+SRCS+= efx_phy_ids.h
+SRCS+= ef10_tlv_layout.h
+
+SRCS+= mcdi_mon.c mcdi_mon.h
+
+SRCS+= siena_mac.c siena_mcdi.c siena_nic.c siena_nvram.c siena_phy.c
+SRCS+= siena_sram.c siena_vpd.c
+SRCS+= siena_flash.h siena_impl.h
+
+SRCS+= ef10_ev.c ef10_filter.c ef10_image.c ef10_intr.c ef10_mac.c ef10_mcdi.c
+SRCS+= ef10_nic.c ef10_nvram.c ef10_phy.c ef10_rx.c ef10_tx.c ef10_vpd.c
+SRCS+= ef10_impl.h ef10_signed_image_layout.h
+
+SRCS+= hunt_nic.c
+SRCS+= hunt_impl.h
+
+SRCS+= medford_nic.c
+SRCS+= medford_impl.h
+
+SRCS+= medford2_nic.c
+SRCS+= medford2_impl.h
+
+# Extra debug checks
+#CFLAGS += -DDEBUG=1
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sge/Makefile b/sys/modules/sge/Makefile
new file mode 100644
index 000000000000..d4032dfab29b
--- /dev/null
+++ b/sys/modules/sge/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/sge
+
+KMOD= if_sge
+SRCS= if_sge.c device_if.h bus_if.h pci_if.h miibus_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sgx/Makefile b/sys/modules/sgx/Makefile
new file mode 100644
index 000000000000..504fa6d2e299
--- /dev/null
+++ b/sys/modules/sgx/Makefile
@@ -0,0 +1,13 @@
+
+.PATH: ${SRCTOP}/sys/amd64/sgx
+
+KMOD= sgx
+SRCS= sgx.c sgxvar.h sgx_support.S
+SRCS+= opt_hwpmc_hooks.h opt_kstack_pages.h
+DPSRCS= assym.inc
+
+sgx_support.o: assym.inc
+ ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \
+ ${.IMPSRC} -o ${.TARGET}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sgx_linux/Makefile b/sys/modules/sgx_linux/Makefile
new file mode 100644
index 000000000000..366918d3ab56
--- /dev/null
+++ b/sys/modules/sgx_linux/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/amd64/sgx
+
+KMOD= sgx_linux
+SRCS= sgx_linux.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/siftr/Makefile b/sys/modules/siftr/Makefile
new file mode 100644
index 000000000000..5bb038bf542f
--- /dev/null
+++ b/sys/modules/siftr/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/netinet
+KMOD= siftr
+SRCS= siftr.c opt_kern_tls.h
+
+# Uncomment to add IPv6 support
+#CFLAGS+=-DSIFTR_IPV6
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/siis/Makefile b/sys/modules/siis/Makefile
new file mode 100644
index 000000000000..0027fbaa3734
--- /dev/null
+++ b/sys/modules/siis/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/siis
+
+KMOD= siis
+SRCS= siis.c siis.h device_if.h bus_if.h pci_if.h opt_cam.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sis/Makefile b/sys/modules/sis/Makefile
new file mode 100644
index 000000000000..3ef619d9999d
--- /dev/null
+++ b/sys/modules/sis/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/sis
+
+KMOD= if_sis
+SRCS= if_sis.c device_if.h bus_if.h pci_if.h
+SRCS+= miibus_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sk/Makefile b/sys/modules/sk/Makefile
new file mode 100644
index 000000000000..1f7b477d9b68
--- /dev/null
+++ b/sys/modules/sk/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/sk
+
+KMOD= if_sk
+SRCS= if_sk.c device_if.h bus_if.h pci_if.h
+SRCS+= miibus_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/smartpqi/Makefile b/sys/modules/smartpqi/Makefile
new file mode 100644
index 000000000000..080ca34d07e2
--- /dev/null
+++ b/sys/modules/smartpqi/Makefile
@@ -0,0 +1,11 @@
+# 5/10/2017
+
+KMOD = smartpqi
+
+.PATH: ${SRCTOP}/sys/dev/${KMOD}
+
+SRCS=smartpqi_mem.c smartpqi_intr.c smartpqi_main.c smartpqi_cam.c smartpqi_ioctl.c smartpqi_misc.c smartpqi_sis.c smartpqi_init.c smartpqi_queue.c smartpqi_tag.c smartpqi_cmd.c smartpqi_request.c smartpqi_response.c smartpqi_event.c smartpqi_helper.c smartpqi_discovery.c smartpqi_features.c
+
+SRCS+= device_if.h bus_if.h pci_if.h opt_scsi.h opt_cam.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/smbfs/Makefile b/sys/modules/smbfs/Makefile
new file mode 100644
index 000000000000..703343eb1b41
--- /dev/null
+++ b/sys/modules/smbfs/Makefile
@@ -0,0 +1,34 @@
+
+.PATH: ${SRCTOP}/sys/crypto/des \
+ ${SRCTOP}/sys/crypto/des/arch/${MACHINE_CPUARCH} \
+ ${SRCTOP}/sys/kern \
+ ${SRCTOP}/sys/libkern \
+ ${SRCTOP}/sys/netsmb \
+ ${SRCTOP}/sys/fs/smbfs
+
+KMOD= smbfs
+
+SRCS= vnode_if.h \
+ opt_inet.h opt_netsmb.h \
+ iconv_converter_if.h \
+ md4c.c \
+ smb_conn.c smb_dev.c smb_trantcp.c smb_smb.c smb_subr.c smb_rq.c \
+ smb_usr.c smb_crypt.c smb_iod.c \
+ smbfs_vfsops.c smbfs_node.c smbfs_io.c smbfs_vnops.c \
+ smbfs_subr.c smbfs_smb.c
+
+# NETSMBCRYPTO
+SRCS+= des_ecb.c des_setkey.c
+.if ${MACHINE_CPUARCH} == "i386"
+SRCS+= des_enc.S
+.else
+SRCS+= des_enc.c
+.endif
+
+CFLAGS+= ${KDEBUG}
+
+.if defined(VNPRINT)
+CFLAGS+= -DVNPRINT
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/snp/Makefile b/sys/modules/snp/Makefile
new file mode 100644
index 000000000000..d963b8e10e6f
--- /dev/null
+++ b/sys/modules/snp/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/snp
+
+KMOD= snp
+SRCS= snp.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sound/Makefile b/sys/modules/sound/Makefile
new file mode 100644
index 000000000000..41314d322c9d
--- /dev/null
+++ b/sys/modules/sound/Makefile
@@ -0,0 +1,6 @@
+
+SUBDIR =
+SUBDIR += sound
+SUBDIR += driver
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/sound/Makefile.inc b/sys/modules/sound/Makefile.inc
new file mode 100644
index 000000000000..d3b5cbd3a79b
--- /dev/null
+++ b/sys/modules/sound/Makefile.inc
@@ -0,0 +1,2 @@
+
+.include "../Makefile.inc"
diff --git a/sys/modules/sound/driver/Makefile b/sys/modules/sound/driver/Makefile
new file mode 100644
index 000000000000..af5e3259aa00
--- /dev/null
+++ b/sys/modules/sound/driver/Makefile
@@ -0,0 +1,26 @@
+
+SYSDIR?=${SRCTOP}/sys
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+# Modules that include binary-only blobs of microcode should be selectable by
+# MK_SOURCELESS_UCODE option (see below).
+
+SUBDIR= als4000 atiixp cs4281 ${_csa} emu10k1 emu10kx
+SUBDIR+= envy24 envy24ht es137x fm801 hda hdspe ich
+SUBDIR+= ${_maestro3} neomagic solo spicds t4dwave via8233
+SUBDIR+= via82c686 vibes driver uaudio
+
+.if ${MK_SOURCELESS_UCODE} != "no"
+_csa= csa
+_maestro3= maestro3
+.endif
+
+.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
+SUBDIR+= cmi
+.endif
+
+.if ${MACHINE_CPUARCH} == "powerpc"
+SUBDIR+= ai2s davbus
+.endif
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/sound/driver/Makefile.inc b/sys/modules/sound/driver/Makefile.inc
new file mode 100644
index 000000000000..980084ed099d
--- /dev/null
+++ b/sys/modules/sound/driver/Makefile.inc
@@ -0,0 +1,4 @@
+
+SRCS+= ac97_if.h channel_if.h feeder_if.h mixer_if.h
+
+.include "../Makefile.inc"
diff --git a/sys/modules/sound/driver/ai2s/Makefile b/sys/modules/sound/driver/ai2s/Makefile
new file mode 100644
index 000000000000..76c00494bd80
--- /dev/null
+++ b/sys/modules/sound/driver/ai2s/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/sound/macio
+
+KMOD= snd_ai2s
+SRCS= device_if.h bus_if.h ofw_bus_if.h
+SRCS+= channel_if.h feeder_if.h mixer_if.h
+SRCS+= onyx.c snapper.c tumbler.c aoa.c i2s.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sound/driver/als4000/Makefile b/sys/modules/sound/driver/als4000/Makefile
new file mode 100644
index 000000000000..a81692cb1838
--- /dev/null
+++ b/sys/modules/sound/driver/als4000/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/sound/pci
+
+KMOD= snd_als4000
+SRCS= device_if.h bus_if.h pci_if.h
+SRCS+= als4000.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sound/driver/atiixp/Makefile b/sys/modules/sound/driver/atiixp/Makefile
new file mode 100644
index 000000000000..7a500dd7e05d
--- /dev/null
+++ b/sys/modules/sound/driver/atiixp/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/sound/pci
+
+KMOD= snd_atiixp
+SRCS= device_if.h bus_if.h pci_if.h
+SRCS+= atiixp.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sound/driver/cmi/Makefile b/sys/modules/sound/driver/cmi/Makefile
new file mode 100644
index 000000000000..ece46bf80fe9
--- /dev/null
+++ b/sys/modules/sound/driver/cmi/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/sound/pci
+
+KMOD= snd_cmi
+SRCS= device_if.h bus_if.h pci_if.h
+SRCS+= mpufoi_if.h
+SRCS+= cmi.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sound/driver/cs4281/Makefile b/sys/modules/sound/driver/cs4281/Makefile
new file mode 100644
index 000000000000..d521d3240ff5
--- /dev/null
+++ b/sys/modules/sound/driver/cs4281/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/sound/pci
+
+KMOD= snd_cs4281
+SRCS= device_if.h bus_if.h pci_if.h
+SRCS+= cs4281.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sound/driver/csa/Makefile b/sys/modules/sound/driver/csa/Makefile
new file mode 100644
index 000000000000..0cc2a3da16a6
--- /dev/null
+++ b/sys/modules/sound/driver/csa/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/sound/pci
+
+KMOD= snd_csa
+SRCS= device_if.h bus_if.h mpufoi_if.h pci_if.h
+SRCS+= csa.c csamidi.c csapcm.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sound/driver/davbus/Makefile b/sys/modules/sound/driver/davbus/Makefile
new file mode 100644
index 000000000000..12df61b69d0c
--- /dev/null
+++ b/sys/modules/sound/driver/davbus/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/sound/macio
+
+KMOD= snd_davbus
+SRCS= device_if.h bus_if.h ofw_bus_if.h
+SRCS+= channel_if.h feeder_if.h mixer_if.h
+SRCS+= aoa.c davbus.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sound/driver/driver/Makefile b/sys/modules/sound/driver/driver/Makefile
new file mode 100644
index 000000000000..ce35900039c2
--- /dev/null
+++ b/sys/modules/sound/driver/driver/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/sound
+
+KMOD= snd_driver
+SRCS= device_if.h bus_if.h
+SRCS+= driver.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sound/driver/emu10k1/Makefile b/sys/modules/sound/driver/emu10k1/Makefile
new file mode 100644
index 000000000000..4ab78cee3bb3
--- /dev/null
+++ b/sys/modules/sound/driver/emu10k1/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/sound/pci
+
+KMOD= snd_emu10k1
+SRCS= device_if.h bus_if.h pci_if.h
+SRCS+= mpufoi_if.h
+SRCS+= emu10k1.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sound/driver/emu10kx/Makefile b/sys/modules/sound/driver/emu10kx/Makefile
new file mode 100644
index 000000000000..096ce2bdb6e1
--- /dev/null
+++ b/sys/modules/sound/driver/emu10kx/Makefile
@@ -0,0 +1,13 @@
+.PATH: ${SRCTOP}/sys/dev/sound/pci
+
+KMOD= snd_emu10kx
+
+SRCS= device_if.h bus_if.h pci_if.h
+SRCS+= isa_if.h channel_if.h ac97_if.h mixer_if.h mpufoi_if.h
+SRCS+= vnode_if.h
+# Master, PCM and MIDI devices
+SRCS+= emu10kx.c
+SRCS+= emu10kx-pcm.c
+SRCS+= emu10kx-midi.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sound/driver/envy24/Makefile b/sys/modules/sound/driver/envy24/Makefile
new file mode 100644
index 000000000000..c2c0e171a47d
--- /dev/null
+++ b/sys/modules/sound/driver/envy24/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/sound/pci
+
+KMOD= snd_envy24
+SRCS= device_if.h bus_if.h pci_if.h
+SRCS+= envy24.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sound/driver/envy24ht/Makefile b/sys/modules/sound/driver/envy24ht/Makefile
new file mode 100644
index 000000000000..179352c39ae2
--- /dev/null
+++ b/sys/modules/sound/driver/envy24ht/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/sound/pci
+
+KMOD= snd_envy24ht
+SRCS= device_if.h bus_if.h pci_if.h
+SRCS+= envy24ht.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sound/driver/es137x/Makefile b/sys/modules/sound/driver/es137x/Makefile
new file mode 100644
index 000000000000..5f08e6d3566b
--- /dev/null
+++ b/sys/modules/sound/driver/es137x/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/sound/pci
+
+KMOD= snd_es137x
+SRCS= device_if.h bus_if.h pci_if.h
+SRCS+= es137x.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sound/driver/fm801/Makefile b/sys/modules/sound/driver/fm801/Makefile
new file mode 100644
index 000000000000..826eaf9522b3
--- /dev/null
+++ b/sys/modules/sound/driver/fm801/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/sound/pci
+
+KMOD= snd_fm801
+SRCS= device_if.h bus_if.h pci_if.h
+SRCS+= fm801.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sound/driver/hda/Makefile b/sys/modules/sound/driver/hda/Makefile
new file mode 100644
index 000000000000..f1dbe405410a
--- /dev/null
+++ b/sys/modules/sound/driver/hda/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/sound/pci/hda
+
+KMOD= snd_hda
+SRCS= device_if.h bus_if.h pci_if.h channel_if.h mixer_if.h hdac_if.h
+SRCS+= hdaa.c hdaa.h hdaa_patches.c hdac.c hdac_if.h hdac_if.c
+SRCS+= hdacc.c hdac_private.h hdac_reg.h hda_reg.h hdac.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sound/driver/hdspe/Makefile b/sys/modules/sound/driver/hdspe/Makefile
new file mode 100644
index 000000000000..c7be05fce737
--- /dev/null
+++ b/sys/modules/sound/driver/hdspe/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/sound/pci
+
+KMOD= snd_hdspe
+SRCS= device_if.h bus_if.h pci_if.h
+SRCS+= hdspe.c hdspe-pcm.c hdspe.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sound/driver/ich/Makefile b/sys/modules/sound/driver/ich/Makefile
new file mode 100644
index 000000000000..b68e872cbf6e
--- /dev/null
+++ b/sys/modules/sound/driver/ich/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/sound/pci
+KMOD = snd_ich
+SRCS = device_if.h bus_if.h pci_if.h
+SRCS += ich.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sound/driver/maestro3/Makefile b/sys/modules/sound/driver/maestro3/Makefile
new file mode 100644
index 000000000000..db6c21035ff0
--- /dev/null
+++ b/sys/modules/sound/driver/maestro3/Makefile
@@ -0,0 +1,10 @@
+
+.PATH: ${SRCTOP}/sys/dev/sound/pci
+
+KMOD= snd_maestro3
+SRCS= device_if.h bus_if.h pci_if.h
+SRCS+= maestro3.c
+
+CFLAGS+= -Wall -DM3_DEBUG_LEVEL=-1
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sound/driver/neomagic/Makefile b/sys/modules/sound/driver/neomagic/Makefile
new file mode 100644
index 000000000000..7a8befaba6f1
--- /dev/null
+++ b/sys/modules/sound/driver/neomagic/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/sound/pci
+
+KMOD= snd_neomagic
+SRCS= device_if.h bus_if.h pci_if.h
+SRCS+= neomagic.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sound/driver/solo/Makefile b/sys/modules/sound/driver/solo/Makefile
new file mode 100644
index 000000000000..a429db8d29e2
--- /dev/null
+++ b/sys/modules/sound/driver/solo/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/sound/pci
+
+KMOD= snd_solo
+SRCS= device_if.h bus_if.h pci_if.h
+SRCS+= solo.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sound/driver/spicds/Makefile b/sys/modules/sound/driver/spicds/Makefile
new file mode 100644
index 000000000000..bf9bc86dc106
--- /dev/null
+++ b/sys/modules/sound/driver/spicds/Makefile
@@ -0,0 +1,10 @@
+
+.PATH: ${SRCTOP}/sys/dev/sound/pci
+
+KMOD= snd_spicds
+SRCS= device_if.h bus_if.h isa_if.h pci_if.h
+SRCS+= spicds.c
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sound/driver/t4dwave/Makefile b/sys/modules/sound/driver/t4dwave/Makefile
new file mode 100644
index 000000000000..4aaf1bd1d903
--- /dev/null
+++ b/sys/modules/sound/driver/t4dwave/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/sound/pci
+
+KMOD= snd_t4dwave
+SRCS= device_if.h bus_if.h pci_if.h
+SRCS+= t4dwave.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sound/driver/uaudio/Makefile b/sys/modules/sound/driver/uaudio/Makefile
new file mode 100644
index 000000000000..a246f23afffb
--- /dev/null
+++ b/sys/modules/sound/driver/uaudio/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/sound/usb
+
+KMOD= snd_uaudio
+SRCS= bus_if.h device_if.h usb_if.h vnode_if.h
+SRCS+= opt_usb.h opt_bus.h feeder_if.h channel_if.h usbdevs.h
+SRCS+= uaudio_pcm.c uaudio.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sound/driver/via8233/Makefile b/sys/modules/sound/driver/via8233/Makefile
new file mode 100644
index 000000000000..07832592c83a
--- /dev/null
+++ b/sys/modules/sound/driver/via8233/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/sound/pci
+
+KMOD= snd_via8233
+SRCS= device_if.h bus_if.h pci_if.h
+SRCS+= via8233.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sound/driver/via82c686/Makefile b/sys/modules/sound/driver/via82c686/Makefile
new file mode 100644
index 000000000000..acf83ce7814c
--- /dev/null
+++ b/sys/modules/sound/driver/via82c686/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/sound/pci
+
+KMOD= snd_via82c686
+SRCS= device_if.h bus_if.h pci_if.h
+SRCS+= via82c686.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sound/driver/vibes/Makefile b/sys/modules/sound/driver/vibes/Makefile
new file mode 100644
index 000000000000..53d1763d0cd5
--- /dev/null
+++ b/sys/modules/sound/driver/vibes/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/sound/pci
+
+KMOD= snd_vibes
+SRCS= device_if.h bus_if.h pci_if.h
+SRCS+= vibes.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sound/sound/Makefile b/sys/modules/sound/sound/Makefile
new file mode 100644
index 000000000000..5dd628d9f342
--- /dev/null
+++ b/sys/modules/sound/sound/Makefile
@@ -0,0 +1,36 @@
+
+SYSDIR?=${SRCTOP}/sys
+
+.PATH: ${SYSDIR}/dev/sound
+.PATH: ${SYSDIR}/dev/sound/pcm
+.PATH: ${SYSDIR}/dev/sound/midi
+.PATH: ${SYSDIR}/dev/sound/isa
+
+KMOD= sound
+SRCS= device_if.h bus_if.h isa_if.h pci_if.h opt_isa.h
+SRCS+= ac97_if.h channel_if.h feeder_if.h mixer_if.h
+SRCS+= ac97_if.c channel_if.c feeder_if.c mixer_if.c
+SRCS+= feeder.c feeder_rate.c feeder_volume.c
+SRCS+= feeder_chain.c feeder_eq.c feeder_format.c
+SRCS+= feeder_matrix.c feeder_mixer.c
+SRCS+= feeder_eq_gen.h feeder_rate_gen.h snd_fxdiv_gen.h
+SRCS+= mpu_if.h mpufoi_if.h synth_if.h
+SRCS+= mpu_if.c mpufoi_if.c synth_if.c
+SRCS+= ac97.c ac97_patch.c buffer.c channel.c clone.c dsp.c
+SRCS+= mixer.c sndstat.c sound.c unit.c vchan.c
+SRCS+= midi.c mpu401.c sequencer.c
+
+feeder_eq_gen.h: ${SYSDIR}/tools/sound/feeder_eq_mkfilter.awk
+ ${AWK} -f ${SYSDIR}/tools/sound/feeder_eq_mkfilter.awk -- ${FEEDER_EQ_PRESETS} > ${.TARGET}
+
+feeder_rate_gen.h: ${SYSDIR}/tools/sound/feeder_rate_mkfilter.awk
+ ${AWK} -f ${SYSDIR}/tools/sound/feeder_rate_mkfilter.awk -- ${FEEDER_RATE_PRESETS} > ${.TARGET}
+
+snd_fxdiv_gen.h: ${SYSDIR}/tools/sound/snd_fxdiv_gen.awk
+ ${AWK} -f ${SYSDIR}/tools/sound/snd_fxdiv_gen.awk -- > ${.TARGET}
+
+CLEANFILES+= feeder_eq_gen.h feeder_rate_gen.h snd_fxdiv_gen.h
+
+EXPORT_SYMS= YES # XXX evaluate
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/speaker/Makefile b/sys/modules/speaker/Makefile
new file mode 100644
index 000000000000..91b3312c2301
--- /dev/null
+++ b/sys/modules/speaker/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/speaker
+
+KMOD= speaker
+SRCS= spkr.c
+SRCS+= bus_if.h device_if.h isa_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/spi/Makefile b/sys/modules/spi/Makefile
new file mode 100644
index 000000000000..494ff6dc2dcf
--- /dev/null
+++ b/sys/modules/spi/Makefile
@@ -0,0 +1,13 @@
+
+SUBDIR = \
+ ../spigen \
+ at45d \
+ ${_atopcase} \
+ mx25l \
+ spibus \
+
+.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
+_atopcase=atopcase
+.endif
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/spi/at45d/Makefile b/sys/modules/spi/at45d/Makefile
new file mode 100644
index 000000000000..a6e27b79a339
--- /dev/null
+++ b/sys/modules/spi/at45d/Makefile
@@ -0,0 +1,18 @@
+
+.PATH: ${SRCTOP}/sys/dev/flash
+
+KMOD= at45d
+SRCS= at45d.c
+
+# Generated files...
+SRCS+= \
+ bus_if.h \
+ device_if.h \
+ opt_platform.h \
+ spibus_if.h \
+
+.if !empty(OPT_FDT)
+SRCS+= ofw_bus_if.h
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/spi/atopcase/Makefile b/sys/modules/spi/atopcase/Makefile
new file mode 100644
index 000000000000..a6acb14ce87a
--- /dev/null
+++ b/sys/modules/spi/atopcase/Makefile
@@ -0,0 +1,7 @@
+.PATH: ${SRCTOP}/sys/dev/atopcase
+KMOD= atopcase
+SRCS= atopcase.c atopcase_acpi.c
+SRCS+= acpi_if.h backlight_if.h bus_if.h device_if.h hid_if.h opt_acpi.h \
+ opt_hid.h opt_spi.h spibus_if.h usbdevs.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/spi/mx25l/Makefile b/sys/modules/spi/mx25l/Makefile
new file mode 100644
index 000000000000..0c52f1f760c0
--- /dev/null
+++ b/sys/modules/spi/mx25l/Makefile
@@ -0,0 +1,18 @@
+
+.PATH: ${SRCTOP}/sys/dev/flash
+
+KMOD= mx25l
+SRCS= mx25l.c
+
+# Generated files...
+SRCS+= \
+ bus_if.h \
+ device_if.h \
+ opt_platform.h \
+ spibus_if.h \
+
+.if !empty(OPT_FDT)
+SRCS+= ofw_bus_if.h
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/spi/spibus/Makefile b/sys/modules/spi/spibus/Makefile
new file mode 100644
index 000000000000..834fbdb2717b
--- /dev/null
+++ b/sys/modules/spi/spibus/Makefile
@@ -0,0 +1,26 @@
+
+.PATH: ${SRCTOP}/sys/dev/spibus
+
+KMOD= spibus
+SRCS= spibus.c
+
+.if !empty(OPT_FDT)
+SRCS+= ofw_spibus.c ofw_bus_if.h
+.endif
+
+.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
+ ${MACHINE_CPUARCH} == "i386"
+SRCS+= acpi_spibus.c opt_acpi.h acpi_if.h
+.endif
+
+# Generated files...
+SRCS+= \
+ bus_if.h \
+ device_if.h \
+ opt_platform.h \
+ spibus_if.c \
+ spibus_if.h \
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/spigen/Makefile b/sys/modules/spigen/Makefile
new file mode 100644
index 000000000000..e23d7dd214bf
--- /dev/null
+++ b/sys/modules/spigen/Makefile
@@ -0,0 +1,20 @@
+
+.PATH: ${SRCTOP}/sys/dev/spibus
+KMOD= spigen
+SRCS= spigen.c
+
+# Generated files...
+SRCS+= \
+ bus_if.h \
+ device_if.h \
+ opt_platform.h \
+ opt_spi.h \
+ spibus_if.h \
+
+.if !empty(OPT_FDT)
+SRCS+= ofw_bus_if.h
+.endif
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/splash/Makefile b/sys/modules/splash/Makefile
new file mode 100644
index 000000000000..8af6313e578f
--- /dev/null
+++ b/sys/modules/splash/Makefile
@@ -0,0 +1,4 @@
+
+SUBDIR= bmp pcx txt
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/splash/Makefile.inc b/sys/modules/splash/Makefile.inc
new file mode 100644
index 000000000000..d3b5cbd3a79b
--- /dev/null
+++ b/sys/modules/splash/Makefile.inc
@@ -0,0 +1,2 @@
+
+.include "../Makefile.inc"
diff --git a/sys/modules/splash/bmp/Makefile b/sys/modules/splash/bmp/Makefile
new file mode 100644
index 000000000000..8bb4e09590e5
--- /dev/null
+++ b/sys/modules/splash/bmp/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/fb
+
+KMOD= splash_bmp
+SRCS= splash_bmp.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/splash/pcx/Makefile b/sys/modules/splash/pcx/Makefile
new file mode 100644
index 000000000000..e29d24ab69a4
--- /dev/null
+++ b/sys/modules/splash/pcx/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/fb
+
+KMOD= splash_pcx
+SRCS= splash_pcx.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/splash/txt/Makefile b/sys/modules/splash/txt/Makefile
new file mode 100644
index 000000000000..e55632edab1c
--- /dev/null
+++ b/sys/modules/splash/txt/Makefile
@@ -0,0 +1,6 @@
+.PATH: ${SRCTOP}/sys/dev/fb
+
+KMOD= splash_txt
+SRCS= splash_txt.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ste/Makefile b/sys/modules/ste/Makefile
new file mode 100644
index 000000000000..552d84f2c91e
--- /dev/null
+++ b/sys/modules/ste/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/ste
+
+KMOD= if_ste
+SRCS= if_ste.c device_if.h bus_if.h pci_if.h
+SRCS+= miibus_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/stge/Makefile b/sys/modules/stge/Makefile
new file mode 100644
index 000000000000..31bdb03fde2e
--- /dev/null
+++ b/sys/modules/stge/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/stge
+
+KMOD= if_stge
+SRCS= if_stge.c device_if.h bus_if.h pci_if.h
+SRCS+= miibus_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sume/Makefile b/sys/modules/sume/Makefile
new file mode 100644
index 000000000000..f10e26a71532
--- /dev/null
+++ b/sys/modules/sume/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/sume
+
+KMOD= if_sume
+SRCS= if_sume.c
+SRCS+= device_if.h bus_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/superio/Makefile b/sys/modules/superio/Makefile
new file mode 100644
index 000000000000..1936c86395ba
--- /dev/null
+++ b/sys/modules/superio/Makefile
@@ -0,0 +1,10 @@
+
+.PATH: ${.CURDIR}/../../dev/superio
+
+KMOD= superio
+SRCS= superio.c
+SRCS+= device_if.h bus_if.h isa_if.h
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sym/Makefile b/sys/modules/sym/Makefile
new file mode 100644
index 000000000000..a3ca47eee715
--- /dev/null
+++ b/sys/modules/sym/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/sym
+
+KMOD= sym
+SRCS= sym_hipd.c opt_sym.h opt_cam.h opt_scsi.h
+SRCS+= device_if.h bus_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/syscons/Makefile b/sys/modules/syscons/Makefile
new file mode 100644
index 000000000000..83c2e34bfcb7
--- /dev/null
+++ b/sys/modules/syscons/Makefile
@@ -0,0 +1,16 @@
+
+SUBDIR= beastie \
+ blank \
+ daemon \
+ dragon \
+ fade \
+ fire \
+ green \
+ logo \
+ plasma \
+ rain \
+ snake \
+ star \
+ warp
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/syscons/Makefile.inc b/sys/modules/syscons/Makefile.inc
new file mode 100644
index 000000000000..d3b5cbd3a79b
--- /dev/null
+++ b/sys/modules/syscons/Makefile.inc
@@ -0,0 +1,2 @@
+
+.include "../Makefile.inc"
diff --git a/sys/modules/syscons/beastie/Makefile b/sys/modules/syscons/beastie/Makefile
new file mode 100644
index 000000000000..263f2940f69b
--- /dev/null
+++ b/sys/modules/syscons/beastie/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/syscons/logo
+
+KMOD= beastie_saver
+SRCS= beastie.c logo_saver.c
+
+CFLAGS+=-DBEASTIE_LOGO
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/syscons/blank/Makefile b/sys/modules/syscons/blank/Makefile
new file mode 100644
index 000000000000..763d895cb32b
--- /dev/null
+++ b/sys/modules/syscons/blank/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/syscons/blank
+
+KMOD= blank_saver
+SRCS= blank_saver.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/syscons/daemon/Makefile b/sys/modules/syscons/daemon/Makefile
new file mode 100644
index 000000000000..296fc734513a
--- /dev/null
+++ b/sys/modules/syscons/daemon/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/syscons/daemon
+
+KMOD= daemon_saver
+SRCS= daemon_saver.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/syscons/dragon/Makefile b/sys/modules/syscons/dragon/Makefile
new file mode 100644
index 000000000000..6f2b2fbac27f
--- /dev/null
+++ b/sys/modules/syscons/dragon/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/syscons/dragon
+
+KMOD= dragon_saver
+SRCS= dragon_saver.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/syscons/fade/Makefile b/sys/modules/syscons/fade/Makefile
new file mode 100644
index 000000000000..e04df9da9fe7
--- /dev/null
+++ b/sys/modules/syscons/fade/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/syscons/fade
+
+KMOD= fade_saver
+SRCS= fade_saver.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/syscons/fire/Makefile b/sys/modules/syscons/fire/Makefile
new file mode 100644
index 000000000000..83c5cd60a04d
--- /dev/null
+++ b/sys/modules/syscons/fire/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/syscons/fire
+
+KMOD= fire_saver
+SRCS= fire_saver.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/syscons/green/Makefile b/sys/modules/syscons/green/Makefile
new file mode 100644
index 000000000000..be5db35f864a
--- /dev/null
+++ b/sys/modules/syscons/green/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/syscons/green
+
+KMOD= green_saver
+SRCS= green_saver.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/syscons/logo/Makefile b/sys/modules/syscons/logo/Makefile
new file mode 100644
index 000000000000..0a3e9c6c2af7
--- /dev/null
+++ b/sys/modules/syscons/logo/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/syscons/logo
+
+KMOD= logo_saver
+SRCS= logo_saver.c logo.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/syscons/plasma/Makefile b/sys/modules/syscons/plasma/Makefile
new file mode 100644
index 000000000000..dd47c7e1e214
--- /dev/null
+++ b/sys/modules/syscons/plasma/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/syscons/plasma
+
+KMOD= plasma_saver
+SRCS= fp16.c plasma_saver.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/syscons/rain/Makefile b/sys/modules/syscons/rain/Makefile
new file mode 100644
index 000000000000..8041246c1260
--- /dev/null
+++ b/sys/modules/syscons/rain/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/syscons/rain
+
+KMOD= rain_saver
+SRCS= rain_saver.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/syscons/snake/Makefile b/sys/modules/syscons/snake/Makefile
new file mode 100644
index 000000000000..23bd60b6b626
--- /dev/null
+++ b/sys/modules/syscons/snake/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/syscons/snake
+
+KMOD= snake_saver
+SRCS= snake_saver.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/syscons/star/Makefile b/sys/modules/syscons/star/Makefile
new file mode 100644
index 000000000000..25ece2cb02fe
--- /dev/null
+++ b/sys/modules/syscons/star/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/syscons/star
+
+KMOD= star_saver
+SRCS= star_saver.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/syscons/warp/Makefile b/sys/modules/syscons/warp/Makefile
new file mode 100644
index 000000000000..e3970032de25
--- /dev/null
+++ b/sys/modules/syscons/warp/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/syscons/warp
+
+KMOD= warp_saver
+SRCS= warp_saver.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sysvipc/Makefile b/sys/modules/sysvipc/Makefile
new file mode 100644
index 000000000000..fc9e27c81732
--- /dev/null
+++ b/sys/modules/sysvipc/Makefile
@@ -0,0 +1,4 @@
+
+SUBDIR= sysvmsg sysvsem sysvshm
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/sysvipc/Makefile.inc b/sys/modules/sysvipc/Makefile.inc
new file mode 100644
index 000000000000..d3b5cbd3a79b
--- /dev/null
+++ b/sys/modules/sysvipc/Makefile.inc
@@ -0,0 +1,2 @@
+
+.include "../Makefile.inc"
diff --git a/sys/modules/sysvipc/sysvmsg/Makefile b/sys/modules/sysvipc/sysvmsg/Makefile
new file mode 100644
index 000000000000..c31e69524722
--- /dev/null
+++ b/sys/modules/sysvipc/sysvmsg/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/kern
+
+KMOD= sysvmsg
+SRCS= sysv_msg.c opt_sysvipc.h
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sysvipc/sysvsem/Makefile b/sys/modules/sysvipc/sysvsem/Makefile
new file mode 100644
index 000000000000..516d275f41e5
--- /dev/null
+++ b/sys/modules/sysvipc/sysvsem/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/kern
+
+KMOD= sysvsem
+SRCS= sysv_sem.c opt_sysvipc.h
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/sysvipc/sysvshm/Makefile b/sys/modules/sysvipc/sysvshm/Makefile
new file mode 100644
index 000000000000..6add9050736a
--- /dev/null
+++ b/sys/modules/sysvipc/sysvshm/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/kern
+
+KMOD= sysvshm
+SRCS= sysv_shm.c opt_sysvipc.h
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/tarfs/Makefile b/sys/modules/tarfs/Makefile
new file mode 100644
index 000000000000..1510d2ea58b5
--- /dev/null
+++ b/sys/modules/tarfs/Makefile
@@ -0,0 +1,22 @@
+
+.PATH: ${.CURDIR:H:H}/fs/tarfs
+
+KMOD= tarfs
+SRCS= opt_tarfs.h \
+ vnode_if.h \
+ tarfs_io.c \
+ tarfs_subr.c \
+ tarfs_vnops.c \
+ tarfs_vfsops.c
+
+.if !defined(KERNBUILDDIR)
+CFLAGS+= -DZSTDIO
+.ifdef TARFS_DEBUG
+CFLAGS+= -DTARFS_DEBUG
+.endif
+.endif
+
+SRCS+= opt_zstdio.h
+CFLAGS+= -I${SRCTOP}/sys/contrib/zstd/lib/freebsd
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/tcp/Makefile b/sys/modules/tcp/Makefile
new file mode 100644
index 000000000000..364c0326c40d
--- /dev/null
+++ b/sys/modules/tcp/Makefile
@@ -0,0 +1,20 @@
+#
+#
+
+.include <kmod.opts.mk>
+
+SUBDIR= \
+ ${_tcp_bbr} \
+ ${_tcp_rack} \
+ ${_tcpmd5} \
+
+.if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \
+ defined(ALL_MODULES)
+_tcp_bbr= bbr
+_tcp_rack= rack
+.if ${KERN_OPTS:MIPSEC_SUPPORT} && !${KERN_OPTS:MTCP_SIGNATURE}
+_tcpmd5= tcpmd5
+.endif
+.endif
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/tcp/bbr/Makefile b/sys/modules/tcp/bbr/Makefile
new file mode 100644
index 000000000000..e18b8f007289
--- /dev/null
+++ b/sys/modules/tcp/bbr/Makefile
@@ -0,0 +1,22 @@
+#
+#
+
+.PATH: ${.CURDIR}/../../../netinet/tcp_stacks
+
+STACKNAME= bbr
+KMOD= tcp_${STACKNAME}
+SRCS= bbr.c sack_filter.c rack_bbr_common.c
+
+SRCS+= opt_inet.h opt_inet6.h opt_ipsec.h
+SRCS+= opt_kern_tls.h
+SRCS+= opt_ratelimit.h
+
+#
+# Enable full debugging
+#
+#CFLAGS += -g
+
+CFLAGS+= -DMODNAME=${KMOD}
+CFLAGS+= -DSTACKNAME=${STACKNAME}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/tcp/rack/Makefile b/sys/modules/tcp/rack/Makefile
new file mode 100644
index 000000000000..c5bb20602337
--- /dev/null
+++ b/sys/modules/tcp/rack/Makefile
@@ -0,0 +1,22 @@
+#
+#
+
+.PATH: ${.CURDIR}/../../../netinet/tcp_stacks
+
+STACKNAME= rack
+KMOD= tcp_${STACKNAME}
+SRCS= rack.c sack_filter.c rack_bbr_common.c tailq_hash.c
+
+SRCS+= opt_inet.h opt_inet6.h opt_ipsec.h
+SRCS+= opt_kern_tls.h
+SRCS+= opt_ratelimit.h
+
+#
+# Enable full debugging
+#
+#CFLAGS += -g
+
+CFLAGS+= -DMODNAME=${KMOD}
+CFLAGS+= -DSTACKNAME=${STACKNAME}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/tcp/tcpmd5/Makefile b/sys/modules/tcp/tcpmd5/Makefile
new file mode 100644
index 000000000000..15a71e9fe25c
--- /dev/null
+++ b/sys/modules/tcp/tcpmd5/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/netipsec
+
+KMOD= tcpmd5
+SRCS= xform_tcp.c opt_inet.h opt_inet6.h opt_ipsec.h opt_kern_tls.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/tests/Makefile b/sys/modules/tests/Makefile
new file mode 100644
index 000000000000..abc077ffa2df
--- /dev/null
+++ b/sys/modules/tests/Makefile
@@ -0,0 +1,8 @@
+
+SUBDIR+= framework
+SUBDIR+= .WAIT
+SUBDIR+= callout_test
+
+SUBDIR_PARALLEL=
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/tests/callout_test/Makefile b/sys/modules/tests/callout_test/Makefile
new file mode 100644
index 000000000000..7cab464b8fc4
--- /dev/null
+++ b/sys/modules/tests/callout_test/Makefile
@@ -0,0 +1,14 @@
+#
+#
+
+.PATH: ${SRCTOP}/sys/tests/callout_test
+
+KMOD= callout_test
+SRCS= callout_test.c
+
+#
+# Enable full debugging
+#
+#CFLAGS += -g
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/tests/fib_lookup/Makefile b/sys/modules/tests/fib_lookup/Makefile
new file mode 100644
index 000000000000..8ad6340acdf3
--- /dev/null
+++ b/sys/modules/tests/fib_lookup/Makefile
@@ -0,0 +1,10 @@
+
+SYSDIR?=${SRCTOP}/sys
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+.PATH: ${SYSDIR}/tests/fib_lookup
+
+KMOD= test_lookup
+SRCS= opt_inet.h opt_inet6.h fib_lookup.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/tests/framework/Makefile b/sys/modules/tests/framework/Makefile
new file mode 100644
index 000000000000..587c5a36fb24
--- /dev/null
+++ b/sys/modules/tests/framework/Makefile
@@ -0,0 +1,15 @@
+#
+#
+
+.PATH: ${SRCTOP}/sys/tests/framework
+
+KMOD= kern_testfrwk
+SRCS= kern_testfrwk.c
+SRCS+= bus_if.h device_if.h
+
+#
+# Enable full debugging
+#
+#CFLAGS += -g
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ti/Makefile b/sys/modules/ti/Makefile
new file mode 100644
index 000000000000..2f60b2225d28
--- /dev/null
+++ b/sys/modules/ti/Makefile
@@ -0,0 +1,9 @@
+# Module for Alteon Networks Tigon PCI gigabit ethernet driver for FreeBSD.
+# Modules for Texas Instruments ARM SoCs are located in sys/modules/arm_ti.
+
+.PATH: ${SRCTOP}/sys/dev/ti
+
+KMOD= if_ti
+SRCS= if_ti.c device_if.h bus_if.h pci_if.h opt_ti.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/tmpfs/Makefile b/sys/modules/tmpfs/Makefile
new file mode 100644
index 000000000000..7a778c487cf5
--- /dev/null
+++ b/sys/modules/tmpfs/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/fs/tmpfs
+
+KMOD= tmpfs
+SRCS= vnode_if.h \
+ tmpfs_vnops.c tmpfs_fifoops.c tmpfs_vfsops.c tmpfs_subr.c \
+ opt_tmpfs.h opt_ddb.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/toecore/Makefile b/sys/modules/toecore/Makefile
new file mode 100644
index 000000000000..90cb4103c759
--- /dev/null
+++ b/sys/modules/toecore/Makefile
@@ -0,0 +1,10 @@
+
+.PATH: ${SRCTOP}/sys/netinet
+
+KMOD= toecore
+SRCS= toecore.c
+SRCS+= opt_ofed.h opt_inet.h opt_inet6.h opt_kern_tls.h
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/tpm/Makefile b/sys/modules/tpm/Makefile
new file mode 100644
index 000000000000..5c43f9a28209
--- /dev/null
+++ b/sys/modules/tpm/Makefile
@@ -0,0 +1,12 @@
+
+.PATH: ${SRCTOP}/sys/dev/tpm
+
+KMOD= tpm
+
+SRCS= tpm.c bus_if.h device_if.h
+#Bus specific stuff.
+SRCS+= tpm_isa.c tpm_acpi.c isa_if.h opt_acpi.h acpi_if.h
+#TPM 2.0
+SRCS+= tpm20.c tpm_crb.c tpm_tis.c opt_tpm.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/tsec/Makefile b/sys/modules/tsec/Makefile
new file mode 100644
index 000000000000..56cd28e1dbfb
--- /dev/null
+++ b/sys/modules/tsec/Makefile
@@ -0,0 +1,10 @@
+
+SYSDIR?=${SRCTOP}/sys
+
+.PATH: ${SYSDIR}/dev/tsec
+
+KMOD= if_tsec
+SRCS= if_tsec.c if_tsec_fdt.c
+SRCS+= bus_if.h device_if.h miibus_if.h miidevs.h ofw_bus_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/tws/Makefile b/sys/modules/tws/Makefile
new file mode 100644
index 000000000000..cce9037144ed
--- /dev/null
+++ b/sys/modules/tws/Makefile
@@ -0,0 +1,9 @@
+# Makefile for tws (LSI 3ware 9750 SAS2/SATA-II RAID PCIe) driver
+
+KMOD= tws
+.PATH: ${SRCTOP}/sys/dev/${KMOD}
+
+SRCS= tws.c tws_services.c tws_cam.c tws_hdm.c tws_user.c
+SRCS+= device_if.h bus_if.h pci_if.h opt_cam.h opt_scsi.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/uart/Makefile b/sys/modules/uart/Makefile
new file mode 100644
index 000000000000..38ffc2d49dd1
--- /dev/null
+++ b/sys/modules/uart/Makefile
@@ -0,0 +1,43 @@
+
+.PATH: ${SRCTOP}/sys/dev/uart
+
+.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
+ ${MACHINE_CPUARCH} == "i386"
+uart_bus_acpi=uart_bus_acpi.c
+uart_cpu_acpi=uart_cpu_acpi.c
+.endif
+
+.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" || \
+ ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "riscv"
+ofw_bus_if= ofw_bus_if.h
+.endif
+
+.if ${MACHINE} == "i386" || ${MACHINE} == "amd64"
+_uart_cpu=uart_cpu_x86.c
+.else
+_uart_cpu=uart_cpu_${MACHINE}.c
+.endif
+.if exists(${.CURDIR:H:H}/dev/uart/${_uart_cpu})
+uart_cpu_machine= ${_uart_cpu}
+.endif
+
+.if ${MACHINE} == "arm64"
+uart_dev_mvebu=uart_dev_mvebu.c
+.if !empty(OPT_FDT)
+uart_dev_mu=uart_dev_mu.c
+.endif
+.endif
+
+KMOD= uart
+SRCS= ${uart_bus_acpi} uart_bus_isa.c \
+ uart_bus_pci.c uart_bus_puc.c uart_bus_scc.c \
+ uart_core.c ${uart_cpu_acpi} ${uart_cpu_machine} uart_dbg.c \
+ ${uart_dev_mvebu} uart_dev_ns8250.c ${uart_dev_mu} \
+ uart_dev_quicc.c uart_dev_z8530.c \
+ uart_if.c uart_if.h uart_subr.c uart_tty.c
+
+SRCS+= acpi_if.h bus_if.h device_if.h isa_if.h ${ofw_bus_if} pci_if.h \
+ serdev_if.h
+SRCS+= opt_acpi.h opt_platform.h opt_uart.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ubser/Makefile b/sys/modules/ubser/Makefile
new file mode 100644
index 000000000000..2543659e4a05
--- /dev/null
+++ b/sys/modules/ubser/Makefile
@@ -0,0 +1,8 @@
+
+S= ${SRCTOP}/sys
+.PATH: $S/dev/usb/serial
+
+KMOD= ubser
+SRCS= ubser.c opt_usb.h device_if.h bus_if.h usbdevs.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/uchcom/Makefile b/sys/modules/uchcom/Makefile
new file mode 100644
index 000000000000..d8d7e7b417c6
--- /dev/null
+++ b/sys/modules/uchcom/Makefile
@@ -0,0 +1,8 @@
+
+S= ${SRCTOP}/sys
+.PATH: $S/dev/usb/serial
+
+KMOD= uchcom
+SRCS= uchcom.c opt_usb.h device_if.h bus_if.h usbdevs.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ucycom/Makefile b/sys/modules/ucycom/Makefile
new file mode 100644
index 000000000000..490c84368c10
--- /dev/null
+++ b/sys/modules/ucycom/Makefile
@@ -0,0 +1,8 @@
+
+S= ${SRCTOP}/sys
+.PATH: $S/dev/usb/serial
+
+KMOD= ucycom
+SRCS= ucycom.c opt_usb.h device_if.h bus_if.h usbdevs.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/udf/Makefile b/sys/modules/udf/Makefile
new file mode 100644
index 000000000000..45e7c6cca186
--- /dev/null
+++ b/sys/modules/udf/Makefile
@@ -0,0 +1,10 @@
+
+.PATH: ${SRCTOP}/sys/fs/udf
+
+KMOD= udf
+
+SRCS= udf_vfsops.c udf_vnops.c osta.c
+SRCS+= vnode_if.h
+EXPORT_SYMS= udf_iconv
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/udf_iconv/Makefile b/sys/modules/udf_iconv/Makefile
new file mode 100644
index 000000000000..13dd047c0ba6
--- /dev/null
+++ b/sys/modules/udf_iconv/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/fs/udf
+KMOD= udf_iconv
+SRCS= udf_iconv.c
+
+CFLAGS+= -I${SRCTOP}/sys/
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/ufs/Makefile b/sys/modules/ufs/Makefile
new file mode 100644
index 000000000000..225f6b09ac68
--- /dev/null
+++ b/sys/modules/ufs/Makefile
@@ -0,0 +1,18 @@
+
+.PATH: ${SRCTOP}/sys/ufs/ufs ${SRCTOP}/sys/ufs/ffs
+
+KMOD= ufs
+SRCS= opt_ddb.h opt_directio.h opt_ffs.h opt_quota.h opt_suiddir.h opt_ufs.h \
+ vnode_if.h ufs_acl.c ufs_bmap.c ufs_dirhash.c ufs_extattr.c \
+ ufs_gjournal.c ufs_inode.c ufs_lookup.c ufs_quota.c ufs_vfsops.c \
+ ufs_vnops.c ffs_alloc.c ffs_balloc.c ffs_inode.c ffs_rawread.c \
+ ffs_snapshot.c ffs_softdep.c ffs_subr.c ffs_suspend.c ffs_tables.c \
+ ffs_vfsops.c ffs_vnops.c
+
+.if !defined(KERNBUILDDIR)
+CFLAGS+= -DSOFTUPDATES -DUFS_DIRHASH
+.endif
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/uinput/Makefile b/sys/modules/uinput/Makefile
new file mode 100644
index 000000000000..623151c580a3
--- /dev/null
+++ b/sys/modules/uinput/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/evdev
+
+KMOD= uinput
+SRCS= uinput.c
+SRCS+= opt_evdev.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/unionfs/Makefile b/sys/modules/unionfs/Makefile
new file mode 100644
index 000000000000..b3edfe7f5dd2
--- /dev/null
+++ b/sys/modules/unionfs/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/fs/unionfs
+
+KMOD= unionfs
+SRCS= vnode_if.h \
+ union_subr.c union_vfsops.c union_vnops.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/Makefile b/sys/modules/usb/Makefile
new file mode 100644
index 000000000000..2c593495b9a4
--- /dev/null
+++ b/sys/modules/usb/Makefile
@@ -0,0 +1,106 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+SYSDIR?=${SRCTOP}/sys
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+#
+# Check for common USB debug flags to pass when building the USB
+# modules in this directory:
+#
+.if defined(USB_DEBUG)
+MAKE+=" DEBUG_FLAGS+=-DUSB_DEBUG"
+.endif
+
+.if defined(USB_DEBUG) && defined(USB_REQ_DEBUG)
+MAKE+=" DEBUG_FLAGS+=-DUSB_REQ_DEBUG"
+.endif
+
+# Modules that include binary-only blobs of microcode should be selectable by
+# MK_SOURCELESS_UCODE option (see below).
+
+SUBDIR = usb
+SUBDIR += ${_dwc_otg} ehci ${_musb} ohci uhci xhci ${_uss820dci} \
+ ${_atmegadci} ${_avr32dci} ${_rsu} ${_rsufw}
+SUBDIR += ${_rum} ${_run} ${_runfw} ${_uath} upgt usie ural ${_zyd} ${_urtw}
+SUBDIR += atp cfumass uhid uhid_snes ukbd ums udbp uep wmt wsp ugold uled \
+ usbhid
+SUBDIR += ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipaq ulpt \
+ umct umcs umodem umoscom uplcom uslcom uvisor uvscom
+SUBDIR += cp2112
+SUBDIR += udl
+SUBDIR += uether aue axe axge cdce cdceem cue ${_kue} mos rue smsc udav uhso \
+ ipheth
+SUBDIR += muge
+SUBDIR += ure urndis
+SUBDIR += usfs umass urio
+SUBDIR += ${_uacpi}
+SUBDIR += quirk template
+SUBDIR += ${_g_audio} ${_g_keyboard} ${_g_modem} ${_g_mouse}
+
+.if ${MK_USB_GADGET_EXAMPLES} == "yes"
+_g_audio= g_audio
+_g_keyboard= g_keyboard
+_g_modem= g_modem
+_g_mouse= g_mouse
+.endif
+
+.if ${MK_SOURCELESS_UCODE} != "no"
+_rum= rum
+_uath= uath
+_zyd= zyd
+_kue= kue
+_run= run
+_rsu= rsu
+_rsufw= rsufw
+_runfw= runfw
+.endif
+
+.if ${MACHINE_CPUARCH} == "amd64"
+_urtw= urtw
+.endif
+
+.if ${MACHINE_CPUARCH} == "arm"
+_atmegadci= atmegadci
+_dwc_otg= dwc_otg
+_musb= musb
+_uss820dci= uss820dci
+.endif
+
+.if ${MACHINE_CPUARCH} == "i386"
+_urtw= urtw
+.endif
+
+.if ${MACHINE_CPUARCH} == "avr32"
+_avr32dci= avr32dci
+.endif
+
+.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
+ ${MACHINE_CPUARCH} == "i386"
+_uacpi= uacpi
+.endif
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/usb/atmegadci/Makefile b/sys/modules/usb/atmegadci/Makefile
new file mode 100644
index 000000000000..1cbd4965d1cf
--- /dev/null
+++ b/sys/modules/usb/atmegadci/Makefile
@@ -0,0 +1,41 @@
+#
+#
+# Copyright (c) 2009 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/controller
+
+KMOD= atmegadci
+SRCS= bus_if.h device_if.h usb_if.h \
+ opt_bus.h opt_usb.h \
+ atmegadci.c \
+ pci_if.h
+
+.if defined(HAS_ATMELARM)
+SRCS+= atmegadci_atmelarm.c
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/atp/Makefile b/sys/modules/usb/atp/Makefile
new file mode 100644
index 000000000000..ae7bccda3ae2
--- /dev/null
+++ b/sys/modules/usb/atp/Makefile
@@ -0,0 +1,10 @@
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/input
+
+KMOD= atp
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h vnode_if.h usbdevs.h \
+ atp.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/aue/Makefile b/sys/modules/usb/aue/Makefile
new file mode 100644
index 000000000000..4ce5ab41d4f4
--- /dev/null
+++ b/sys/modules/usb/aue/Makefile
@@ -0,0 +1,36 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/net
+
+KMOD= if_aue
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ miibus_if.h opt_inet.h \
+ if_aue.c opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/avr32dci/Makefile b/sys/modules/usb/avr32dci/Makefile
new file mode 100644
index 000000000000..9aa5cb22904f
--- /dev/null
+++ b/sys/modules/usb/avr32dci/Makefile
@@ -0,0 +1,37 @@
+#
+#
+# Copyright (c) 2011 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/controller
+
+KMOD= avr32dci
+SRCS= bus_if.h device_if.h usb_if.h \
+ opt_bus.h opt_usb.h \
+ avr32dci.c \
+ pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/axe/Makefile b/sys/modules/usb/axe/Makefile
new file mode 100644
index 000000000000..b71c561f8236
--- /dev/null
+++ b/sys/modules/usb/axe/Makefile
@@ -0,0 +1,36 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/net
+
+KMOD= if_axe
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ miibus_if.h opt_inet.h \
+ if_axe.c opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/axge/Makefile b/sys/modules/usb/axge/Makefile
new file mode 100644
index 000000000000..cc1ad19068c7
--- /dev/null
+++ b/sys/modules/usb/axge/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/usb/net
+
+KMOD= if_axge
+SRCS+= if_axge.c usbdevs.h
+SRCS+= bus_if.h device_if.h miibus_if.h usb_if.h \
+ opt_bus.h opt_inet.h opt_usb.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/cdce/Makefile b/sys/modules/usb/cdce/Makefile
new file mode 100644
index 000000000000..d74fb605ef99
--- /dev/null
+++ b/sys/modules/usb/cdce/Makefile
@@ -0,0 +1,36 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/net
+
+KMOD= if_cdce
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ miibus_if.h opt_inet.h \
+ if_cdce.c opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/cdceem/Makefile b/sys/modules/usb/cdceem/Makefile
new file mode 100644
index 000000000000..692035bae850
--- /dev/null
+++ b/sys/modules/usb/cdceem/Makefile
@@ -0,0 +1,10 @@
+#
+
+.PATH: ${SRCTOP}/sys/dev/usb/net
+
+KMOD= if_cdceem
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ miibus_if.h opt_inet.h \
+ if_cdceem.c opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/cfumass/Makefile b/sys/modules/usb/cfumass/Makefile
new file mode 100644
index 000000000000..72b882efadbe
--- /dev/null
+++ b/sys/modules/usb/cfumass/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/usb/storage
+KMOD= cfumass
+
+SRCS= bus_if.h device_if.h opt_bus.h opt_usb.h usb_if.h usbdevs.h \
+ cfumass.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/cp2112/Makefile b/sys/modules/usb/cp2112/Makefile
new file mode 100644
index 000000000000..28d855ba38a2
--- /dev/null
+++ b/sys/modules/usb/cp2112/Makefile
@@ -0,0 +1,36 @@
+#
+#
+# Copyright (c) Andriy Gapon <avg@FreeBSD.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/misc
+
+KMOD= cp2112
+SRCS= cp2112.c
+SRCS+= opt_bus.h opt_platform.h opt_usb.h
+SRCS+= device_if.h bus_if.h gpio_if.h iicbus_if.h usb_if.h usbdevs.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/cue/Makefile b/sys/modules/usb/cue/Makefile
new file mode 100644
index 000000000000..d51d68635188
--- /dev/null
+++ b/sys/modules/usb/cue/Makefile
@@ -0,0 +1,36 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/net
+
+KMOD= if_cue
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ miibus_if.h opt_inet.h \
+ if_cue.c opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/dwc_otg/Makefile b/sys/modules/usb/dwc_otg/Makefile
new file mode 100644
index 000000000000..5cb98293f6a9
--- /dev/null
+++ b/sys/modules/usb/dwc_otg/Makefile
@@ -0,0 +1,37 @@
+#
+#
+# Copyright (c) 2012 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/controller
+
+KMOD= dwc_otg
+SRCS= bus_if.h device_if.h usb_if.h \
+ opt_bus.h opt_usb.h ofw_bus_if.h \
+ dwc_otg.c dwc_otg_fdt.c \
+ pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/ehci/Makefile b/sys/modules/usb/ehci/Makefile
new file mode 100644
index 000000000000..8c896103c055
--- /dev/null
+++ b/sys/modules/usb/ehci/Makefile
@@ -0,0 +1,37 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/controller
+
+KMOD= ehci
+SRCS= bus_if.h device_if.h usb_if.h \
+ opt_bus.h opt_usb.h \
+ ehci_pci.c ehci.c ehci.h \
+ pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/g_audio/Makefile b/sys/modules/usb/g_audio/Makefile
new file mode 100644
index 000000000000..741ef0305d4c
--- /dev/null
+++ b/sys/modules/usb/g_audio/Makefile
@@ -0,0 +1,34 @@
+#
+#
+# Copyright (c) 2010 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+.PATH: ${SRCTOP}/sys/dev/usb/gadget
+
+KMOD= g_audio
+
+SRCS= bus_if.h usb_if.h device_if.h vnode_if.h \
+ card_if.h opt_usb.h pci_if.h g_audio.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/g_keyboard/Makefile b/sys/modules/usb/g_keyboard/Makefile
new file mode 100644
index 000000000000..0a6fbbbe6579
--- /dev/null
+++ b/sys/modules/usb/g_keyboard/Makefile
@@ -0,0 +1,34 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+.PATH: ${SRCTOP}/sys/dev/usb/gadget
+
+KMOD= g_keyboard
+
+SRCS= bus_if.h usb_if.h device_if.h vnode_if.h \
+ opt_usb.h g_keyboard.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/g_modem/Makefile b/sys/modules/usb/g_modem/Makefile
new file mode 100644
index 000000000000..963095b2df08
--- /dev/null
+++ b/sys/modules/usb/g_modem/Makefile
@@ -0,0 +1,34 @@
+#
+#
+# Copyright (c) 2010 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+.PATH: ${SRCTOP}/sys/dev/usb/gadget
+
+KMOD= g_modem
+
+SRCS= bus_if.h usb_if.h device_if.h vnode_if.h \
+ card_if.h opt_usb.h pci_if.h g_modem.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/g_mouse/Makefile b/sys/modules/usb/g_mouse/Makefile
new file mode 100644
index 000000000000..2079debdc181
--- /dev/null
+++ b/sys/modules/usb/g_mouse/Makefile
@@ -0,0 +1,34 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+.PATH: ${SRCTOP}/sys/dev/usb/gadget
+
+KMOD= g_mouse
+
+SRCS= bus_if.h usb_if.h device_if.h vnode_if.h \
+ opt_usb.h g_mouse.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/ipheth/Makefile b/sys/modules/usb/ipheth/Makefile
new file mode 100644
index 000000000000..c77182fd2135
--- /dev/null
+++ b/sys/modules/usb/ipheth/Makefile
@@ -0,0 +1,36 @@
+#
+#
+# Copyright (c) 2010 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/net
+
+KMOD= if_ipheth
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ miibus_if.h opt_inet.h \
+ if_ipheth.c opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/kue/Makefile b/sys/modules/usb/kue/Makefile
new file mode 100644
index 000000000000..fb611072c699
--- /dev/null
+++ b/sys/modules/usb/kue/Makefile
@@ -0,0 +1,36 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/net
+
+KMOD= if_kue
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ miibus_if.h opt_inet.h \
+ if_kue.c opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/mos/Makefile b/sys/modules/usb/mos/Makefile
new file mode 100644
index 000000000000..6c5ae20a4ce3
--- /dev/null
+++ b/sys/modules/usb/mos/Makefile
@@ -0,0 +1,36 @@
+#
+#
+# Copyright (c) 2011 Rick van der Zwet <info@rickvanderzwet.nl>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/net
+
+KMOD= if_mos
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ miibus_if.h opt_inet.h \
+ if_mos.c opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/muge/Makefile b/sys/modules/usb/muge/Makefile
new file mode 100644
index 000000000000..7985ea81663d
--- /dev/null
+++ b/sys/modules/usb/muge/Makefile
@@ -0,0 +1,12 @@
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/net
+
+KMOD= if_muge
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ miibus_if.h miidevs.h opt_inet.h opt_platform.h ofw_bus_if.h \
+ if_muge.c
+SRCS+=
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/musb/Makefile b/sys/modules/usb/musb/Makefile
new file mode 100644
index 000000000000..aae6220df3dc
--- /dev/null
+++ b/sys/modules/usb/musb/Makefile
@@ -0,0 +1,41 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/controller
+
+KMOD= musb
+SRCS= bus_if.h device_if.h usb_if.h \
+ opt_bus.h opt_usb.h \
+ musb_otg.c \
+ pci_if.h
+
+.if defined(HAS_ATMELARM)
+SRCS+= musb_otg_atmelarm.c
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/ohci/Makefile b/sys/modules/usb/ohci/Makefile
new file mode 100644
index 000000000000..262d655eff07
--- /dev/null
+++ b/sys/modules/usb/ohci/Makefile
@@ -0,0 +1,37 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/controller
+
+KMOD= ohci
+SRCS= bus_if.h device_if.h usb_if.h \
+ opt_bus.h opt_usb.h \
+ ohci_pci.c ohci.c ohci.h \
+ pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/quirk/Makefile b/sys/modules/usb/quirk/Makefile
new file mode 100644
index 000000000000..5700cf634210
--- /dev/null
+++ b/sys/modules/usb/quirk/Makefile
@@ -0,0 +1,35 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/quirk
+
+KMOD= usb_quirk
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ usb_quirk.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/rsu/Makefile b/sys/modules/usb/rsu/Makefile
new file mode 100644
index 000000000000..d9258591a2a7
--- /dev/null
+++ b/sys/modules/usb/rsu/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/usb/wlan
+
+KMOD = if_rsu
+SRCS = if_rsu.c if_rsureg.h \
+ bus_if.h device_if.h \
+ opt_bus.h opt_usb.h opt_wlan.h usb_if.h usbdevs.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/rsufw/Makefile b/sys/modules/usb/rsufw/Makefile
new file mode 100644
index 000000000000..ae154d51f979
--- /dev/null
+++ b/sys/modules/usb/rsufw/Makefile
@@ -0,0 +1,4 @@
+
+SUBDIR= rsurtl8712fw
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/usb/rsufw/Makefile.inc b/sys/modules/usb/rsufw/Makefile.inc
new file mode 100644
index 000000000000..582c34aa8ebd
--- /dev/null
+++ b/sys/modules/usb/rsufw/Makefile.inc
@@ -0,0 +1,14 @@
+#
+# Common rules for building firmware. Note this gets auto-included
+# by the subdir Makefile's as a consequence of included bsd.kmod.mk.
+
+_FIRM= ${IMG}.fw
+
+CLEANFILES+= ${_FIRM}
+
+FIRMWS= ${_FIRM}:${KMOD}:120
+
+# FIRMWARE_LICENSE= realtek
+
+${_FIRM}: ${SRCTOP}/sys/contrib/dev/rsu/${_FIRM}.uu
+ uudecode -p ${.ALLSRC} > ${.TARGET}
diff --git a/sys/modules/usb/rsufw/rsurtl8712fw/Makefile b/sys/modules/usb/rsufw/rsurtl8712fw/Makefile
new file mode 100644
index 000000000000..cdeeb8f73333
--- /dev/null
+++ b/sys/modules/usb/rsufw/rsurtl8712fw/Makefile
@@ -0,0 +1,5 @@
+
+KMOD= rsu-rtl8712fw
+IMG= rsu-rtl8712fw
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/rue/Makefile b/sys/modules/usb/rue/Makefile
new file mode 100644
index 000000000000..1c06189f3c62
--- /dev/null
+++ b/sys/modules/usb/rue/Makefile
@@ -0,0 +1,35 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/net
+
+KMOD= if_rue
+SRCS= bus_if.h device_if.h miibus_if.h miidevs.h if_rue.c opt_bus.h
+SRCS+= opt_inet.h opt_usb.h ruephy.c usb_if.h usbdevs.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/rum/Makefile b/sys/modules/usb/rum/Makefile
new file mode 100644
index 000000000000..58a168ced263
--- /dev/null
+++ b/sys/modules/usb/rum/Makefile
@@ -0,0 +1,35 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/wlan
+
+KMOD= if_rum
+SRCS= opt_bus.h opt_usb.h opt_wlan.h device_if.h bus_if.h usb_if.h \
+ usbdevs.h if_rum.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/run/Makefile b/sys/modules/usb/run/Makefile
new file mode 100644
index 000000000000..ec3ebe22671f
--- /dev/null
+++ b/sys/modules/usb/run/Makefile
@@ -0,0 +1,35 @@
+#
+#
+# Copyright (c) 2010 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/wlan
+
+KMOD= if_run
+SRCS= opt_bus.h opt_usb.h opt_wlan.h device_if.h bus_if.h usb_if.h \
+ usbdevs.h if_run.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/runfw/Makefile b/sys/modules/usb/runfw/Makefile
new file mode 100644
index 000000000000..6369337268be
--- /dev/null
+++ b/sys/modules/usb/runfw/Makefile
@@ -0,0 +1,10 @@
+
+KMOD= runfw
+FIRMWS= run.fw:runfw:1
+
+CLEANFILES= run.fw
+
+run.fw: ${SRCTOP}/sys/contrib/dev/run/rt2870.fw.uu
+ uudecode -p ${.ALLSRC} > ${.TARGET}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/smsc/Makefile b/sys/modules/usb/smsc/Makefile
new file mode 100644
index 000000000000..5aeec81d8cb1
--- /dev/null
+++ b/sys/modules/usb/smsc/Makefile
@@ -0,0 +1,37 @@
+#
+#
+# Copyright (c) 2011 Ben Gray. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/net
+
+KMOD= if_smsc
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ miibus_if.h opt_inet.h opt_platform.h \
+ if_smsc.c
+SRCS+= ofw_bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/template/Makefile b/sys/modules/usb/template/Makefile
new file mode 100644
index 000000000000..5b951ec9530e
--- /dev/null
+++ b/sys/modules/usb/template/Makefile
@@ -0,0 +1,52 @@
+#
+#
+# Copyright (c) 2008-2020 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/template
+
+KMOD= usb_template
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h vnode_if.h usbdevs.h \
+ usb_template.c \
+ usb_template_audio.c \
+ usb_template_cdce.c \
+ usb_template_kbd.c \
+ usb_template_modem.c \
+ usb_template_mouse.c \
+ usb_template_msc.c \
+ usb_template_mtp.c \
+ usb_template_phone.c \
+ usb_template_serialnet.c \
+ usb_template_midi.c \
+ usb_template_multi.c \
+ usb_template_cdceem.c
+
+#
+# NOTE:
+# Keep source list above in sync with stand/usb/usbcore.mk
+#
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/u3g/Makefile b/sys/modules/usb/u3g/Makefile
new file mode 100644
index 000000000000..62be87d15c6a
--- /dev/null
+++ b/sys/modules/usb/u3g/Makefile
@@ -0,0 +1,35 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/serial
+
+KMOD= u3g
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ u3g.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/uacpi/Makefile b/sys/modules/usb/uacpi/Makefile
new file mode 100644
index 000000000000..ebb9524565b0
--- /dev/null
+++ b/sys/modules/usb/uacpi/Makefile
@@ -0,0 +1,35 @@
+#
+#
+# Copyright (c) 2019 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+.PATH: ${SRCTOP}/sys/dev/usb
+
+KMOD= uacpi
+SRCS= bus_if.h device_if.h usb_if.h usb_if.c vnode_if.h \
+ opt_usb.h opt_bus.h opt_ddb.h \
+ opt_acpi.h acpi_if.h \
+ usb_hub_acpi.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/uark/Makefile b/sys/modules/usb/uark/Makefile
new file mode 100644
index 000000000000..a597e360085d
--- /dev/null
+++ b/sys/modules/usb/uark/Makefile
@@ -0,0 +1,35 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/serial
+
+KMOD= uark
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ uark.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/uath/Makefile b/sys/modules/usb/uath/Makefile
new file mode 100644
index 000000000000..04d167486fb2
--- /dev/null
+++ b/sys/modules/usb/uath/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/usb/wlan
+
+KMOD = if_uath
+SRCS = if_uath.c if_uathvar.h if_uathreg.h \
+ bus_if.h device_if.h \
+ opt_bus.h opt_usb.h opt_wlan.h usb_if.h usbdevs.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/ubsa/Makefile b/sys/modules/usb/ubsa/Makefile
new file mode 100644
index 000000000000..a9e5e373f9d4
--- /dev/null
+++ b/sys/modules/usb/ubsa/Makefile
@@ -0,0 +1,35 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/serial
+
+KMOD= ubsa
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ ubsa.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/ubser/Makefile b/sys/modules/usb/ubser/Makefile
new file mode 100644
index 000000000000..837da796ae35
--- /dev/null
+++ b/sys/modules/usb/ubser/Makefile
@@ -0,0 +1,35 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/serial
+
+KMOD= ubser
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ ubser.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/uchcom/Makefile b/sys/modules/usb/uchcom/Makefile
new file mode 100644
index 000000000000..cb4e97f75019
--- /dev/null
+++ b/sys/modules/usb/uchcom/Makefile
@@ -0,0 +1,35 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/serial
+
+KMOD= uchcom
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ uchcom.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/ucom/Makefile b/sys/modules/usb/ucom/Makefile
new file mode 100644
index 000000000000..1cd0b63b09d3
--- /dev/null
+++ b/sys/modules/usb/ucom/Makefile
@@ -0,0 +1,37 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/serial
+
+KMOD= ucom
+SRCS= opt_bus.h opt_usb.h opt_gdb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ usb_serial.c
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/ucycom/Makefile b/sys/modules/usb/ucycom/Makefile
new file mode 100644
index 000000000000..7df84803035e
--- /dev/null
+++ b/sys/modules/usb/ucycom/Makefile
@@ -0,0 +1,35 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/serial
+
+KMOD= ucycom
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ ucycom.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/udav/Makefile b/sys/modules/usb/udav/Makefile
new file mode 100644
index 000000000000..2e0e1e96ae2b
--- /dev/null
+++ b/sys/modules/usb/udav/Makefile
@@ -0,0 +1,36 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/net
+
+KMOD= if_udav
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ miibus_if.h opt_inet.h \
+ if_udav.c opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/udbp/Makefile b/sys/modules/usb/udbp/Makefile
new file mode 100644
index 000000000000..1b09c3171fb0
--- /dev/null
+++ b/sys/modules/usb/udbp/Makefile
@@ -0,0 +1,36 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/misc
+
+KMOD= udbp
+SRCS= opt_bus.h opt_usb.h opt_netgraph.h \
+ device_if.h bus_if.h usb_if.h usbdevs.h \
+ udbp.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/udl/Makefile b/sys/modules/usb/udl/Makefile
new file mode 100644
index 000000000000..6bc0a99f2509
--- /dev/null
+++ b/sys/modules/usb/udl/Makefile
@@ -0,0 +1,11 @@
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/video
+
+KMOD= udl
+SRCS= opt_bus.h opt_usb.h fb_if.h device_if.h \
+ bus_if.h usb_if.h vnode_if.h usbdevs.h \
+ udl.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/uep/Makefile b/sys/modules/usb/uep/Makefile
new file mode 100644
index 000000000000..e7fb87517b34
--- /dev/null
+++ b/sys/modules/usb/uep/Makefile
@@ -0,0 +1,10 @@
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/input
+
+KMOD= uep
+SRCS= opt_bus.h opt_evdev.h opt_usb.h device_if.h bus_if.h usb_if.h \
+ vnode_if.h usbdevs.h uep.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/uether/Makefile b/sys/modules/usb/uether/Makefile
new file mode 100644
index 000000000000..93cf756370b6
--- /dev/null
+++ b/sys/modules/usb/uether/Makefile
@@ -0,0 +1,38 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/net
+
+KMOD= uether
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ miibus_if.h opt_inet.h \
+ usb_ethernet.c opt_platform.h
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/ufoma/Makefile b/sys/modules/usb/ufoma/Makefile
new file mode 100644
index 000000000000..9dfcc9b1b27c
--- /dev/null
+++ b/sys/modules/usb/ufoma/Makefile
@@ -0,0 +1,35 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/serial
+
+KMOD= ufoma
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ ufoma.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/uftdi/Makefile b/sys/modules/usb/uftdi/Makefile
new file mode 100644
index 000000000000..408b93d01a40
--- /dev/null
+++ b/sys/modules/usb/uftdi/Makefile
@@ -0,0 +1,35 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/serial
+
+KMOD= uftdi
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ uftdi.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/ugensa/Makefile b/sys/modules/usb/ugensa/Makefile
new file mode 100644
index 000000000000..b72c33475f63
--- /dev/null
+++ b/sys/modules/usb/ugensa/Makefile
@@ -0,0 +1,35 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/serial
+
+KMOD= ugensa
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ ugensa.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/ugold/Makefile b/sys/modules/usb/ugold/Makefile
new file mode 100644
index 000000000000..bb9276996a27
--- /dev/null
+++ b/sys/modules/usb/ugold/Makefile
@@ -0,0 +1,12 @@
+#
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/misc
+
+KMOD= ugold
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h vnode_if.h \
+ usbdevs.h ugold.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/uhci/Makefile b/sys/modules/usb/uhci/Makefile
new file mode 100644
index 000000000000..fb97602a4ce9
--- /dev/null
+++ b/sys/modules/usb/uhci/Makefile
@@ -0,0 +1,37 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/controller
+
+KMOD= uhci
+SRCS= bus_if.h device_if.h usb_if.h \
+ opt_bus.h opt_usb.h \
+ uhci_pci.c uhci.c uhci.h \
+ pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/uhid/Makefile b/sys/modules/usb/uhid/Makefile
new file mode 100644
index 000000000000..be9eae25eb73
--- /dev/null
+++ b/sys/modules/usb/uhid/Makefile
@@ -0,0 +1,37 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/input
+
+KMOD= uhid
+SRCS= opt_bus.h opt_hid.h opt_usb.h device_if.h bus_if.h usb_if.h \
+ vnode_if.h usbdevs.h uhid.c
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/uhid_snes/Makefile b/sys/modules/usb/uhid_snes/Makefile
new file mode 100644
index 000000000000..36d6c2ba51ca
--- /dev/null
+++ b/sys/modules/usb/uhid_snes/Makefile
@@ -0,0 +1,35 @@
+#
+#
+# Copyright (c) 2018 Johannes Lundberg. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/input
+
+KMOD= uhid_snes
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h vnode_if.h usbdevs.h \
+ uhid_snes.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/uhso/Makefile b/sys/modules/usb/uhso/Makefile
new file mode 100644
index 000000000000..4553806e63fb
--- /dev/null
+++ b/sys/modules/usb/uhso/Makefile
@@ -0,0 +1,36 @@
+#
+#
+# Copyright (c) 2010 Andrew Thompson. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/net
+
+KMOD= uhso
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ opt_inet.h \
+ uhso.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/uipaq/Makefile b/sys/modules/usb/uipaq/Makefile
new file mode 100644
index 000000000000..4b4e66ad8bdc
--- /dev/null
+++ b/sys/modules/usb/uipaq/Makefile
@@ -0,0 +1,35 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/serial
+
+KMOD= uipaq
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ uipaq.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/ukbd/Makefile b/sys/modules/usb/ukbd/Makefile
new file mode 100644
index 000000000000..b723b225aec0
--- /dev/null
+++ b/sys/modules/usb/ukbd/Makefile
@@ -0,0 +1,36 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/input
+
+KMOD= ukbd
+SRCS= opt_bus.h opt_evdev.h opt_kbd.h opt_ukbd.h opt_usb.h \
+ device_if.h bus_if.h usb_if.h usbdevs.h \
+ ukbd.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/uled/Makefile b/sys/modules/usb/uled/Makefile
new file mode 100644
index 000000000000..952ea1b06cbb
--- /dev/null
+++ b/sys/modules/usb/uled/Makefile
@@ -0,0 +1,35 @@
+#
+#
+# Copyright (c) 2014 Kevin Lo. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/misc
+
+KMOD= uled
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h vnode_if.h usbdevs.h \
+ uled.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/ulpt/Makefile b/sys/modules/usb/ulpt/Makefile
new file mode 100644
index 000000000000..41b336ae8afa
--- /dev/null
+++ b/sys/modules/usb/ulpt/Makefile
@@ -0,0 +1,35 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/serial
+
+KMOD= ulpt
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h vnode_if.h usbdevs.h \
+ ulpt.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/umass/Makefile b/sys/modules/usb/umass/Makefile
new file mode 100644
index 000000000000..93d59d494685
--- /dev/null
+++ b/sys/modules/usb/umass/Makefile
@@ -0,0 +1,35 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/storage
+
+KMOD= umass
+SRCS= bus_if.h device_if.h opt_bus.h opt_cam.h opt_usb.h umass.c usb_if.h \
+ usbdevs.h vnode_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/umcs/Makefile b/sys/modules/usb/umcs/Makefile
new file mode 100644
index 000000000000..155aaccbdcbe
--- /dev/null
+++ b/sys/modules/usb/umcs/Makefile
@@ -0,0 +1,35 @@
+#
+#
+# Copyright (c) 2011 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/serial
+
+KMOD= umcs
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ umcs.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/umct/Makefile b/sys/modules/usb/umct/Makefile
new file mode 100644
index 000000000000..de611de2f3fe
--- /dev/null
+++ b/sys/modules/usb/umct/Makefile
@@ -0,0 +1,35 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/serial
+
+KMOD= umct
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ umct.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/umodem/Makefile b/sys/modules/usb/umodem/Makefile
new file mode 100644
index 000000000000..690c6b6839b7
--- /dev/null
+++ b/sys/modules/usb/umodem/Makefile
@@ -0,0 +1,35 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/serial
+
+KMOD= umodem
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ umodem.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/umoscom/Makefile b/sys/modules/usb/umoscom/Makefile
new file mode 100644
index 000000000000..6f64b03f1aee
--- /dev/null
+++ b/sys/modules/usb/umoscom/Makefile
@@ -0,0 +1,35 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/serial
+
+KMOD= umoscom
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ umoscom.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/ums/Makefile b/sys/modules/usb/ums/Makefile
new file mode 100644
index 000000000000..afb30c11d85d
--- /dev/null
+++ b/sys/modules/usb/ums/Makefile
@@ -0,0 +1,35 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/input
+
+KMOD= ums
+SRCS= opt_bus.h opt_evdev.h opt_usb.h device_if.h bus_if.h usb_if.h \
+ vnode_if.h usbdevs.h ums.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/upgt/Makefile b/sys/modules/usb/upgt/Makefile
new file mode 100644
index 000000000000..4db4b167915e
--- /dev/null
+++ b/sys/modules/usb/upgt/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/usb/wlan
+
+KMOD = if_upgt
+SRCS = if_upgt.c if_upgtvar.h \
+ bus_if.h device_if.h \
+ opt_bus.h opt_usb.h opt_wlan.h usb_if.h usbdevs.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/uplcom/Makefile b/sys/modules/usb/uplcom/Makefile
new file mode 100644
index 000000000000..961b66b639ad
--- /dev/null
+++ b/sys/modules/usb/uplcom/Makefile
@@ -0,0 +1,35 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/serial
+
+KMOD= uplcom
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ uplcom.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/ural/Makefile b/sys/modules/usb/ural/Makefile
new file mode 100644
index 000000000000..fe02b26e8a6d
--- /dev/null
+++ b/sys/modules/usb/ural/Makefile
@@ -0,0 +1,35 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/wlan
+
+KMOD= if_ural
+SRCS= opt_bus.h opt_usb.h opt_wlan.h device_if.h bus_if.h usb_if.h \
+ usbdevs.h if_ural.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/ure/Makefile b/sys/modules/usb/ure/Makefile
new file mode 100644
index 000000000000..0ff0fce8a435
--- /dev/null
+++ b/sys/modules/usb/ure/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/usb/net
+
+KMOD= if_ure
+SRCS+= if_ure.c usbdevs.h
+SRCS+= bus_if.h device_if.h miibus_if.h usb_if.h \
+ opt_bus.h opt_inet.h opt_inet6.h opt_usb.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/urio/Makefile b/sys/modules/usb/urio/Makefile
new file mode 100644
index 000000000000..62fe58ec68d8
--- /dev/null
+++ b/sys/modules/usb/urio/Makefile
@@ -0,0 +1,34 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/storage
+
+KMOD= urio
+SRCS= bus_if.h device_if.h opt_bus.h opt_usb.h usb_if.h usbdevs.h urio.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/urndis/Makefile b/sys/modules/usb/urndis/Makefile
new file mode 100644
index 000000000000..bdbb485bfe05
--- /dev/null
+++ b/sys/modules/usb/urndis/Makefile
@@ -0,0 +1,36 @@
+#
+#
+# Copyright (c) 2014 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/net
+
+KMOD= if_urndis
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ miibus_if.h opt_inet.h \
+ if_urndis.c opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/urtw/Makefile b/sys/modules/usb/urtw/Makefile
new file mode 100644
index 000000000000..89c1baf9cdea
--- /dev/null
+++ b/sys/modules/usb/urtw/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/usb/wlan
+
+KMOD = if_urtw
+SRCS = if_urtw.c if_urtwreg.h if_urtwvar.h \
+ bus_if.h device_if.h \
+ opt_bus.h opt_usb.h opt_wlan.h usb_if.h usbdevs.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/usb/Makefile b/sys/modules/usb/usb/Makefile
new file mode 100644
index 000000000000..225b210c6857
--- /dev/null
+++ b/sys/modules/usb/usb/Makefile
@@ -0,0 +1,45 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+.PATH: ${SRCTOP}/sys/dev/usb ${SRCTOP}/sys/dev/usb/controller
+
+KMOD= usb
+SRCS= bus_if.h device_if.h usb_if.h usb_if.c vnode_if.h \
+ opt_usb.h opt_bus.h opt_ddb.h \
+ usb_pf.h usbdevs.h usbdevs_data.h \
+ usb_busdma.c usb_controller.c usb_core.c usb_debug.c \
+ usb_dev.c usb_device.c usb_dynamic.c usb_error.c usb_generic.c \
+ usb_handle_request.c usb_hid.c usb_hub.c usb_lookup.c usb_mbuf.c \
+ usb_msctest.c usb_parse.c usb_pf.c usb_process.c usb_request.c \
+ usb_transfer.c usb_util.c
+
+.if !empty(OPT_FDT)
+SRCS+= usb_fdt_support.c ofw_bus_if.h
+.endif
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/usbhid/Makefile b/sys/modules/usb/usbhid/Makefile
new file mode 100644
index 000000000000..910385d1314b
--- /dev/null
+++ b/sys/modules/usb/usbhid/Makefile
@@ -0,0 +1,9 @@
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/input
+
+KMOD= usbhid
+SRCS= opt_usb.h bus_if.h device_if.h hid_if.h usb_if.h usbhid.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/usfs/Makefile b/sys/modules/usb/usfs/Makefile
new file mode 100644
index 000000000000..a8e2ae6a0da7
--- /dev/null
+++ b/sys/modules/usb/usfs/Makefile
@@ -0,0 +1,35 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/storage
+
+KMOD= usfs
+SRCS= bus_if.h device_if.h opt_bus.h opt_usb.h usb_if.h usbdevs.h \
+ ustorage_fs.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/usie/Makefile b/sys/modules/usb/usie/Makefile
new file mode 100644
index 000000000000..6a5f79248ff8
--- /dev/null
+++ b/sys/modules/usb/usie/Makefile
@@ -0,0 +1,34 @@
+#
+#
+# Copyright (c) 2011 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+.PATH: ${SRCTOP}/sys/dev/usb/net
+
+KMOD = usie
+SRCS = if_usie.c
+SRCS += opt_bus.h opt_usb.h device_if.h bus_if.h \
+ usb_if.h usbdevs.h opt_inet.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/uslcom/Makefile b/sys/modules/usb/uslcom/Makefile
new file mode 100644
index 000000000000..9efeb8dcc621
--- /dev/null
+++ b/sys/modules/usb/uslcom/Makefile
@@ -0,0 +1,35 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/serial
+
+KMOD= uslcom
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ uslcom.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/uss820dci/Makefile b/sys/modules/usb/uss820dci/Makefile
new file mode 100644
index 000000000000..74e6c329c3d2
--- /dev/null
+++ b/sys/modules/usb/uss820dci/Makefile
@@ -0,0 +1,41 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/controller
+
+KMOD= uss820dci
+SRCS= bus_if.h device_if.h usb_if.h \
+ opt_bus.h opt_usb.h \
+ uss820dci.c \
+ pci_if.h
+
+.if defined(HAS_ATMELARM)
+SRCS+= uss820dci_atmelarm.c
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/uvisor/Makefile b/sys/modules/usb/uvisor/Makefile
new file mode 100644
index 000000000000..e83f0dadb364
--- /dev/null
+++ b/sys/modules/usb/uvisor/Makefile
@@ -0,0 +1,35 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/serial
+
+KMOD= uvisor
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ uvisor.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/uvscom/Makefile b/sys/modules/usb/uvscom/Makefile
new file mode 100644
index 000000000000..69cc293743e2
--- /dev/null
+++ b/sys/modules/usb/uvscom/Makefile
@@ -0,0 +1,35 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/serial
+
+KMOD= uvscom
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
+ uvscom.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/wmt/Makefile b/sys/modules/usb/wmt/Makefile
new file mode 100644
index 000000000000..b20fa8f14297
--- /dev/null
+++ b/sys/modules/usb/wmt/Makefile
@@ -0,0 +1,9 @@
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/input
+
+KMOD= wmt
+SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h wmt.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/wsp/Makefile b/sys/modules/usb/wsp/Makefile
new file mode 100644
index 000000000000..98f6f21f2bef
--- /dev/null
+++ b/sys/modules/usb/wsp/Makefile
@@ -0,0 +1,35 @@
+#
+#
+# Copyright (c) 2012 Huang Wen Hui. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/input
+
+KMOD= wsp
+SRCS= opt_bus.h opt_evdev.h opt_usb.h device_if.h bus_if.h usb_if.h \
+ vnode_if.h usbdevs.h wsp.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/xhci/Makefile b/sys/modules/usb/xhci/Makefile
new file mode 100644
index 000000000000..1badf66ce5bc
--- /dev/null
+++ b/sys/modules/usb/xhci/Makefile
@@ -0,0 +1,37 @@
+#
+#
+# Copyright (c) 2010 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/controller
+
+KMOD= xhci
+SRCS= bus_if.h device_if.h usb_if.h \
+ opt_bus.h opt_usb.h \
+ xhci_pci.c xhci.c \
+ pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/usb/zyd/Makefile b/sys/modules/usb/zyd/Makefile
new file mode 100644
index 000000000000..21b492a2a27e
--- /dev/null
+++ b/sys/modules/usb/zyd/Makefile
@@ -0,0 +1,35 @@
+#
+#
+# Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/usb/wlan
+
+KMOD= if_zyd
+SRCS= opt_bus.h opt_usb.h opt_wlan.h device_if.h bus_if.h usb_if.h \
+ usbdevs.h if_zyd.c if_zydreg.h if_zydfw.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/veriexec/Makefile b/sys/modules/veriexec/Makefile
new file mode 100644
index 000000000000..453177fe199c
--- /dev/null
+++ b/sys/modules/veriexec/Makefile
@@ -0,0 +1,11 @@
+
+.PATH: ${.PARSEDIR:H:H}/dev/veriexec
+
+.include <bsd.own.mk>
+
+KMOD= veriexec
+SRCS= verified_exec.c
+SRCS+= bus_if.h device_if.h vnode_if.h
+
+.include <bsd.kmod.mk>
+
diff --git a/sys/modules/vesa/Makefile b/sys/modules/vesa/Makefile
new file mode 100644
index 000000000000..9f539d20a138
--- /dev/null
+++ b/sys/modules/vesa/Makefile
@@ -0,0 +1,12 @@
+
+KMOD= vesa
+SRCS= opt_vga.h opt_vesa.h
+SRCS+= bus_if.h device_if.h pci_if.h
+
+.PATH: ${SRCTOP}/sys/dev/fb
+SRCS+= vesa.c
+
+.PATH: ${SRCTOP}/sys/dev/syscons
+SRCS+= scvesactl.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/vge/Makefile b/sys/modules/vge/Makefile
new file mode 100644
index 000000000000..f6b3655366ee
--- /dev/null
+++ b/sys/modules/vge/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/vge
+
+KMOD= if_vge
+SRCS= if_vge.c miibus_if.h device_if.h bus_if.h pci_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/viawd/Makefile b/sys/modules/viawd/Makefile
new file mode 100644
index 000000000000..fb8efb69ca14
--- /dev/null
+++ b/sys/modules/viawd/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/viawd
+
+KMOD= viawd
+SRCS= viawd.c device_if.h bus_if.h pci_if.h isa_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/videomode/Makefile b/sys/modules/videomode/Makefile
new file mode 100644
index 000000000000..729297a03a96
--- /dev/null
+++ b/sys/modules/videomode/Makefile
@@ -0,0 +1,39 @@
+#
+#
+# Copyright (c) 2015 Hans Petter Selasky. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/videomode
+
+KMOD= videomode
+SRCS= bus_if.h device_if.h vnode_if.h \
+ opt_bus.h opt_ddb.h opt_videomode.h \
+ videomode.c \
+ edid.c \
+ pickmode.c \
+ vesagtf.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/virtio/Makefile b/sys/modules/virtio/Makefile
new file mode 100644
index 000000000000..7622e58c0c93
--- /dev/null
+++ b/sys/modules/virtio/Makefile
@@ -0,0 +1,27 @@
+#
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+SUBDIR= virtio pci network block balloon scsi random console
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/virtio/balloon/Makefile b/sys/modules/virtio/balloon/Makefile
new file mode 100644
index 000000000000..fd0e4a085da5
--- /dev/null
+++ b/sys/modules/virtio/balloon/Makefile
@@ -0,0 +1,32 @@
+#
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+.PATH: ${SRCTOP}/sys/dev/virtio/balloon
+
+KMOD= virtio_balloon
+SRCS= virtio_balloon.c
+SRCS+= virtio_bus_if.h virtio_if.h
+SRCS+= bus_if.h device_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/virtio/block/Makefile b/sys/modules/virtio/block/Makefile
new file mode 100644
index 000000000000..d802f35a2fab
--- /dev/null
+++ b/sys/modules/virtio/block/Makefile
@@ -0,0 +1,32 @@
+#
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+.PATH: ${SRCTOP}/sys/dev/virtio/block
+
+KMOD= virtio_blk
+SRCS= virtio_blk.c
+SRCS+= virtio_bus_if.h virtio_if.h
+SRCS+= bus_if.h device_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/virtio/console/Makefile b/sys/modules/virtio/console/Makefile
new file mode 100644
index 000000000000..1664d443c9e8
--- /dev/null
+++ b/sys/modules/virtio/console/Makefile
@@ -0,0 +1,32 @@
+#
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+.PATH: ${SRCTOP}/sys/dev/virtio/console
+
+KMOD= virtio_console
+SRCS= virtio_console.c
+SRCS+= virtio_bus_if.h virtio_if.h
+SRCS+= bus_if.h device_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/virtio/network/Makefile b/sys/modules/virtio/network/Makefile
new file mode 100644
index 000000000000..5025034daa45
--- /dev/null
+++ b/sys/modules/virtio/network/Makefile
@@ -0,0 +1,33 @@
+#
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+.PATH: ${SRCTOP}/sys/dev/virtio/network
+
+KMOD= if_vtnet
+SRCS= if_vtnet.c
+SRCS+= virtio_bus_if.h virtio_if.h
+SRCS+= bus_if.h device_if.h
+SRCS+= opt_inet.h opt_inet6.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/virtio/pci/Makefile b/sys/modules/virtio/pci/Makefile
new file mode 100644
index 000000000000..d1361059ceba
--- /dev/null
+++ b/sys/modules/virtio/pci/Makefile
@@ -0,0 +1,33 @@
+#
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+.PATH: ${SRCTOP}/sys/dev/virtio/pci
+
+KMOD= virtio_pci
+SRCS= virtio_pci.c virtio_pci_legacy.c virtio_pci_modern.c
+SRCS+= virtio_pci_if.c virtio_pci_if.h
+SRCS+= virtio_bus_if.h virtio_if.h
+SRCS+= bus_if.h device_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/virtio/random/Makefile b/sys/modules/virtio/random/Makefile
new file mode 100644
index 000000000000..effae07c5659
--- /dev/null
+++ b/sys/modules/virtio/random/Makefile
@@ -0,0 +1,32 @@
+#
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+.PATH: ${SRCTOP}/sys/dev/virtio/random
+
+KMOD= virtio_random
+SRCS= virtio_random.c
+SRCS+= virtio_bus_if.h virtio_if.h
+SRCS+= bus_if.h device_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/virtio/scsi/Makefile b/sys/modules/virtio/scsi/Makefile
new file mode 100644
index 000000000000..0c14314112ff
--- /dev/null
+++ b/sys/modules/virtio/scsi/Makefile
@@ -0,0 +1,32 @@
+#
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+.PATH: ${SRCTOP}/sys/dev/virtio/scsi
+
+KMOD= virtio_scsi
+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
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/virtio/virtio/Makefile b/sys/modules/virtio/virtio/Makefile
new file mode 100644
index 000000000000..04cbcd0e44f1
--- /dev/null
+++ b/sys/modules/virtio/virtio/Makefile
@@ -0,0 +1,36 @@
+#
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+.PATH: ${SRCTOP}/sys/dev/virtio
+
+KMOD= virtio
+
+SRCS= virtio.c virtqueue.c
+SRCS+= virtio_bus_if.c virtio_bus_if.h
+SRCS+= virtio_if.c virtio_if.h
+SRCS+= bus_if.h device_if.h
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/vkbd/Makefile b/sys/modules/vkbd/Makefile
new file mode 100644
index 000000000000..299fea441210
--- /dev/null
+++ b/sys/modules/vkbd/Makefile
@@ -0,0 +1,13 @@
+# $Id: Makefile,v 1.1 2004/08/13 18:30:24 max Exp $
+
+.PATH: ${SRCTOP}/sys/dev/vkbd
+
+KMOD= vkbd
+SRCS= vkbd.c opt_kbd.h
+
+.if !defined(KERNBUILDDIR)
+opt_kbd.h:
+ echo "#define KBD_INSTALL_CDEV 1" > ${.TARGET}
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/vmd/Makefile b/sys/modules/vmd/Makefile
new file mode 100644
index 000000000000..c9f2f40730ec
--- /dev/null
+++ b/sys/modules/vmd/Makefile
@@ -0,0 +1,13 @@
+
+.PATH: ${SRCTOP}/sys/dev/vmd
+
+KMOD= vmd
+
+SRCS= \
+ vmd.c \
+ bus_if.h \
+ device_if.h \
+ pci_if.h \
+ pcib_if.h \
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/vmm/Makefile b/sys/modules/vmm/Makefile
new file mode 100644
index 000000000000..6bb78d055580
--- /dev/null
+++ b/sys/modules/vmm/Makefile
@@ -0,0 +1,90 @@
+
+.include <kmod.opts.mk>
+
+KMOD= vmm
+
+SRCS= opt_acpi.h opt_bhyve_snapshot.h opt_ddb.h
+SRCS+= device_if.h bus_if.h pci_if.h pcib_if.h acpi_if.h vnode_if.h
+DPSRCS+= vmx_assym.h svm_assym.h
+DPSRCS+= vmx_genassym.c svm_genassym.c offset.inc
+
+CFLAGS+= -DVMM_KEEP_STATS
+CFLAGS+= -I${SRCTOP}/sys/amd64/vmm
+CFLAGS+= -I${SRCTOP}/sys/amd64/vmm/io
+CFLAGS+= -I${SRCTOP}/sys/amd64/vmm/intel
+CFLAGS+= -I${SRCTOP}/sys/amd64/vmm/amd
+
+# generic vmm support
+.PATH: ${SRCTOP}/sys/amd64/vmm
+SRCS+= vmm.c \
+ vmm_dev.c \
+ vmm_host.c \
+ vmm_instruction_emul.c \
+ vmm_ioport.c \
+ vmm_lapic.c \
+ vmm_mem.c \
+ vmm_stat.c \
+ vmm_util.c \
+ x86.c
+
+.PATH: ${SRCTOP}/sys/amd64/vmm/io
+SRCS+= iommu.c \
+ ppt.c \
+ vatpic.c \
+ vatpit.c \
+ vhpet.c \
+ vioapic.c \
+ vlapic.c \
+ vpmtmr.c \
+ vrtc.c
+
+# intel-specific files
+.PATH: ${SRCTOP}/sys/amd64/vmm/intel
+SRCS+= ept.c \
+ vmcs.c \
+ vmx_msr.c \
+ vmx_support.S \
+ vmx.c \
+ vtd.c
+
+# amd-specific files
+.PATH: ${SRCTOP}/sys/amd64/vmm/amd
+SRCS+= vmcb.c \
+ amdiommu.c \
+ ivhd_if.c \
+ ivhd_if.h \
+ svm.c \
+ svm_support.S \
+ npt.c \
+ ivrs_drv.c \
+ amdvi_hw.c \
+ svm_msr.c
+
+SRCS.BHYVE_SNAPSHOT= vmm_snapshot.c
+
+CLEANFILES= vmx_assym.h vmx_genassym.o svm_assym.h svm_genassym.o
+
+OBJS_DEPEND_GUESS.vmx_support.o+= vmx_assym.h
+OBJS_DEPEND_GUESS.svm_support.o+= svm_assym.h
+
+vmx_assym.h: vmx_genassym.o
+ sh ${SYSDIR}/kern/genassym.sh vmx_genassym.o > ${.TARGET}
+
+svm_assym.h: svm_genassym.o
+ sh ${SYSDIR}/kern/genassym.sh svm_genassym.o > ${.TARGET}
+
+vmx_support.o:
+ ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \
+ ${.IMPSRC} -o ${.TARGET}
+
+svm_support.o:
+ ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \
+ ${.IMPSRC} -o ${.TARGET}
+
+vmx_genassym.o: offset.inc
+ ${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon ${.IMPSRC}
+
+svm_genassym.o: offset.inc
+ ${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon ${.IMPSRC}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/vmware/Makefile b/sys/modules/vmware/Makefile
new file mode 100644
index 000000000000..3d75f1a59c5c
--- /dev/null
+++ b/sys/modules/vmware/Makefile
@@ -0,0 +1,29 @@
+#
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+SUBDIR= pvscsi vmxnet3
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
+SUBDIR+= vmci
+.endif
+.include <bsd.subdir.mk>
diff --git a/sys/modules/vmware/pvscsi/Makefile b/sys/modules/vmware/pvscsi/Makefile
new file mode 100644
index 000000000000..60951e886ce5
--- /dev/null
+++ b/sys/modules/vmware/pvscsi/Makefile
@@ -0,0 +1,9 @@
+
+.PATH: ${SRCTOP}/sys/dev/vmware/pvscsi
+
+KMOD= pvscsi
+SRCS= pvscsi.c
+SRCS+= device_if.h bus_if.h pci_if.h
+SRCS+= opt_cam.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/vmware/vmci/Makefile b/sys/modules/vmware/vmci/Makefile
new file mode 100644
index 000000000000..45accc068cc8
--- /dev/null
+++ b/sys/modules/vmware/vmci/Makefile
@@ -0,0 +1,10 @@
+
+.PATH: ${SRCTOP}/sys/dev/vmware/vmci
+
+KMOD= vmci
+SRCS= vmci.c vmci_datagram.c vmci_doorbell.c vmci_driver.c vmci_event.c
+SRCS+= vmci_hashtable.c vmci_kernel_if.c vmci_qpair.c vmci_queue_pair.c
+SRCS+= vmci_resource.c
+SRCS+= device_if.h bus_if.h pci_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/vmware/vmxnet3/Makefile b/sys/modules/vmware/vmxnet3/Makefile
new file mode 100644
index 000000000000..8e0e9ba68f95
--- /dev/null
+++ b/sys/modules/vmware/vmxnet3/Makefile
@@ -0,0 +1,32 @@
+#
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+
+.PATH: ${SRCTOP}/sys/dev/vmware/vmxnet3
+
+KMOD= if_vmx
+SRCS= if_vmx.c
+SRCS+= bus_if.h device_if.h pci_if.h ifdi_if.h
+SRCS+= opt_inet.h opt_inet6.h opt_rss.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/vnic/Makefile b/sys/modules/vnic/Makefile
new file mode 100644
index 000000000000..79e206c8ef08
--- /dev/null
+++ b/sys/modules/vnic/Makefile
@@ -0,0 +1,9 @@
+
+SYSDIR?=${SRCTOP}/sys
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+CFLAGS+= -DFDT
+
+SUBDIR = mrmlbus thunder_mdio thunder_bgx vnicpf vnicvf
+
+.include <bsd.subdir.mk>
diff --git a/sys/modules/vnic/mrmlbus/Makefile b/sys/modules/vnic/mrmlbus/Makefile
new file mode 100644
index 000000000000..e7397f8d8402
--- /dev/null
+++ b/sys/modules/vnic/mrmlbus/Makefile
@@ -0,0 +1,15 @@
+
+SYSDIR?=${SRCTOP}/sys
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/vnic
+
+KMOD= mrmlbus
+SRCS= device_if.h bus_if.h opt_platform.h pci_if.h ofw_bus_if.h miibus_if.h lmac_if.h
+SRCS+= mrml_bridge.c
+
+CFLAGS+= -DFDT
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/vnic/thunder_bgx/Makefile b/sys/modules/vnic/thunder_bgx/Makefile
new file mode 100644
index 000000000000..b51fe40a3b15
--- /dev/null
+++ b/sys/modules/vnic/thunder_bgx/Makefile
@@ -0,0 +1,15 @@
+
+SYSDIR?=${SRCTOP}/sys
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/vnic
+
+KMOD= thunder_bgx
+SRCS= thunder_bgx.c thunder_bgx_fdt.c
+SRCS+= opt_platform.h device_if.h bus_if.h pci_if.h lmac_if.h ofw_bus_if.h
+
+CFLAGS+= -DFDT
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/vnic/thunder_mdio/Makefile b/sys/modules/vnic/thunder_mdio/Makefile
new file mode 100644
index 000000000000..899a9dfb5789
--- /dev/null
+++ b/sys/modules/vnic/thunder_mdio/Makefile
@@ -0,0 +1,15 @@
+
+SYSDIR?=${SRCTOP}/sys
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/vnic
+
+KMOD= thunder_mdio
+SRCS= opt_platform.h device_if.h bus_if.h pci_if.h ofw_bus_if.h miibus_if.h lmac_if.h
+SRCS+= thunder_mdio.c thunder_mdio_fdt.c
+
+CFLAGS+= -DFDT
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/vnic/vnicpf/Makefile b/sys/modules/vnic/vnicpf/Makefile
new file mode 100644
index 000000000000..8ba2cd029854
--- /dev/null
+++ b/sys/modules/vnic/vnicpf/Makefile
@@ -0,0 +1,15 @@
+
+SYSDIR?=${SRCTOP}/sys
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/vnic
+
+KMOD= vnicpf
+SRCS= pci_iov_if.h opt_platform.h device_if.h bus_if.h pci_if.h ofw_bus_if.h miibus_if.h lmac_if.h
+SRCS+= nic_main.c
+
+CFLAGS+= -DFDT -DPCI_IOV
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/vnic/vnicvf/Makefile b/sys/modules/vnic/vnicvf/Makefile
new file mode 100644
index 000000000000..3f81ba16cff2
--- /dev/null
+++ b/sys/modules/vnic/vnicvf/Makefile
@@ -0,0 +1,15 @@
+
+SYSDIR?=${SRCTOP}/sys
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+S= ${SRCTOP}/sys
+
+.PATH: $S/dev/vnic
+
+KMOD= vnicvf
+SRCS= nicvf_main.c nicvf_queues.c
+SRCS+= opt_platform.h ofw_bus_if.h lmac_if.h miibus_if.h pci_if.h bus_if.h device_if.h opt_inet.h opt_inet6.h
+
+CFLAGS+= -DFDT -DPCI_IOV
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/vr/Makefile b/sys/modules/vr/Makefile
new file mode 100644
index 000000000000..980243faea4e
--- /dev/null
+++ b/sys/modules/vr/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/vr
+
+KMOD= if_vr
+SRCS= if_vr.c device_if.h bus_if.h pci_if.h
+SRCS+= miibus_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/vte/Makefile b/sys/modules/vte/Makefile
new file mode 100644
index 000000000000..3dc09ebf829e
--- /dev/null
+++ b/sys/modules/vte/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/vte
+
+KMOD= if_vte
+SRCS= if_vte.c device_if.h bus_if.h pci_if.h miibus_if.h opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/wbwd/Makefile b/sys/modules/wbwd/Makefile
new file mode 100644
index 000000000000..053d4a7aa9e6
--- /dev/null
+++ b/sys/modules/wbwd/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/wbwd
+
+KMOD= wbwd
+SRCS= wbwd.c
+SRCS+= bus_if.h device_if.h isa_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/wdatwd/Makefile b/sys/modules/wdatwd/Makefile
new file mode 100644
index 000000000000..d9f578c8ad01
--- /dev/null
+++ b/sys/modules/wdatwd/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/dev/wdatwd
+
+KMOD= wdatwd
+SRCS= wdatwd.c
+SRCS+= opt_acpi.h acpi_if.h device_if.h bus_if.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/wlan/Makefile b/sys/modules/wlan/Makefile
new file mode 100644
index 000000000000..1233e8216b4e
--- /dev/null
+++ b/sys/modules/wlan/Makefile
@@ -0,0 +1,26 @@
+
+.PATH: ${SRCTOP}/sys/net80211
+
+KMOD= wlan
+SRCS= ieee80211.c ieee80211_action.c ieee80211_ageq.c \
+ ieee80211_crypto.c ieee80211_crypto_none.c ieee80211_dfs.c \
+ ieee80211_freebsd.c ieee80211_input.c ieee80211_ioctl.c \
+ ieee80211_mesh.c ieee80211_node.c ieee80211_output.c ieee80211_phy.c \
+ ieee80211_power.c ieee80211_proto.c ieee80211_scan.c ieee80211_scan_sw.c \
+ ieee80211_scan_sta.c ieee80211_radiotap.c ieee80211_ratectl.c \
+ ieee80211_ratectl_none.c ieee80211_regdomain.c \
+ ieee80211_ht.c ieee80211_hwmp.c ieee80211_adhoc.c ieee80211_hostap.c \
+ ieee80211_monitor.c ieee80211_sta.c ieee80211_wds.c ieee80211_ddb.c \
+ ieee80211_tdma.c ieee80211_superg.c ieee80211_vht.c
+SRCS+= bus_if.h device_if.h opt_ddb.h opt_inet.h opt_inet6.h \
+ opt_tdma.h opt_wlan.h
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
+
+CWARNFLAGS.ieee80211_adhoc.c= -Wno-unused-function
+CWARNFLAGS.ieee80211_crypto.c= -Wno-unused-function
+CWARNFLAGS.ieee80211_hostap.c= -Wno-unused-function
+CWARNFLAGS.ieee80211_mesh.c= -Wno-unused-function
+CWARNFLAGS.ieee80211_sta.c= -Wno-unused-function
diff --git a/sys/modules/wlan_acl/Makefile b/sys/modules/wlan_acl/Makefile
new file mode 100644
index 000000000000..168966aa0d81
--- /dev/null
+++ b/sys/modules/wlan_acl/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/net80211
+
+KMOD= wlan_acl
+SRCS= ieee80211_acl.c
+SRCS+= opt_wlan.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/wlan_amrr/Makefile b/sys/modules/wlan_amrr/Makefile
new file mode 100644
index 000000000000..13503fff695d
--- /dev/null
+++ b/sys/modules/wlan_amrr/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/net80211
+
+KMOD= wlan_amrr
+SRCS= ieee80211_amrr.c
+SRCS+= opt_wlan.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/wlan_ccmp/Makefile b/sys/modules/wlan_ccmp/Makefile
new file mode 100644
index 000000000000..a00d61b5f23d
--- /dev/null
+++ b/sys/modules/wlan_ccmp/Makefile
@@ -0,0 +1,10 @@
+
+.PATH: ${SRCTOP}/sys/net80211
+.PATH: ${SRCTOP}/sys/crypto/rijndael
+
+KMOD= wlan_ccmp
+SRCS= ieee80211_crypto_ccmp.c
+SRCS+= rijndael-alg-fst.c rijndael-api.c
+SRCS+= opt_wlan.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/wlan_rssadapt/Makefile b/sys/modules/wlan_rssadapt/Makefile
new file mode 100644
index 000000000000..df3f86611d94
--- /dev/null
+++ b/sys/modules/wlan_rssadapt/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/net80211
+
+KMOD= wlan_rssadapt
+SRCS= ieee80211_rssadapt.c
+SRCS+= opt_wlan.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/wlan_tkip/Makefile b/sys/modules/wlan_tkip/Makefile
new file mode 100644
index 000000000000..2888597dde8d
--- /dev/null
+++ b/sys/modules/wlan_tkip/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/net80211
+
+KMOD= wlan_tkip
+SRCS= ieee80211_crypto_tkip.c
+SRCS+= opt_wlan.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/wlan_wep/Makefile b/sys/modules/wlan_wep/Makefile
new file mode 100644
index 000000000000..4d3e75803282
--- /dev/null
+++ b/sys/modules/wlan_wep/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/net80211
+
+KMOD= wlan_wep
+SRCS= ieee80211_crypto_wep.c
+SRCS+= opt_wlan.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/wlan_xauth/Makefile b/sys/modules/wlan_xauth/Makefile
new file mode 100644
index 000000000000..6d5cb21147fc
--- /dev/null
+++ b/sys/modules/wlan_xauth/Makefile
@@ -0,0 +1,8 @@
+
+.PATH: ${SRCTOP}/sys/net80211
+
+KMOD= wlan_xauth
+SRCS= ieee80211_xauth.c
+SRCS+= opt_wlan.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/wpi/Makefile b/sys/modules/wpi/Makefile
new file mode 100644
index 000000000000..d292618f5fcc
--- /dev/null
+++ b/sys/modules/wpi/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/wpi
+
+KMOD = if_wpi
+SRCS = if_wpi.c device_if.h bus_if.h pci_if.h opt_wpi.h opt_wlan.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/wpifw/Makefile b/sys/modules/wpifw/Makefile
new file mode 100644
index 000000000000..60638d514db0
--- /dev/null
+++ b/sys/modules/wpifw/Makefile
@@ -0,0 +1,12 @@
+
+.PATH: ${SRCTOP}/sys/contrib/dev/wpi
+
+KMOD= wpifw
+FIRMWS= iwlwifi-3945-15.32.2.9.fw:wpifw:153229
+
+CLEANFILES= iwlwifi-3945-15.32.2.9.fw
+
+iwlwifi-3945-15.32.2.9.fw: iwlwifi-3945-15.32.2.9.fw.uu
+ uudecode -p ${.ALLSRC} > ${.TARGET}
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/wtap/Makefile b/sys/modules/wtap/Makefile
new file mode 100644
index 000000000000..0ad01b627b15
--- /dev/null
+++ b/sys/modules/wtap/Makefile
@@ -0,0 +1,23 @@
+
+KMOD= wtap
+
+.PATH: ${SRCTOP}/sys/dev/wtap
+SRCS= if_wtap_module.c if_wtap.c if_medium.c
+
+.PATH: ${SRCTOP}/sys/dev/wtap/wtap_hal
+SRCS+= hal.c
+
+.PATH: ${SRCTOP}/sys/dev/wtap/plugins
+SRCS+= visibility.c
+
+SRCS+= opt_wlan.h opt_global.h
+
+.if !defined(KERNBUILDDIR)
+.if defined(VIMAGE)
+opt_global.h:
+ echo "#define VIMAGE 1" >> ${.TARGET}
+CFLAGS+= -include opt_global.h
+.endif
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/x86bios/Makefile b/sys/modules/x86bios/Makefile
new file mode 100644
index 000000000000..c3708b277504
--- /dev/null
+++ b/sys/modules/x86bios/Makefile
@@ -0,0 +1,13 @@
+
+KMOD= x86bios
+SRCS= opt_x86bios.h
+SRCS+= bus_if.h device_if.h pci_if.h
+
+.PATH: ${SRCTOP}/sys/contrib/x86emu
+.PATH: ${SRCTOP}/sys/compat/x86bios
+SRCS+= x86bios.c
+.if ${MACHINE_ARCH} != "i386"
+SRCS+= x86emu.c
+.endif
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/xdr/Makefile b/sys/modules/xdr/Makefile
new file mode 100644
index 000000000000..44274237aac9
--- /dev/null
+++ b/sys/modules/xdr/Makefile
@@ -0,0 +1,13 @@
+
+.PATH: ${SRCTOP}/sys/xdr
+KMOD= xdr
+SRCS= xdr.c \
+ xdr_array.c \
+ xdr_mbuf.c \
+ xdr_mem.c \
+ xdr_reference.c \
+ xdr_sizeof.c
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/xl/Makefile b/sys/modules/xl/Makefile
new file mode 100644
index 000000000000..74f82c998d7d
--- /dev/null
+++ b/sys/modules/xl/Makefile
@@ -0,0 +1,7 @@
+
+.PATH: ${SRCTOP}/sys/dev/xl
+
+KMOD= if_xl
+SRCS= bus_if.h device_if.h if_xl.c miibus_if.h miidevs.h pci_if.h xlphy.c opt_platform.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/xz/Makefile b/sys/modules/xz/Makefile
new file mode 100644
index 000000000000..fae30d8ad885
--- /dev/null
+++ b/sys/modules/xz/Makefile
@@ -0,0 +1,23 @@
+
+.PATH: ${SRCTOP}/sys/dev/xz
+.PATH: ${SRCTOP}/sys/contrib/xz-embedded/freebsd
+.PATH: ${SRCTOP}/sys/contrib/xz-embedded/linux/lib/xz
+
+KMOD= xz
+SRCS= \
+ xz_crc32.c \
+ xz_crc64.c \
+ xz_dec_bcj.c \
+ xz_dec_lzma2.c \
+ xz_dec_stream.c \
+ xz_mod.c
+
+CFLAGS+= \
+ -DXZ_USE_CRC64 \
+ -I${SRCTOP}/sys/contrib/xz-embedded/freebsd \
+ -I${SRCTOP}/sys/contrib/xz-embedded/linux/lib/xz \
+ -I${SRCTOP}/sys/contrib/xz-embedded/linux/include/linux
+
+EXPORT_SYMS= YES
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/zfs/Makefile b/sys/modules/zfs/Makefile
new file mode 100644
index 000000000000..056e6a015971
--- /dev/null
+++ b/sys/modules/zfs/Makefile
@@ -0,0 +1,527 @@
+
+SRCDIR=${SRCTOP}/sys/contrib/openzfs/module
+INCDIR=${SRCTOP}/sys/contrib/openzfs/include
+
+KMOD= zfs
+
+.PATH: ${SRCDIR}/avl \
+ ${SRCDIR}/lua \
+ ${SRCDIR}/nvpair \
+ ${SRCDIR}/icp/algs/blake3 \
+ ${SRCDIR}/icp/algs/edonr \
+ ${SRCDIR}/icp/algs/sha2 \
+ ${SRCDIR}/icp/asm-aarch64/blake3 \
+ ${SRCDIR}/icp/asm-aarch64/sha2 \
+ ${SRCDIR}/icp/asm-arm/sha2 \
+ ${SRCDIR}/icp/asm-ppc64/sha2 \
+ ${SRCDIR}/icp/asm-ppc64/blake3 \
+ ${SRCDIR}/icp/asm-x86_64/blake3 \
+ ${SRCDIR}/icp/asm-x86_64/sha2 \
+ ${SRCDIR}/os/freebsd/spl \
+ ${SRCDIR}/os/freebsd/zfs \
+ ${SRCDIR}/unicode \
+ ${SRCDIR}/zcommon \
+ ${SRCDIR}/zfs \
+ ${SRCDIR}/zstd \
+ ${SRCDIR}/zstd/lib/common \
+ ${SRCDIR}/zstd/lib/compress \
+ ${SRCDIR}/zstd/lib/decompress
+
+CFLAGS+= -I${INCDIR}
+CFLAGS+= -I${SRCDIR}/icp/include
+CFLAGS+= -I${INCDIR}/os/freebsd
+CFLAGS+= -I${INCDIR}/os/freebsd/spl
+CFLAGS+= -I${INCDIR}/os/freebsd/zfs
+CFLAGS+= -I${SRCDIR}/zstd/include
+CFLAGS+= -I${.CURDIR}
+
+CFLAGS+= -D__KERNEL__ -DFREEBSD_NAMECACHE -DBUILDING_ZFS \
+ -DHAVE_UIO_ZEROCOPY -DWITHOUT_NETDUMP -D__KERNEL -D_SYS_CONDVAR_H_ \
+ -D_SYS_VMEM_H_
+
+.if ${MACHINE_ARCH} == "amd64"
+CFLAGS+= -D__x86_64 -DHAVE_SSE2 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 \
+ -DHAVE_AVX -DHAVE_AVX2 -DHAVE_AVX512F -DHAVE_AVX512VL -DHAVE_AVX512BW
+.endif
+
+.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \
+ ${MACHINE_ARCH} == "powerpcspe" || ${MACHINE_ARCH} == "arm"
+CFLAGS+= -DBITS_PER_LONG=32
+.else
+CFLAGS+= -DBITS_PER_LONG=64
+.endif
+
+SRCS= vnode_if.h device_if.h bus_if.h
+
+# avl
+SRCS+= avl.c
+
+# icp
+SRCS+= edonr.c
+
+#icp/algs/blake3
+SRCS+= blake3.c \
+ blake3_generic.c \
+ blake3_impl.c
+
+
+.if ${MACHINE_ARCH} == "aarch64"
+#icp/asm-aarch64/blake3
+SRCS+= b3_aarch64_sse2.S \
+ b3_aarch64_sse41.S
+.endif
+
+.if ${MACHINE_ARCH} == "powerpc64le"
+#icp/asm-ppc64/blake3
+SRCS+= b3_ppc64le_sse2.S \
+ b3_ppc64le_sse41.S
+.endif
+
+.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
+#icp/asm-x86_64/blake3
+SRCS+= blake3_avx2.S \
+ blake3_avx512.S \
+ blake3_sse2.S \
+ blake3_sse41.S
+.endif
+
+#icp/algs/sha2
+SRCS+= sha2_generic.c \
+ sha256_impl.c \
+ sha512_impl.c
+
+.if ${MACHINE_ARCH} == "armv7"
+#icp/asm-arm/sha2
+SRCS+= sha256-armv7.S \
+ sha512-armv7.S
+.endif
+
+.if ${MACHINE_ARCH} == "aarch64"
+#icp/asm-aarch64/sha2
+OBJS+= zfs-sha256-armv8.o \
+ zfs-sha512-armv8.o
+.endif
+
+.if ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "powerpc64le"
+#icp/asm-ppc64/sha2
+SRCS+= sha256-p8.S \
+ sha512-p8.S \
+ sha256-ppc.S \
+ sha512-ppc.S
+.endif
+
+.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
+#icp/asm-x86_64/sha2
+OBJS+= zfs-sha256-x86_64.o \
+ zfs-sha512-x86_64.o
+.endif
+
+#lua
+SRCS+= lapi.c \
+ lauxlib.c \
+ lbaselib.c \
+ lcode.c \
+ lcompat.c \
+ lcorolib.c \
+ lctype.c \
+ ldebug.c \
+ ldo.c \
+ lfunc.c \
+ lgc.c \
+ llex.c \
+ lmem.c \
+ lobject.c \
+ lopcodes.c \
+ lparser.c \
+ lstate.c \
+ lstring.c \
+ lstrlib.c \
+ ltable.c \
+ ltablib.c \
+ ltm.c \
+ lvm.c \
+ lzio.c
+
+#nvpair
+SRCS+= nvpair.c \
+ fnvpair.c \
+ nvpair_alloc_spl.c \
+ nvpair_alloc_fixed.c
+
+#os/freebsd/spl
+SRCS+= acl_common.c \
+ callb.c \
+ list.c \
+ spl_acl.c \
+ spl_cmn_err.c \
+ spl_dtrace.c \
+ spl_kmem.c \
+ spl_kstat.c \
+ spl_misc.c \
+ spl_policy.c \
+ spl_procfs_list.c \
+ spl_string.c \
+ spl_sunddi.c \
+ spl_sysevent.c \
+ spl_taskq.c \
+ spl_uio.c \
+ spl_vfs.c \
+ spl_vm.c \
+ spl_zlib.c \
+ spl_zone.c
+
+
+.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \
+ ${MACHINE_ARCH} == "powerpcspe" || ${MACHINE_ARCH} == "arm"
+SRCS+= spl_atomic.c
+.endif
+
+#os/freebsd/zfs
+SRCS+= abd_os.c \
+ arc_os.c \
+ crypto_os.c \
+ dmu_os.c \
+ event_os.c \
+ hkdf.c \
+ kmod_core.c \
+ spa_os.c \
+ sysctl_os.c \
+ vdev_file.c \
+ vdev_geom.c \
+ vdev_label_os.c \
+ zfs_acl.c \
+ zfs_ctldir.c \
+ zfs_debug.c \
+ zfs_dir.c \
+ zfs_ioctl_compat.c \
+ zfs_ioctl_os.c \
+ zfs_racct.c \
+ zfs_vfsops.c \
+ zfs_vnops_os.c \
+ zfs_znode.c \
+ zio_crypt.c \
+ zvol_os.c
+
+#unicode
+SRCS+= uconv.c \
+ u8_textprep.c
+
+#zcommon
+SRCS+= zfeature_common.c \
+ zfs_comutil.c \
+ zfs_deleg.c \
+ zfs_fletcher.c \
+ zfs_fletcher_avx512.c \
+ zfs_fletcher_intel.c \
+ zfs_fletcher_sse.c \
+ zfs_fletcher_superscalar.c \
+ zfs_fletcher_superscalar4.c \
+ zfs_namecheck.c \
+ zfs_prop.c \
+ zpool_prop.c \
+ zprop_common.c
+
+#zfs
+SRCS+= abd.c \
+ aggsum.c \
+ arc.c \
+ blake3_zfs.c \
+ blkptr.c \
+ bplist.c \
+ bpobj.c \
+ brt.c \
+ btree.c \
+ cityhash.c \
+ dbuf.c \
+ dbuf_stats.c \
+ bptree.c \
+ bqueue.c \
+ dataset_kstats.c \
+ ddt.c \
+ ddt_zap.c \
+ dmu.c \
+ dmu_diff.c \
+ dmu_object.c \
+ dmu_objset.c \
+ dmu_recv.c \
+ dmu_redact.c \
+ dmu_send.c \
+ dmu_traverse.c \
+ dmu_tx.c \
+ dmu_zfetch.c \
+ dnode.c \
+ dnode_sync.c \
+ dsl_dataset.c \
+ dsl_deadlist.c \
+ dsl_deleg.c \
+ dsl_bookmark.c \
+ dsl_dir.c \
+ dsl_crypt.c \
+ dsl_destroy.c \
+ dsl_pool.c \
+ dsl_prop.c \
+ dsl_scan.c \
+ dsl_synctask.c \
+ dsl_userhold.c \
+ edonr_zfs.c \
+ fm.c \
+ gzip.c \
+ lzjb.c \
+ lz4.c \
+ lz4_zfs.c \
+ metaslab.c \
+ mmp.c \
+ multilist.c \
+ objlist.c \
+ pathname.c \
+ range_tree.c \
+ refcount.c \
+ rrwlock.c \
+ sa.c \
+ sha2_zfs.c \
+ skein_zfs.c \
+ spa.c \
+ spa_checkpoint.c \
+ spa_config.c \
+ spa_errlog.c \
+ spa_history.c \
+ spa_log_spacemap.c \
+ spa_misc.c \
+ spa_stats.c \
+ space_map.c \
+ space_reftree.c \
+ txg.c \
+ uberblock.c \
+ unique.c \
+ vdev.c \
+ vdev_draid.c \
+ vdev_draid_rand.c \
+ vdev_indirect.c \
+ vdev_indirect_births.c \
+ vdev_indirect_mapping.c \
+ vdev_initialize.c \
+ vdev_label.c \
+ vdev_mirror.c \
+ vdev_missing.c \
+ vdev_queue.c \
+ vdev_raidz.c \
+ vdev_raidz_math.c \
+ vdev_raidz_math_scalar.c \
+ vdev_raidz_math_avx2.c \
+ vdev_raidz_math_avx512bw.c \
+ vdev_raidz_math_avx512f.c \
+ vdev_raidz_math_sse2.c \
+ vdev_raidz_math_ssse3.c \
+ vdev_rebuild.c \
+ vdev_removal.c \
+ vdev_root.c \
+ vdev_trim.c \
+ zap.c \
+ zap_leaf.c \
+ zap_micro.c \
+ zcp.c \
+ zcp_get.c \
+ zcp_global.c \
+ zcp_iter.c \
+ zcp_set.c \
+ zcp_synctask.c \
+ zfeature.c \
+ zfs_byteswap.c \
+ zfs_chksum.c \
+ zfs_file_os.c \
+ zfs_fm.c \
+ zfs_fuid.c \
+ zfs_impl.c \
+ zfs_ioctl.c \
+ zfs_log.c \
+ zfs_onexit.c \
+ zfs_quota.c \
+ zfs_ratelimit.c \
+ zfs_replay.c \
+ zfs_rlock.c \
+ zfs_sa.c \
+ zfs_vnops.c \
+ zil.c \
+ zio.c \
+ zio_checksum.c \
+ zio_compress.c \
+ zio_inject.c \
+ zle.c \
+ zrlock.c \
+ zthr.c \
+ zvol.c
+
+#zstd
+SRCS+= zfs_zstd.c \
+ entropy_common.c \
+ error_private.c \
+ fse_compress.c \
+ fse_decompress.c \
+ hist.c \
+ huf_compress.c \
+ huf_decompress.c \
+ pool.c \
+ xxhash.c \
+ zstd_common.c \
+ zstd_compress.c \
+ zstd_compress_literals.c \
+ zstd_compress_sequences.c \
+ zstd_compress_superblock.c \
+ zstd_ddict.c \
+ zstd_decompress.c \
+ zstd_decompress_block.c \
+ zstd_double_fast.c \
+ zstd_fast.c \
+ zstd_lazy.c \
+ zstd_ldm.c \
+ zstd_opt.c
+
+.include <bsd.kmod.mk>
+
+CFLAGS+= -include ${SRCTOP}/sys/cddl/compat/opensolaris/sys/debug_compat.h
+CFLAGS+= -include ${INCDIR}/os/freebsd/spl/sys/ccompile.h
+CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/static_ccompile.h
+
+CFLAGS.sysctl_os.c= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h
+CFLAGS.xxhash.c+= -include ${SRCTOP}/sys/sys/_null.h
+
+CFLAGS.gcc+= -Wno-pointer-to-int-cast
+
+CFLAGS.abd.c= -Wno-cast-qual
+CFLAGS.ddt.c= -Wno-cast-qual
+CFLAGS.dmu.c= -Wno-cast-qual
+CFLAGS.dmu_traverse.c= -Wno-cast-qual
+CFLAGS.dnode.c= ${NO_WUNUSED_BUT_SET_VARIABLE}
+CFLAGS.dsl_deadlist.c= -Wno-cast-qual
+CFLAGS.dsl_dir.c= -Wno-cast-qual
+CFLAGS.dsl_prop.c= -Wno-cast-qual
+CFLAGS.edonr.c= -Wno-cast-qual
+CFLAGS.fm.c= -Wno-cast-qual
+CFLAGS.hist.c= -U__BMI__ -fno-tree-vectorize ${NO_WBITWISE_INSTEAD_OF_LOGICAL}
+CFLAGS.lapi.c= -Wno-cast-qual
+CFLAGS.lcompat.c= -Wno-cast-qual
+CFLAGS.ldo.c= ${NO_WINFINITE_RECURSION}
+CFLAGS.lobject.c= -Wno-cast-qual
+CFLAGS.ltable.c= -Wno-cast-qual
+CFLAGS.lvm.c= -Wno-cast-qual
+CFLAGS.lz4.c= -Wno-cast-qual
+CFLAGS.lz4_zfs.c= -Wno-cast-qual
+CFLAGS.nvpair.c= -Wno-cast-qual -DHAVE_RPC_TYPES ${NO_WSTRINGOP_OVERREAD}
+CFLAGS.pool.c+= ${NO_WBITWISE_INSTEAD_OF_LOGICAL}
+CFLAGS.pool.c= -U__BMI__ -fno-tree-vectorize
+CFLAGS.spa.c= -Wno-cast-qual
+CFLAGS.spa_misc.c= -Wno-cast-qual
+CFLAGS.spl_string.c= -Wno-cast-qual
+CFLAGS.spl_vm.c= -Wno-cast-qual
+CFLAGS.spl_zlib.c= -Wno-cast-qual
+CFLAGS.u8_textprep.c= -Wno-cast-qual
+CFLAGS.vdev_draid.c= -Wno-cast-qual
+CFLAGS.vdev_raidz.c= -Wno-cast-qual
+CFLAGS.vdev_raidz_math.c= -Wno-cast-qual
+CFLAGS.vdev_raidz_math_avx2.c= -Wno-cast-qual -Wno-duplicate-decl-specifier
+CFLAGS.vdev_raidz_math_avx512f.c= -Wno-cast-qual -Wno-duplicate-decl-specifier
+CFLAGS.vdev_raidz_math_scalar.c= -Wno-cast-qual
+CFLAGS.vdev_raidz_math_sse2.c= -Wno-cast-qual -Wno-duplicate-decl-specifier
+CFLAGS.zap_leaf.c= -Wno-cast-qual
+CFLAGS.zap_micro.c= -Wno-cast-qual
+CFLAGS.zcp.c= -Wno-cast-qual
+CFLAGS.zfs_fletcher.c= -Wno-cast-qual -Wno-pointer-arith
+CFLAGS.zfs_fletcher_avx512.c= -Wno-cast-qual -Wno-pointer-arith
+CFLAGS.zfs_fletcher_intel.c= -Wno-cast-qual -Wno-pointer-arith
+CFLAGS.zfs_fletcher_sse.c= -Wno-cast-qual -Wno-pointer-arith
+CFLAGS.zfs_fm.c= -Wno-cast-qual ${NO_WUNUSED_BUT_SET_VARIABLE}
+CFLAGS.zfs_ioctl.c= -Wno-cast-qual
+CFLAGS.zfs_log.c= -Wno-cast-qual
+CFLAGS.zfs_vnops_os.c= -Wno-pointer-arith
+CFLAGS.zfs_zstd.c= -Wno-cast-qual -Wno-pointer-arith
+CFLAGS.zil.c= -Wno-cast-qual
+CFLAGS.zio.c= -Wno-cast-qual
+CFLAGS.zprop_common.c= -Wno-cast-qual
+CFLAGS.zrlock.c= -Wno-cast-qual
+
+#zstd
+CFLAGS.entropy_common.c= -U__BMI__ -fno-tree-vectorize ${NO_WBITWISE_INSTEAD_OF_LOGICAL}
+CFLAGS.error_private.c= -U__BMI__ -fno-tree-vectorize ${NO_WBITWISE_INSTEAD_OF_LOGICAL}
+CFLAGS.fse_compress.c= -U__BMI__ -fno-tree-vectorize ${NO_WBITWISE_INSTEAD_OF_LOGICAL} ${NO_WUNUSED_BUT_SET_VARIABLE}
+CFLAGS.fse_decompress.c= -U__BMI__ -fno-tree-vectorize ${NO_WBITWISE_INSTEAD_OF_LOGICAL}
+CFLAGS.huf_compress.c= -U__BMI__ -fno-tree-vectorize ${NO_WBITWISE_INSTEAD_OF_LOGICAL}
+CFLAGS.huf_decompress.c= -U__BMI__ -fno-tree-vectorize ${NO_WBITWISE_INSTEAD_OF_LOGICAL}
+CFLAGS.xxhash.c+= -U__BMI__ -fno-tree-vectorize
+CFLAGS.xxhash.c+= ${NO_WBITWISE_INSTEAD_OF_LOGICAL}
+CFLAGS.zstd.c= -U__BMI__ -fno-tree-vectorize ${NO_WBITWISE_INSTEAD_OF_LOGICAL}
+CFLAGS.zstd_common.c= -U__BMI__ -fno-tree-vectorize ${NO_WBITWISE_INSTEAD_OF_LOGICAL}
+CFLAGS.zstd_compress.c= -U__BMI__ -fno-tree-vectorize ${NO_WBITWISE_INSTEAD_OF_LOGICAL}
+CFLAGS.zstd_compress_literals.c= -U__BMI__ -fno-tree-vectorize ${NO_WBITWISE_INSTEAD_OF_LOGICAL}
+CFLAGS.zstd_compress_sequences.c= -U__BMI__ -fno-tree-vectorize ${NO_WBITWISE_INSTEAD_OF_LOGICAL}
+CFLAGS.zstd_compress_superblock.c= -U__BMI__ -fno-tree-vectorize ${NO_WBITWISE_INSTEAD_OF_LOGICAL} ${NO_WUNUSED_BUT_SET_VARIABLE}
+CFLAGS.zstd_ddict.c= -U__BMI__ -fno-tree-vectorize ${NO_WBITWISE_INSTEAD_OF_LOGICAL}
+CFLAGS.zstd_decompress.c= -U__BMI__ -fno-tree-vectorize ${NO_WBITWISE_INSTEAD_OF_LOGICAL}
+CFLAGS.zstd_decompress_block.c= -U__BMI__ -fno-tree-vectorize ${NO_WBITWISE_INSTEAD_OF_LOGICAL}
+CFLAGS.zstd_double_fast.c= -U__BMI__ -fno-tree-vectorize ${NO_WBITWISE_INSTEAD_OF_LOGICAL}
+CFLAGS.zstd_fast.c= -U__BMI__ -fno-tree-vectorize ${NO_WBITWISE_INSTEAD_OF_LOGICAL}
+CFLAGS.zstd_lazy.c= -U__BMI__ -fno-tree-vectorize ${NO_WBITWISE_INSTEAD_OF_LOGICAL}
+CFLAGS.zstd_ldm.c= -U__BMI__ -fno-tree-vectorize ${NO_WBITWISE_INSTEAD_OF_LOGICAL}
+CFLAGS.zstd_opt.c= -U__BMI__ -fno-tree-vectorize ${NO_WBITWISE_INSTEAD_OF_LOGICAL}
+
+.if ${MACHINE_ARCH} == "aarch64"
+__ZFS_ZSTD_AARCH64_FLAGS= -include ${SRCDIR}/zstd/include/aarch64_compat.h
+CFLAGS.zstd.c+= ${__ZFS_ZSTD_AARCH64_FLAGS}
+CFLAGS.entropy_common.c+= ${__ZFS_ZSTD_AARCH64_FLAGS}
+CFLAGS.error_private.c+= ${__ZFS_ZSTD_AARCH64_FLAGS}
+CFLAGS.fse_compress.c+= ${__ZFS_ZSTD_AARCH64_FLAGS}
+CFLAGS.fse_decompress.c+= ${__ZFS_ZSTD_AARCH64_FLAGS}
+CFLAGS.hist.c+= ${__ZFS_ZSTD_AARCH64_FLAGS}
+CFLAGS.huf_compress.c+= ${__ZFS_ZSTD_AARCH64_FLAGS}
+CFLAGS.huf_decompress.c+= ${__ZFS_ZSTD_AARCH64_FLAGS}
+CFLAGS.pool.c+= ${__ZFS_ZSTD_AARCH64_FLAGS}
+CFLAGS.xxhash.c+= ${__ZFS_ZSTD_AARCH64_FLAGS}
+CFLAGS.zstd_common.c+= ${__ZFS_ZSTD_AARCH64_FLAGS}
+CFLAGS.zstd_compress.c+= ${__ZFS_ZSTD_AARCH64_FLAGS}
+CFLAGS.zstd_compress_literals.c+= ${__ZFS_ZSTD_AARCH64_FLAGS}
+CFLAGS.zstd_compress_sequences.c+= ${__ZFS_ZSTD_AARCH64_FLAGS}
+CFLAGS.zstd_compress_superblock.c+= ${__ZFS_ZSTD_AARCH64_FLAGS}
+CFLAGS.zstd_ddict.c+= ${__ZFS_ZSTD_AARCH64_FLAGS}
+CFLAGS.zstd_decompress.c+= ${__ZFS_ZSTD_AARCH64_FLAGS}
+CFLAGS.zstd_decompress_block.c+= ${__ZFS_ZSTD_AARCH64_FLAGS}
+CFLAGS.zstd_double_fast.c+= ${__ZFS_ZSTD_AARCH64_FLAGS}
+CFLAGS.zstd_fast.c+= ${__ZFS_ZSTD_AARCH64_FLAGS}
+CFLAGS.zstd_lazy.c+= ${__ZFS_ZSTD_AARCH64_FLAGS}
+CFLAGS.zstd_ldm.c+= ${__ZFS_ZSTD_AARCH64_FLAGS}
+CFLAGS.zstd_opt.c+= ${__ZFS_ZSTD_AARCH64_FLAGS}
+
+b3_aarch64_sse2.o: b3_aarch64_sse2.S
+ ${CC} -c ${CFLAGS:N-mgeneral-regs-only} ${WERROR} ${.IMPSRC} \
+ -o ${.TARGET}
+ ${CTFCONVERT_CMD}
+
+b3_aarch64_sse41.o: b3_aarch64_sse41.S
+ ${CC} -c ${CFLAGS:N-mgeneral-regs-only} ${WERROR} ${.IMPSRC} \
+ -o ${.TARGET}
+ ${CTFCONVERT_CMD}
+
+zfs-sha256-armv8.o: sha256-armv8.S
+ ${CC} -c ${CFLAGS:N-mgeneral-regs-only} ${WERROR} \
+ ${SRCDIR}/icp/asm-aarch64/sha2/sha256-armv8.S \
+ -o ${.TARGET}
+ ${CTFCONVERT_CMD}
+
+zfs-sha512-armv8.o: sha512-armv8.S
+ ${CC} -c ${CFLAGS:N-mgeneral-regs-only} ${WERROR} \
+ ${SRCDIR}/icp/asm-aarch64/sha2/sha512-armv8.S \
+ -o ${.TARGET}
+ ${CTFCONVERT_CMD}
+.endif
+
+.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
+zfs-sha256-x86_64.o: sha256-x86_64.S
+ ${CC} -c ${CFLAGS} ${WERROR} \
+ ${SRCDIR}/icp/asm-x86_64/sha2/sha256-x86_64.S \
+ -o ${.TARGET}
+ ${CTFCONVERT_CMD}
+
+zfs-sha512-x86_64.o: sha512-x86_64.S
+ ${CC} -c ${CFLAGS} ${WERROR} \
+ ${SRCDIR}/icp/asm-x86_64/sha2/sha512-x86_64.S \
+ -o ${.TARGET}
+ ${CTFCONVERT_CMD}
+.endif
diff --git a/sys/modules/zfs/static_ccompile.h b/sys/modules/zfs/static_ccompile.h
new file mode 100644
index 000000000000..7ebf4f6db3c4
--- /dev/null
+++ b/sys/modules/zfs/static_ccompile.h
@@ -0,0 +1,28 @@
+/*
+ */
+
+#ifndef _SPL_NVLIST_H_
+#define _SPL_NVLIST_H_
+
+#ifdef INVARIANTS
+#define ZFS_DEBUG
+#endif
+
+#define nvlist_add_nvlist spl_nvlist_add_nvlist
+#define nvlist_add_nvlist_array spl_nvlist_add_nvlist_array
+#define nvlist_add_nvpair spl_nvlist_add_nvpair
+#define nvlist_add_string spl_nvlist_add_string
+#define nvlist_add_string_array spl_nvlist_add_string_array
+#define nvlist_empty spl_nvlist_empty
+#define nvlist_exists spl_nvlist_exists
+#define nvlist_free spl_nvlist_free
+#define nvlist_next_nvpair spl_nvlist_next_nvpair
+#define nvlist_pack spl_nvlist_pack
+#define nvlist_prev_nvpair spl_nvlist_prev_nvpair
+#define nvlist_remove_nvpair spl_nvlist_remove_nvpair
+#define nvlist_size spl_nvlist_size
+#define nvlist_unpack spl_nvlist_unpack
+
+#define nvpair_type spl_nvpair_type
+#define nvpair_name spl_nvpair_name
+#endif
diff --git a/sys/modules/zfs/zfs_config.h b/sys/modules/zfs/zfs_config.h
new file mode 100644
index 000000000000..686ab2e3f80d
--- /dev/null
+++ b/sys/modules/zfs/zfs_config.h
@@ -0,0 +1,1149 @@
+/*
+ */
+
+/* zfs_config.h. Generated from zfs_config.h.in by configure. */
+/* zfs_config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if translation of program messages to the user's native
+ language is requested. */
+/* #undef ENABLE_NLS */
+
+/* bio_end_io_t wants 1 arg */
+/* #undef HAVE_1ARG_BIO_END_IO_T */
+
+/* lookup_bdev() wants 1 arg */
+/* #undef HAVE_1ARG_LOOKUP_BDEV */
+
+/* submit_bio() wants 1 arg */
+/* #undef HAVE_1ARG_SUBMIT_BIO */
+
+/* bdi_setup_and_register() wants 2 args */
+/* #undef HAVE_2ARGS_BDI_SETUP_AND_REGISTER */
+
+/* vfs_getattr wants 2 args */
+/* #undef HAVE_2ARGS_VFS_GETATTR */
+
+/* zlib_deflate_workspacesize() wants 2 args */
+/* #undef HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE */
+
+/* bdi_setup_and_register() wants 3 args */
+/* #undef HAVE_3ARGS_BDI_SETUP_AND_REGISTER */
+
+/* vfs_getattr wants 3 args */
+/* #undef HAVE_3ARGS_VFS_GETATTR */
+
+/* vfs_getattr wants 4 args */
+/* #undef HAVE_4ARGS_VFS_GETATTR */
+
+/* kernel has access_ok with 'type' parameter */
+/* #undef HAVE_ACCESS_OK_TYPE */
+
+/* posix_acl has refcount_t */
+/* #undef HAVE_ACL_REFCOUNT */
+
+/* add_disk() returns int */
+/* #undef HAVE_ADD_DISK_RET */
+
+/* Define if host toolchain supports AES */
+#define HAVE_AES 1
+
+/* Define if you have [rt] */
+#define HAVE_AIO_H 1
+
+#ifdef __amd64__
+#ifndef RESCUE
+/* Define if host toolchain supports AVX */
+#define HAVE_AVX 1
+#endif
+
+/* Define if host toolchain supports AVX2 */
+#define HAVE_AVX2 1
+
+/* Define if host toolchain supports AVX512BW */
+#define HAVE_AVX512BW 1
+
+/* Define if host toolchain supports AVX512CD */
+#define HAVE_AVX512CD 1
+
+/* Define if host toolchain supports AVX512DQ */
+#define HAVE_AVX512DQ 1
+
+/* Define if host toolchain supports AVX512ER */
+#define HAVE_AVX512ER 1
+
+/* Define if host toolchain supports AVX512F */
+#define HAVE_AVX512F 1
+
+/* Define if host toolchain supports AVX512IFMA */
+#define HAVE_AVX512IFMA 1
+
+/* Define if host toolchain supports AVX512PF */
+#define HAVE_AVX512PF 1
+
+/* Define if host toolchain supports AVX512VBMI */
+#define HAVE_AVX512VBMI 1
+
+/* Define if host toolchain supports AVX512VL */
+#define HAVE_AVX512VL 1
+#endif
+
+/* bdevname() is available */
+/* #undef HAVE_BDEVNAME */
+
+/* bdev_check_media_change() exists */
+/* #undef HAVE_BDEV_CHECK_MEDIA_CHANGE */
+
+/* bdev_*_io_acct() available */
+/* #undef HAVE_BDEV_IO_ACCT_63 */
+
+/* bdev_*_io_acct() available */
+/* #undef HAVE_BDEV_IO_ACCT_OLD */
+
+/* bdev_kobj() exists */
+/* #undef HAVE_BDEV_KOBJ */
+
+/* bdev_max_discard_sectors() is available */
+/* #undef HAVE_BDEV_MAX_DISCARD_SECTORS */
+
+/* bdev_max_secure_erase_sectors() is available */
+/* #undef HAVE_BDEV_MAX_SECURE_ERASE_SECTORS */
+
+/* block_device_operations->submit_bio() returns void */
+/* #undef HAVE_BDEV_SUBMIT_BIO_RETURNS_VOID */
+
+/* bdev_whole() is available */
+/* #undef HAVE_BDEV_WHOLE */
+
+/* bio_alloc() takes 4 arguments */
+/* #undef HAVE_BIO_ALLOC_4ARG */
+
+/* bio->bi_bdev->bd_disk exists */
+/* #undef HAVE_BIO_BDEV_DISK */
+
+/* bio->bi_opf is defined */
+/* #undef HAVE_BIO_BI_OPF */
+
+/* bio->bi_status exists */
+/* #undef HAVE_BIO_BI_STATUS */
+
+/* bio has bi_iter */
+/* #undef HAVE_BIO_BVEC_ITER */
+
+/* bio_*_io_acct() available */
+/* #undef HAVE_BIO_IO_ACCT */
+
+/* bio_max_segs() is implemented */
+/* #undef HAVE_BIO_MAX_SEGS */
+
+/* bio_set_dev() is available */
+/* #undef HAVE_BIO_SET_DEV */
+
+/* bio_set_dev() GPL-only */
+/* #undef HAVE_BIO_SET_DEV_GPL_ONLY */
+
+/* bio_set_dev() is a macro */
+/* #undef HAVE_BIO_SET_DEV_MACRO */
+
+/* bio_set_op_attrs is available */
+/* #undef HAVE_BIO_SET_OP_ATTRS */
+
+/* blkdev_get_by_path() exists and takes 4 args */
+/* #undef HAVE_BLKDEV_GET_BY_PATH_4ARG */
+
+/* blkdev_get_by_path() handles ERESTARTSYS */
+/* #undef HAVE_BLKDEV_GET_ERESTARTSYS */
+
+/* blkdev_issue_discard() is available */
+/* #undef HAVE_BLKDEV_ISSUE_DISCARD */
+
+/* blkdev_issue_secure_erase() is available */
+/* #undef HAVE_BLKDEV_ISSUE_SECURE_ERASE */
+
+/* blkdev_put() accepts void* as arg 2 */
+/* #undef HAVE_BLKDEV_PUT_HOLDER */
+
+/* blkdev_reread_part() exists */
+/* #undef HAVE_BLKDEV_REREAD_PART */
+
+/* blkg_tryget() is available */
+/* #undef HAVE_BLKG_TRYGET */
+
+/* blkg_tryget() GPL-only */
+/* #undef HAVE_BLKG_TRYGET_GPL_ONLY */
+
+/* blk_alloc_disk() exists */
+/* #undef HAVE_BLK_ALLOC_DISK */
+
+/* blk_alloc_queue() expects request function */
+/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN */
+
+/* blk_alloc_queue_rh() expects request function */
+/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH */
+
+/* blk_cleanup_disk() exists */
+/* #undef HAVE_BLK_CLEANUP_DISK */
+
+/* blk_mode_t is defined */
+/* #undef HAVE_BLK_MODE_T */
+
+/* block multiqueue is available */
+/* #undef HAVE_BLK_MQ */
+
+/* blk queue backing_dev_info is dynamic */
+/* #undef HAVE_BLK_QUEUE_BDI_DYNAMIC */
+
+/* blk_queue_discard() is available */
+/* #undef HAVE_BLK_QUEUE_DISCARD */
+
+/* blk_queue_flag_clear() exists */
+/* #undef HAVE_BLK_QUEUE_FLAG_CLEAR */
+
+/* blk_queue_flag_set() exists */
+/* #undef HAVE_BLK_QUEUE_FLAG_SET */
+
+/* blk_queue_flush() is available */
+/* #undef HAVE_BLK_QUEUE_FLUSH */
+
+/* blk_queue_flush() is GPL-only */
+/* #undef HAVE_BLK_QUEUE_FLUSH_GPL_ONLY */
+
+/* blk_queue_secdiscard() is available */
+/* #undef HAVE_BLK_QUEUE_SECDISCARD */
+
+/* blk_queue_secure_erase() is available */
+/* #undef HAVE_BLK_QUEUE_SECURE_ERASE */
+
+/* blk_queue_update_readahead() exists */
+/* #undef HAVE_BLK_QUEUE_UPDATE_READAHEAD */
+
+/* blk_queue_write_cache() exists */
+/* #undef HAVE_BLK_QUEUE_WRITE_CACHE */
+
+/* blk_queue_write_cache() is GPL-only */
+/* #undef HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY */
+
+/* BLK_STS_RESV_CONFLICT is defined */
+/* #undef HAVE_BLK_STS_RESV_CONFLICT */
+
+/* Define if release() in block_device_operations takes 1 arg */
+/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_RELEASE_1ARG */
+
+/* Define if revalidate_disk() in block_device_operations */
+/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK */
+
+/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the
+ CoreFoundation framework. */
+/* #undef HAVE_CFLOCALECOPYCURRENT */
+
+/* Define to 1 if you have the Mac OS X function
+ CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */
+/* #undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES */
+
+/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in
+ the CoreFoundation framework. */
+/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */
+
+/* check_disk_change() exists */
+/* #undef HAVE_CHECK_DISK_CHANGE */
+
+/* clear_inode() is available */
+/* #undef HAVE_CLEAR_INODE */
+
+/* dentry uses const struct dentry_operations */
+/* #undef HAVE_CONST_DENTRY_OPERATIONS */
+
+/* copy_from_iter() is available */
+/* #undef HAVE_COPY_FROM_ITER */
+
+/* copy_splice_read exists */
+/* #undef HAVE_COPY_SPLICE_READ */
+
+/* copy_to_iter() is available */
+/* #undef HAVE_COPY_TO_ITER */
+
+/* cpu_has_feature() is GPL-only */
+/* #undef HAVE_CPU_HAS_FEATURE_GPL_ONLY */
+
+/* yes */
+/* #undef HAVE_CPU_HOTPLUG */
+
+/* current_time() exists */
+/* #undef HAVE_CURRENT_TIME */
+
+/* Define if the GNU dcgettext() function is already present or preinstalled.
+ */
+/* #undef HAVE_DCGETTEXT */
+
+/* DECLARE_EVENT_CLASS() is available */
+/* #undef HAVE_DECLARE_EVENT_CLASS */
+
+/* dentry aliases are in d_u member */
+/* #undef HAVE_DENTRY_D_U_ALIASES */
+
+/* dequeue_signal() takes 4 arguments */
+/* #undef HAVE_DEQUEUE_SIGNAL_4ARG */
+
+/* lookup_bdev() wants dev_t arg */
+/* #undef HAVE_DEVT_LOOKUP_BDEV */
+
+/* sops->dirty_inode() wants flags */
+/* #undef HAVE_DIRTY_INODE_WITH_FLAGS */
+
+/* disk_check_media_change() exists */
+/* #undef HAVE_DISK_CHECK_MEDIA_CHANGE */
+
+/* disk_*_io_acct() available */
+/* #undef HAVE_DISK_IO_ACCT */
+
+/* disk_update_readahead() exists */
+/* #undef HAVE_DISK_UPDATE_READAHEAD */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* d_make_root() is available */
+/* #undef HAVE_D_MAKE_ROOT */
+
+/* d_prune_aliases() is available */
+/* #undef HAVE_D_PRUNE_ALIASES */
+
+/* dops->d_revalidate() operation takes nameidata */
+/* #undef HAVE_D_REVALIDATE_NAMEIDATA */
+
+/* eops->encode_fh() wants child and parent inodes */
+/* #undef HAVE_ENCODE_FH_WITH_INODE */
+
+/* sops->evict_inode() exists */
+/* #undef HAVE_EVICT_INODE */
+
+/* FALLOC_FL_ZERO_RANGE is defined */
+/* #undef HAVE_FALLOC_FL_ZERO_RANGE */
+
+/* fault_in_iov_iter_readable() is available */
+/* #undef HAVE_FAULT_IN_IOV_ITER_READABLE */
+
+/* filemap_range_has_page() is available */
+/* #undef HAVE_FILEMAP_RANGE_HAS_PAGE */
+
+/* fops->aio_fsync() exists */
+/* #undef HAVE_FILE_AIO_FSYNC */
+
+/* file_dentry() is available */
+/* #undef HAVE_FILE_DENTRY */
+
+/* fops->fadvise() exists */
+/* #undef HAVE_FILE_FADVISE */
+
+/* file_inode() is available */
+/* #undef HAVE_FILE_INODE */
+
+/* flush_dcache_page() is GPL-only */
+/* #undef HAVE_FLUSH_DCACHE_PAGE_GPL_ONLY */
+
+/* iops->follow_link() cookie */
+/* #undef HAVE_FOLLOW_LINK_COOKIE */
+
+/* iops->follow_link() nameidata */
+/* #undef HAVE_FOLLOW_LINK_NAMEIDATA */
+
+/* Define if compiler supports -Wformat-overflow */
+/* #undef HAVE_FORMAT_OVERFLOW */
+
+/* fsync_bdev() is declared in include/blkdev.h */
+/* #undef HAVE_FSYNC_BDEV */
+
+/* fops->fsync() with range */
+/* #undef HAVE_FSYNC_RANGE */
+
+/* fops->fsync() without dentry */
+/* #undef HAVE_FSYNC_WITHOUT_DENTRY */
+
+/* yes */
+/* #undef HAVE_GENERIC_FADVISE */
+
+/* generic_fillattr requires struct mnt_idmap* */
+/* #undef HAVE_GENERIC_FILLATTR_IDMAP */
+
+/* generic_fillattr requires struct mnt_idmap* and u32 request_mask */
+/* #undef HAVE_GENERIC_FILLATTR_IDMAP_REQMASK */
+
+/* generic_fillattr requires struct user_namespace* */
+/* #undef HAVE_GENERIC_FILLATTR_USERNS */
+
+/* generic_*_io_acct() 3 arg available */
+/* #undef HAVE_GENERIC_IO_ACCT_3ARG */
+
+/* generic_*_io_acct() 4 arg available */
+/* #undef HAVE_GENERIC_IO_ACCT_4ARG */
+
+/* generic_readlink is global */
+/* #undef HAVE_GENERIC_READLINK */
+
+/* generic_setxattr() exists */
+/* #undef HAVE_GENERIC_SETXATTR */
+
+/* generic_write_checks() takes kiocb */
+/* #undef HAVE_GENERIC_WRITE_CHECKS_KIOCB */
+
+/* Define if the GNU gettext() function is already present or preinstalled. */
+/* #undef HAVE_GETTEXT */
+
+/* iops->get_acl() exists */
+/* #undef HAVE_GET_ACL */
+
+/* iops->get_acl() takes rcu */
+/* #undef HAVE_GET_ACL_RCU */
+
+/* has iops->get_inode_acl() */
+/* #undef HAVE_GET_INODE_ACL */
+
+/* iops->get_link() cookie */
+/* #undef HAVE_GET_LINK_COOKIE */
+
+/* iops->get_link() delayed */
+/* #undef HAVE_GET_LINK_DELAYED */
+
+/* group_info->gid exists */
+/* #undef HAVE_GROUP_INFO_GID */
+
+/* has_capability() is available */
+/* #undef HAVE_HAS_CAPABILITY */
+
+/* iattr->ia_vfsuid and iattr->ia_vfsgid exist */
+/* #undef HAVE_IATTR_VFSID */
+
+/* Define if you have the iconv() function and it works. */
+#define HAVE_ICONV 1
+
+/* iops->getattr() takes struct mnt_idmap* */
+/* #undef HAVE_IDMAP_IOPS_GETATTR */
+
+/* iops->setattr() takes struct mnt_idmap* */
+/* #undef HAVE_IDMAP_IOPS_SETATTR */
+
+/* APIs for idmapped mount are present */
+/* #undef HAVE_IDMAP_MNT_API */
+
+/* Define if compiler supports -Wimplicit-fallthrough */
+/* #undef HAVE_IMPLICIT_FALLTHROUGH */
+
+/* Define if compiler supports -Winfinite-recursion */
+/* #undef HAVE_INFINITE_RECURSION */
+
+/* inode_get_ctime() exists in linux/fs.h */
+/* #undef HAVE_INODE_GET_CTIME */
+
+/* yes */
+/* #undef HAVE_INODE_LOCK_SHARED */
+
+/* inode_owner_or_capable() exists */
+/* #undef HAVE_INODE_OWNER_OR_CAPABLE */
+
+/* inode_owner_or_capable() takes mnt_idmap */
+/* #undef HAVE_INODE_OWNER_OR_CAPABLE_IDMAP */
+
+/* inode_owner_or_capable() takes user_ns */
+/* #undef HAVE_INODE_OWNER_OR_CAPABLE_USERNS */
+
+/* inode_set_ctime_to_ts() exists in linux/fs.h */
+/* #undef HAVE_INODE_SET_CTIME_TO_TS */
+
+/* inode_set_flags() exists */
+/* #undef HAVE_INODE_SET_FLAGS */
+
+/* inode_set_iversion() exists */
+/* #undef HAVE_INODE_SET_IVERSION */
+
+/* inode->i_*time's are timespec64 */
+/* #undef HAVE_INODE_TIMESPEC64_TIMES */
+
+/* timestamp_truncate() exists */
+/* #undef HAVE_INODE_TIMESTAMP_TRUNCATE */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* in_compat_syscall() is available */
+/* #undef HAVE_IN_COMPAT_SYSCALL */
+
+/* iops->create() takes struct mnt_idmap* */
+/* #undef HAVE_IOPS_CREATE_IDMAP */
+
+/* iops->create() takes struct user_namespace* */
+/* #undef HAVE_IOPS_CREATE_USERNS */
+
+/* iops->mkdir() takes struct mnt_idmap* */
+/* #undef HAVE_IOPS_MKDIR_IDMAP */
+
+/* iops->mkdir() takes struct user_namespace* */
+/* #undef HAVE_IOPS_MKDIR_USERNS */
+
+/* iops->mknod() takes struct mnt_idmap* */
+/* #undef HAVE_IOPS_MKNOD_IDMAP */
+
+/* iops->mknod() takes struct user_namespace* */
+/* #undef HAVE_IOPS_MKNOD_USERNS */
+
+/* iops->permission() takes struct mnt_idmap* */
+/* #undef HAVE_IOPS_PERMISSION_IDMAP */
+
+/* iops->permission() takes struct user_namespace* */
+/* #undef HAVE_IOPS_PERMISSION_USERNS */
+
+/* iops->rename() takes struct mnt_idmap* */
+/* #undef HAVE_IOPS_RENAME_IDMAP */
+
+/* iops->rename() takes struct user_namespace* */
+/* #undef HAVE_IOPS_RENAME_USERNS */
+
+/* iops->setattr() exists */
+/* #undef HAVE_IOPS_SETATTR */
+
+/* iops->symlink() takes struct mnt_idmap* */
+/* #undef HAVE_IOPS_SYMLINK_IDMAP */
+
+/* iops->symlink() takes struct user_namespace* */
+/* #undef HAVE_IOPS_SYMLINK_USERNS */
+
+/* iov_iter_advance() is available */
+/* #undef HAVE_IOV_ITER_ADVANCE */
+
+/* iov_iter_count() is available */
+/* #undef HAVE_IOV_ITER_COUNT */
+
+/* iov_iter_fault_in_readable() is available */
+/* #undef HAVE_IOV_ITER_FAULT_IN_READABLE */
+
+/* iov_iter_revert() is available */
+/* #undef HAVE_IOV_ITER_REVERT */
+
+/* iov_iter_type() is available */
+/* #undef HAVE_IOV_ITER_TYPE */
+
+/* iov_iter types are available */
+/* #undef HAVE_IOV_ITER_TYPES */
+
+/* yes */
+/* #undef HAVE_IO_SCHEDULE_TIMEOUT */
+
+/* Define to 1 if you have the `issetugid' function. */
+#define HAVE_ISSETUGID 1
+
+/* iter_iov() is available */
+/* #undef HAVE_ITER_IOV */
+
+/* kernel has kernel_fpu_* functions */
+/* #undef HAVE_KERNEL_FPU */
+
+/* kernel has asm/fpu/api.h */
+/* #undef HAVE_KERNEL_FPU_API_HEADER */
+
+/* kernel fpu internal */
+/* #undef HAVE_KERNEL_FPU_INTERNAL */
+
+/* kernel has asm/fpu/internal.h */
+/* #undef HAVE_KERNEL_FPU_INTERNAL_HEADER */
+
+/* uncached_acl_sentinel() exists */
+/* #undef HAVE_KERNEL_GET_ACL_HANDLE_CACHE */
+
+/* Define if compiler supports -Winfinite-recursion */
+/* #undef HAVE_KERNEL_INFINITE_RECURSION */
+
+/* kernel does stack verification */
+/* #undef HAVE_KERNEL_OBJTOOL */
+
+/* kernel has linux/objtool.h */
+/* #undef HAVE_KERNEL_OBJTOOL_HEADER */
+
+/* kernel_read() take loff_t pointer */
+/* #undef HAVE_KERNEL_READ_PPOS */
+
+/* timer_list.function gets a timer_list */
+/* #undef HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST */
+
+/* struct timer_list has a flags member */
+/* #undef HAVE_KERNEL_TIMER_LIST_FLAGS */
+
+/* timer_setup() is available */
+/* #undef HAVE_KERNEL_TIMER_SETUP */
+
+/* kernel_write() take loff_t pointer */
+/* #undef HAVE_KERNEL_WRITE_PPOS */
+
+/* kmem_cache_create_usercopy() exists */
+/* #undef HAVE_KMEM_CACHE_CREATE_USERCOPY */
+
+/* kstrtoul() exists */
+/* #undef HAVE_KSTRTOUL */
+
+/* ktime_get_coarse_real_ts64() exists */
+/* #undef HAVE_KTIME_GET_COARSE_REAL_TS64 */
+
+/* ktime_get_raw_ts64() exists */
+/* #undef HAVE_KTIME_GET_RAW_TS64 */
+
+/* kvmalloc exists */
+/* #undef HAVE_KVMALLOC */
+
+/* Define if you have [aio] */
+/* #undef HAVE_LIBAIO */
+
+/* Define if you have [blkid] */
+/* #undef HAVE_LIBBLKID */
+
+/* Define if you have [crypto] */
+#define HAVE_LIBCRYPTO 1
+
+/* Define if you have [tirpc] */
+/* #undef HAVE_LIBTIRPC */
+
+/* Define if you have [udev] */
+/* #undef HAVE_LIBUDEV */
+
+/* Define if you have [uuid] */
+/* #undef HAVE_LIBUUID */
+
+/* linux/blk-cgroup.h exists */
+/* #undef HAVE_LINUX_BLK_CGROUP_HEADER */
+
+/* lseek_execute() is available */
+/* #undef HAVE_LSEEK_EXECUTE */
+
+/* makedev() is declared in sys/mkdev.h */
+/* #undef HAVE_MAKEDEV_IN_MKDEV */
+
+/* makedev() is declared in sys/sysmacros.h */
+/* #undef HAVE_MAKEDEV_IN_SYSMACROS */
+
+/* Noting that make_request_fn() returns blk_qc_t */
+/* #undef HAVE_MAKE_REQUEST_FN_RET_QC */
+
+/* Noting that make_request_fn() returns void */
+/* #undef HAVE_MAKE_REQUEST_FN_RET_VOID */
+
+/* iops->mkdir() takes umode_t */
+/* #undef HAVE_MKDIR_UMODE_T */
+
+/* Define to 1 if you have the `mlockall' function. */
+#define HAVE_MLOCKALL 1
+
+/* lookup_bdev() wants mode arg */
+/* #undef HAVE_MODE_LOOKUP_BDEV */
+
+/* Define if host toolchain supports MOVBE */
+#define HAVE_MOVBE 1
+
+/* new_sync_read()/new_sync_write() are available */
+/* #undef HAVE_NEW_SYNC_READ */
+
+/* folio_wait_bit() exists */
+/* #undef HAVE_PAGEMAP_FOLIO_WAIT_BIT */
+
+/* part_to_dev() exists */
+/* #undef HAVE_PART_TO_DEV */
+
+/* iops->getattr() takes a path */
+/* #undef HAVE_PATH_IOPS_GETATTR */
+
+/* Define if host toolchain supports PCLMULQDQ */
+#define HAVE_PCLMULQDQ 1
+
+/* percpu_counter_add_batch() is defined */
+/* #undef HAVE_PERCPU_COUNTER_ADD_BATCH */
+
+/* percpu_counter_init() wants gfp_t */
+/* #undef HAVE_PERCPU_COUNTER_INIT_WITH_GFP */
+
+/* posix_acl_chmod() exists */
+/* #undef HAVE_POSIX_ACL_CHMOD */
+
+/* posix_acl_from_xattr() needs user_ns */
+/* #undef HAVE_POSIX_ACL_FROM_XATTR_USERNS */
+
+/* posix_acl_release() is available */
+/* #undef HAVE_POSIX_ACL_RELEASE */
+
+/* posix_acl_release() is GPL-only */
+/* #undef HAVE_POSIX_ACL_RELEASE_GPL_ONLY */
+
+/* posix_acl_valid() wants user namespace */
+/* #undef HAVE_POSIX_ACL_VALID_WITH_NS */
+
+/* proc_ops structure exists */
+/* #undef HAVE_PROC_OPS_STRUCT */
+
+/* iops->put_link() cookie */
+/* #undef HAVE_PUT_LINK_COOKIE */
+
+/* iops->put_link() delayed */
+/* #undef HAVE_PUT_LINK_DELAYED */
+
+/* iops->put_link() nameidata */
+/* #undef HAVE_PUT_LINK_NAMEIDATA */
+
+/* If available, contains the Python version number currently in use. */
+#define HAVE_PYTHON "3.7"
+
+/* qat is enabled and existed */
+/* #undef HAVE_QAT */
+
+/* struct reclaim_state has reclaimed */
+/* #undef HAVE_RECLAIM_STATE_RECLAIMED */
+
+/* register_shrinker is vararg */
+/* #undef HAVE_REGISTER_SHRINKER_VARARG */
+
+/* register_sysctl_table exists */
+/* #undef HAVE_REGISTER_SYSCTL_TABLE */
+
+/* iops->rename2() exists */
+/* #undef HAVE_RENAME2 */
+
+/* struct inode_operations_wrapper takes .rename2() */
+/* #undef HAVE_RENAME2_OPERATIONS_WRAPPER */
+
+/* iops->rename() wants flags */
+/* #undef HAVE_RENAME_WANTS_FLAGS */
+
+/* REQ_DISCARD is defined */
+/* #undef HAVE_REQ_DISCARD */
+
+/* REQ_FLUSH is defined */
+/* #undef HAVE_REQ_FLUSH */
+
+/* REQ_OP_DISCARD is defined */
+/* #undef HAVE_REQ_OP_DISCARD */
+
+/* REQ_OP_FLUSH is defined */
+/* #undef HAVE_REQ_OP_FLUSH */
+
+/* REQ_OP_SECURE_ERASE is defined */
+/* #undef HAVE_REQ_OP_SECURE_ERASE */
+
+/* REQ_PREFLUSH is defined */
+/* #undef HAVE_REQ_PREFLUSH */
+
+/* revalidate_disk() is available */
+/* #undef HAVE_REVALIDATE_DISK */
+
+/* revalidate_disk_size() is available */
+/* #undef HAVE_REVALIDATE_DISK_SIZE */
+
+/* struct rw_semaphore has member activity */
+/* #undef HAVE_RWSEM_ACTIVITY */
+
+/* struct rw_semaphore has atomic_long_t member count */
+/* #undef HAVE_RWSEM_ATOMIC_LONG_COUNT */
+
+/* linux/sched/signal.h exists */
+/* #undef HAVE_SCHED_SIGNAL_HEADER */
+
+/* Define to 1 if you have the <security/pam_modules.h> header file. */
+#define HAVE_SECURITY_PAM_MODULES_H 1
+
+/* setattr_prepare() accepts mnt_idmap */
+/* #undef HAVE_SETATTR_PREPARE_IDMAP */
+
+/* setattr_prepare() is available, doesn't accept user_namespace */
+/* #undef HAVE_SETATTR_PREPARE_NO_USERNS */
+
+/* setattr_prepare() accepts user_namespace */
+/* #undef HAVE_SETATTR_PREPARE_USERNS */
+
+/* iops->set_acl() exists, takes 3 args */
+/* #undef HAVE_SET_ACL */
+
+/* iops->set_acl() takes 4 args, arg1 is struct mnt_idmap * */
+/* #undef HAVE_SET_ACL_IDMAP_DENTRY */
+
+/* iops->set_acl() takes 4 args */
+/* #undef HAVE_SET_ACL_USERNS */
+
+/* iops->set_acl() takes 4 args, arg2 is struct dentry * */
+/* #undef HAVE_SET_ACL_USERNS_DENTRY_ARG2 */
+
+/* set_cached_acl() is usable */
+/* #undef HAVE_SET_CACHED_ACL_USABLE */
+
+/* set_special_state() exists */
+/* #undef HAVE_SET_SPECIAL_STATE */
+
+/* struct shrink_control exists */
+/* #undef HAVE_SHRINK_CONTROL_STRUCT */
+
+/* kernel_siginfo_t exists */
+/* #undef HAVE_SIGINFO */
+
+/* signal_stop() exists */
+/* #undef HAVE_SIGNAL_STOP */
+
+/* new shrinker callback wants 2 args */
+/* #undef HAVE_SINGLE_SHRINKER_CALLBACK */
+
+/* cs->count_objects exists */
+/* #undef HAVE_SPLIT_SHRINKER_CALLBACK */
+
+#if defined(__amd64__) || defined(__i386__)
+/* Define if host toolchain supports SSE */
+#define HAVE_SSE 1
+
+/* Define if host toolchain supports SSE2 */
+#define HAVE_SSE2 1
+
+/* Define if host toolchain supports SSE3 */
+#define HAVE_SSE3 1
+
+/* Define if host toolchain supports SSE4.1 */
+#define HAVE_SSE4_1 1
+
+/* Define if host toolchain supports SSE4.2 */
+#define HAVE_SSE4_2 1
+
+/* Define if host toolchain supports SSSE3 */
+#define HAVE_SSSE3 1
+#endif
+
+/* STACK_FRAME_NON_STANDARD is defined */
+/* #undef HAVE_STACK_FRAME_NON_STANDARD */
+
+/* standalone <linux/stdarg.h> exists */
+/* #undef HAVE_STANDALONE_LINUX_STDARG */
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdio.h> header file. */
+#define HAVE_STDIO_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strlcat' function. */
+#define HAVE_STRLCAT 1
+
+/* Define to 1 if you have the `strlcpy' function. */
+#define HAVE_STRLCPY 1
+
+/* submit_bio is member of struct block_device_operations */
+/* #undef HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS */
+
+/* super_setup_bdi_name() exits */
+/* #undef HAVE_SUPER_SETUP_BDI_NAME */
+
+/* super_block->s_user_ns exists */
+/* #undef HAVE_SUPER_USER_NS */
+
+/* sync_blockdev() is declared in include/blkdev.h */
+/* #undef HAVE_SYNC_BLOCKDEV */
+
+/* struct kobj_type has default_groups */
+/* #undef HAVE_SYSFS_DEFAULT_GROUPS */
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* i_op->tmpfile() exists */
+/* #undef HAVE_TMPFILE */
+
+/* i_op->tmpfile() uses old dentry signature */
+/* #undef HAVE_TMPFILE_DENTRY */
+
+/* i_op->tmpfile() has mnt_idmap */
+/* #undef HAVE_TMPFILE_IDMAP */
+
+/* i_op->tmpfile() has userns */
+/* #undef HAVE_TMPFILE_USERNS */
+
+/* totalhigh_pages() exists */
+/* #undef HAVE_TOTALHIGH_PAGES */
+
+/* kernel has totalram_pages() */
+/* #undef HAVE_TOTALRAM_PAGES_FUNC */
+
+/* Define to 1 if you have the `udev_device_get_is_initialized' function. */
+/* #undef HAVE_UDEV_DEVICE_GET_IS_INITIALIZED */
+
+/* kernel has __kernel_fpu_* functions */
+/* #undef HAVE_UNDERSCORE_KERNEL_FPU */
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* iops->getattr() takes struct user_namespace* */
+/* #undef HAVE_USERNS_IOPS_GETATTR */
+
+/* iops->setattr() takes struct user_namespace* */
+/* #undef HAVE_USERNS_IOPS_SETATTR */
+
+/* user_namespace->ns.inum exists */
+/* #undef HAVE_USER_NS_COMMON_INUM */
+
+/* iops->getattr() takes a vfsmount */
+/* #undef HAVE_VFSMOUNT_IOPS_GETATTR */
+
+/* fops->clone_file_range() is available */
+/* #undef HAVE_VFS_CLONE_FILE_RANGE */
+
+/* fops->copy_file_range() is available */
+/* #undef HAVE_VFS_COPY_FILE_RANGE */
+
+/* fops->dedupe_file_range() is available */
+/* #undef HAVE_VFS_DEDUPE_FILE_RANGE */
+
+/* aops->direct_IO() uses iovec */
+/* #undef HAVE_VFS_DIRECT_IO_IOVEC */
+
+/* aops->direct_IO() uses iov_iter without rw */
+/* #undef HAVE_VFS_DIRECT_IO_ITER */
+
+/* aops->direct_IO() uses iov_iter with offset */
+/* #undef HAVE_VFS_DIRECT_IO_ITER_OFFSET */
+
+/* aops->direct_IO() uses iov_iter with rw and offset */
+/* #undef HAVE_VFS_DIRECT_IO_ITER_RW_OFFSET */
+
+/* filemap_dirty_folio exists */
+/* #undef HAVE_VFS_FILEMAP_DIRTY_FOLIO */
+
+/* file_operations_extend takes .copy_file_range() and .clone_file_range() */
+/* #undef HAVE_VFS_FILE_OPERATIONS_EXTEND */
+
+/* generic_copy_file_range() is available */
+/* #undef HAVE_VFS_GENERIC_COPY_FILE_RANGE */
+
+/* All required iov_iter interfaces are available */
+/* #undef HAVE_VFS_IOV_ITER */
+
+/* fops->iterate() is available */
+/* #undef HAVE_VFS_ITERATE */
+
+/* fops->iterate_shared() is available */
+/* #undef HAVE_VFS_ITERATE_SHARED */
+
+/* fops->readdir() is available */
+/* #undef HAVE_VFS_READDIR */
+
+/* address_space_operations->readpages exists */
+/* #undef HAVE_VFS_READPAGES */
+
+/* read_folio exists */
+/* #undef HAVE_VFS_READ_FOLIO */
+
+/* fops->remap_file_range() is available */
+/* #undef HAVE_VFS_REMAP_FILE_RANGE */
+
+/* fops->read/write_iter() are available */
+/* #undef HAVE_VFS_RW_ITERATE */
+
+/* __set_page_dirty_nobuffers exists */
+/* #undef HAVE_VFS_SET_PAGE_DIRTY_NOBUFFERS */
+
+/* __vmalloc page flags exists */
+/* #undef HAVE_VMALLOC_PAGE_KERNEL */
+
+/* yes */
+/* #undef HAVE_WAIT_ON_BIT_ACTION */
+
+/* wait_queue_entry_t exists */
+/* #undef HAVE_WAIT_QUEUE_ENTRY_T */
+
+/* wq_head->head and wq_entry->entry exist */
+/* #undef HAVE_WAIT_QUEUE_HEAD_ENTRY */
+
+/* int (*writepage_t)() takes struct folio* */
+/* #undef HAVE_WRITEPAGE_T_FOLIO */
+
+/* xattr_handler->get() wants dentry */
+/* #undef HAVE_XATTR_GET_DENTRY */
+
+/* xattr_handler->get() wants both dentry and inode */
+/* #undef HAVE_XATTR_GET_DENTRY_INODE */
+
+/* xattr_handler->get() wants dentry and inode and flags */
+/* #undef HAVE_XATTR_GET_DENTRY_INODE_FLAGS */
+
+/* xattr_handler->get() wants xattr_handler */
+/* #undef HAVE_XATTR_GET_HANDLER */
+
+/* xattr_handler has name */
+/* #undef HAVE_XATTR_HANDLER_NAME */
+
+/* xattr_handler->list() wants dentry */
+/* #undef HAVE_XATTR_LIST_DENTRY */
+
+/* xattr_handler->list() wants xattr_handler */
+/* #undef HAVE_XATTR_LIST_HANDLER */
+
+/* xattr_handler->list() wants simple */
+/* #undef HAVE_XATTR_LIST_SIMPLE */
+
+/* xattr_handler->set() wants dentry */
+/* #undef HAVE_XATTR_SET_DENTRY */
+
+/* xattr_handler->set() wants both dentry and inode */
+/* #undef HAVE_XATTR_SET_DENTRY_INODE */
+
+/* xattr_handler->set() wants xattr_handler */
+/* #undef HAVE_XATTR_SET_HANDLER */
+
+/* xattr_handler->set() takes mnt_idmap */
+/* #undef HAVE_XATTR_SET_IDMAP */
+
+/* xattr_handler->set() takes user_namespace */
+/* #undef HAVE_XATTR_SET_USERNS */
+
+/* Define if host toolchain supports XSAVE */
+#define HAVE_XSAVE 1
+
+/* Define if host toolchain supports XSAVEOPT */
+#define HAVE_XSAVEOPT 1
+
+/* Define if host toolchain supports XSAVES */
+#define HAVE_XSAVES 1
+
+/* ZERO_PAGE() is GPL-only */
+/* #undef HAVE_ZERO_PAGE_GPL_ONLY */
+
+/* Define if you have [z] */
+#define HAVE_ZLIB 1
+
+/* __posix_acl_chmod() exists */
+/* #undef HAVE___POSIX_ACL_CHMOD */
+
+/* kernel exports FPU functions */
+/* #undef KERNEL_EXPORTS_X86_FPU */
+
+/* TBD: fetch(3) support */
+#if 0
+/* whether the chosen libfetch is to be loaded at run-time */
+#define LIBFETCH_DYNAMIC 1
+
+/* libfetch is fetch(3) */
+#define LIBFETCH_IS_FETCH 1
+
+/* libfetch is libcurl */
+#define LIBFETCH_IS_LIBCURL 0
+
+/* soname of chosen libfetch */
+#define LIBFETCH_SONAME "libfetch.so.6"
+#endif
+
+/* Define to the sub-directory where libtool stores uninstalled libraries. */
+#define LT_OBJDIR ".libs/"
+
+/* make_request_fn() return type */
+/* #undef MAKE_REQUEST_FN_RET */
+
+/* struct shrink_control has nid */
+/* #undef SHRINK_CONTROL_HAS_NID */
+
+/* using complete_and_exit() instead */
+/* #undef SPL_KTHREAD_COMPLETE_AND_EXIT */
+
+/* Defined for legacy compatibility. */
+#define SPL_META_ALIAS ZFS_META_ALIAS
+
+/* Defined for legacy compatibility. */
+#define SPL_META_RELEASE ZFS_META_RELEASE
+
+/* Defined for legacy compatibility. */
+#define SPL_META_VERSION ZFS_META_VERSION
+
+/* pde_data() is PDE_DATA() */
+/* #undef SPL_PDE_DATA */
+
+/* Define to 1 if all of the C90 standard headers exist (not just the ones
+ required in a freestanding environment). This macro is provided for
+ backward compatibility; new code need not use it. */
+#define SYSTEM_FREEBSD 1
+
+/* True if ZFS is to be compiled for a Linux system */
+/* #undef SYSTEM_LINUX */
+
+/* Version number of package */
+/* #undef ZFS_DEBUG */
+
+/* /dev/zfs minor */
+/* #undef ZFS_DEVICE_MINOR */
+
+/* enum node_stat_item contains NR_FILE_PAGES */
+/* #undef ZFS_ENUM_NODE_STAT_ITEM_NR_FILE_PAGES */
+
+/* enum node_stat_item contains NR_INACTIVE_ANON */
+/* #undef ZFS_ENUM_NODE_STAT_ITEM_NR_INACTIVE_ANON */
+
+/* enum node_stat_item contains NR_INACTIVE_FILE */
+/* #undef ZFS_ENUM_NODE_STAT_ITEM_NR_INACTIVE_FILE */
+
+/* enum zone_stat_item contains NR_FILE_PAGES */
+/* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_FILE_PAGES */
+
+/* enum zone_stat_item contains NR_INACTIVE_ANON */
+/* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_INACTIVE_ANON */
+
+/* enum zone_stat_item contains NR_INACTIVE_FILE */
+/* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_INACTIVE_FILE */
+
+/* GENHD_FL_EXT_DEVT flag is not available */
+/* #undef ZFS_GENHD_FL_EXT_DEVT */
+
+/* GENHD_FL_NO_PART_SCAN flag is available */
+/* #undef ZFS_GENHD_FL_NO_PART */
+
+/* global_node_page_state() exists */
+/* #undef ZFS_GLOBAL_NODE_PAGE_STATE */
+
+/* global_zone_page_state() exists */
+/* #undef ZFS_GLOBAL_ZONE_PAGE_STATE */
+
+/* Define to 1 if GPL-only symbols can be used */
+/* #undef ZFS_IS_GPL_COMPATIBLE */
+
+/* Define the project alias string. */
+#define ZFS_META_ALIAS "zfs-2.2.99-202-FreeBSD_g887a3c533"
+
+/* Define the project author. */
+#define ZFS_META_AUTHOR "OpenZFS"
+
+/* Define the project release date. */
+/* #undef ZFS_META_DATA */
+
+/* Define the maximum compatible kernel version. */
+#define ZFS_META_KVER_MAX "6.5"
+
+/* Define the minimum compatible kernel version. */
+#define ZFS_META_KVER_MIN "3.10"
+
+/* Define the project license. */
+#define ZFS_META_LICENSE "CDDL"
+
+/* Define the libtool library 'age' version information. */
+/* #undef ZFS_META_LT_AGE */
+
+/* Define the libtool library 'current' version information. */
+/* #undef ZFS_META_LT_CURRENT */
+
+/* Define the libtool library 'revision' version information. */
+/* #undef ZFS_META_LT_REVISION */
+
+/* Define the project name. */
+#define ZFS_META_NAME "zfs"
+
+/* Define the project release. */
+#define ZFS_META_RELEASE "202-FreeBSD_g887a3c533"
+
+/* Define the project version. */
+#define ZFS_META_VERSION "2.2.99"
+
+/* count is located in percpu_ref.data */
+/* #undef ZFS_PERCPU_REF_COUNT_IN_DATA */
diff --git a/sys/modules/zfs/zfs_gitrev.h b/sys/modules/zfs/zfs_gitrev.h
new file mode 100644
index 000000000000..d2aeef5edc18
--- /dev/null
+++ b/sys/modules/zfs/zfs_gitrev.h
@@ -0,0 +1 @@
+#define ZFS_META_GITREV "zfs-2.2.99-202-g887a3c533"
diff --git a/sys/modules/zlib/Makefile b/sys/modules/zlib/Makefile
new file mode 100644
index 000000000000..7f4f76fa2112
--- /dev/null
+++ b/sys/modules/zlib/Makefile
@@ -0,0 +1,29 @@
+
+.PATH: ${SRCTOP}/sys/libkern
+.PATH: ${SRCTOP}/sys/dev/zlib
+.PATH: ${SRCTOP}/sys/contrib/zlib
+
+KMOD= zlib
+SRCS+= zcalloc.c
+SRCS+= zlib_mod.c
+SRCS+= adler32.c
+SRCS+= compress.c
+SRCS+= crc32.c
+SRCS+= deflate.c
+SRCS+= inffast.c
+SRCS+= inflate.c
+SRCS+= inftrees.c
+SRCS+= trees.c
+SRCS+= uncompr.c
+SRCS+= zutil.c
+
+CWARNFLAGS.compress.c+=-Wno-cast-qual # compress:49
+CWARNFLAGS.deflate.c+=-Wno-cast-qual # deflate.c:415
+CWARNFLAGS.uncompr.c+=-Wno-cast-qual # uncompr:49
+CWARNFLAGS.crc32.c+=${NO_WSTRICT_PROTOTYPES} # crc32.c:586
+CWARNFLAGS.trees.c+=${NO_WSTRICT_PROTOTYPES} # trees.c:232
+CWARNFLAGS.zutil.c+=${NO_WSTRICT_PROTOTYPES} # zutil.c:27,32
+
+.include <bsd.kmod.mk>
+
+CWARNFLAGS+=${NO_WDEPRECATED_NON_PROTOTYPE} # https://github.com/madler/zlib/issues/633