xref: /freebsd/sys/modules/Makefile (revision 43c2dac0e5d6bac6bdef575a17a4ad730983bd3f)
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	vr \
376	vte \
377	${_wbwd} \
378	${_wi} \
379	wlan \
380	wlan_acl \
381	wlan_amrr \
382	wlan_ccmp \
383	wlan_rssadapt \
384	wlan_tkip \
385	wlan_wep \
386	wlan_xauth \
387	${_wpi} \
388	${_wpifw} \
389	${_x86bios} \
390	xl \
391	xz \
392	zlib
393
394.if ${MK_AUTOFS} != "no" || defined(ALL_MODULES)
395_autofs=	autofs
396.endif
397
398.if ${MK_CDDL} != "no" || defined(ALL_MODULES)
399.if (${MACHINE_CPUARCH} != "arm" || ${MACHINE_ARCH:Marmv[67]*} != "") && \
400	${MACHINE_CPUARCH} != "mips" && \
401	${MACHINE_CPUARCH} != "sparc64"
402SUBDIR+=	dtrace
403.endif
404SUBDIR+=	opensolaris
405.endif
406
407.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
408.if exists(${SRCTOP}/sys/opencrypto)
409_crypto=	crypto
410_cryptodev=	cryptodev
411_random_fortuna=random_fortuna
412_random_other=	random_other
413_ktls_ocf=	ktls_ocf
414.endif
415.endif
416
417.if ${MK_CUSE} != "no" || defined(ALL_MODULES)
418SUBDIR+=	cuse
419.endif
420
421.if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \
422	defined(ALL_MODULES)
423_carp=		carp
424_toecore=	toecore
425_if_enc=	if_enc
426_if_gif=	if_gif
427_if_gre=	if_gre
428_ipfw_pmod=	ipfw_pmod
429.if ${MK_IPSEC_SUPPORT} != "no"
430_ipsec=		ipsec
431.endif
432.endif
433
434.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
435	defined(ALL_MODULES)
436_if_stf=	if_stf
437.endif
438
439.if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES)
440_if_me=		if_me
441_ipdivert=	ipdivert
442_ipfw=		ipfw
443.if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
444_ipfw_nat64=	ipfw_nat64
445.endif
446.endif
447
448.if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
449_ipfw_nptv6=	ipfw_nptv6
450.endif
451
452.if ${MK_IPFILTER} != "no" || defined(ALL_MODULES)
453_ipfilter=	ipfilter
454.endif
455
456.if ${MK_ISCSI} != "no" || defined(ALL_MODULES)
457SUBDIR+=	cfiscsi
458SUBDIR+=	iscsi
459SUBDIR+=	iscsi_initiator
460.endif
461
462.if !empty(OPT_FDT)
463SUBDIR+=	fdt
464.endif
465
466# Linuxulator
467.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
468    ${MACHINE_CPUARCH} == "i386"
469SUBDIR+=	linprocfs
470SUBDIR+=	linsysfs
471.endif
472.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
473SUBDIR+=	linux
474.endif
475.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
476SUBDIR+=	linux64
477SUBDIR+=	linux_common
478.endif
479
480.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
481    ${MACHINE_CPUARCH} == "i386"
482_ena=		ena
483.if ${MK_OFED} != "no" || defined(ALL_MODULES)
484_ibcore=	ibcore
485_ipoib=		ipoib
486_iser=		iser
487.endif
488_mlx4=		mlx4
489_mlx5=		mlx5
490.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
491	defined(ALL_MODULES)
492_mlx4en=	mlx4en
493_mlx5en=	mlx5en
494.endif
495.if ${MK_OFED} != "no" || defined(ALL_MODULES)
496_mthca=		mthca
497_mlx4ib=	mlx4ib
498_mlx5ib=	mlx5ib
499.endif
500.endif
501
502.if ${MK_NETGRAPH} != "no" || defined(ALL_MODULES)
503_netgraph=	netgraph
504.endif
505
506.if (${MK_PF} != "no" && (${MK_INET_SUPPORT} != "no" || \
507	${MK_INET6_SUPPORT} != "no")) || defined(ALL_MODULES)
508_pf=		pf
509_pflog=		pflog
510.if ${MK_INET_SUPPORT} != "no"
511_pfsync=	pfsync
512.endif
513.endif
514
515.if ${MK_SOURCELESS_UCODE} != "no"
516_bce=		bce
517_fxp=		fxp
518_ispfw=		ispfw
519_ti=		ti
520
521.if ${MACHINE_CPUARCH} != "mips"
522_mwlfw=		mwlfw
523_otusfw=	otusfw
524_ralfw=		ralfw
525_rtwnfw=	rtwnfw
526.endif
527.endif
528
529.if ${MK_SOURCELESS_UCODE} != "no" && ${MACHINE_CPUARCH} != "arm" && \
530	${MACHINE_CPUARCH} != "mips" && \
531	${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe" && \
532	${MACHINE_CPUARCH} != "riscv"
533_cxgbe=		cxgbe
534.endif
535
536# These rely on 64bit atomics
537.if ${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe" && \
538	${MACHINE_CPUARCH} != "mips"
539_mps=		mps
540_mpr=		mpr
541.endif
542
543.if ${MK_TESTS} != "no" || defined(ALL_MODULES)
544SUBDIR+=	tests
545.endif
546
547.if ${MK_ZFS} != "no" || defined(ALL_MODULES)
548SUBDIR+=	zfs
549.endif
550
551.if (${MACHINE_CPUARCH} == "mips" && ${MACHINE_ARCH:Mmips64} == "")
552_hwpmc_mips24k=	hwpmc_mips24k
553_hwpmc_mips74k=	hwpmc_mips74k
554.endif
555
556.if ${MACHINE_CPUARCH} != "aarch64" && ${MACHINE_CPUARCH} != "arm" && \
557	${MACHINE_CPUARCH} != "mips" && ${MACHINE_CPUARCH} != "powerpc" && \
558	${MACHINE_CPUARCH} != "riscv"
559_syscons=	syscons
560.endif
561
562.if ${MACHINE_CPUARCH} != "mips"
563# no BUS_SPACE_UNSPECIFIED
564# No barrier instruction support (specific to this driver)
565_sym=		sym
566# intr_disable() is a macro, causes problems
567.if ${MK_SOURCELESS_UCODE} != "no"
568_cxgb=		cxgb
569.endif
570.endif
571
572.if ${MACHINE_CPUARCH} == "aarch64"
573_allwinner=	allwinner
574_armv8crypto=	armv8crypto
575_efirt=		efirt
576_em=		em
577_rockchip=	rockchip
578.endif
579
580.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
581_agp=		agp
582_an=		an
583_aout=		aout
584_bios=		bios
585_bktr=		bktr
586.if ${MK_SOURCELESS_UCODE} != "no"
587_bxe=		bxe
588.endif
589_cardbus=	cardbus
590_cbb=		cbb
591_cpuctl=	cpuctl
592_cpufreq=	cpufreq
593_dpms=		dpms
594_em=		em
595_et=		et
596_exca=		exca
597_if_ndis=	if_ndis
598_io=		io
599_itwd=		itwd
600_ix=		ix
601_ixv=		ixv
602.if ${MK_SOURCELESS_UCODE} != "no"
603_lio=		lio
604.endif
605_nctgpio=	nctgpio
606_ndis=		ndis
607_ntb=		ntb
608_ocs_fc=	ocs_fc
609_pccard=	pccard
610.if ${MK_OFED} != "no" || defined(ALL_MODULES)
611_rdma=		rdma
612.endif
613_safe=		safe
614_speaker=	speaker
615_splash=	splash
616_sppp=		sppp
617_vmware=	vmware
618_wbwd=		wbwd
619_wi=		wi
620
621_aac=		aac
622_aacraid=	aacraid
623_acpi=		acpi
624.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
625.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} > 40201
626_aesni=		aesni
627.endif
628.endif
629_amd_ecc_inject=amd_ecc_inject
630_amdsbwd=	amdsbwd
631_amdsmn=	amdsmn
632_amdtemp=	amdtemp
633_arcmsr=	arcmsr
634_asmc=		asmc
635.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
636_blake2=	blake2
637.endif
638_bytgpio=	bytgpio
639_chvgpio=	chvgpio
640_ciss=		ciss
641_chromebook_platform=	chromebook_platform
642_cmx=		cmx
643_coretemp=	coretemp
644.if ${MK_SOURCELESS_HOST} != "no" && empty(KCSAN_ENABLED)
645_hpt27xx=	hpt27xx
646.endif
647_hptiop=	hptiop
648.if ${MK_SOURCELESS_HOST} != "no" && empty(KCSAN_ENABLED)
649_hptmv=		hptmv
650_hptnr=		hptnr
651_hptrr=		hptrr
652.endif
653_hyperv=	hyperv
654_ichwd=		ichwd
655_ida=		ida
656_iir=		iir
657_intelspi=	intelspi
658_ipmi=		ipmi
659_ips=		ips
660_isci=		isci
661_ipw=		ipw
662_iwi=		iwi
663_iwm=		iwm
664_iwn=		iwn
665.if ${MK_SOURCELESS_UCODE} != "no"
666_ipwfw=		ipwfw
667_iwifw=		iwifw
668_iwmfw=		iwmfw
669_iwnfw=		iwnfw
670.endif
671_mly=		mly
672_nfe=		nfe
673_nvd=		nvd
674_nvme=		nvme
675_nvram=		nvram
676.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
677_padlock=	padlock
678_padlock_rng=	padlock_rng
679_rdrand_rng=	rdrand_rng
680.endif
681_s3=		s3
682_sdhci_acpi=	sdhci_acpi
683_superio=	superio
684_tpm=		tpm
685_twa=		twa
686_vesa=		vesa
687_viawd=		viawd
688_virtio=	virtio
689_wpi=		wpi
690.if ${MK_SOURCELESS_UCODE} != "no"
691_wpifw=		wpifw
692.endif
693_x86bios=	x86bios
694.endif
695
696.if ${MACHINE_CPUARCH} == "amd64"
697_amdgpio=	amdgpio
698_ccp=		ccp
699_efirt=		efirt
700_iavf=		iavf
701_ioat=		ioat
702_ixl=		ixl
703_nvdimm=	nvdimm
704_pms=		pms
705_qlxge=		qlxge
706_qlxgb=		qlxgb
707_vmd=		vmd
708.if ${MK_SOURCELESS_UCODE} != "no"
709_qlxgbe=	qlxgbe
710_qlnx=		qlnx
711.endif
712_sfxge=		sfxge
713_sgx=		sgx
714_sgx_linux=	sgx_linux
715_smartpqi=	smartpqi
716
717.if ${MK_BHYVE} != "no" || defined(ALL_MODULES)
718_vmm=		vmm
719.endif
720.endif
721
722.if ${MACHINE_CPUARCH} == "i386"
723# XXX some of these can move to the general case when de-i386'ed
724# XXX some of these can move now, but are untested on other architectures.
725_3dfx=		3dfx
726_3dfx_linux=	3dfx_linux
727_apm=		apm
728.if ${MK_SOURCELESS_HOST} != "no"
729_ce=		ce
730.endif
731.if ${MK_SOURCELESS_UCODE} != "no"
732_cp=		cp
733.endif
734_glxiic=	glxiic
735_glxsb=		glxsb
736_pcfclock=	pcfclock
737_pst=		pst
738_sbni=		sbni
739.if ${MK_SOURCELESS_UCODE} != "no"
740_ctau=		ctau
741.endif
742.endif
743
744.if ${MACHINE_CPUARCH} == "arm"
745_cfi=		cfi
746_cpsw=		cpsw
747.endif
748
749.if ${MACHINE_CPUARCH} == "powerpc"
750_agp=		agp
751_an=		an
752_cardbus=	cardbus
753_cbb=		cbb
754_cfi=		cfi
755_cpufreq=	cpufreq
756_exca=		exca
757_ffec=		ffec
758_nvd=		nvd
759_nvme=		nvme
760_pccard=	pccard
761_wi=		wi
762_virtio=	virtio
763.endif
764
765.if ${MACHINE_ARCH} == "powerpc64"
766_ipmi=		ipmi
767_nvram=		opal_nvram
768.endif
769.if ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "powerpc"
770# Don't build powermac_nvram for powerpcspe, it's never supported.
771_nvram+=	powermac_nvram
772.endif
773
774.if ${MACHINE_CPUARCH} == "sparc64"
775_auxio=		auxio
776_em=		em
777_epic=		epic
778.endif
779
780.if (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
781     ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "i386")
782_cloudabi32=	cloudabi32
783.endif
784.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
785_cloudabi64=	cloudabi64
786.endif
787
788.endif
789
790.if ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "aarch64"
791_bcm283x_clkman=  bcm283x_clkman
792_bcm283x_pwm=  bcm283x_pwm
793.endif
794
795SUBDIR+=${MODULES_EXTRA}
796
797.for reject in ${WITHOUT_MODULES}
798SUBDIR:= ${SUBDIR:N${reject}}
799.endfor
800
801# Calling kldxref(8) for each module is expensive.
802.if !defined(NO_XREF)
803.MAKEFLAGS+=	-DNO_XREF
804afterinstall: .PHONY
805	@if type kldxref >/dev/null 2>&1; then \
806		${ECHO} ${KLDXREF_CMD} ${DESTDIR}${KMODDIR}; \
807		${KLDXREF_CMD} ${DESTDIR}${KMODDIR}; \
808	fi
809.endif
810
811.include "${SYSDIR}/conf/config.mk"
812
813SUBDIR:= ${SUBDIR:u:O}
814
815.include <bsd.subdir.mk>
816