xref: /freebsd/sys/modules/Makefile (revision daceb336172a6b0572de864b97e70b28451ca636)
1# $FreeBSD$
2
3SYSDIR?=${SRCTOP}/sys
4.include "${SYSDIR}/conf/kern.opts.mk"
5
6SUBDIR_PARALLEL=
7
8# Modules that include binary-only blobs of microcode should be selectable by
9# MK_SOURCELESS_UCODE option (see below).
10
11.if defined(MODULES_OVERRIDE) && !defined(ALL_MODULES)
12SUBDIR=${MODULES_OVERRIDE}
13.else
14SUBDIR=	\
15	${_3dfx} \
16	${_3dfx_linux} \
17	${_aac} \
18	${_aacraid} \
19	accf_data \
20	accf_dns \
21	accf_http \
22	acl_nfs4 \
23	acl_posix1e \
24	${_acpi} \
25	ae \
26	${_aesni} \
27	age \
28	${_agp} \
29	ahci \
30	aic7xxx \
31	alc \
32	ale \
33	alq \
34	${_amd_ecc_inject} \
35	${_amdgpio} \
36	${_amdsbwd} \
37	${_amdsmn} \
38	${_amdtemp} \
39	amr \
40	${_an} \
41	${_aout} \
42	${_apm} \
43	${_arcmsr} \
44	${_allwinner} \
45	${_armv8crypto} \
46	${_asmc} \
47	ata \
48	ath \
49	ath_dfs \
50	ath_hal \
51	ath_hal_ar5210 \
52	ath_hal_ar5211 \
53	ath_hal_ar5212 \
54	ath_hal_ar5416 \
55	ath_hal_ar9300 \
56	ath_main \
57	ath_rate \
58	ath_pci \
59	${_autofs} \
60	${_auxio} \
61	${_bce} \
62	${_bcm283x_clkman} \
63	${_bcm283x_pwm} \
64	bfe \
65	bge \
66	bhnd \
67	${_bxe} \
68	${_bios} \
69	${_bktr} \
70	${_blake2} \
71	${_bm} \
72	bnxt \
73	bridgestp \
74	bwi \
75	bwn \
76	${_bytgpio} \
77	${_chvgpio} \
78	cam \
79	${_cardbus} \
80	${_carp} \
81	cas \
82	${_cbb} \
83	cc \
84	${_ccp} \
85	cd9660 \
86	cd9660_iconv \
87	${_ce} \
88	${_cfi} \
89	${_chromebook_platform} \
90	${_ciss} \
91	cloudabi \
92	${_cloudabi32} \
93	${_cloudabi64} \
94	${_cmx} \
95	${_coretemp} \
96	${_cp} \
97	${_cpsw} \
98	${_cpuctl} \
99	${_cpufreq} \
100	${_crypto} \
101	${_cryptodev} \
102	${_cs} \
103	${_ctau} \
104	ctl \
105	${_cxgb} \
106	${_cxgbe} \
107	dc \
108	dcons \
109	dcons_crom \
110	de \
111	${_dpms} \
112	dummynet \
113	${_ed} \
114	${_efirt} \
115	${_em} \
116	${_ena} \
117	${_ep} \
118	${_epic} \
119	esp \
120	${_et} \
121	evdev \
122	${_ex} \
123	${_exca} \
124	ext2fs \
125	fdc \
126	fdescfs \
127	${_fe} \
128	${_ffec} \
129	filemon \
130	firewire \
131	firmware \
132	fusefs \
133	${_fxp} \
134	gem \
135	geom \
136	${_glxiic} \
137	${_glxsb} \
138	gpio \
139	hifn \
140	hme \
141	${_hpt27xx} \
142	${_hptiop} \
143	${_hptmv} \
144	${_hptnr} \
145	${_hptrr} \
146	hwpmc \
147	${_hwpmc_mips24k} \
148	${_hwpmc_mips74k} \
149	${_hyperv} \
150	i2c \
151	${_iavf} \
152        ${_ibcore} \
153	${_ichwd} \
154	${_ida} \
155	if_bridge \
156	if_disc \
157	if_edsc \
158	${_if_enc} \
159	if_epair \
160	${_if_gif} \
161	${_if_gre} \
162	${_if_me} \
163	if_lagg \
164	${_if_ndis} \
165	${_if_stf} \
166	if_tuntap \
167	if_vlan \
168	if_vxlan \
169	iflib \
170	${_iir} \
171	imgact_binmisc \
172	${_intelspi} \
173	${_io} \
174	${_ioat} \
175        ${_ipoib} \
176	${_ipdivert} \
177	${_ipfilter} \
178	${_ipfw} \
179	ipfw_nat \
180	${_ipfw_nat64} \
181	${_ipfw_nptv6} \
182	${_ipfw_pmod} \
183	${_ipmi} \
184	ip6_mroute_mod \
185	ip_mroute_mod \
186	${_ips} \
187	${_ipsec} \
188	${_ipw} \
189	${_ipwfw} \
190	${_isci} \
191	${_iser} \
192	isp \
193	${_ispfw} \
194	${_iwi} \
195	${_iwifw} \
196	${_iwm} \
197	${_iwmfw} \
198	${_iwn} \
199	${_iwnfw} \
200	${_ix} \
201	${_ixv} \
202	${_ixl} \
203	jme \
204	kbdmux \
205	kgssapi \
206	kgssapi_krb5 \
207	khelp \
208	krpc \
209	ksyms \
210	le \
211	lge \
212	libalias \
213	libiconv \
214	libmchain \
215	${_linux} \
216	${_linux_common} \
217	${_linux64} \
218	linuxkpi \
219	${_lio} \
220	lpt \
221	mac_biba \
222	mac_bsdextended \
223	mac_ifoff \
224	mac_lomac \
225	mac_mls \
226	mac_none \
227	mac_ntpd \
228	mac_partition \
229	mac_portacl \
230	mac_seeotheruids \
231	mac_stub \
232	mac_test \
233	malo \
234	md \
235	mdio \
236	mem \
237	mfi \
238	mii \
239	mlx \
240	mlxfw \
241	${_mlx4} \
242	${_mlx4ib} \
243	${_mlx4en} \
244	${_mlx5} \
245	${_mlx5en} \
246	${_mlx5ib} \
247	${_mly} \
248	mmc \
249	mmcsd \
250	${_mpr} \
251	${_mps} \
252	mpt \
253	mqueue \
254	mrsas \
255	msdosfs \
256	msdosfs_iconv \
257	msk \
258	${_mthca} \
259	mvs \
260	mwl \
261	${_mwlfw} \
262	mxge \
263	my \
264	${_nandfs} \
265	${_nandsim} \
266	${_nctgpio} \
267	${_ndis} \
268	${_netgraph} \
269	${_nfe} \
270	nfscl \
271	nfscommon \
272	nfsd \
273	nfslock \
274	nfslockd \
275	nfssvc \
276	nge \
277	nmdm \
278	nullfs \
279	${_ntb} \
280	${_nvd} \
281	${_nvdimm} \
282	${_nvme} \
283	${_nvram} \
284	oce \
285	${_ocs_fc} \
286	otus \
287	${_otusfw} \
288	ow \
289	${_padlock} \
290	${_padlock_rng} \
291	${_pccard} \
292	${_pcfclock} \
293	pcn \
294	${_pf} \
295	${_pflog} \
296	${_pfsync} \
297	plip \
298	${_pms} \
299	ppbus \
300	ppc \
301	ppi \
302	pps \
303	procfs \
304	proto \
305	pseudofs \
306	${_pst} \
307	pty  \
308	puc \
309	${_qlxge} \
310	${_qlxgb} \
311	${_qlxgbe} \
312	${_qlnx} \
313	ral \
314	${_ralfw} \
315	${_random_fortuna} \
316	${_random_other} \
317	rc4 \
318	${_rdma} \
319	${_rdrand_rng} \
320	re \
321	rl \
322	${_rockchip} \
323	rtwn \
324	rtwn_pci \
325	rtwn_usb \
326	${_rtwnfw} \
327	${_s3} \
328	${_safe} \
329	${_sbni} \
330	scc \
331	sdhci \
332	${_sdhci_acpi} \
333	sdhci_pci \
334	sem \
335	send \
336	${_sf} \
337	${_sfxge} \
338	sge \
339	${_sgx} \
340	${_sgx_linux} \
341	siftr \
342	siis \
343	sis \
344	sk \
345	${_smartpqi} \
346	smbfs \
347	sn \
348	snp \
349	sound \
350	${_speaker} \
351	spi \
352	${_splash} \
353	${_sppp} \
354	ste \
355	stge \
356	${_sym} \
357	${_syscons} \
358	sysvipc \
359	tcp \
360	${_ti} \
361	tl \
362	tmpfs \
363	${_toecore} \
364	${_tpm} \
365	trm \
366	${_twa} \
367	twe \
368	tws \
369	tx \
370	${_txp} \
371	uart \
372	ubsec \
373	udf \
374	udf_iconv \
375	ufs \
376	uinput \
377	unionfs \
378	usb \
379	${_vesa} \
380	${_virtio} \
381	vge \
382	${_viawd} \
383	videomode \
384	vkbd \
385	${_vmm} \
386	${_vmware} \
387	${_vpo} \
388	vr \
389	vte \
390	vx \
391	wb \
392	${_wbwd} \
393	${_wi} \
394	wlan \
395	wlan_acl \
396	wlan_amrr \
397	wlan_ccmp \
398	wlan_rssadapt \
399	wlan_tkip \
400	wlan_wep \
401	wlan_xauth \
402	${_wpi} \
403	${_wpifw} \
404	${_x86bios} \
405	${_xe} \
406	xl \
407	xz \
408	zlib
409
410.if ${MK_AUTOFS} != "no" || defined(ALL_MODULES)
411_autofs=	autofs
412.endif
413
414.if ${MK_CDDL} != "no" || defined(ALL_MODULES)
415.if (${MACHINE_CPUARCH} != "arm" || ${MACHINE_ARCH:Marmv[67]*} != "") && \
416	${MACHINE_CPUARCH} != "mips" && \
417	${MACHINE_CPUARCH} != "sparc64"
418SUBDIR+=	dtrace
419.endif
420SUBDIR+=	opensolaris
421.endif
422
423.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
424.if exists(${SRCTOP}/sys/opencrypto)
425_crypto=	crypto
426_cryptodev=	cryptodev
427_random_fortuna=random_fortuna
428_random_other=	random_other
429.endif
430.endif
431
432.if ${MK_CUSE} != "no" || defined(ALL_MODULES)
433SUBDIR+=	cuse
434.endif
435
436.if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \
437	defined(ALL_MODULES)
438_carp=		carp
439_toecore=	toecore
440_if_enc=	if_enc
441_if_gif=	if_gif
442_if_gre=	if_gre
443_ipfw_pmod=	ipfw_pmod
444.if ${MK_IPSEC_SUPPORT} != "no"
445_ipsec=		ipsec
446.endif
447.endif
448
449.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
450	defined(ALL_MODULES)
451_if_stf=	if_stf
452.endif
453
454.if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES)
455_if_me=		if_me
456_ipdivert=	ipdivert
457_ipfw=		ipfw
458.if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
459_ipfw_nat64=	ipfw_nat64
460.endif
461.endif
462
463.if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
464_ipfw_nptv6=	ipfw_nptv6
465.endif
466
467.if ${MK_IPFILTER} != "no" || defined(ALL_MODULES)
468_ipfilter=	ipfilter
469.endif
470
471.if ${MK_ISCSI} != "no" || defined(ALL_MODULES)
472SUBDIR+=	cfiscsi
473SUBDIR+=	iscsi
474SUBDIR+=	iscsi_initiator
475.endif
476
477.if !empty(OPT_FDT)
478SUBDIR+=	fdt
479.endif
480
481.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
482    ${MACHINE_CPUARCH} == "i386"
483SUBDIR+=	linprocfs
484SUBDIR+=	linsysfs
485_ena=		ena
486.if ${MK_OFED} != "no" || defined(ALL_MODULES)
487_ibcore=	ibcore
488_ipoib=		ipoib
489_iser=		iser
490.endif
491_mlx4=		mlx4
492_mlx5=		mlx5
493.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
494	defined(ALL_MODULES)
495_mlx4en=	mlx4en
496_mlx5en=	mlx5en
497.endif
498.if ${MK_OFED} != "no" || defined(ALL_MODULES)
499_mthca=		mthca
500_mlx4ib=	mlx4ib
501_mlx5ib=	mlx5ib
502.endif
503.endif
504
505.if ${MK_NAND} != "no" || defined(ALL_MODULES)
506_nandfs=	nandfs
507_nandsim=	nandsim
508.endif
509
510.if ${MK_NETGRAPH} != "no" || defined(ALL_MODULES)
511_netgraph=	netgraph
512.endif
513
514.if (${MK_PF} != "no" && (${MK_INET_SUPPORT} != "no" || \
515	${MK_INET6_SUPPORT} != "no")) || defined(ALL_MODULES)
516_pf=		pf
517_pflog=		pflog
518.if ${MK_INET_SUPPORT} != "no"
519_pfsync=	pfsync
520.endif
521.endif
522
523.if ${MK_SOURCELESS_UCODE} != "no"
524_bce=		bce
525_fxp=		fxp
526_ispfw=		ispfw
527_sf=		sf
528_ti=		ti
529_txp=		txp
530
531.if ${MACHINE_CPUARCH} != "mips"
532_mwlfw=		mwlfw
533_otusfw=	otusfw
534_ralfw=		ralfw
535_rtwnfw=	rtwnfw
536.endif
537.endif
538
539.if ${MK_SOURCELESS_UCODE} != "no" && ${MACHINE_CPUARCH} != "arm" && \
540	${MACHINE_CPUARCH} != "mips" && \
541	${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe" && \
542	${MACHINE_CPUARCH} != "riscv"
543_cxgbe=		cxgbe
544.endif
545
546# These rely on 64bit atomics
547.if ${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe" && \
548	${MACHINE_CPUARCH} != "mips"
549_mps=		mps
550_mpr=		mpr
551.endif
552
553.if ${MK_TESTS} != "no" || defined(ALL_MODULES)
554SUBDIR+=	tests
555.endif
556
557.if ${MK_ZFS} != "no" || defined(ALL_MODULES)
558SUBDIR+=	zfs
559.endif
560
561.if (${MACHINE_CPUARCH} == "mips" && ${MACHINE_ARCH:Mmips64} == "")
562_hwpmc_mips24k=	hwpmc_mips24k
563_hwpmc_mips74k=	hwpmc_mips74k
564.endif
565
566.if ${MACHINE_CPUARCH} != "aarch64" && ${MACHINE_CPUARCH} != "arm" && \
567	${MACHINE_CPUARCH} != "mips" && ${MACHINE_CPUARCH} != "powerpc" && \
568	${MACHINE_CPUARCH} != "riscv"
569_syscons=	syscons
570_vpo=		vpo
571.endif
572
573.if ${MACHINE_CPUARCH} != "mips"
574# no BUS_SPACE_UNSPECIFIED
575# No barrier instruction support (specific to this driver)
576_sym=		sym
577# intr_disable() is a macro, causes problems
578.if ${MK_SOURCELESS_UCODE} != "no"
579_cxgb=		cxgb
580.endif
581.endif
582
583.if ${MACHINE_CPUARCH} == "aarch64"
584_allwinner=	allwinner
585_armv8crypto=	armv8crypto
586_efirt=		efirt
587_em=		em
588_rockchip=	rockchip
589.endif
590
591.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
592_agp=		agp
593_an=		an
594_aout=		aout
595_bios=		bios
596_bktr=		bktr
597.if ${MK_SOURCELESS_UCODE} != "no"
598_bxe=		bxe
599.endif
600_cardbus=	cardbus
601_cbb=		cbb
602_cpuctl=	cpuctl
603_cpufreq=	cpufreq
604_cs=		cs
605_dpms=		dpms
606_ed=		ed
607_em=		em
608_ep=		ep
609_et=		et
610_exca=		exca
611_fe=		fe
612_if_ndis=	if_ndis
613_io=		io
614_ix=		ix
615_ixv=		ixv
616_linux=		linux
617.if ${MK_SOURCELESS_UCODE} != "no"
618_lio=		lio
619.endif
620_nctgpio=	nctgpio
621_ndis=		ndis
622_ocs_fc=	ocs_fc
623_pccard=	pccard
624.if ${MK_OFED} != "no" || defined(ALL_MODULES)
625_rdma=		rdma
626.endif
627_safe=		safe
628_speaker=	speaker
629_splash=	splash
630_sppp=		sppp
631_vmware=	vmware
632_wbwd=		wbwd
633_wi=		wi
634_xe=		xe
635
636_aac=		aac
637_aacraid=	aacraid
638_acpi=		acpi
639.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
640.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} > 40201
641_aesni=		aesni
642.endif
643.endif
644_amd_ecc_inject=amd_ecc_inject
645_amdsbwd=	amdsbwd
646_amdsmn=	amdsmn
647_amdtemp=	amdtemp
648_arcmsr=	arcmsr
649_asmc=		asmc
650.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
651_blake2=	blake2
652.endif
653_bytgpio=	bytgpio
654_chvgpio=	chvgpio
655_ciss=		ciss
656_chromebook_platform=	chromebook_platform
657_cmx=		cmx
658_coretemp=	coretemp
659.if ${MK_SOURCELESS_HOST} != "no"
660_hpt27xx=	hpt27xx
661.endif
662_hptiop=	hptiop
663.if ${MK_SOURCELESS_HOST} != "no"
664_hptmv=		hptmv
665_hptnr=		hptnr
666_hptrr=		hptrr
667.endif
668_hyperv=	hyperv
669_ichwd=		ichwd
670_ida=		ida
671_iir=		iir
672_intelspi=	intelspi
673_ipmi=		ipmi
674_ips=		ips
675_isci=		isci
676_ipw=		ipw
677_iwi=		iwi
678_iwm=		iwm
679_iwn=		iwn
680.if ${MK_SOURCELESS_UCODE} != "no"
681_ipwfw=		ipwfw
682_iwifw=		iwifw
683_iwmfw=		iwmfw
684_iwnfw=		iwnfw
685.endif
686_mly=		mly
687_nfe=		nfe
688_nvd=		nvd
689_nvme=		nvme
690_nvram=		nvram
691.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
692_padlock=	padlock
693_padlock_rng=	padlock_rng
694_rdrand_rng=	rdrand_rng
695.endif
696_s3=		s3
697_sdhci_acpi=	sdhci_acpi
698_tpm=		tpm
699_twa=		twa
700_vesa=		vesa
701_viawd=		viawd
702_virtio=	virtio
703_wpi=		wpi
704.if ${MK_SOURCELESS_UCODE} != "no"
705_wpifw=		wpifw
706.endif
707_x86bios=	x86bios
708.endif
709
710.if ${MACHINE_CPUARCH} == "amd64"
711_amdgpio=	amdgpio
712_ccp=		ccp
713_efirt=		efirt
714_iavf=		iavf
715_ioat=		ioat
716_ixl=		ixl
717_linux64=	linux64
718_linux_common=	linux_common
719_ntb=		ntb
720_nvdimm=	nvdimm
721_pms=		pms
722_qlxge=		qlxge
723_qlxgb=		qlxgb
724.if ${MK_SOURCELESS_UCODE} != "no"
725_qlxgbe=	qlxgbe
726_qlnx=		qlnx
727.endif
728_sfxge=		sfxge
729_sgx=		sgx
730_sgx_linux=	sgx_linux
731_smartpqi=	smartpqi
732
733.if ${MK_BHYVE} != "no" || defined(ALL_MODULES)
734_vmm=		vmm
735.endif
736.endif
737
738.if ${MACHINE_CPUARCH} == "i386"
739# XXX some of these can move to the general case when de-i386'ed
740# XXX some of these can move now, but are untested on other architectures.
741_3dfx=		3dfx
742_3dfx_linux=	3dfx_linux
743_apm=		apm
744.if ${MK_SOURCELESS_UCODE} != "no"
745_ce=		ce
746.endif
747.if ${MK_SOURCELESS_UCODE} != "no"
748_cp=		cp
749.endif
750_glxiic=	glxiic
751_glxsb=		glxsb
752_pcfclock=	pcfclock
753_pst=		pst
754_sbni=		sbni
755.if ${MK_SOURCELESS_UCODE} != "no"
756_ctau=		ctau
757.endif
758_ex=		ex
759.endif
760
761.if ${MACHINE_CPUARCH} == "arm"
762_cfi=		cfi
763_cpsw=		cpsw
764.endif
765
766.if ${MACHINE_CPUARCH} == "powerpc"
767_agp=		agp
768_an=		an
769_bm=		bm
770_cardbus=	cardbus
771_cbb=		cbb
772_cfi=		cfi
773_cpufreq=	cpufreq
774_exca=		exca
775_ffec=		ffec
776_nvd=		nvd
777_nvme=		nvme
778_pccard=	pccard
779_wi=		wi
780.endif
781
782.if ${MACHINE_ARCH} == "powerpc64"
783_ipmi=		ipmi
784.endif
785.if ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "powerpc"
786# Don't build powermac_nvram for powerpcspe, it's never supported.
787_nvram=		powermac_nvram
788.endif
789
790.if ${MACHINE_CPUARCH} == "sparc64"
791_auxio=		auxio
792_em=		em
793_epic=		epic
794.endif
795
796.if (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
797     ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "i386")
798_cloudabi32=	cloudabi32
799.endif
800.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
801_cloudabi64=	cloudabi64
802.endif
803
804.endif
805
806.if ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "aarch64"
807_bcm283x_clkman=  bcm283x_clkman
808_bcm283x_pwm=  bcm283x_pwm
809.endif
810
811SUBDIR+=${MODULES_EXTRA}
812
813.for reject in ${WITHOUT_MODULES}
814SUBDIR:= ${SUBDIR:N${reject}}
815.endfor
816
817# Calling kldxref(8) for each module is expensive.
818.if !defined(NO_XREF)
819.MAKEFLAGS+=	-DNO_XREF
820afterinstall: .PHONY
821	@if type kldxref >/dev/null 2>&1; then \
822		${ECHO} kldxref ${DESTDIR}${KMODDIR}; \
823		kldxref ${DESTDIR}${KMODDIR}; \
824	fi
825.endif
826
827.include "${SYSDIR}/conf/config.mk"
828
829SUBDIR:= ${SUBDIR:u:O}
830
831.include <bsd.subdir.mk>
832