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