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