xref: /freebsd/sys/modules/Makefile (revision f39bffc62c1395bde25d152c7f68fdf7cbaab414)
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	${_allwinner} \
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_clkman} \
64	${_bcm283x_pwm} \
65	bfe \
66	bge \
67	bhnd \
68	${_bxe} \
69	${_bios} \
70	${_bktr} \
71	${_blake2} \
72	${_bm} \
73	bnxt \
74	bridgestp \
75	bwi \
76	bwn \
77	${_bytgpio} \
78	${_chvgpio} \
79	cam \
80	${_cardbus} \
81	${_carp} \
82	cas \
83	${_cbb} \
84	cc \
85	${_ccp} \
86	cd9660 \
87	cd9660_iconv \
88	${_ce} \
89	${_cfi} \
90	${_chromebook_platform} \
91	${_ciss} \
92	cloudabi \
93	${_cloudabi32} \
94	${_cloudabi64} \
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	epoch_test \
125	esp \
126	${_et} \
127	evdev \
128	${_ex} \
129	${_exca} \
130	ext2fs \
131	fdc \
132	fdescfs \
133	${_fe} \
134	${_ffec} \
135	filemon \
136	firewire \
137	firmware \
138	fuse \
139	${_fxp} \
140	gem \
141	geom \
142	${_glxiic} \
143	${_glxsb} \
144	gpio \
145	hifn \
146	hme \
147	${_hpt27xx} \
148	${_hptiop} \
149	${_hptmv} \
150	${_hptnr} \
151	${_hptrr} \
152	hwpmc \
153	${_hwpmc_mips24k} \
154	${_hwpmc_mips74k} \
155	${_hyperv} \
156	i2c \
157        ${_ibcore} \
158	${_ibcs2} \
159	${_ichwd} \
160	${_ida} \
161	if_bridge \
162	if_disc \
163	if_edsc \
164	${_if_enc} \
165	if_epair \
166	${_if_gif} \
167	${_if_gre} \
168	${_if_me} \
169	if_lagg \
170	${_if_ndis} \
171	${_if_stf} \
172	if_tap \
173	if_tun \
174	if_vlan \
175	if_vxlan \
176	${_iir} \
177	imgact_binmisc \
178	${_intelspi} \
179	${_io} \
180	${_ioat} \
181        ${_ipoib} \
182	${_ipdivert} \
183	${_ipfilter} \
184	${_ipfw} \
185	ipfw_nat \
186	${_ipfw_nat64} \
187	${_ipfw_nptv6} \
188	${_ipfw_pmod} \
189	${_ipmi} \
190	ip6_mroute_mod \
191	ip_mroute_mod \
192	${_ips} \
193	${_ipsec} \
194	${_ipw} \
195	${_ipwfw} \
196	${_isci} \
197	${_iser} \
198	isp \
199	${_ispfw} \
200	${_iwi} \
201	${_iwifw} \
202	${_iwm} \
203	${_iwmfw} \
204	${_iwn} \
205	${_iwnfw} \
206	${_ix} \
207	${_ixv} \
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	lpt \
231	mac_biba \
232	mac_bsdextended \
233	mac_ifoff \
234	mac_lomac \
235	mac_mls \
236	mac_none \
237	mac_partition \
238	mac_portacl \
239	mac_seeotheruids \
240	mac_stub \
241	mac_test \
242	malo \
243	md \
244	mdio \
245	mem \
246	mfi \
247	mii \
248	mlx \
249	${_mlx4} \
250	${_mlx4ib} \
251	${_mlx4en} \
252	${_mlx5} \
253	${_mlx5en} \
254	${_mlx5ib} \
255	${_mly} \
256	mmc \
257	mmcsd \
258	mpr \
259	mps \
260	mpt \
261	mqueue \
262	mrsas \
263	msdosfs \
264	msdosfs_iconv \
265	${_mse} \
266	msk \
267	${_mthca} \
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	oce \
296	${_ocs_fc} \
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	${_rockchip} \
335	rtwn \
336	rtwn_pci \
337	rtwn_usb \
338	${_rtwnfw} \
339	${_s3} \
340	${_safe} \
341	${_sbni} \
342	scc \
343	${_scsi_low} \
344	sdhci \
345	${_sdhci_acpi} \
346	sdhci_pci \
347	sem \
348	send \
349	${_sf} \
350	${_sfxge} \
351	sge \
352	${_sgx} \
353	${_sgx_linux} \
354	siftr \
355	siis \
356	sis \
357	sk \
358	${_smartpqi} \
359	smbfs \
360	sn \
361	snp \
362	sound \
363	${_speaker} \
364	spi \
365	${_splash} \
366	${_sppp} \
367	ste \
368	${_stg} \
369	stge \
370	${_sym} \
371	${_syscons} \
372	sysvipc \
373	tcp \
374	${_ti} \
375	tl \
376	tmpfs \
377	${_toecore} \
378	${_tpm} \
379	trm \
380	${_twa} \
381	twe \
382	tws \
383	tx \
384	${_txp} \
385	uart \
386	ubsec \
387	udf \
388	udf_iconv \
389	ufs \
390	uinput \
391	unionfs \
392	usb \
393	${_vesa} \
394	${_virtio} \
395	vge \
396	${_viawd} \
397	videomode \
398	vkbd \
399	${_vmm} \
400	${_vmware} \
401	${_vpo} \
402	vr \
403	vte \
404	vx \
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_allwinner=	allwinner
564_armv8crypto=	armv8crypto
565_efirt=		efirt
566_em=		em
567_rockchip=	rockchip
568.endif
569
570.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
571_agp=		agp
572_an=		an
573_aout=		aout
574_bios=		bios
575_bktr=		bktr
576.if ${MK_SOURCELESS_UCODE} != "no"
577_bxe=		bxe
578.endif
579_cardbus=	cardbus
580_cbb=		cbb
581_cpuctl=	cpuctl
582_cpufreq=	cpufreq
583_cs=		cs
584_dpms=		dpms
585_drm=		drm
586_drm2=		drm2
587_ed=		ed
588_em=		em
589_ena=		ena
590_ep=		ep
591_et=		et
592_exca=		exca
593_fe=		fe
594.if ${MK_OFED} != "no" || defined(ALL_MODULES)
595_ibcore=        ibcore
596.endif
597_if_ndis=	if_ndis
598_io=		io
599.if ${MK_OFED} != "no" || defined(ALL_MODULES)
600_ipoib=         ipoib
601_iser=		iser
602.endif
603_ix=		ix
604_ixv=		ixv
605_linprocfs=	linprocfs
606_linsysfs=	linsysfs
607_linux=		linux
608.if ${MK_SOURCELESS_UCODE} != "no"
609_lio=		lio
610.endif
611_nctgpio=	nctgpio
612_ndis=		ndis
613_ocs_fc=	ocs_fc
614_pccard=	pccard
615.if ${MK_OFED} != "no" || defined(ALL_MODULES)
616_rdma=		rdma
617.endif
618_safe=		safe
619_scsi_low=	scsi_low
620_speaker=	speaker
621_splash=	splash
622_sppp=		sppp
623_vmware=	vmware
624_wbwd=		wbwd
625_wi=		wi
626_xe=		xe
627
628_aac=		aac
629_aacraid=	aacraid
630_acpi=		acpi
631.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
632.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} > 40201
633_aesni=		aesni
634.endif
635.endif
636_amd_ecc_inject=amd_ecc_inject
637_amdsbwd=	amdsbwd
638_amdsmn=	amdsmn
639_amdtemp=	amdtemp
640_arcmsr=	arcmsr
641_asmc=		asmc
642.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
643_blake2=	blake2
644.endif
645_bytgpio=	bytgpio
646_chvgpio=	chvgpio
647_ciss=		ciss
648_chromebook_platform=	chromebook_platform
649_cmx=		cmx
650_coretemp=	coretemp
651.if ${MK_SOURCELESS_HOST} != "no"
652_hpt27xx=	hpt27xx
653.endif
654_hptiop=	hptiop
655.if ${MK_SOURCELESS_HOST} != "no"
656_hptmv=		hptmv
657_hptnr=		hptnr
658_hptrr=		hptrr
659.endif
660_hyperv=	hyperv
661_ichwd=		ichwd
662_ida=		ida
663_iir=		iir
664_intelspi=	intelspi
665_ipmi=		ipmi
666_ips=		ips
667_isci=		isci
668_ipw=		ipw
669_iwi=		iwi
670_iwm=		iwm
671_iwn=		iwn
672.if ${MK_SOURCELESS_UCODE} != "no"
673_ipwfw=		ipwfw
674_iwifw=		iwifw
675_iwmfw=		iwmfw
676_iwnfw=		iwnfw
677.endif
678_mlx4=		mlx4
679_mlx5=		mlx5
680.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
681	defined(ALL_MODULES)
682_mlx4en=	mlx4en
683_mlx5en=	mlx5en
684.endif
685.if ${MK_OFED} != "no" || defined(ALL_MODULES)
686_mthca=		mthca
687_mlx4ib=	mlx4ib
688_mlx5ib=	mlx5ib
689.endif
690_mly=		mly
691_nfe=		nfe
692_nvd=		nvd
693_nvme=		nvme
694_nvram=		nvram
695.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
696_padlock=	padlock
697_padlock_rng=	padlock_rng
698_rdrand_rng=	rdrand_rng
699.endif
700_s3=		s3
701_sdhci_acpi=	sdhci_acpi
702_tpm=		tpm
703_twa=		twa
704_vesa=		vesa
705_viawd=		viawd
706_virtio=	virtio
707_wpi=		wpi
708.if ${MK_SOURCELESS_UCODE} != "no"
709_wpifw=		wpifw
710.endif
711_x86bios=	x86bios
712.endif
713
714.if ${MACHINE_CPUARCH} == "amd64"
715_ccp=		ccp
716_efirt=		efirt
717_ioat=		ioat
718_ixl=		ixl
719_ixlv=		ixlv
720_linux64=	linux64
721_linux_common=	linux_common
722_ntb=		ntb
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_aic=		aic
746_apm=		apm
747.if ${MK_SOURCELESS_UCODE} != "no"
748_ce=		ce
749.endif
750_coff=		coff
751.if ${MK_SOURCELESS_UCODE} != "no"
752_cp=		cp
753.endif
754_glxiic=	glxiic
755_glxsb=		glxsb
756#_ibcs2=		ibcs2
757_mse=		mse
758_ncr=		ncr
759_ncv=		ncv
760_nsp=		nsp
761_pcfclock=	pcfclock
762_pst=		pst
763_sbni=		sbni
764_stg=		stg
765.if ${MK_SOURCELESS_UCODE} != "no"
766_ctau=		ctau
767.endif
768_dpt=		dpt
769_ex=		ex
770.endif
771
772.if ${MACHINE_CPUARCH} == "arm"
773_cfi=		cfi
774_cpsw=		cpsw
775.endif
776
777.if ${MACHINE_CPUARCH} == "powerpc"
778_agp=		agp
779_an=		an
780_bm=		bm
781_cardbus=	cardbus
782_cbb=		cbb
783_cfi=		cfi
784_cpufreq=	cpufreq
785_drm=		drm
786_exca=		exca
787_ffec=		ffec
788_nvd=		nvd
789_nvme=		nvme
790_pccard=	pccard
791_wi=		wi
792.endif
793
794.if ${MACHINE_ARCH} == "powerpc64"
795_drm2=		drm2
796.endif
797.if ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "powerpc"
798# Don't build powermac_nvram for powerpcspe, it's never supported.
799_nvram=		powermac_nvram
800.endif
801
802.if ${MACHINE_CPUARCH} == "sparc64"
803_auxio=		auxio
804_em=		em
805_epic=		epic
806.endif
807
808.if (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
809     ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "i386")
810_cloudabi32=	cloudabi32
811.endif
812.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
813_cloudabi64=	cloudabi64
814.endif
815
816.endif
817
818.if ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "aarch64"
819_bcm283x_clkman=  bcm283x_clkman
820_bcm283x_pwm=  bcm283x_pwm
821.endif
822
823SUBDIR+=${MODULES_EXTRA}
824
825.for reject in ${WITHOUT_MODULES}
826SUBDIR:= ${SUBDIR:N${reject}}
827.endfor
828
829# Calling kldxref(8) for each module is expensive.
830.if !defined(NO_XREF)
831.MAKEFLAGS+=	-DNO_XREF
832afterinstall: .PHONY
833	@if type kldxref >/dev/null 2>&1; then \
834		${ECHO} kldxref ${DESTDIR}${KMODDIR}; \
835		kldxref ${DESTDIR}${KMODDIR}; \
836	fi
837.endif
838
839.include "${SYSDIR}/conf/config.mk"
840
841SUBDIR:= ${SUBDIR:u:O}
842
843.include <bsd.subdir.mk>
844