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