xref: /freebsd/sys/modules/Makefile (revision 036d2e814bf0f5d88ffb4b24c159320894541757)
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	${_iwi} \
188	${_iwifw} \
189	${_iwm} \
190	${_iwmfw} \
191	${_iwn} \
192	${_iwnfw} \
193	${_ix} \
194	${_ixv} \
195	${_ixl} \
196	jme \
197	kbdmux \
198	kgssapi \
199	kgssapi_krb5 \
200	khelp \
201	krpc \
202	ksyms \
203	${_ktls_ocf} \
204	le \
205	lge \
206	libalias \
207	libiconv \
208	libmchain \
209	lindebugfs \
210	linuxkpi \
211	${_lio} \
212	lpt \
213	mac_biba \
214	mac_bsdextended \
215	mac_ifoff \
216	mac_lomac \
217	mac_mls \
218	mac_none \
219	mac_ntpd \
220	mac_partition \
221	mac_portacl \
222	mac_seeotheruids \
223	mac_stub \
224	mac_test \
225	malo \
226	md \
227	mdio \
228	mem \
229	mfi \
230	mii \
231	mlx \
232	mlxfw \
233	${_mlx4} \
234	${_mlx4ib} \
235	${_mlx4en} \
236	${_mlx5} \
237	${_mlx5en} \
238	${_mlx5ib} \
239	${_mly} \
240	mmc \
241	mmcsd \
242	${_mpr} \
243	${_mps} \
244	mpt \
245	mqueue \
246	mrsas \
247	msdosfs \
248	msdosfs_iconv \
249	msk \
250	${_mthca} \
251	mvs \
252	mwl \
253	${_mwlfw} \
254	mxge \
255	my \
256	${_nctgpio} \
257	${_ndis} \
258	${_netgraph} \
259	${_nfe} \
260	nfscl \
261	nfscommon \
262	nfsd \
263	nfslock \
264	nfslockd \
265	nfssvc \
266	nge \
267	nmdm \
268	nullfs \
269	${_ntb} \
270	${_nvd} \
271	${_nvdimm} \
272	${_nvme} \
273	${_nvram} \
274	oce \
275	${_ocs_fc} \
276	otus \
277	${_otusfw} \
278	ow \
279	${_padlock} \
280	${_padlock_rng} \
281	${_pccard} \
282	${_pcfclock} \
283	${_pf} \
284	${_pflog} \
285	${_pfsync} \
286	plip \
287	${_pms} \
288	ppbus \
289	ppc \
290	ppi \
291	pps \
292	procfs \
293	proto \
294	pseudofs \
295	${_pst} \
296	pty  \
297	puc \
298	pwm \
299	${_qlxge} \
300	${_qlxgb} \
301	${_qlxgbe} \
302	${_qlnx} \
303	ral \
304	${_ralfw} \
305	${_random_fortuna} \
306	${_random_other} \
307	rc4 \
308	${_rdma} \
309	${_rdrand_rng} \
310	re \
311	rl \
312	${_rockchip} \
313	rtwn \
314	rtwn_pci \
315	rtwn_usb \
316	${_rtwnfw} \
317	${_s3} \
318	${_safe} \
319	${_sbni} \
320	scc \
321	sdhci \
322	${_sdhci_acpi} \
323	sdhci_pci \
324	sdio \
325	sem \
326	send \
327	${_sfxge} \
328	sge \
329	${_sgx} \
330	${_sgx_linux} \
331	siftr \
332	siis \
333	sis \
334	sk \
335	${_smartpqi} \
336	smbfs \
337	snp \
338	sound \
339	${_speaker} \
340	spi \
341	${_splash} \
342	${_sppp} \
343	ste \
344	stge \
345	${_superio} \
346	${_sym} \
347	${_syscons} \
348	sysvipc \
349	tcp \
350	${_ti} \
351	tmpfs \
352	${_toecore} \
353	${_tpm} \
354	trm \
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	${_vmm} \
373	${_vmware} \
374	${_vpo} \
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_vpo=		vpo
561.endif
562
563.if ${MACHINE_CPUARCH} != "mips"
564# no BUS_SPACE_UNSPECIFIED
565# No barrier instruction support (specific to this driver)
566_sym=		sym
567# intr_disable() is a macro, causes problems
568.if ${MK_SOURCELESS_UCODE} != "no"
569_cxgb=		cxgb
570.endif
571.endif
572
573.if ${MACHINE_CPUARCH} == "aarch64"
574_allwinner=	allwinner
575_armv8crypto=	armv8crypto
576_efirt=		efirt
577_em=		em
578_rockchip=	rockchip
579.endif
580
581.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
582_agp=		agp
583_an=		an
584_aout=		aout
585_bios=		bios
586_bktr=		bktr
587.if ${MK_SOURCELESS_UCODE} != "no"
588_bxe=		bxe
589.endif
590_cardbus=	cardbus
591_cbb=		cbb
592_cpuctl=	cpuctl
593_cpufreq=	cpufreq
594_dpms=		dpms
595_em=		em
596_et=		et
597_exca=		exca
598_if_ndis=	if_ndis
599_io=		io
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"
645_hpt27xx=	hpt27xx
646.endif
647_hptiop=	hptiop
648.if ${MK_SOURCELESS_HOST} != "no"
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.if ${MK_SOURCELESS_UCODE} != "no"
708_qlxgbe=	qlxgbe
709_qlnx=		qlnx
710.endif
711_sfxge=		sfxge
712_sgx=		sgx
713_sgx_linux=	sgx_linux
714_smartpqi=	smartpqi
715
716.if ${MK_BHYVE} != "no" || defined(ALL_MODULES)
717_vmm=		vmm
718.endif
719.endif
720
721.if ${MACHINE_CPUARCH} == "i386"
722# XXX some of these can move to the general case when de-i386'ed
723# XXX some of these can move now, but are untested on other architectures.
724_3dfx=		3dfx
725_3dfx_linux=	3dfx_linux
726_apm=		apm
727.if ${MK_SOURCELESS_UCODE} != "no"
728_ce=		ce
729.endif
730.if ${MK_SOURCELESS_UCODE} != "no"
731_cp=		cp
732.endif
733_glxiic=	glxiic
734_glxsb=		glxsb
735_pcfclock=	pcfclock
736_pst=		pst
737_sbni=		sbni
738.if ${MK_SOURCELESS_UCODE} != "no"
739_ctau=		ctau
740.endif
741.endif
742
743.if ${MACHINE_CPUARCH} == "arm"
744_cfi=		cfi
745_cpsw=		cpsw
746.endif
747
748.if ${MACHINE_CPUARCH} == "powerpc"
749_agp=		agp
750_an=		an
751_cardbus=	cardbus
752_cbb=		cbb
753_cfi=		cfi
754_cpufreq=	cpufreq
755_exca=		exca
756_ffec=		ffec
757_nvd=		nvd
758_nvme=		nvme
759_pccard=	pccard
760_wi=		wi
761.endif
762
763.if ${MACHINE_ARCH} == "powerpc64"
764_ipmi=		ipmi
765_nvram=		opal_nvram
766.endif
767.if ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "powerpc"
768# Don't build powermac_nvram for powerpcspe, it's never supported.
769_nvram+=	powermac_nvram
770.endif
771
772.if ${MACHINE_CPUARCH} == "sparc64"
773_auxio=		auxio
774_em=		em
775_epic=		epic
776.endif
777
778.if (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
779     ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "i386")
780_cloudabi32=	cloudabi32
781.endif
782.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
783_cloudabi64=	cloudabi64
784.endif
785
786.endif
787
788.if ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "aarch64"
789_bcm283x_clkman=  bcm283x_clkman
790_bcm283x_pwm=  bcm283x_pwm
791.endif
792
793SUBDIR+=${MODULES_EXTRA}
794
795.for reject in ${WITHOUT_MODULES}
796SUBDIR:= ${SUBDIR:N${reject}}
797.endfor
798
799# Calling kldxref(8) for each module is expensive.
800.if !defined(NO_XREF)
801.MAKEFLAGS+=	-DNO_XREF
802afterinstall: .PHONY
803	@if type kldxref >/dev/null 2>&1; then \
804		${ECHO} ${KLDXREF_CMD} ${DESTDIR}${KMODDIR}; \
805		${KLDXREF_CMD} ${DESTDIR}${KMODDIR}; \
806	fi
807.endif
808
809.include "${SYSDIR}/conf/config.mk"
810
811SUBDIR:= ${SUBDIR:u:O}
812
813.include <bsd.subdir.mk>
814