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