xref: /freebsd/sys/modules/Makefile (revision 3ee5c55415a7b08c6c4c403cc6b96e30d768e1c9)
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	${_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	${_coff} \
96	${_coretemp} \
97	${_cp} \
98	${_cpsw} \
99	${_cpuctl} \
100	${_cpufreq} \
101	${_crypto} \
102	${_cryptodev} \
103	${_cs} \
104	${_ctau} \
105	ctl \
106	${_cxgb} \
107	${_cxgbe} \
108	dc \
109	dcons \
110	dcons_crom \
111	de \
112	${_dpms} \
113	${_dpt} \
114	${_drm} \
115	${_drm2} \
116	dummynet \
117	${_ed} \
118	${_efirt} \
119	${_em} \
120	${_ena} \
121	${_ep} \
122	${_epic} \
123	esp \
124	${_et} \
125	evdev \
126	${_ex} \
127	${_exca} \
128	ext2fs \
129	fdc \
130	fdescfs \
131	${_fe} \
132	${_ffec} \
133	filemon \
134	firewire \
135	firmware \
136	fuse \
137	${_fxp} \
138	gem \
139	geom \
140	${_glxiic} \
141	${_glxsb} \
142	gpio \
143	hifn \
144	hme \
145	${_hpt27xx} \
146	${_hptiop} \
147	${_hptmv} \
148	${_hptnr} \
149	${_hptrr} \
150	hwpmc \
151	${_hwpmc_mips24k} \
152	${_hwpmc_mips74k} \
153	${_hyperv} \
154	i2c \
155        ${_ibcore} \
156	${_ibcs2} \
157	${_ichwd} \
158	${_ida} \
159	if_bridge \
160	if_disc \
161	if_edsc \
162	${_if_enc} \
163	if_epair \
164	${_if_gif} \
165	${_if_gre} \
166	${_if_me} \
167	if_lagg \
168	${_if_ndis} \
169	${_if_stf} \
170	if_tap \
171	if_tun \
172	if_vlan \
173	if_vxlan \
174	${_iir} \
175	imgact_binmisc \
176	${_intelspi} \
177	${_io} \
178	${_ioat} \
179        ${_ipoib} \
180	${_ipdivert} \
181	${_ipfilter} \
182	${_ipfw} \
183	ipfw_nat \
184	${_ipfw_nat64} \
185	${_ipfw_nptv6} \
186	${_ipfw_pmod} \
187	${_ipmi} \
188	ip6_mroute_mod \
189	ip_mroute_mod \
190	${_ips} \
191	${_ipsec} \
192	${_ipw} \
193	${_ipwfw} \
194	${_isci} \
195	${_iser} \
196	isp \
197	${_ispfw} \
198	${_iwi} \
199	${_iwifw} \
200	${_iwm} \
201	${_iwmfw} \
202	${_iwn} \
203	${_iwnfw} \
204	${_ix} \
205	${_ixv} \
206	${_ixgb} \
207	${_ixl} \
208	${_ixlv} \
209	jme \
210	joy \
211	kbdmux \
212	kgssapi \
213	kgssapi_krb5 \
214	khelp \
215	krpc \
216	ksyms \
217	le \
218	lge \
219	libalias \
220	libiconv \
221	libmchain \
222	${_linprocfs} \
223	${_linsysfs} \
224	${_linux} \
225	${_linux_common} \
226	${_linux64} \
227	linuxkpi \
228	${_lio} \
229	lmc \
230	lpt \
231	mac_biba \
232	mac_bsdextended \
233	mac_ifoff \
234	mac_lomac \
235	mac_mls \
236	mac_none \
237	mac_partition \
238	mac_portacl \
239	mac_seeotheruids \
240	mac_stub \
241	mac_test \
242	malo \
243	md \
244	mdio \
245	mem \
246	mfi \
247	mii \
248	mlx \
249	${_mlx4} \
250	${_mlx4ib} \
251	${_mlx4en} \
252	${_mlx5} \
253	${_mlx5en} \
254	${_mlx5ib} \
255	${_mly} \
256	mmc \
257	mmcsd \
258	mpr \
259	mps \
260	mpt \
261	mqueue \
262	mrsas \
263	msdosfs \
264	msdosfs_iconv \
265	${_mse} \
266	msk \
267	${_mthca} \
268	mvs \
269	mwl \
270	${_mwlfw} \
271	mxge \
272	my \
273	${_nandfs} \
274	${_nandsim} \
275	${_ncr} \
276	${_nctgpio} \
277	${_ncv} \
278	${_ndis} \
279	${_netgraph} \
280	${_nfe} \
281	nfscl \
282	nfscommon \
283	nfsd \
284	nfslock \
285	nfslockd \
286	nfssvc \
287	nge \
288	nmdm \
289	${_nsp} \
290	nullfs \
291	${_ntb} \
292	${_nvd} \
293	${_nvme} \
294	${_nvram} \
295	${_nxge} \
296	oce \
297	${_ocs_fc} \
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	siftr \
355	siis \
356	sis \
357	sk \
358	${_smartpqi} \
359	smbfs \
360	sn \
361	snp \
362	sound \
363	${_speaker} \
364	spi \
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_ocs_fc=	ocs_fc
613_pccard=	pccard
614.if ${MK_OFED} != "no" || defined(ALL_MODULES)
615_rdma=		rdma
616.endif
617_safe=		safe
618_scsi_low=	scsi_low
619_speaker=	speaker
620_splash=	splash
621_sppp=		sppp
622_vmware=	vmware
623_vxge=  	vxge
624_wbwd=		wbwd
625_wi=		wi
626_xe=		xe
627
628_aac=		aac
629_aacraid=	aacraid
630_acpi=		acpi
631.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
632_aesni=		aesni
633.endif
634_amd_ecc_inject=amd_ecc_inject
635_amdsbwd=	amdsbwd
636_amdsmn=	amdsmn
637_amdtemp=	amdtemp
638_arcmsr=	arcmsr
639_asmc=		asmc
640.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
641_blake2=	blake2
642.endif
643_bytgpio=	bytgpio
644_chvgpio=	chvgpio
645_ciss=		ciss
646_chromebook_platform=	chromebook_platform
647_cmx=		cmx
648_coretemp=	coretemp
649.if ${MK_SOURCELESS_HOST} != "no"
650_hpt27xx=	hpt27xx
651.endif
652_hptiop=	hptiop
653.if ${MK_SOURCELESS_HOST} != "no"
654_hptmv=		hptmv
655_hptnr=		hptnr
656_hptrr=		hptrr
657.endif
658_hyperv=	hyperv
659_ichwd=		ichwd
660_ida=		ida
661_iir=		iir
662_intelspi=	intelspi
663_ipmi=		ipmi
664_ips=		ips
665_isci=		isci
666_ipw=		ipw
667_iwi=		iwi
668_iwm=		iwm
669_iwn=		iwn
670_ixgb=		ixgb
671.if ${MK_SOURCELESS_UCODE} != "no"
672_ipwfw=		ipwfw
673_iwifw=		iwifw
674_iwmfw=		iwmfw
675_iwnfw=		iwnfw
676.endif
677_mlx4=		mlx4
678_mlx5=		mlx5
679.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
680	defined(ALL_MODULES)
681_mlx4en=	mlx4en
682_mlx5en=	mlx5en
683.endif
684.if ${MK_OFED} != "no" || defined(ALL_MODULES)
685_mthca=		mthca
686_mlx4ib=	mlx4ib
687_mlx5ib=	mlx5ib
688.endif
689_mly=		mly
690_nfe=		nfe
691_nvd=		nvd
692_nvme=		nvme
693_nvram=		nvram
694_nxge=		nxge
695.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
696_padlock=	padlock
697_padlock_rng=	padlock_rng
698_rdrand_rng=	rdrand_rng
699.endif
700_s3=		s3
701_sdhci_acpi=	sdhci_acpi
702_tpm=		tpm
703_twa=		twa
704_vesa=		vesa
705_viawd=		viawd
706_virtio=	virtio
707_wpi=		wpi
708.if ${MK_SOURCELESS_UCODE} != "no"
709_wpifw=		wpifw
710.endif
711_x86bios=	x86bios
712.endif
713
714.if ${MACHINE_CPUARCH} == "amd64"
715_ccp=		ccp
716_efirt=		efirt
717_ioat=		ioat
718_ixl=		ixl
719_ixlv=		ixlv
720_linux64=	linux64
721_linux_common=	linux_common
722_ntb=		ntb
723_pms=		pms
724_qlxge=		qlxge
725_qlxgb=		qlxgb
726.if ${MK_SOURCELESS_UCODE} != "no"
727_qlxgbe=	qlxgbe
728_qlnx=		qlnx
729.endif
730_sfxge=		sfxge
731_sgx=		sgx
732_sgx_linux=	sgx_linux
733_smartpqi=	smartpqi
734
735.if ${MK_BHYVE} != "no" || defined(ALL_MODULES)
736_vmm=		vmm
737.endif
738.endif
739
740.if ${MACHINE_CPUARCH} == "i386"
741# XXX some of these can move to the general case when de-i386'ed
742# XXX some of these can move now, but are untested on other architectures.
743_3dfx=		3dfx
744_3dfx_linux=	3dfx_linux
745_aic=		aic
746_apm=		apm
747.if ${MK_SOURCELESS_UCODE} != "no"
748_ce=		ce
749.endif
750_coff=		coff
751.if ${MK_SOURCELESS_UCODE} != "no"
752_cp=		cp
753.endif
754_glxiic=	glxiic
755_glxsb=		glxsb
756#_ibcs2=		ibcs2
757_mse=		mse
758_ncr=		ncr
759_ncv=		ncv
760_nsp=		nsp
761_pcfclock=	pcfclock
762_pst=		pst
763_sbni=		sbni
764_stg=		stg
765.if ${MK_SOURCELESS_UCODE} != "no"
766_ctau=		ctau
767.endif
768_dpt=		dpt
769_ex=		ex
770.endif
771
772.if ${MACHINE_CPUARCH} == "arm"
773_cfi=		cfi
774_cpsw=		cpsw
775.endif
776
777.if ${MACHINE_CPUARCH} == "powerpc"
778_agp=		agp
779_an=		an
780_bm=		bm
781_cardbus=	cardbus
782_cbb=		cbb
783_cfi=		cfi
784_cpufreq=	cpufreq
785_drm=		drm
786_exca=		exca
787_ffec=		ffec
788_pccard=	pccard
789_wi=		wi
790.endif
791
792.if ${MACHINE_ARCH} == "powerpc64"
793_drm2=		drm2
794.endif
795.if ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "powerpc"
796# Don't build powermac_nvram for powerpcspe, it's never supported.
797_nvram=		powermac_nvram
798.endif
799
800.if ${MACHINE_CPUARCH} == "sparc64"
801_auxio=		auxio
802_em=		em
803_epic=		epic
804.endif
805
806.if (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
807     ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "i386")
808_cloudabi32=	cloudabi32
809.endif
810.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
811_cloudabi64=	cloudabi64
812.endif
813
814.endif
815
816.if ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "aarch64"
817_bcm283x_clkman=  bcm283x_clkman
818_bcm283x_pwm=  bcm283x_pwm
819.endif
820
821SUBDIR+=${MODULES_EXTRA}
822
823.for reject in ${WITHOUT_MODULES}
824SUBDIR:= ${SUBDIR:N${reject}}
825.endfor
826
827# Calling kldxref(8) for each module is expensive.
828.if !defined(NO_XREF)
829.MAKEFLAGS+=	-DNO_XREF
830afterinstall: .PHONY
831	@if type kldxref >/dev/null 2>&1; then \
832		${ECHO} kldxref ${DESTDIR}${KMODDIR}; \
833		kldxref ${DESTDIR}${KMODDIR}; \
834	fi
835.endif
836
837.include "${SYSDIR}/conf/config.mk"
838
839SUBDIR:= ${SUBDIR:u:O}
840
841.include <bsd.subdir.mk>
842