xref: /freebsd/sys/modules/Makefile (revision 1728aef23dac2541a3a7de00393ea3ea39b968d7)
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_nat64} \
171	${_ipfw_nptv6} \
172	${_ipmi} \
173	ip6_mroute_mod \
174	ip_mroute_mod \
175	${_ips} \
176	${_ipw} \
177	${_ipwfw} \
178	${_isci} \
179	${_iser} \
180	isp \
181	${_ispfw} \
182	${_iwi} \
183	${_iwifw} \
184	${_iwm} \
185	${_iwmfw} \
186	${_iwn} \
187	${_iwnfw} \
188	${_ix} \
189	${_ixv} \
190	${_ixgb} \
191	${_ixl} \
192	${_ixlv} \
193	jme \
194	joy \
195	kbdmux \
196	kgssapi \
197	kgssapi_krb5 \
198	khelp \
199	krpc \
200	ksyms \
201	le \
202	lge \
203	libalias \
204	libiconv \
205	libmbpool \
206	libmchain \
207	${_linprocfs} \
208	${_linsysfs} \
209	${_linux} \
210	${_linux_common} \
211	${_linux64} \
212	linuxkpi \
213	lmc \
214	lpt \
215	mac_biba \
216	mac_bsdextended \
217	mac_ifoff \
218	mac_lomac \
219	mac_mls \
220	mac_none \
221	mac_partition \
222	mac_portacl \
223	mac_seeotheruids \
224	mac_stub \
225	mac_test \
226	malo \
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.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_urtwnfw=	urtwnfw
508_sf=		sf
509_ti=		ti
510_txp=		txp
511.endif
512
513.if ${MK_SOURCELESS_UCODE} != "no" && ${MACHINE_CPUARCH} != "arm" && \
514	${MACHINE_CPUARCH} != "mips" && \
515	${MACHINE_ARCH} != "powerpc" && ${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_si=		si
589_speaker=	speaker
590_splash=	splash
591_sppp=		sppp
592_vmware=	vmware
593_vxge=  	vxge
594_wbwd=		wbwd
595_wi=		wi
596_xe=		xe
597.if ${MACHINE} != "pc98"
598_aac=		aac
599_aacraid=	aacraid
600_acpi=		acpi
601.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
602_aesni=		aesni
603.endif
604_amdsbwd=	amdsbwd
605_amdtemp=	amdtemp
606_arcmsr=	arcmsr
607_asmc=		asmc
608_ciss=		ciss
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.if ${MK_OFED} != "no" || defined(ALL_MODULES)
639_mlx4=		mlx4
640_mlx4ib=	mlx4ib
641_mlxen=		mlxen
642.endif
643_mlx5=		mlx5
644.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
645	defined(ALL_MODULES)
646_mlx5en=	mlx5en
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_ioat=		ioat
678_ixl=		ixl
679_ixlv=		ixlv
680_linux64=	linux64
681_linux_common=	linux_common
682_ntb=		ntb
683_pms=		pms
684_qlxge=		qlxge
685_qlxgb=		qlxgb
686_qlxgbe=	qlxgbe
687_sfxge=		sfxge
688
689.if ${MK_BHYVE} != "no" || defined(ALL_MODULES)
690_vmm=		vmm
691.endif
692.endif
693
694.if ${MACHINE_CPUARCH} == "i386"
695# XXX some of these can move to the general case when de-i386'ed
696# XXX some of these can move now, but are untested on other architectures.
697_3dfx=		3dfx
698_3dfx_linux=	3dfx_linux
699_aic=		aic
700_apm=		apm
701_arcnet=	arcnet
702.if ${MK_SOURCELESS_UCODE} != "no"
703_ce=		ce
704.endif
705_coff=		coff
706.if ${MK_SOURCELESS_UCODE} != "no"
707_cp=		cp
708.endif
709_elink=		elink
710_glxiic=	glxiic
711_glxsb=		glxsb
712#_ibcs2=		ibcs2
713_ie=		ie
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_wds=		wds
725.if ${MACHINE} == "i386"
726.if ${MK_EISA} != "no"
727_ahb=		ahb
728.endif
729_bios=		bios
730_cm=		cm
731.if ${MK_SOURCELESS_UCODE} != "no"
732_ctau=		ctau
733.endif
734_dpt=		dpt
735_ex=		ex
736_wl=		wl
737.elif ${MACHINE} == "pc98"
738_canbepm=	canbepm
739_canbus=	canbus
740_ct=		ct
741_pmc=		pmc
742_snc=		snc
743.endif
744.endif
745
746.if ${MACHINE_CPUARCH} == "arm"
747_cfi=		cfi
748_cpsw=		cpsw
749.endif
750
751.if ${MACHINE_CPUARCH} == "powerpc"
752_agp=		agp
753_an=		an
754_bm=		bm
755_cardbus=	cardbus
756_cbb=		cbb
757_cfi=		cfi
758_cpufreq=	cpufreq
759_drm=		drm
760_exca=		exca
761_nvram=		powermac_nvram
762_pccard=	pccard
763_wi=		wi
764.endif
765
766.if ${MACHINE_ARCH} == "powerpc64"
767_drm2=		drm2
768.endif
769
770.if ${MACHINE_CPUARCH} == "sparc64"
771_auxio=		auxio
772_em=		em
773_epic=		epic
774_igb=		igb
775.endif
776
777.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
778_cloudabi64=	cloudabi64
779.endif
780
781.endif
782
783SUBDIR+=${MODULES_EXTRA}
784
785.for reject in ${WITHOUT_MODULES}
786SUBDIR:= ${SUBDIR:N${reject}}
787.endfor
788
789# Calling kldxref(8) for each module is expensive.
790.if !defined(NO_XREF)
791.MAKEFLAGS+=	-DNO_XREF
792afterinstall: .PHONY
793	@if type kldxref >/dev/null 2>&1; then \
794		${ECHO} kldxref ${DESTDIR}${KMODDIR}; \
795		kldxref ${DESTDIR}${KMODDIR}; \
796	fi
797.endif
798
799.include "${SYSDIR}/conf/config.mk"
800
801SUBDIR:= ${SUBDIR:u:O}
802
803.include <bsd.subdir.mk>
804