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