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