xref: /freebsd/sys/modules/Makefile (revision 28f4385e45a2681c14bd04b83fe1796eaefe8265)
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	ahci \
30	aic7xxx \
31	alc \
32	ale \
33	alq \
34	${_amd_ecc_inject} \
35	${_amdgpio} \
36	${_amdsbwd} \
37	${_amdsmn} \
38	${_amdtemp} \
39	amr \
40	${_an} \
41	${_aout} \
42	${_apm} \
43	${_arcmsr} \
44	${_allwinner} \
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	${_coretemp} \
96	${_cp} \
97	${_cpsw} \
98	${_cpuctl} \
99	${_cpufreq} \
100	${_crypto} \
101	${_cryptodev} \
102	${_cs} \
103	${_ctau} \
104	ctl \
105	${_cxgb} \
106	${_cxgbe} \
107	dc \
108	dcons \
109	dcons_crom \
110	de \
111	${_dpms} \
112	${_drm} \
113	${_drm2} \
114	dummynet \
115	${_ed} \
116	${_efirt} \
117	${_em} \
118	${_ena} \
119	${_ep} \
120	${_epic} \
121	esp \
122	${_et} \
123	evdev \
124	${_ex} \
125	${_exca} \
126	ext2fs \
127	fdc \
128	fdescfs \
129	${_fe} \
130	${_ffec} \
131	filemon \
132	firewire \
133	firmware \
134	fuse \
135	${_fxp} \
136	gem \
137	geom \
138	${_glxiic} \
139	${_glxsb} \
140	gpio \
141	hifn \
142	hme \
143	${_hpt27xx} \
144	${_hptiop} \
145	${_hptmv} \
146	${_hptnr} \
147	${_hptrr} \
148	hwpmc \
149	${_hwpmc_mips24k} \
150	${_hwpmc_mips74k} \
151	${_hyperv} \
152	i2c \
153	${_iavf} \
154        ${_ibcore} \
155	${_ichwd} \
156	${_ida} \
157	if_bridge \
158	if_disc \
159	if_edsc \
160	${_if_enc} \
161	if_epair \
162	${_if_gif} \
163	${_if_gre} \
164	${_if_me} \
165	if_lagg \
166	${_if_ndis} \
167	${_if_stf} \
168	if_tap \
169	if_tun \
170	if_vlan \
171	if_vxlan \
172	${_iir} \
173	imgact_binmisc \
174	${_intelspi} \
175	${_io} \
176	${_ioat} \
177        ${_ipoib} \
178	${_ipdivert} \
179	${_ipfilter} \
180	${_ipfw} \
181	ipfw_nat \
182	${_ipfw_nat64} \
183	${_ipfw_nptv6} \
184	${_ipfw_pmod} \
185	${_ipmi} \
186	ip6_mroute_mod \
187	ip_mroute_mod \
188	${_ips} \
189	${_ipsec} \
190	${_ipw} \
191	${_ipwfw} \
192	${_isci} \
193	${_iser} \
194	isp \
195	${_ispfw} \
196	${_iwi} \
197	${_iwifw} \
198	${_iwm} \
199	${_iwmfw} \
200	${_iwn} \
201	${_iwnfw} \
202	${_ix} \
203	${_ixv} \
204	${_ixl} \
205	jme \
206	kbdmux \
207	kgssapi \
208	kgssapi_krb5 \
209	khelp \
210	krpc \
211	ksyms \
212	le \
213	lge \
214	libalias \
215	libiconv \
216	libmchain \
217	${_linux} \
218	${_linux_common} \
219	${_linux64} \
220	linuxkpi \
221	${_lio} \
222	lpt \
223	mac_biba \
224	mac_bsdextended \
225	mac_ifoff \
226	mac_lomac \
227	mac_mls \
228	mac_none \
229	mac_ntpd \
230	mac_partition \
231	mac_portacl \
232	mac_seeotheruids \
233	mac_stub \
234	mac_test \
235	malo \
236	md \
237	mdio \
238	mem \
239	mfi \
240	mii \
241	mlx \
242	${_mlx4} \
243	${_mlx4ib} \
244	${_mlx4en} \
245	${_mlx5} \
246	${_mlx5en} \
247	${_mlx5ib} \
248	${_mly} \
249	mmc \
250	mmcsd \
251	${_mpr} \
252	${_mps} \
253	mpt \
254	mqueue \
255	mrsas \
256	msdosfs \
257	msdosfs_iconv \
258	msk \
259	${_mthca} \
260	mvs \
261	mwl \
262	${_mwlfw} \
263	mxge \
264	my \
265	${_nandfs} \
266	${_nandsim} \
267	${_nctgpio} \
268	${_ndis} \
269	${_netgraph} \
270	${_nfe} \
271	nfscl \
272	nfscommon \
273	nfsd \
274	nfslock \
275	nfslockd \
276	nfssvc \
277	nge \
278	nmdm \
279	nullfs \
280	${_ntb} \
281	${_nvd} \
282	${_nvdimm} \
283	${_nvme} \
284	${_nvram} \
285	oce \
286	${_ocs_fc} \
287	otus \
288	${_otusfw} \
289	ow \
290	${_padlock} \
291	${_padlock_rng} \
292	${_pccard} \
293	${_pcfclock} \
294	pcn \
295	${_pf} \
296	${_pflog} \
297	${_pfsync} \
298	plip \
299	${_pms} \
300	ppbus \
301	ppc \
302	ppi \
303	pps \
304	procfs \
305	proto \
306	pseudofs \
307	${_pst} \
308	pty  \
309	puc \
310	${_qlxge} \
311	${_qlxgb} \
312	${_qlxgbe} \
313	${_qlnx} \
314	ral \
315	${_ralfw} \
316	${_random_fortuna} \
317	${_random_other} \
318	rc4 \
319	${_rdma} \
320	${_rdrand_rng} \
321	re \
322	rl \
323	${_rockchip} \
324	rtwn \
325	rtwn_pci \
326	rtwn_usb \
327	${_rtwnfw} \
328	${_s3} \
329	${_safe} \
330	${_sbni} \
331	scc \
332	sdhci \
333	${_sdhci_acpi} \
334	sdhci_pci \
335	sem \
336	send \
337	${_sf} \
338	${_sfxge} \
339	sge \
340	${_sgx} \
341	${_sgx_linux} \
342	siftr \
343	siis \
344	sis \
345	sk \
346	${_smartpqi} \
347	smbfs \
348	sn \
349	snp \
350	sound \
351	${_speaker} \
352	spi \
353	${_splash} \
354	${_sppp} \
355	ste \
356	stge \
357	${_sym} \
358	${_syscons} \
359	sysvipc \
360	tcp \
361	${_ti} \
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	${_vesa} \
381	${_virtio} \
382	vge \
383	${_viawd} \
384	videomode \
385	vkbd \
386	${_vmm} \
387	${_vmware} \
388	${_vpo} \
389	vr \
390	vte \
391	vx \
392	wb \
393	${_wbwd} \
394	${_wi} \
395	wlan \
396	wlan_acl \
397	wlan_amrr \
398	wlan_ccmp \
399	wlan_rssadapt \
400	wlan_tkip \
401	wlan_wep \
402	wlan_xauth \
403	${_wpi} \
404	${_wpifw} \
405	${_x86bios} \
406	${_xe} \
407	xl \
408	zlib
409
410.if ${MK_AUTOFS} != "no" || defined(ALL_MODULES)
411_autofs=	autofs
412.endif
413
414.if ${MK_CDDL} != "no" || defined(ALL_MODULES)
415.if (${MACHINE_CPUARCH} != "arm" || ${MACHINE_ARCH:Marmv[67]*} != "") && \
416	${MACHINE_CPUARCH} != "mips" && \
417	${MACHINE_CPUARCH} != "sparc64"
418SUBDIR+=	dtrace
419.endif
420SUBDIR+=	opensolaris
421.endif
422
423.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
424.if exists(${SRCTOP}/sys/opencrypto)
425_crypto=	crypto
426_cryptodev=	cryptodev
427_random_fortuna=random_fortuna
428_random_other=	random_other
429.endif
430.endif
431
432.if ${MK_CUSE} != "no" || defined(ALL_MODULES)
433SUBDIR+=	cuse
434.endif
435
436.if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \
437	defined(ALL_MODULES)
438_carp=		carp
439_toecore=	toecore
440_if_enc=	if_enc
441_if_gif=	if_gif
442_if_gre=	if_gre
443_ipfw_pmod=	ipfw_pmod
444.if ${MK_IPSEC_SUPPORT} != "no"
445_ipsec=		ipsec
446.endif
447.endif
448
449.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
450	defined(ALL_MODULES)
451_if_stf=	if_stf
452.endif
453
454.if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES)
455_if_me=		if_me
456_ipdivert=	ipdivert
457_ipfw=		ipfw
458.if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
459_ipfw_nat64=	ipfw_nat64
460.endif
461.endif
462
463.if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
464_ipfw_nptv6=	ipfw_nptv6
465.endif
466
467.if ${MK_IPFILTER} != "no" || defined(ALL_MODULES)
468_ipfilter=	ipfilter
469.endif
470
471.if ${MK_ISCSI} != "no" || defined(ALL_MODULES)
472SUBDIR+=	cfiscsi
473SUBDIR+=	iscsi
474SUBDIR+=	iscsi_initiator
475.endif
476
477.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
478    ${MACHINE_CPUARCH} == "i386"
479SUBDIR+=	linprocfs
480SUBDIR+=	linsysfs
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_fxp=		fxp
504_ispfw=		ispfw
505_sf=		sf
506_ti=		ti
507_txp=		txp
508
509.if ${MACHINE_CPUARCH} != "mips"
510_mwlfw=		mwlfw
511_otusfw=	otusfw
512_ralfw=		ralfw
513_rtwnfw=	rtwnfw
514.endif
515.endif
516
517.if ${MK_SOURCELESS_UCODE} != "no" && ${MACHINE_CPUARCH} != "arm" && \
518	${MACHINE_CPUARCH} != "mips" && \
519	${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe" && \
520	${MACHINE_CPUARCH} != "riscv"
521_cxgbe=		cxgbe
522.endif
523
524# These rely on 64bit atomics
525.if ${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe" && \
526	${MACHINE_CPUARCH} != "mips"
527_mps=		mps
528_mpr=		mpr
529.endif
530
531.if ${MK_TESTS} != "no" || defined(ALL_MODULES)
532SUBDIR+=	tests
533.endif
534
535.if ${MK_ZFS} != "no" || defined(ALL_MODULES)
536SUBDIR+=	zfs
537.endif
538
539.if (${MACHINE_CPUARCH} == "mips" && ${MACHINE_ARCH:Mmips64} == "")
540_hwpmc_mips24k=	hwpmc_mips24k
541_hwpmc_mips74k=	hwpmc_mips74k
542.endif
543
544.if ${MACHINE_CPUARCH} != "aarch64" && ${MACHINE_CPUARCH} != "arm" && \
545	${MACHINE_CPUARCH} != "mips" && ${MACHINE_CPUARCH} != "powerpc" && \
546	${MACHINE_CPUARCH} != "riscv"
547_syscons=	syscons
548_vpo=		vpo
549.endif
550
551.if ${MACHINE_CPUARCH} != "mips"
552# no BUS_SPACE_UNSPECIFIED
553# No barrier instruction support (specific to this driver)
554_sym=		sym
555# intr_disable() is a macro, causes problems
556.if ${MK_SOURCELESS_UCODE} != "no"
557_cxgb=		cxgb
558.endif
559.endif
560
561.if ${MACHINE_CPUARCH} == "aarch64"
562_allwinner=	allwinner
563_armv8crypto=	armv8crypto
564_efirt=		efirt
565_em=		em
566_rockchip=	rockchip
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.if ${MK_MODULE_DRM} != "no"
585_drm=		drm
586.endif
587.if ${MK_MODULE_DRM2} != "no"
588_drm2=		drm2
589.endif
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_speaker=	speaker
621_splash=	splash
622_sppp=		sppp
623_vmware=	vmware
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.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} > 40201
633_aesni=		aesni
634.endif
635.endif
636_amd_ecc_inject=amd_ecc_inject
637_amdsbwd=	amdsbwd
638_amdsmn=	amdsmn
639_amdtemp=	amdtemp
640_arcmsr=	arcmsr
641_asmc=		asmc
642.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
643_blake2=	blake2
644.endif
645_bytgpio=	bytgpio
646_chvgpio=	chvgpio
647_ciss=		ciss
648_chromebook_platform=	chromebook_platform
649_cmx=		cmx
650_coretemp=	coretemp
651.if ${MK_SOURCELESS_HOST} != "no"
652_hpt27xx=	hpt27xx
653.endif
654_hptiop=	hptiop
655.if ${MK_SOURCELESS_HOST} != "no"
656_hptmv=		hptmv
657_hptnr=		hptnr
658_hptrr=		hptrr
659.endif
660_hyperv=	hyperv
661_ichwd=		ichwd
662_ida=		ida
663_iir=		iir
664_intelspi=	intelspi
665_ipmi=		ipmi
666_ips=		ips
667_isci=		isci
668_ipw=		ipw
669_iwi=		iwi
670_iwm=		iwm
671_iwn=		iwn
672.if ${MK_SOURCELESS_UCODE} != "no"
673_ipwfw=		ipwfw
674_iwifw=		iwifw
675_iwmfw=		iwmfw
676_iwnfw=		iwnfw
677.endif
678_mlx4=		mlx4
679_mlx5=		mlx5
680.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
681	defined(ALL_MODULES)
682_mlx4en=	mlx4en
683_mlx5en=	mlx5en
684.endif
685.if ${MK_OFED} != "no" || defined(ALL_MODULES)
686_mthca=		mthca
687_mlx4ib=	mlx4ib
688_mlx5ib=	mlx5ib
689.endif
690_mly=		mly
691_nfe=		nfe
692_nvd=		nvd
693_nvme=		nvme
694_nvram=		nvram
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_amdgpio=	amdgpio
716_ccp=		ccp
717_efirt=		efirt
718_iavf=		iavf
719_ioat=		ioat
720_ixl=		ixl
721_linux64=	linux64
722_linux_common=	linux_common
723_ntb=		ntb
724_nvdimm=	nvdimm
725_pms=		pms
726_qlxge=		qlxge
727_qlxgb=		qlxgb
728.if ${MK_SOURCELESS_UCODE} != "no"
729_qlxgbe=	qlxgbe
730_qlnx=		qlnx
731.endif
732_sfxge=		sfxge
733_sgx=		sgx
734_sgx_linux=	sgx_linux
735_smartpqi=	smartpqi
736
737.if ${MK_BHYVE} != "no" || defined(ALL_MODULES)
738_vmm=		vmm
739.endif
740.endif
741
742.if ${MACHINE_CPUARCH} == "i386"
743# XXX some of these can move to the general case when de-i386'ed
744# XXX some of these can move now, but are untested on other architectures.
745_3dfx=		3dfx
746_3dfx_linux=	3dfx_linux
747_apm=		apm
748.if ${MK_SOURCELESS_UCODE} != "no"
749_ce=		ce
750.endif
751.if ${MK_SOURCELESS_UCODE} != "no"
752_cp=		cp
753.endif
754_glxiic=	glxiic
755_glxsb=		glxsb
756_pcfclock=	pcfclock
757_pst=		pst
758_sbni=		sbni
759.if ${MK_SOURCELESS_UCODE} != "no"
760_ctau=		ctau
761.endif
762_ex=		ex
763.endif
764
765.if ${MACHINE_CPUARCH} == "arm"
766_cfi=		cfi
767_cpsw=		cpsw
768.endif
769
770.if ${MACHINE_CPUARCH} == "powerpc"
771_agp=		agp
772_an=		an
773_bm=		bm
774_cardbus=	cardbus
775_cbb=		cbb
776_cfi=		cfi
777_cpufreq=	cpufreq
778.if ${MK_MODULE_DRM} != "no"
779_drm=		drm
780.endif
781_exca=		exca
782_ffec=		ffec
783_nvd=		nvd
784_nvme=		nvme
785_pccard=	pccard
786_wi=		wi
787.endif
788
789.if ${MACHINE_ARCH} == "powerpc64"
790.if ${MK_MODULE_DRM2} != "no"
791_drm2=		drm2
792.endif
793_ipmi=		ipmi
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