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