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