xref: /freebsd/sys/modules/Makefile (revision 0629b152762b06325dd75a41bcb0a2789514141b)
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	${_arcnet} \
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	${_cm} \
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        ${_ibcore} \
158	${_ibcs2} \
159	${_ichwd} \
160	${_ida} \
161	if_bridge \
162	if_disc \
163	if_edsc \
164	${_if_enc} \
165	if_epair \
166	${_if_gif} \
167	${_if_gre} \
168	${_if_me} \
169	if_lagg \
170	${_if_ndis} \
171	${_if_stf} \
172	if_tap \
173	if_tun \
174	if_vlan \
175	if_vxlan \
176	${_iir} \
177	imgact_binmisc \
178	${_intelspi} \
179	${_io} \
180	${_ioat} \
181        ${_ipoib} \
182	${_ipdivert} \
183	${_ipfilter} \
184	${_ipfw} \
185	ipfw_nat \
186	${_ipfw_nat64} \
187	${_ipfw_nptv6} \
188	${_ipfw_pmod} \
189	${_ipmi} \
190	ip6_mroute_mod \
191	ip_mroute_mod \
192	${_ips} \
193	${_ipsec} \
194	${_ipw} \
195	${_ipwfw} \
196	${_isci} \
197	${_iser} \
198	isp \
199	${_ispfw} \
200	${_iwi} \
201	${_iwifw} \
202	${_iwm} \
203	${_iwmfw} \
204	${_iwn} \
205	${_iwnfw} \
206	${_ix} \
207	${_ixv} \
208	${_ixgb} \
209	${_ixl} \
210	${_ixlv} \
211	jme \
212	joy \
213	kbdmux \
214	kgssapi \
215	kgssapi_krb5 \
216	khelp \
217	krpc \
218	ksyms \
219	le \
220	lge \
221	libalias \
222	libiconv \
223	libmchain \
224	${_linprocfs} \
225	${_linsysfs} \
226	${_linux} \
227	${_linux_common} \
228	${_linux64} \
229	linuxkpi \
230	${_lio} \
231	lmc \
232	lpt \
233	mac_biba \
234	mac_bsdextended \
235	mac_ifoff \
236	mac_lomac \
237	mac_mls \
238	mac_none \
239	mac_partition \
240	mac_portacl \
241	mac_seeotheruids \
242	mac_stub \
243	mac_test \
244	malo \
245	md \
246	mdio \
247	mem \
248	mfi \
249	mii \
250	mlx \
251	${_mlx4} \
252	${_mlx4ib} \
253	${_mlx4en} \
254	${_mlx5} \
255	${_mlx5en} \
256	${_mlx5ib} \
257	${_mly} \
258	mmc \
259	mmcsd \
260	mpr \
261	mps \
262	mpt \
263	mqueue \
264	mrsas \
265	msdosfs \
266	msdosfs_iconv \
267	${_mse} \
268	msk \
269	${_mthca} \
270	mvs \
271	mwl \
272	${_mwlfw} \
273	mxge \
274	my \
275	${_nandfs} \
276	${_nandsim} \
277	${_ncr} \
278	${_nctgpio} \
279	${_ncv} \
280	${_ndis} \
281	${_netgraph} \
282	${_nfe} \
283	nfscl \
284	nfscommon \
285	nfsd \
286	nfslock \
287	nfslockd \
288	nfssvc \
289	nge \
290	nmdm \
291	${_nsp} \
292	nullfs \
293	${_ntb} \
294	${_nvd} \
295	${_nvme} \
296	${_nvram} \
297	${_nxge} \
298	oce \
299	${_ocs_fc} \
300	otus \
301	${_otusfw} \
302	ow \
303	${_padlock} \
304	${_padlock_rng} \
305	${_pccard} \
306	${_pcfclock} \
307	pcn \
308	${_pf} \
309	${_pflog} \
310	${_pfsync} \
311	plip \
312	${_pms} \
313	ppbus \
314	ppc \
315	ppi \
316	pps \
317	procfs \
318	proto \
319	pseudofs \
320	${_pst} \
321	pty  \
322	puc \
323	${_qlxge} \
324	${_qlxgb} \
325	${_qlxgbe} \
326	${_qlnx} \
327	ral \
328	${_ralfw} \
329	${_random_fortuna} \
330	${_random_yarrow} \
331	${_random_other} \
332	rc4 \
333	${_rdma} \
334	${_rdrand_rng} \
335	re \
336	rl \
337	rtwn \
338	rtwn_pci \
339	rtwn_usb \
340	${_rtwnfw} \
341	${_s3} \
342	${_safe} \
343	${_sbni} \
344	scc \
345	${_scsi_low} \
346	sdhci \
347	${_sdhci_acpi} \
348	sdhci_pci \
349	sem \
350	send \
351	${_sf} \
352	${_sfxge} \
353	sge \
354	${_sgx} \
355	${_sgx_linux} \
356	siftr \
357	siis \
358	sis \
359	sk \
360	smbfs \
361	sn \
362	snp \
363	sound \
364	${_speaker} \
365	spi \
366	${_splash} \
367	${_sppp} \
368	ste \
369	${_stg} \
370	stge \
371	${_sym} \
372	${_syscons} \
373	sysvipc \
374	tcp \
375	${_ti} \
376	tl \
377	tmpfs \
378	${_toecore} \
379	${_tpm} \
380	trm \
381	${_twa} \
382	twe \
383	tws \
384	tx \
385	${_txp} \
386	uart \
387	ubsec \
388	udf \
389	udf_iconv \
390	ufs \
391	uinput \
392	unionfs \
393	usb \
394	${_vesa} \
395	${_virtio} \
396	vge \
397	${_viawd} \
398	videomode \
399	vkbd \
400	${_vmm} \
401	${_vmware} \
402	${_vpo} \
403	vr \
404	vte \
405	vx \
406	${_vxge} \
407	wb \
408	${_wbwd} \
409	${_wi} \
410	wlan \
411	wlan_acl \
412	wlan_amrr \
413	wlan_ccmp \
414	wlan_rssadapt \
415	wlan_tkip \
416	wlan_wep \
417	wlan_xauth \
418	${_wpi} \
419	${_wpifw} \
420	${_x86bios} \
421	${_xe} \
422	xl \
423	zlib
424
425.if ${MK_AUTOFS} != "no" || defined(ALL_MODULES)
426_autofs=	autofs
427.endif
428
429.if ${MK_CDDL} != "no" || defined(ALL_MODULES)
430.if (${MACHINE_CPUARCH} != "arm" || ${MACHINE_ARCH:Marmv[67]*} != "") && \
431	${MACHINE_CPUARCH} != "mips" && \
432	${MACHINE_CPUARCH} != "sparc64"
433SUBDIR+=	dtrace
434.endif
435SUBDIR+=	opensolaris
436.endif
437
438.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
439.if exists(${SRCTOP}/sys/opencrypto)
440_crypto=	crypto
441_cryptodev=	cryptodev
442_random_fortuna=random_fortuna
443_random_yarrow=	random_yarrow
444_random_other=	random_other
445.endif
446.endif
447
448.if ${MK_CUSE} != "no" || defined(ALL_MODULES)
449SUBDIR+=	cuse
450.endif
451
452.if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \
453	defined(ALL_MODULES)
454_carp=		carp
455_toecore=	toecore
456_if_enc=	if_enc
457_if_gif=	if_gif
458_if_gre=	if_gre
459_ipfw_pmod=	ipfw_pmod
460.if ${MK_IPSEC_SUPPORT} != "no"
461_ipsec=		ipsec
462.endif
463.endif
464
465.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
466	defined(ALL_MODULES)
467_if_stf=	if_stf
468.endif
469
470.if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES)
471_if_me=		if_me
472_ipdivert=	ipdivert
473_ipfw=		ipfw
474.if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
475_ipfw_nat64=	ipfw_nat64
476.endif
477.endif
478
479.if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
480_ipfw_nptv6=	ipfw_nptv6
481.endif
482
483.if ${MK_IPFILTER} != "no" || defined(ALL_MODULES)
484_ipfilter=	ipfilter
485.endif
486
487.if ${MK_ISCSI} != "no" || defined(ALL_MODULES)
488SUBDIR+=	cfiscsi
489SUBDIR+=	iscsi
490SUBDIR+=	iscsi_initiator
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_armv8crypto=	armv8crypto
566_efirt=		efirt
567_em=		em
568.endif
569
570.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
571_agp=		agp
572_an=		an
573_aout=		aout
574_bios=		bios
575_bktr=		bktr
576.if ${MK_SOURCELESS_UCODE} != "no"
577_bxe=		bxe
578.endif
579_cardbus=	cardbus
580_cbb=		cbb
581_cpuctl=	cpuctl
582_cpufreq=	cpufreq
583_cs=		cs
584_dpms=		dpms
585_drm=		drm
586_drm2=		drm2
587_ed=		ed
588_em=		em
589_ena=		ena
590_ep=		ep
591_et=		et
592_exca=		exca
593_fe=		fe
594.if ${MK_OFED} != "no" || defined(ALL_MODULES)
595_ibcore=        ibcore
596.endif
597_if_ndis=	if_ndis
598_io=		io
599.if ${MK_OFED} != "no" || defined(ALL_MODULES)
600_ipoib=         ipoib
601_iser=		iser
602.endif
603_ix=		ix
604_ixv=		ixv
605_linprocfs=	linprocfs
606_linsysfs=	linsysfs
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_vxge=  	vxge
625_wbwd=		wbwd
626_wi=		wi
627_xe=		xe
628
629_aac=		aac
630_aacraid=	aacraid
631_acpi=		acpi
632.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
633_aesni=		aesni
634.endif
635_amd_ecc_inject=amd_ecc_inject
636_amdsbwd=	amdsbwd
637_amdsmn=	amdsmn
638_amdtemp=	amdtemp
639_arcmsr=	arcmsr
640_asmc=		asmc
641.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
642_blake2=	blake2
643.endif
644_bytgpio=	bytgpio
645_chvgpio=	chvgpio
646_ciss=		ciss
647_chromebook_platform=	chromebook_platform
648_cmx=		cmx
649_coretemp=	coretemp
650.if ${MK_SOURCELESS_HOST} != "no"
651_hpt27xx=	hpt27xx
652.endif
653_hptiop=	hptiop
654.if ${MK_SOURCELESS_HOST} != "no"
655_hptmv=		hptmv
656_hptnr=		hptnr
657_hptrr=		hptrr
658.endif
659_hyperv=	hyperv
660_ichwd=		ichwd
661_ida=		ida
662_iir=		iir
663_intelspi=	intelspi
664_ipmi=		ipmi
665_ips=		ips
666_isci=		isci
667_ipw=		ipw
668_iwi=		iwi
669_iwm=		iwm
670_iwn=		iwn
671_ixgb=		ixgb
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_nxge=		nxge
696.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
697_padlock=	padlock
698_padlock_rng=	padlock_rng
699_rdrand_rng=	rdrand_rng
700.endif
701_s3=		s3
702_sdhci_acpi=	sdhci_acpi
703_tpm=		tpm
704_twa=		twa
705_vesa=		vesa
706_viawd=		viawd
707_virtio=	virtio
708_wpi=		wpi
709.if ${MK_SOURCELESS_UCODE} != "no"
710_wpifw=		wpifw
711.endif
712_x86bios=	x86bios
713.endif
714
715.if ${MACHINE_CPUARCH} == "amd64"
716_ccp=		ccp
717_efirt=		efirt
718_ioat=		ioat
719_ixl=		ixl
720_ixlv=		ixlv
721_linux64=	linux64
722_linux_common=	linux_common
723_ntb=		ntb
724_pms=		pms
725_qlxge=		qlxge
726_qlxgb=		qlxgb
727.if ${MK_SOURCELESS_UCODE} != "no"
728_qlxgbe=	qlxgbe
729_qlnx=		qlnx
730.endif
731_sfxge=		sfxge
732_sgx=		sgx
733_sgx_linux=	sgx_linux
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_arcnet=	arcnet
748.if ${MK_SOURCELESS_UCODE} != "no"
749_ce=		ce
750.endif
751_coff=		coff
752.if ${MK_SOURCELESS_UCODE} != "no"
753_cp=		cp
754.endif
755_glxiic=	glxiic
756_glxsb=		glxsb
757#_ibcs2=		ibcs2
758_mse=		mse
759_ncr=		ncr
760_ncv=		ncv
761_nsp=		nsp
762_pcfclock=	pcfclock
763_pst=		pst
764_sbni=		sbni
765_stg=		stg
766_cm=		cm
767.if ${MK_SOURCELESS_UCODE} != "no"
768_ctau=		ctau
769.endif
770_dpt=		dpt
771_ex=		ex
772.endif
773
774.if ${MACHINE_CPUARCH} == "arm"
775_cfi=		cfi
776_cpsw=		cpsw
777.endif
778
779.if ${MACHINE_CPUARCH} == "powerpc"
780_agp=		agp
781_an=		an
782_bm=		bm
783_cardbus=	cardbus
784_cbb=		cbb
785_cfi=		cfi
786_cpufreq=	cpufreq
787_drm=		drm
788_exca=		exca
789_ffec=		ffec
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