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