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