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