xref: /freebsd/sys/modules/Makefile (revision 3d32dc633c5e21bf15dd0d968734efe72776afdc)
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_other} \
325	rc4 \
326	${_rdma} \
327	${_rdrand_rng} \
328	re \
329	rl \
330	${_rockchip} \
331	rtwn \
332	rtwn_pci \
333	rtwn_usb \
334	${_rtwnfw} \
335	${_s3} \
336	${_safe} \
337	${_sbni} \
338	scc \
339	${_scsi_low} \
340	sdhci \
341	${_sdhci_acpi} \
342	sdhci_pci \
343	sem \
344	send \
345	${_sf} \
346	${_sfxge} \
347	sge \
348	${_sgx} \
349	${_sgx_linux} \
350	siftr \
351	siis \
352	sis \
353	sk \
354	${_smartpqi} \
355	smbfs \
356	sn \
357	snp \
358	sound \
359	${_speaker} \
360	spi \
361	${_splash} \
362	${_sppp} \
363	ste \
364	${_stg} \
365	stge \
366	${_sym} \
367	${_syscons} \
368	sysvipc \
369	tcp \
370	${_ti} \
371	tl \
372	tmpfs \
373	${_toecore} \
374	${_tpm} \
375	trm \
376	${_twa} \
377	twe \
378	tws \
379	tx \
380	${_txp} \
381	uart \
382	ubsec \
383	udf \
384	udf_iconv \
385	ufs \
386	uinput \
387	unionfs \
388	usb \
389	${_vesa} \
390	${_virtio} \
391	vge \
392	${_viawd} \
393	videomode \
394	vkbd \
395	${_vmm} \
396	${_vmware} \
397	${_vpo} \
398	vr \
399	vte \
400	vx \
401	wb \
402	${_wbwd} \
403	${_wi} \
404	wlan \
405	wlan_acl \
406	wlan_amrr \
407	wlan_ccmp \
408	wlan_rssadapt \
409	wlan_tkip \
410	wlan_wep \
411	wlan_xauth \
412	${_wpi} \
413	${_wpifw} \
414	${_x86bios} \
415	${_xe} \
416	xl \
417	zlib
418
419.if ${MK_AUTOFS} != "no" || defined(ALL_MODULES)
420_autofs=	autofs
421.endif
422
423.if ${MK_CDDL} != "no" || defined(ALL_MODULES)
424.if (${MACHINE_CPUARCH} != "arm" || ${MACHINE_ARCH:Marmv[67]*} != "") && \
425	${MACHINE_CPUARCH} != "mips" && \
426	${MACHINE_CPUARCH} != "sparc64"
427SUBDIR+=	dtrace
428.endif
429SUBDIR+=	opensolaris
430.endif
431
432.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
433.if exists(${SRCTOP}/sys/opencrypto)
434_crypto=	crypto
435_cryptodev=	cryptodev
436_random_fortuna=random_fortuna
437_random_other=	random_other
438.endif
439.endif
440
441.if ${MK_CUSE} != "no" || defined(ALL_MODULES)
442SUBDIR+=	cuse
443.endif
444
445.if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \
446	defined(ALL_MODULES)
447_carp=		carp
448_toecore=	toecore
449_if_enc=	if_enc
450_if_gif=	if_gif
451_if_gre=	if_gre
452_ipfw_pmod=	ipfw_pmod
453.if ${MK_IPSEC_SUPPORT} != "no"
454_ipsec=		ipsec
455.endif
456.endif
457
458.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
459	defined(ALL_MODULES)
460_if_stf=	if_stf
461.endif
462
463.if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES)
464_if_me=		if_me
465_ipdivert=	ipdivert
466_ipfw=		ipfw
467.if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
468_ipfw_nat64=	ipfw_nat64
469.endif
470.endif
471
472.if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
473_ipfw_nptv6=	ipfw_nptv6
474.endif
475
476.if ${MK_IPFILTER} != "no" || defined(ALL_MODULES)
477_ipfilter=	ipfilter
478.endif
479
480.if ${MK_ISCSI} != "no" || defined(ALL_MODULES)
481SUBDIR+=	cfiscsi
482SUBDIR+=	iscsi
483SUBDIR+=	iscsi_initiator
484.endif
485
486.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
487    ${MACHINE_CPUARCH} == "i386"
488SUBDIR+=	linprocfs
489SUBDIR+=	linsysfs
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_allwinner=	allwinner
565_armv8crypto=	armv8crypto
566_efirt=		efirt
567_em=		em
568_rockchip=	rockchip
569.endif
570
571.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
572_agp=		agp
573_an=		an
574_aout=		aout
575_bios=		bios
576_bktr=		bktr
577.if ${MK_SOURCELESS_UCODE} != "no"
578_bxe=		bxe
579.endif
580_cardbus=	cardbus
581_cbb=		cbb
582_cpuctl=	cpuctl
583_cpufreq=	cpufreq
584_cs=		cs
585_dpms=		dpms
586.if ${MK_MODULE_DRM} != "no"
587_drm=		drm
588.endif
589.if ${MK_MODULE_DRM2} != "no"
590_drm2=		drm2
591.endif
592_ed=		ed
593_em=		em
594_ena=		ena
595_ep=		ep
596_et=		et
597_exca=		exca
598_fe=		fe
599.if ${MK_OFED} != "no" || defined(ALL_MODULES)
600_ibcore=        ibcore
601.endif
602_if_ndis=	if_ndis
603_io=		io
604.if ${MK_OFED} != "no" || defined(ALL_MODULES)
605_ipoib=         ipoib
606_iser=		iser
607.endif
608_ix=		ix
609_ixv=		ixv
610_linux=		linux
611.if ${MK_SOURCELESS_UCODE} != "no"
612_lio=		lio
613.endif
614_nctgpio=	nctgpio
615_ndis=		ndis
616_ocs_fc=	ocs_fc
617_pccard=	pccard
618.if ${MK_OFED} != "no" || defined(ALL_MODULES)
619_rdma=		rdma
620.endif
621_safe=		safe
622_scsi_low=	scsi_low
623_speaker=	speaker
624_splash=	splash
625_sppp=		sppp
626_vmware=	vmware
627_wbwd=		wbwd
628_wi=		wi
629_xe=		xe
630
631_aac=		aac
632_aacraid=	aacraid
633_acpi=		acpi
634.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
635.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} > 40201
636_aesni=		aesni
637.endif
638.endif
639_amd_ecc_inject=amd_ecc_inject
640_amdsbwd=	amdsbwd
641_amdsmn=	amdsmn
642_amdtemp=	amdtemp
643_arcmsr=	arcmsr
644_asmc=		asmc
645.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
646_blake2=	blake2
647.endif
648_bytgpio=	bytgpio
649_chvgpio=	chvgpio
650_ciss=		ciss
651_chromebook_platform=	chromebook_platform
652_cmx=		cmx
653_coretemp=	coretemp
654.if ${MK_SOURCELESS_HOST} != "no"
655_hpt27xx=	hpt27xx
656.endif
657_hptiop=	hptiop
658.if ${MK_SOURCELESS_HOST} != "no"
659_hptmv=		hptmv
660_hptnr=		hptnr
661_hptrr=		hptrr
662.endif
663_hyperv=	hyperv
664_ichwd=		ichwd
665_ida=		ida
666_iir=		iir
667_intelspi=	intelspi
668_ipmi=		ipmi
669_ips=		ips
670_isci=		isci
671_ipw=		ipw
672_iwi=		iwi
673_iwm=		iwm
674_iwn=		iwn
675.if ${MK_SOURCELESS_UCODE} != "no"
676_ipwfw=		ipwfw
677_iwifw=		iwifw
678_iwmfw=		iwmfw
679_iwnfw=		iwnfw
680.endif
681_mlx4=		mlx4
682_mlx5=		mlx5
683.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
684	defined(ALL_MODULES)
685_mlx4en=	mlx4en
686_mlx5en=	mlx5en
687.endif
688.if ${MK_OFED} != "no" || defined(ALL_MODULES)
689_mthca=		mthca
690_mlx4ib=	mlx4ib
691_mlx5ib=	mlx5ib
692.endif
693_mly=		mly
694_nfe=		nfe
695_nvd=		nvd
696_nvme=		nvme
697_nvram=		nvram
698.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
699_padlock=	padlock
700_padlock_rng=	padlock_rng
701_rdrand_rng=	rdrand_rng
702.endif
703_s3=		s3
704_sdhci_acpi=	sdhci_acpi
705_tpm=		tpm
706_twa=		twa
707_vesa=		vesa
708_viawd=		viawd
709_virtio=	virtio
710_wpi=		wpi
711.if ${MK_SOURCELESS_UCODE} != "no"
712_wpifw=		wpifw
713.endif
714_x86bios=	x86bios
715.endif
716
717.if ${MACHINE_CPUARCH} == "amd64"
718_ccp=		ccp
719_efirt=		efirt
720_ioat=		ioat
721_ixl=		ixl
722_ixlv=		ixlv
723_linux64=	linux64
724_linux_common=	linux_common
725_ntb=		ntb
726_pms=		pms
727_qlxge=		qlxge
728_qlxgb=		qlxgb
729.if ${MK_SOURCELESS_UCODE} != "no"
730_qlxgbe=	qlxgbe
731_qlnx=		qlnx
732.endif
733_sfxge=		sfxge
734_sgx=		sgx
735_sgx_linux=	sgx_linux
736_smartpqi=	smartpqi
737
738.if ${MK_BHYVE} != "no" || defined(ALL_MODULES)
739_vmm=		vmm
740.endif
741.endif
742
743.if ${MACHINE_CPUARCH} == "i386"
744# XXX some of these can move to the general case when de-i386'ed
745# XXX some of these can move now, but are untested on other architectures.
746_3dfx=		3dfx
747_3dfx_linux=	3dfx_linux
748_aic=		aic
749_apm=		apm
750.if ${MK_SOURCELESS_UCODE} != "no"
751_ce=		ce
752.endif
753_coff=		coff
754.if ${MK_SOURCELESS_UCODE} != "no"
755_cp=		cp
756.endif
757_glxiic=	glxiic
758_glxsb=		glxsb
759#_ibcs2=		ibcs2
760_mse=		mse
761_ncr=		ncr
762_ncv=		ncv
763_nsp=		nsp
764_pcfclock=	pcfclock
765_pst=		pst
766_sbni=		sbni
767_stg=		stg
768.if ${MK_SOURCELESS_UCODE} != "no"
769_ctau=		ctau
770.endif
771_dpt=		dpt
772_ex=		ex
773.endif
774
775.if ${MACHINE_CPUARCH} == "arm"
776_cfi=		cfi
777_cpsw=		cpsw
778.endif
779
780.if ${MACHINE_CPUARCH} == "powerpc"
781_agp=		agp
782_an=		an
783_bm=		bm
784_cardbus=	cardbus
785_cbb=		cbb
786_cfi=		cfi
787_cpufreq=	cpufreq
788.if ${MK_MODULE_DRM} != "no"
789_drm=		drm
790.endif
791_exca=		exca
792_ffec=		ffec
793_nvd=		nvd
794_nvme=		nvme
795_pccard=	pccard
796_wi=		wi
797.endif
798
799.if ${MACHINE_ARCH} == "powerpc64"
800.if ${MK_MODULE_DRM2} != "no"
801_drm2=		drm2
802.endif
803_ipmi=		ipmi
804.endif
805.if ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "powerpc"
806# Don't build powermac_nvram for powerpcspe, it's never supported.
807_nvram=		powermac_nvram
808.endif
809
810.if ${MACHINE_CPUARCH} == "sparc64"
811_auxio=		auxio
812_em=		em
813_epic=		epic
814.endif
815
816.if (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
817     ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "i386")
818_cloudabi32=	cloudabi32
819.endif
820.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
821_cloudabi64=	cloudabi64
822.endif
823
824.endif
825
826.if ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "aarch64"
827_bcm283x_clkman=  bcm283x_clkman
828_bcm283x_pwm=  bcm283x_pwm
829.endif
830
831SUBDIR+=${MODULES_EXTRA}
832
833.for reject in ${WITHOUT_MODULES}
834SUBDIR:= ${SUBDIR:N${reject}}
835.endfor
836
837# Calling kldxref(8) for each module is expensive.
838.if !defined(NO_XREF)
839.MAKEFLAGS+=	-DNO_XREF
840afterinstall: .PHONY
841	@if type kldxref >/dev/null 2>&1; then \
842		${ECHO} kldxref ${DESTDIR}${KMODDIR}; \
843		kldxref ${DESTDIR}${KMODDIR}; \
844	fi
845.endif
846
847.include "${SYSDIR}/conf/config.mk"
848
849SUBDIR:= ${SUBDIR:u:O}
850
851.include <bsd.subdir.mk>
852