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