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