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