xref: /freebsd/sys/modules/Makefile (revision 193d9e768ba63fcfb187cfd17f461f7d41345048)
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	${_splash} \
350	${_sppp} \
351	ste \
352	${_stg} \
353	stge \
354	${_sym} \
355	${_syscons} \
356	sysvipc \
357	${_ti} \
358	${_tcp_fastpath} \
359	${_tcpmd5} \
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_EXTRA_TCP_STACKS} != "no" || defined(ALL_MODULES)
440_tcp_fastpath=	tcp/fastpath
441.endif
442
443.if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \
444	defined(ALL_MODULES)
445_carp=		carp
446_toecore=	toecore
447_if_enc=	if_enc
448_if_gif=	if_gif
449_if_gre=	if_gre
450.if ${MK_IPSEC_SUPPORT} != "no"
451_ipsec=		ipsec
452_tcpmd5=	tcp/tcpmd5
453.endif
454.endif
455
456.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
457	defined(ALL_MODULES)
458_if_stf=	if_stf
459.endif
460
461.if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES)
462_if_me=		if_me
463_ipdivert=	ipdivert
464_ipfw=		ipfw
465.if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
466_ipfw_nat64=	ipfw_nat64
467.endif
468.endif
469
470.if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
471_ipfw_nptv6=	ipfw_nptv6
472.endif
473
474.if ${MK_IPFILTER} != "no" || defined(ALL_MODULES)
475_ipfilter=	ipfilter
476.endif
477
478.if ${MK_ISCSI} != "no" || defined(ALL_MODULES)
479SUBDIR+=	iscsi
480SUBDIR+=	iscsi_initiator
481.endif
482
483.if ${MK_NAND} != "no" || defined(ALL_MODULES)
484_nandfs=	nandfs
485_nandsim=	nandsim
486.endif
487
488.if ${MK_NETGRAPH} != "no" || defined(ALL_MODULES)
489_netgraph=	netgraph
490.endif
491
492.if (${MK_PF} != "no" && (${MK_INET_SUPPORT} != "no" || \
493	${MK_INET6_SUPPORT} != "no")) || defined(ALL_MODULES)
494_pf=		pf
495_pflog=		pflog
496.if ${MK_INET_SUPPORT} != "no"
497_pfsync=	pfsync
498.endif
499.endif
500
501.if ${MK_SOURCELESS_UCODE} != "no"
502_bce=		bce
503_fatm=		fatm
504_fxp=		fxp
505_ispfw=		ispfw
506_sf=		sf
507_ti=		ti
508_txp=		txp
509
510.if ${MACHINE_CPUARCH} != "mips"
511_mwlfw=		mwlfw
512_otusfw=	otusfw
513_ralfw=		ralfw
514_rtwnfw=	rtwnfw
515.endif
516.endif
517
518.if ${MK_SOURCELESS_UCODE} != "no" && ${MACHINE_CPUARCH} != "arm" && \
519	${MACHINE_CPUARCH} != "mips" && \
520	${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe" && \
521	${MACHINE_CPUARCH} != "riscv"
522_cxgbe=		cxgbe
523.endif
524
525.if ${MK_ZFS} != "no" || defined(ALL_MODULES)
526SUBDIR+=	zfs
527.endif
528
529.if (${MACHINE_CPUARCH} == "mips" && ${MACHINE_ARCH:Mmips64} == "")
530_hwpmc_mips24k=	hwpmc_mips24k
531_hwpmc_mips74k=	hwpmc_mips74k
532.endif
533
534.if ${MACHINE_CPUARCH} != "aarch64" && ${MACHINE_CPUARCH} != "arm" && \
535	${MACHINE_CPUARCH} != "mips" && ${MACHINE_CPUARCH} != "powerpc" && \
536	${MACHINE_CPUARCH} != "riscv"
537_syscons=	syscons
538_vpo=		vpo
539.endif
540
541.if ${MACHINE_CPUARCH} != "mips"
542# no BUS_SPACE_UNSPECIFIED
543# No barrier instruction support (specific to this driver)
544_sym=		sym
545# intr_disable() is a macro, causes problems
546.if ${MK_SOURCELESS_UCODE} != "no"
547_cxgb=		cxgb
548.endif
549.endif
550
551.if ${MACHINE_CPUARCH} == "aarch64"
552_armv8crypto=	armv8crypto
553_em=		em
554.endif
555
556.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
557_agp=		agp
558_an=		an
559_aout=		aout
560_bios=		bios
561_bktr=		bktr
562_bxe=		bxe
563_cardbus=	cardbus
564_cbb=		cbb
565_cpuctl=	cpuctl
566_cpufreq=	cpufreq
567_cs=		cs
568_dpms=		dpms
569_drm=		drm
570_drm2=		drm2
571_ed=		ed
572_em=		em
573_ep=		ep
574_et=		et
575_exca=		exca
576_fe=		fe
577.if ${MK_OFED} != "no" || defined(ALL_MODULES)
578_ibcore=        ibcore
579.endif
580_if_ndis=	if_ndis
581_io=		io
582.if ${MK_OFED} != "no" || defined(ALL_MODULES)
583_ipoib=         ipoib
584_iser=		iser
585.endif
586_ix=		ix
587_ixv=		ixv
588_linprocfs=	linprocfs
589_linsysfs=	linsysfs
590_linux=		linux
591_nctgpio=	nctgpio
592_ndis=		ndis
593_pccard=	pccard
594.if ${MK_OFED} != "no" || defined(ALL_MODULES)
595_rdma=		rdma
596.endif
597_safe=		safe
598_scsi_low=	scsi_low
599_speaker=	speaker
600_splash=	splash
601_sppp=		sppp
602_vmware=	vmware
603_vxge=  	vxge
604_wbwd=		wbwd
605_wi=		wi
606_xe=		xe
607
608_aac=		aac
609_aacraid=	aacraid
610_acpi=		acpi
611.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
612_aesni=		aesni
613.endif
614_amd_ecc_inject=amd_ecc_inject
615_amdsbwd=	amdsbwd
616_amdtemp=	amdtemp
617_arcmsr=	arcmsr
618_asmc=		asmc
619_bytgpio=	bytgpio
620_ciss=		ciss
621_chromebook_platform=	chromebook_platform
622_cmx=		cmx
623_coretemp=	coretemp
624.if ${MK_SOURCELESS_HOST} != "no"
625_hpt27xx=	hpt27xx
626.endif
627_hptiop=	hptiop
628.if ${MK_SOURCELESS_HOST} != "no"
629_hptmv=		hptmv
630_hptnr=		hptnr
631_hptrr=		hptrr
632.endif
633_hyperv=	hyperv
634_ichwd=		ichwd
635_ida=		ida
636_iir=		iir
637_intelspi=	intelspi
638_ipmi=		ipmi
639_ips=		ips
640_isci=		isci
641_ipw=		ipw
642_iwi=		iwi
643_iwm=		iwm
644_iwn=		iwn
645_ixgb=		ixgb
646.if ${MK_SOURCELESS_UCODE} != "no"
647_ipwfw=		ipwfw
648_iwifw=		iwifw
649_iwmfw=		iwmfw
650_iwnfw=		iwnfw
651.endif
652_mlx4=		mlx4
653_mlx5=		mlx5
654.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
655	defined(ALL_MODULES)
656_mlx4en=	mlx4en
657_mlx5en=	mlx5en
658.endif
659.if ${MK_OFED} != "no" || defined(ALL_MODULES)
660_mlx4ib=	mlx4ib
661.endif
662_mly=		mly
663.if ${MK_OFED} != "no" || defined(ALL_MODULES)
664_mthca=		mthca
665.endif
666_nfe=		nfe
667_nvd=		nvd
668_nvme=		nvme
669_nvram=		nvram
670_nxge=		nxge
671.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
672_padlock=	padlock
673_padlock_rng=	padlock_rng
674_rdrand_rng=	rdrand_rng
675.endif
676_s3=		s3
677_sdhci_acpi=	sdhci_acpi
678_tpm=		tpm
679_twa=		twa
680_vesa=		vesa
681_viawd=		viawd
682_virtio=	virtio
683_wpi=		wpi
684.if ${MK_SOURCELESS_UCODE} != "no"
685_wpifw=		wpifw
686.endif
687_x86bios=	x86bios
688.endif
689
690.if ${MACHINE_CPUARCH} == "amd64"
691_efirt=		efirt
692_ioat=		ioat
693_ixl=		ixl
694_ixlv=		ixlv
695_linux64=	linux64
696_linux_common=	linux_common
697_ntb=		ntb
698_pms=		pms
699_qlxge=		qlxge
700_qlxgb=		qlxgb
701_qlxgbe=	qlxgbe
702_sfxge=		sfxge
703
704.if ${MK_BHYVE} != "no" || defined(ALL_MODULES)
705_vmm=		vmm
706.endif
707.endif
708
709.if ${MACHINE_CPUARCH} == "i386"
710# XXX some of these can move to the general case when de-i386'ed
711# XXX some of these can move now, but are untested on other architectures.
712_3dfx=		3dfx
713_3dfx_linux=	3dfx_linux
714_aic=		aic
715_apm=		apm
716_arcnet=	arcnet
717.if ${MK_SOURCELESS_UCODE} != "no"
718_ce=		ce
719.endif
720_coff=		coff
721.if ${MK_SOURCELESS_UCODE} != "no"
722_cp=		cp
723.endif
724_elink=		elink
725_glxiic=	glxiic
726_glxsb=		glxsb
727#_ibcs2=		ibcs2
728_mse=		mse
729_ncr=		ncr
730_ncv=		ncv
731_nsp=		nsp
732_pcfclock=	pcfclock
733_pst=		pst
734_sbni=		sbni
735_stg=		stg
736_cm=		cm
737.if ${MK_SOURCELESS_UCODE} != "no"
738_ctau=		ctau
739.endif
740_dpt=		dpt
741_ex=		ex
742.endif
743
744.if ${MACHINE_CPUARCH} == "arm"
745_cfi=		cfi
746_cpsw=		cpsw
747.endif
748
749.if ${MACHINE_CPUARCH} == "powerpc"
750_agp=		agp
751_an=		an
752_bm=		bm
753_cardbus=	cardbus
754_cbb=		cbb
755_cfi=		cfi
756_cpufreq=	cpufreq
757_drm=		drm
758_exca=		exca
759_pccard=	pccard
760_wi=		wi
761.endif
762
763.if ${MACHINE_ARCH} == "powerpc64"
764_drm2=		drm2
765.endif
766.if ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "powerpc"
767# Don't build powermac_nvram for powerpcspe, it's never supported.
768_nvram=		powermac_nvram
769.endif
770
771.if ${MACHINE_CPUARCH} == "sparc64"
772_auxio=		auxio
773_em=		em
774_epic=		epic
775.endif
776
777.if (${MACHINE_CPUARCH} == "amd64" || ${MACHINE_ARCH} == "armv6" || \
778     ${MACHINE_CPUARCH} == "i386")
779_cloudabi32=	cloudabi32
780.endif
781.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
782_cloudabi64=	cloudabi64
783.endif
784
785.endif
786
787SUBDIR+=${MODULES_EXTRA}
788
789.for reject in ${WITHOUT_MODULES}
790SUBDIR:= ${SUBDIR:N${reject}}
791.endfor
792
793# Calling kldxref(8) for each module is expensive.
794.if !defined(NO_XREF)
795.MAKEFLAGS+=	-DNO_XREF
796afterinstall: .PHONY
797	@if type kldxref >/dev/null 2>&1; then \
798		${ECHO} kldxref ${DESTDIR}${KMODDIR}; \
799		kldxref ${DESTDIR}${KMODDIR}; \
800	fi
801.endif
802
803.include "${SYSDIR}/conf/config.mk"
804
805SUBDIR:= ${SUBDIR:u:O}
806
807.include <bsd.subdir.mk>
808