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