xref: /freebsd/sys/modules/Makefile (revision 69718b786d3943ea9a99eeeb5f5f6162f11c78b7)
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	${_igb} \
167	${_iir} \
168	imgact_binmisc \
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_pci \
336	sem \
337	send \
338	${_sf} \
339	${_sfxge} \
340	sge \
341	siba_bwn \
342	siftr \
343	siis \
344	sis \
345	sk \
346	smbfs \
347	sn \
348	${_snc} \
349	snp \
350	sound \
351	${_speaker} \
352	${_splash} \
353	${_sppp} \
354	ste \
355	${_stg} \
356	stge \
357	${_streams} \
358	${_svr4} \
359	${_sym} \
360	${_syscons} \
361	sysvipc \
362	${_ti} \
363	${_tcp_fastpath} \
364	tests/framework \
365	tests/callout_test \
366	tl \
367	tmpfs \
368	${_toecore} \
369	${_tpm} \
370	trm \
371	${_twa} \
372	twe \
373	tws \
374	tx \
375	${_txp} \
376	uart \
377	ubsec \
378	udf \
379	udf_iconv \
380	ufs \
381	uinput \
382	unionfs \
383	usb \
384	utopia \
385	${_vesa} \
386	${_virtio} \
387	vge \
388	${_viawd} \
389	videomode \
390	vkbd \
391	${_vmm} \
392	${_vmware} \
393	${_vpo} \
394	vr \
395	vte \
396	vx \
397	${_vxge} \
398	wb \
399	${_wbwd} \
400	${_wi} \
401	wlan \
402	wlan_acl \
403	wlan_amrr \
404	wlan_ccmp \
405	wlan_rssadapt \
406	wlan_tkip \
407	wlan_wep \
408	wlan_xauth \
409	${_wpi} \
410	${_wpifw} \
411	${_x86bios} \
412	${_xe} \
413	xl \
414	zlib
415
416.if ${MK_AUTOFS} != "no" || defined(ALL_MODULES)
417_autofs=	autofs
418.endif
419
420.if ${MK_CDDL} != "no" || defined(ALL_MODULES)
421.if (${MACHINE_CPUARCH} != "arm" || ${MACHINE_ARCH:Marmv6*} != "") && \
422	${MACHINE_CPUARCH} != "mips" && \
423	${MACHINE_CPUARCH} != "sparc64"
424SUBDIR+=	dtrace
425.endif
426SUBDIR+=	opensolaris
427.endif
428
429.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
430.if exists(${.CURDIR}/../opencrypto)
431_crypto=	crypto
432_cryptodev=	cryptodev
433_random_fortuna=random_fortuna
434_random_yarrow=	random_yarrow
435_random_other=	random_other
436.endif
437.endif
438
439.if ${MK_CUSE} != "no" || defined(ALL_MODULES)
440SUBDIR+=	cuse
441.endif
442
443.if ${MK_EXTRA_TCP_STACKS} != "no" || defined(ALL_MODULES)
444_tcp_fastpath=	tcp/fastpath
445.endif
446
447.if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \
448	defined(ALL_MODULES)
449_carp=		carp
450_toecore=	toecore
451_if_enc=	if_enc
452_if_gif=	if_gif
453_if_gre=	if_gre
454.endif
455
456.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
457	defined(ALL_MODULES)
458_if_stf=	if_stf
459.endif
460
461.if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES)
462_if_me=		if_me
463_ipdivert=	ipdivert
464_ipfw=		ipfw
465.if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
466_ipfw_nat64=	ipfw_nat64
467.endif
468.endif
469
470.if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
471_ipfw_nptv6=	ipfw_nptv6
472.endif
473
474.if ${MK_IPFILTER} != "no" || defined(ALL_MODULES)
475_ipfilter=	ipfilter
476.endif
477
478.if ${MK_ISCSI} != "no" || defined(ALL_MODULES)
479SUBDIR+=	iscsi
480SUBDIR+=	iscsi_initiator
481.endif
482
483.if ${MK_NAND} != "no" || defined(ALL_MODULES)
484_nandfs=	nandfs
485_nandsim=	nandsim
486.endif
487
488.if ${MK_NETGRAPH} != "no" || defined(ALL_MODULES)
489_netgraph=	netgraph
490.endif
491
492.if (${MK_PF} != "no" && (${MK_INET_SUPPORT} != "no" || \
493	${MK_INET6_SUPPORT} != "no")) || defined(ALL_MODULES)
494_pf=		pf
495_pflog=		pflog
496.if ${MK_INET_SUPPORT} != "no"
497_pfsync=	pfsync
498.endif
499.endif
500
501.if ${MK_SOURCELESS_UCODE} != "no"
502_bce=		bce
503_fatm=		fatm
504_fxp=		fxp
505_ispfw=		ispfw
506_mwlfw=		mwlfw
507_otusfw=	otusfw
508_ralfw=		ralfw
509_rtwnfw=	rtwnfw
510_sf=		sf
511_ti=		ti
512_txp=		txp
513.endif
514
515.if ${MK_SOURCELESS_UCODE} != "no" && ${MACHINE_CPUARCH} != "arm" && \
516	${MACHINE_CPUARCH} != "mips" && \
517	${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe" && \
518	${MACHINE_CPUARCH} != "riscv"
519_cxgbe=		cxgbe
520.endif
521
522.if ${MK_ZFS} != "no" || defined(ALL_MODULES)
523SUBDIR+=	zfs
524.endif
525
526.if ${MACHINE_CPUARCH} != "aarch64" && ${MACHINE_CPUARCH} != "arm" && \
527	${MACHINE_CPUARCH} != "mips" && ${MACHINE_CPUARCH} != "powerpc" && \
528	${MACHINE_CPUARCH} != "riscv"
529_syscons=	syscons
530_vpo=		vpo
531.endif
532
533.if ${MACHINE_CPUARCH} != "mips"
534# no BUS_SPACE_UNSPECIFIED
535# No barrier instruction support (specific to this driver)
536_sym=		sym
537# intr_disable() is a macro, causes problems
538.if ${MK_SOURCELESS_UCODE} != "no"
539_cxgb=		cxgb
540.endif
541.endif
542
543.if ${MACHINE_CPUARCH} == "aarch64"
544_armv8crypto=	armv8crypto
545_em=		em
546_igb=		igb
547.endif
548
549.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
550_agp=		agp
551_an=		an
552_aout=		aout
553_bktr=		bktr
554_bxe=		bxe
555_cardbus=	cardbus
556_cbb=		cbb
557_cpuctl=	cpuctl
558_cpufreq=	cpufreq
559_cs=		cs
560_dpms=		dpms
561_drm=		drm
562_drm2=		drm2
563_ed=		ed
564_em=		em
565_ep=		ep
566_et=		et
567_exca=		exca
568_fe=		fe
569.if ${MK_OFED} != "no" || defined(ALL_MODULES)
570_ibcore=        ibcore
571.endif
572_if_ndis=	if_ndis
573_igb=		igb
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_ipmi=		ipmi
630_ips=		ips
631_isci=		isci
632_ipw=		ipw
633_iwi=		iwi
634_iwm=		iwm
635_iwn=		iwn
636_ixgb=		ixgb
637.if ${MK_SOURCELESS_UCODE} != "no"
638_ipwfw=		ipwfw
639_iwifw=		iwifw
640_iwmfw=		iwmfw
641_iwnfw=		iwnfw
642.endif
643_mlx4=		mlx4
644_mlx5=		mlx5
645.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
646	defined(ALL_MODULES)
647_mlx4en=	mlx4en
648_mlx5en=	mlx5en
649.endif
650.if ${MK_OFED} != "no" || defined(ALL_MODULES)
651_mlx4ib=	mlx4ib
652.endif
653_mly=		mly
654.if ${MK_OFED} != "no" || defined(ALL_MODULES)
655_mthca=		mthca
656.endif
657_nfe=		nfe
658_nvd=		nvd
659_nvme=		nvme
660_nvram=		nvram
661_nxge=		nxge
662.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
663_padlock=	padlock
664_padlock_rng=	padlock_rng
665_rdrand_rng=	rdrand_rng
666.endif
667_s3=		s3
668_tpm=		tpm
669_twa=		twa
670_vesa=		vesa
671_viawd=		viawd
672_virtio=	virtio
673_wpi=		wpi
674.if ${MK_SOURCELESS_UCODE} != "no"
675_wpifw=		wpifw
676.endif
677_x86bios=	x86bios
678.endif
679.endif
680
681.if ${MACHINE_CPUARCH} == "amd64"
682_efirt=		efirt
683_ioat=		ioat
684_ixl=		ixl
685_ixlv=		ixlv
686_linux64=	linux64
687_linux_common=	linux_common
688_ntb=		ntb
689_pms=		pms
690_qlxge=		qlxge
691_qlxgb=		qlxgb
692_qlxgbe=	qlxgbe
693_sfxge=		sfxge
694
695.if ${MK_BHYVE} != "no" || defined(ALL_MODULES)
696_vmm=		vmm
697.endif
698.endif
699
700.if ${MACHINE_CPUARCH} == "i386"
701# XXX some of these can move to the general case when de-i386'ed
702# XXX some of these can move now, but are untested on other architectures.
703_3dfx=		3dfx
704_3dfx_linux=	3dfx_linux
705_aic=		aic
706_apm=		apm
707_arcnet=	arcnet
708.if ${MK_SOURCELESS_UCODE} != "no"
709_ce=		ce
710.endif
711_coff=		coff
712.if ${MK_SOURCELESS_UCODE} != "no"
713_cp=		cp
714.endif
715_elink=		elink
716_glxiic=	glxiic
717_glxsb=		glxsb
718#_ibcs2=		ibcs2
719_mse=		mse
720_ncr=		ncr
721_ncv=		ncv
722_nsp=		nsp
723_pcfclock=	pcfclock
724_pst=		pst
725_sbni=		sbni
726_streams=	streams
727_stg=		stg
728_svr4=		svr4
729.if ${MACHINE} == "i386"
730.if ${MK_EISA} != "no"
731_ahb=		ahb
732.endif
733_bios=		bios
734_cm=		cm
735.if ${MK_SOURCELESS_UCODE} != "no"
736_ctau=		ctau
737.endif
738_dpt=		dpt
739_ex=		ex
740.elif ${MACHINE} == "pc98"
741_canbepm=	canbepm
742_canbus=	canbus
743_ct=		ct
744_pmc=		pmc
745_snc=		snc
746.endif
747.endif
748
749.if ${MACHINE_CPUARCH} == "arm"
750_cfi=		cfi
751_cpsw=		cpsw
752.endif
753
754.if ${MACHINE_CPUARCH} == "powerpc"
755_agp=		agp
756_an=		an
757_bm=		bm
758_cardbus=	cardbus
759_cbb=		cbb
760_cfi=		cfi
761_cpufreq=	cpufreq
762_drm=		drm
763_exca=		exca
764_pccard=	pccard
765_wi=		wi
766.endif
767
768.if ${MACHINE_ARCH} == "powerpc64"
769_drm2=		drm2
770.endif
771.if ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "powerpc"
772# Don't build powermac_nvram for powerpcspe, it's never supported.
773_nvram=		powermac_nvram
774.endif
775
776.if ${MACHINE_CPUARCH} == "sparc64"
777_auxio=		auxio
778_em=		em
779_epic=		epic
780_igb=		igb
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