xref: /freebsd/sys/modules/Makefile (revision 2da0fcde21e0b90384f61fd50b87ea7dbd820233)
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_partition \
234	mac_portacl \
235	mac_seeotheruids \
236	mac_stub \
237	mac_test \
238	malo \
239	md \
240	mdio \
241	mem \
242	mfi \
243	mii \
244	mlx \
245	${_mlx4} \
246	${_mlx4ib} \
247	${_mlx4en} \
248	${_mlx5} \
249	${_mlx5en} \
250	${_mlx5ib} \
251	${_mly} \
252	mmc \
253	mmcsd \
254	mpr \
255	mps \
256	mpt \
257	mqueue \
258	mrsas \
259	msdosfs \
260	msdosfs_iconv \
261	${_mse} \
262	msk \
263	${_mthca} \
264	mvs \
265	mwl \
266	${_mwlfw} \
267	mxge \
268	my \
269	${_nandfs} \
270	${_nandsim} \
271	${_ncr} \
272	${_nctgpio} \
273	${_ncv} \
274	${_ndis} \
275	${_netgraph} \
276	${_nfe} \
277	nfscl \
278	nfscommon \
279	nfsd \
280	nfslock \
281	nfslockd \
282	nfssvc \
283	nge \
284	nmdm \
285	${_nsp} \
286	nullfs \
287	${_ntb} \
288	${_nvd} \
289	${_nvme} \
290	${_nvram} \
291	oce \
292	${_ocs_fc} \
293	otus \
294	${_otusfw} \
295	ow \
296	${_padlock} \
297	${_padlock_rng} \
298	${_pccard} \
299	${_pcfclock} \
300	pcn \
301	${_pf} \
302	${_pflog} \
303	${_pfsync} \
304	plip \
305	${_pms} \
306	ppbus \
307	ppc \
308	ppi \
309	pps \
310	procfs \
311	proto \
312	pseudofs \
313	${_pst} \
314	pty  \
315	puc \
316	${_qlxge} \
317	${_qlxgb} \
318	${_qlxgbe} \
319	${_qlnx} \
320	ral \
321	${_ralfw} \
322	${_random_fortuna} \
323	${_random_yarrow} \
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_yarrow=	random_yarrow
438_random_other=	random_other
439.endif
440.endif
441
442.if ${MK_CUSE} != "no" || defined(ALL_MODULES)
443SUBDIR+=	cuse
444.endif
445
446.if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \
447	defined(ALL_MODULES)
448_carp=		carp
449_toecore=	toecore
450_if_enc=	if_enc
451_if_gif=	if_gif
452_if_gre=	if_gre
453_ipfw_pmod=	ipfw_pmod
454.if ${MK_IPSEC_SUPPORT} != "no"
455_ipsec=		ipsec
456.endif
457.endif
458
459.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
460	defined(ALL_MODULES)
461_if_stf=	if_stf
462.endif
463
464.if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES)
465_if_me=		if_me
466_ipdivert=	ipdivert
467_ipfw=		ipfw
468.if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
469_ipfw_nat64=	ipfw_nat64
470.endif
471.endif
472
473.if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
474_ipfw_nptv6=	ipfw_nptv6
475.endif
476
477.if ${MK_IPFILTER} != "no" || defined(ALL_MODULES)
478_ipfilter=	ipfilter
479.endif
480
481.if ${MK_ISCSI} != "no" || defined(ALL_MODULES)
482SUBDIR+=	cfiscsi
483SUBDIR+=	iscsi
484SUBDIR+=	iscsi_initiator
485.endif
486
487.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
488    ${MACHINE_CPUARCH} == "i386"
489SUBDIR+=	linprocfs
490SUBDIR+=	linsysfs
491.endif
492
493.if ${MK_NAND} != "no" || defined(ALL_MODULES)
494_nandfs=	nandfs
495_nandsim=	nandsim
496.endif
497
498.if ${MK_NETGRAPH} != "no" || defined(ALL_MODULES)
499_netgraph=	netgraph
500.endif
501
502.if (${MK_PF} != "no" && (${MK_INET_SUPPORT} != "no" || \
503	${MK_INET6_SUPPORT} != "no")) || defined(ALL_MODULES)
504_pf=		pf
505_pflog=		pflog
506.if ${MK_INET_SUPPORT} != "no"
507_pfsync=	pfsync
508.endif
509.endif
510
511.if ${MK_SOURCELESS_UCODE} != "no"
512_bce=		bce
513_fxp=		fxp
514_ispfw=		ispfw
515_sf=		sf
516_ti=		ti
517_txp=		txp
518
519.if ${MACHINE_CPUARCH} != "mips"
520_mwlfw=		mwlfw
521_otusfw=	otusfw
522_ralfw=		ralfw
523_rtwnfw=	rtwnfw
524.endif
525.endif
526
527.if ${MK_SOURCELESS_UCODE} != "no" && ${MACHINE_CPUARCH} != "arm" && \
528	${MACHINE_CPUARCH} != "mips" && \
529	${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe" && \
530	${MACHINE_CPUARCH} != "riscv"
531_cxgbe=		cxgbe
532.endif
533
534.if ${MK_TESTS} != "no" || defined(ALL_MODULES)
535SUBDIR+=	tests
536.endif
537
538.if ${MK_ZFS} != "no" || defined(ALL_MODULES)
539SUBDIR+=	zfs
540.endif
541
542.if (${MACHINE_CPUARCH} == "mips" && ${MACHINE_ARCH:Mmips64} == "")
543_hwpmc_mips24k=	hwpmc_mips24k
544_hwpmc_mips74k=	hwpmc_mips74k
545.endif
546
547.if ${MACHINE_CPUARCH} != "aarch64" && ${MACHINE_CPUARCH} != "arm" && \
548	${MACHINE_CPUARCH} != "mips" && ${MACHINE_CPUARCH} != "powerpc" && \
549	${MACHINE_CPUARCH} != "riscv"
550_syscons=	syscons
551_vpo=		vpo
552.endif
553
554.if ${MACHINE_CPUARCH} != "mips"
555# no BUS_SPACE_UNSPECIFIED
556# No barrier instruction support (specific to this driver)
557_sym=		sym
558# intr_disable() is a macro, causes problems
559.if ${MK_SOURCELESS_UCODE} != "no"
560_cxgb=		cxgb
561.endif
562.endif
563
564.if ${MACHINE_CPUARCH} == "aarch64"
565_allwinner=	allwinner
566_armv8crypto=	armv8crypto
567_efirt=		efirt
568_em=		em
569_rockchip=	rockchip
570.endif
571
572.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
573_agp=		agp
574_an=		an
575_aout=		aout
576_bios=		bios
577_bktr=		bktr
578.if ${MK_SOURCELESS_UCODE} != "no"
579_bxe=		bxe
580.endif
581_cardbus=	cardbus
582_cbb=		cbb
583_cpuctl=	cpuctl
584_cpufreq=	cpufreq
585_cs=		cs
586_dpms=		dpms
587_drm=		drm
588_drm2=		drm2
589_ed=		ed
590_em=		em
591_ena=		ena
592_ep=		ep
593_et=		et
594_exca=		exca
595_fe=		fe
596.if ${MK_OFED} != "no" || defined(ALL_MODULES)
597_ibcore=        ibcore
598.endif
599_if_ndis=	if_ndis
600_io=		io
601.if ${MK_OFED} != "no" || defined(ALL_MODULES)
602_ipoib=         ipoib
603_iser=		iser
604.endif
605_ix=		ix
606_ixv=		ixv
607_linux=		linux
608.if ${MK_SOURCELESS_UCODE} != "no"
609_lio=		lio
610.endif
611_nctgpio=	nctgpio
612_ndis=		ndis
613_ocs_fc=	ocs_fc
614_pccard=	pccard
615.if ${MK_OFED} != "no" || defined(ALL_MODULES)
616_rdma=		rdma
617.endif
618_safe=		safe
619_scsi_low=	scsi_low
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_ccp=		ccp
716_efirt=		efirt
717_ioat=		ioat
718_ixl=		ixl
719_ixlv=		ixlv
720_linux64=	linux64
721_linux_common=	linux_common
722_ntb=		ntb
723_pms=		pms
724_qlxge=		qlxge
725_qlxgb=		qlxgb
726.if ${MK_SOURCELESS_UCODE} != "no"
727_qlxgbe=	qlxgbe
728_qlnx=		qlnx
729.endif
730_sfxge=		sfxge
731_sgx=		sgx
732_sgx_linux=	sgx_linux
733_smartpqi=	smartpqi
734
735.if ${MK_BHYVE} != "no" || defined(ALL_MODULES)
736_vmm=		vmm
737.endif
738.endif
739
740.if ${MACHINE_CPUARCH} == "i386"
741# XXX some of these can move to the general case when de-i386'ed
742# XXX some of these can move now, but are untested on other architectures.
743_3dfx=		3dfx
744_3dfx_linux=	3dfx_linux
745_aic=		aic
746_apm=		apm
747.if ${MK_SOURCELESS_UCODE} != "no"
748_ce=		ce
749.endif
750_coff=		coff
751.if ${MK_SOURCELESS_UCODE} != "no"
752_cp=		cp
753.endif
754_glxiic=	glxiic
755_glxsb=		glxsb
756#_ibcs2=		ibcs2
757_mse=		mse
758_ncr=		ncr
759_ncv=		ncv
760_nsp=		nsp
761_pcfclock=	pcfclock
762_pst=		pst
763_sbni=		sbni
764_stg=		stg
765.if ${MK_SOURCELESS_UCODE} != "no"
766_ctau=		ctau
767.endif
768_dpt=		dpt
769_ex=		ex
770.endif
771
772.if ${MACHINE_CPUARCH} == "arm"
773_cfi=		cfi
774_cpsw=		cpsw
775.endif
776
777.if ${MACHINE_CPUARCH} == "powerpc"
778_agp=		agp
779_an=		an
780_bm=		bm
781_cardbus=	cardbus
782_cbb=		cbb
783_cfi=		cfi
784_cpufreq=	cpufreq
785_drm=		drm
786_exca=		exca
787_ffec=		ffec
788_nvd=		nvd
789_nvme=		nvme
790_pccard=	pccard
791_wi=		wi
792.endif
793
794.if ${MACHINE_ARCH} == "powerpc64"
795_drm2=		drm2
796.endif
797.if ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "powerpc"
798# Don't build powermac_nvram for powerpcspe, it's never supported.
799_nvram=		powermac_nvram
800.endif
801
802.if ${MACHINE_CPUARCH} == "sparc64"
803_auxio=		auxio
804_em=		em
805_epic=		epic
806.endif
807
808.if (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
809     ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "i386")
810_cloudabi32=	cloudabi32
811.endif
812.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
813_cloudabi64=	cloudabi64
814.endif
815
816.endif
817
818.if ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "aarch64"
819_bcm283x_clkman=  bcm283x_clkman
820_bcm283x_pwm=  bcm283x_pwm
821.endif
822
823SUBDIR+=${MODULES_EXTRA}
824
825.for reject in ${WITHOUT_MODULES}
826SUBDIR:= ${SUBDIR:N${reject}}
827.endfor
828
829# Calling kldxref(8) for each module is expensive.
830.if !defined(NO_XREF)
831.MAKEFLAGS+=	-DNO_XREF
832afterinstall: .PHONY
833	@if type kldxref >/dev/null 2>&1; then \
834		${ECHO} kldxref ${DESTDIR}${KMODDIR}; \
835		kldxref ${DESTDIR}${KMODDIR}; \
836	fi
837.endif
838
839.include "${SYSDIR}/conf/config.mk"
840
841SUBDIR:= ${SUBDIR:u:O}
842
843.include <bsd.subdir.mk>
844