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