xref: /freebsd/sys/modules/Makefile (revision fb47a3769c514735bceb2822a64e5e70c3d2f7a4)
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	esp \
125	${_et} \
126	evdev \
127	${_ex} \
128	${_exca} \
129	ext2fs \
130	fdc \
131	fdescfs \
132	${_fe} \
133	${_ffec} \
134	filemon \
135	firewire \
136	firmware \
137	fuse \
138	${_fxp} \
139	gem \
140	geom \
141	${_glxiic} \
142	${_glxsb} \
143	gpio \
144	hifn \
145	hme \
146	${_hpt27xx} \
147	${_hptiop} \
148	${_hptmv} \
149	${_hptnr} \
150	${_hptrr} \
151	hwpmc \
152	${_hwpmc_mips24k} \
153	${_hwpmc_mips74k} \
154	${_hyperv} \
155	i2c \
156        ${_ibcore} \
157	${_ibcs2} \
158	${_ichwd} \
159	${_ida} \
160	if_bridge \
161	if_disc \
162	if_edsc \
163	${_if_enc} \
164	if_epair \
165	${_if_gif} \
166	${_if_gre} \
167	${_if_me} \
168	if_lagg \
169	${_if_ndis} \
170	${_if_stf} \
171	if_tap \
172	if_tun \
173	if_vlan \
174	if_vxlan \
175	${_iir} \
176	imgact_binmisc \
177	${_intelspi} \
178	${_io} \
179	${_ioat} \
180        ${_ipoib} \
181	${_ipdivert} \
182	${_ipfilter} \
183	${_ipfw} \
184	ipfw_nat \
185	${_ipfw_nat64} \
186	${_ipfw_nptv6} \
187	${_ipfw_pmod} \
188	${_ipmi} \
189	ip6_mroute_mod \
190	ip_mroute_mod \
191	${_ips} \
192	${_ipsec} \
193	${_ipw} \
194	${_ipwfw} \
195	${_isci} \
196	${_iser} \
197	isp \
198	${_ispfw} \
199	${_iwi} \
200	${_iwifw} \
201	${_iwm} \
202	${_iwmfw} \
203	${_iwn} \
204	${_iwnfw} \
205	${_ix} \
206	${_ixv} \
207	${_ixl} \
208	jme \
209	joy \
210	kbdmux \
211	kgssapi \
212	kgssapi_krb5 \
213	khelp \
214	krpc \
215	ksyms \
216	le \
217	lge \
218	libalias \
219	libiconv \
220	libmchain \
221	${_linprocfs} \
222	${_linsysfs} \
223	${_linux} \
224	${_linux_common} \
225	${_linux64} \
226	linuxkpi \
227	${_lio} \
228	lpt \
229	mac_biba \
230	mac_bsdextended \
231	mac_ifoff \
232	mac_lomac \
233	mac_mls \
234	mac_none \
235	mac_partition \
236	mac_portacl \
237	mac_seeotheruids \
238	mac_stub \
239	mac_test \
240	mac_veriexec \
241	mac_veriexec_rmd160 \
242	mac_veriexec_sha1 \
243	mac_veriexec_sha256 \
244	mac_veriexec_sha384 \
245	mac_veriexec_sha512 \
246	malo \
247	md \
248	mdio \
249	mem \
250	mfi \
251	mii \
252	mlx \
253	${_mlx4} \
254	${_mlx4ib} \
255	${_mlx4en} \
256	${_mlx5} \
257	${_mlx5en} \
258	${_mlx5ib} \
259	${_mly} \
260	mmc \
261	mmcsd \
262	mpr \
263	mps \
264	mpt \
265	mqueue \
266	mrsas \
267	msdosfs \
268	msdosfs_iconv \
269	${_mse} \
270	msk \
271	${_mthca} \
272	mvs \
273	mwl \
274	${_mwlfw} \
275	mxge \
276	my \
277	${_nandfs} \
278	${_nandsim} \
279	${_ncr} \
280	${_nctgpio} \
281	${_ncv} \
282	${_ndis} \
283	${_netgraph} \
284	${_nfe} \
285	nfscl \
286	nfscommon \
287	nfsd \
288	nfslock \
289	nfslockd \
290	nfssvc \
291	nge \
292	nmdm \
293	${_nsp} \
294	nullfs \
295	${_ntb} \
296	${_nvd} \
297	${_nvme} \
298	${_nvram} \
299	oce \
300	${_ocs_fc} \
301	otus \
302	${_otusfw} \
303	ow \
304	${_padlock} \
305	${_padlock_rng} \
306	${_pccard} \
307	${_pcfclock} \
308	pcn \
309	${_pf} \
310	${_pflog} \
311	${_pfsync} \
312	plip \
313	${_pms} \
314	ppbus \
315	ppc \
316	ppi \
317	pps \
318	procfs \
319	proto \
320	pseudofs \
321	${_pst} \
322	pty  \
323	puc \
324	${_qlxge} \
325	${_qlxgb} \
326	${_qlxgbe} \
327	${_qlnx} \
328	ral \
329	${_ralfw} \
330	${_random_fortuna} \
331	${_random_yarrow} \
332	${_random_other} \
333	rc4 \
334	${_rdma} \
335	${_rdrand_rng} \
336	re \
337	rl \
338	${_rockchip} \
339	rtwn \
340	rtwn_pci \
341	rtwn_usb \
342	${_rtwnfw} \
343	${_s3} \
344	${_safe} \
345	${_sbni} \
346	scc \
347	${_scsi_low} \
348	sdhci \
349	${_sdhci_acpi} \
350	sdhci_pci \
351	sem \
352	send \
353	${_sf} \
354	${_sfxge} \
355	sge \
356	${_sgx} \
357	${_sgx_linux} \
358	siftr \
359	siis \
360	sis \
361	sk \
362	${_smartpqi} \
363	smbfs \
364	sn \
365	snp \
366	sound \
367	${_speaker} \
368	spi \
369	${_splash} \
370	${_sppp} \
371	ste \
372	${_stg} \
373	stge \
374	${_sym} \
375	${_syscons} \
376	sysvipc \
377	tcp \
378	${_ti} \
379	tl \
380	tmpfs \
381	${_toecore} \
382	${_tpm} \
383	trm \
384	${_twa} \
385	twe \
386	tws \
387	tx \
388	${_txp} \
389	uart \
390	ubsec \
391	udf \
392	udf_iconv \
393	ufs \
394	uinput \
395	unionfs \
396	usb \
397	${_vesa} \
398	${_virtio} \
399	vge \
400	${_viawd} \
401	videomode \
402	vkbd \
403	${_vmm} \
404	${_vmware} \
405	${_vpo} \
406	vr \
407	vte \
408	vx \
409	wb \
410	${_wbwd} \
411	${_wi} \
412	wlan \
413	wlan_acl \
414	wlan_amrr \
415	wlan_ccmp \
416	wlan_rssadapt \
417	wlan_tkip \
418	wlan_wep \
419	wlan_xauth \
420	${_wpi} \
421	${_wpifw} \
422	${_x86bios} \
423	${_xe} \
424	xl \
425	zlib
426
427.if ${MK_AUTOFS} != "no" || defined(ALL_MODULES)
428_autofs=	autofs
429.endif
430
431.if ${MK_CDDL} != "no" || defined(ALL_MODULES)
432.if (${MACHINE_CPUARCH} != "arm" || ${MACHINE_ARCH:Marmv[67]*} != "") && \
433	${MACHINE_CPUARCH} != "mips" && \
434	${MACHINE_CPUARCH} != "sparc64"
435SUBDIR+=	dtrace
436.endif
437SUBDIR+=	opensolaris
438.endif
439
440.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
441.if exists(${SRCTOP}/sys/opencrypto)
442_crypto=	crypto
443_cryptodev=	cryptodev
444_random_fortuna=random_fortuna
445_random_yarrow=	random_yarrow
446_random_other=	random_other
447.endif
448.endif
449
450.if ${MK_CUSE} != "no" || defined(ALL_MODULES)
451SUBDIR+=	cuse
452.endif
453
454.if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \
455	defined(ALL_MODULES)
456_carp=		carp
457_toecore=	toecore
458_if_enc=	if_enc
459_if_gif=	if_gif
460_if_gre=	if_gre
461_ipfw_pmod=	ipfw_pmod
462.if ${MK_IPSEC_SUPPORT} != "no"
463_ipsec=		ipsec
464.endif
465.endif
466
467.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
468	defined(ALL_MODULES)
469_if_stf=	if_stf
470.endif
471
472.if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES)
473_if_me=		if_me
474_ipdivert=	ipdivert
475_ipfw=		ipfw
476.if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
477_ipfw_nat64=	ipfw_nat64
478.endif
479.endif
480
481.if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
482_ipfw_nptv6=	ipfw_nptv6
483.endif
484
485.if ${MK_IPFILTER} != "no" || defined(ALL_MODULES)
486_ipfilter=	ipfilter
487.endif
488
489.if ${MK_ISCSI} != "no" || defined(ALL_MODULES)
490SUBDIR+=	cfiscsi
491SUBDIR+=	iscsi
492SUBDIR+=	iscsi_initiator
493.endif
494
495.if ${MK_NAND} != "no" || defined(ALL_MODULES)
496_nandfs=	nandfs
497_nandsim=	nandsim
498.endif
499
500.if ${MK_NETGRAPH} != "no" || defined(ALL_MODULES)
501_netgraph=	netgraph
502.endif
503
504.if (${MK_PF} != "no" && (${MK_INET_SUPPORT} != "no" || \
505	${MK_INET6_SUPPORT} != "no")) || defined(ALL_MODULES)
506_pf=		pf
507_pflog=		pflog
508.if ${MK_INET_SUPPORT} != "no"
509_pfsync=	pfsync
510.endif
511.endif
512
513.if ${MK_SOURCELESS_UCODE} != "no"
514_bce=		bce
515_fxp=		fxp
516_ispfw=		ispfw
517_sf=		sf
518_ti=		ti
519_txp=		txp
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.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_drm=		drm
590_drm2=		drm2
591_ed=		ed
592_em=		em
593_ena=		ena
594_ep=		ep
595_et=		et
596_exca=		exca
597_fe=		fe
598.if ${MK_OFED} != "no" || defined(ALL_MODULES)
599_ibcore=        ibcore
600.endif
601_if_ndis=	if_ndis
602_io=		io
603.if ${MK_OFED} != "no" || defined(ALL_MODULES)
604_ipoib=         ipoib
605_iser=		iser
606.endif
607_ix=		ix
608_ixv=		ixv
609_linprocfs=	linprocfs
610_linsysfs=	linsysfs
611_linux=		linux
612.if ${MK_SOURCELESS_UCODE} != "no"
613_lio=		lio
614.endif
615_nctgpio=	nctgpio
616_ndis=		ndis
617_ocs_fc=	ocs_fc
618_pccard=	pccard
619.if ${MK_OFED} != "no" || defined(ALL_MODULES)
620_rdma=		rdma
621.endif
622_safe=		safe
623_scsi_low=	scsi_low
624_speaker=	speaker
625_splash=	splash
626_sppp=		sppp
627_vmware=	vmware
628_wbwd=		wbwd
629_wi=		wi
630_xe=		xe
631
632_aac=		aac
633_aacraid=	aacraid
634_acpi=		acpi
635.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
636.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} > 40201
637_aesni=		aesni
638.endif
639.endif
640_amd_ecc_inject=amd_ecc_inject
641_amdsbwd=	amdsbwd
642_amdsmn=	amdsmn
643_amdtemp=	amdtemp
644_arcmsr=	arcmsr
645_asmc=		asmc
646.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
647_blake2=	blake2
648.endif
649_bytgpio=	bytgpio
650_chvgpio=	chvgpio
651_ciss=		ciss
652_chromebook_platform=	chromebook_platform
653_cmx=		cmx
654_coretemp=	coretemp
655.if ${MK_SOURCELESS_HOST} != "no"
656_hpt27xx=	hpt27xx
657.endif
658_hptiop=	hptiop
659.if ${MK_SOURCELESS_HOST} != "no"
660_hptmv=		hptmv
661_hptnr=		hptnr
662_hptrr=		hptrr
663.endif
664_hyperv=	hyperv
665_ichwd=		ichwd
666_ida=		ida
667_iir=		iir
668_intelspi=	intelspi
669_ipmi=		ipmi
670_ips=		ips
671_isci=		isci
672_ipw=		ipw
673_iwi=		iwi
674_iwm=		iwm
675_iwn=		iwn
676.if ${MK_SOURCELESS_UCODE} != "no"
677_ipwfw=		ipwfw
678_iwifw=		iwifw
679_iwmfw=		iwmfw
680_iwnfw=		iwnfw
681.endif
682_mlx4=		mlx4
683_mlx5=		mlx5
684.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
685	defined(ALL_MODULES)
686_mlx4en=	mlx4en
687_mlx5en=	mlx5en
688.endif
689.if ${MK_OFED} != "no" || defined(ALL_MODULES)
690_mthca=		mthca
691_mlx4ib=	mlx4ib
692_mlx5ib=	mlx5ib
693.endif
694_mly=		mly
695_nfe=		nfe
696_nvd=		nvd
697_nvme=		nvme
698_nvram=		nvram
699.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
700_padlock=	padlock
701_padlock_rng=	padlock_rng
702_rdrand_rng=	rdrand_rng
703.endif
704_s3=		s3
705_sdhci_acpi=	sdhci_acpi
706_tpm=		tpm
707_twa=		twa
708_vesa=		vesa
709_viawd=		viawd
710_virtio=	virtio
711_wpi=		wpi
712.if ${MK_SOURCELESS_UCODE} != "no"
713_wpifw=		wpifw
714.endif
715_x86bios=	x86bios
716.endif
717
718.if ${MACHINE_CPUARCH} == "amd64"
719_ccp=		ccp
720_efirt=		efirt
721_ioat=		ioat
722_ixl=		ixl
723_ixlv=		ixlv
724_linux64=	linux64
725_linux_common=	linux_common
726_ntb=		ntb
727_pms=		pms
728_qlxge=		qlxge
729_qlxgb=		qlxgb
730.if ${MK_SOURCELESS_UCODE} != "no"
731_qlxgbe=	qlxgbe
732_qlnx=		qlnx
733.endif
734_sfxge=		sfxge
735_sgx=		sgx
736_sgx_linux=	sgx_linux
737_smartpqi=	smartpqi
738
739.if ${MK_BHYVE} != "no" || defined(ALL_MODULES)
740_vmm=		vmm
741.endif
742.endif
743
744.if ${MACHINE_CPUARCH} == "i386"
745# XXX some of these can move to the general case when de-i386'ed
746# XXX some of these can move now, but are untested on other architectures.
747_3dfx=		3dfx
748_3dfx_linux=	3dfx_linux
749_aic=		aic
750_apm=		apm
751.if ${MK_SOURCELESS_UCODE} != "no"
752_ce=		ce
753.endif
754_coff=		coff
755.if ${MK_SOURCELESS_UCODE} != "no"
756_cp=		cp
757.endif
758_glxiic=	glxiic
759_glxsb=		glxsb
760#_ibcs2=		ibcs2
761_mse=		mse
762_ncr=		ncr
763_ncv=		ncv
764_nsp=		nsp
765_pcfclock=	pcfclock
766_pst=		pst
767_sbni=		sbni
768_stg=		stg
769.if ${MK_SOURCELESS_UCODE} != "no"
770_ctau=		ctau
771.endif
772_dpt=		dpt
773_ex=		ex
774.endif
775
776.if ${MACHINE_CPUARCH} == "arm"
777_cfi=		cfi
778_cpsw=		cpsw
779.endif
780
781.if ${MACHINE_CPUARCH} == "powerpc"
782_agp=		agp
783_an=		an
784_bm=		bm
785_cardbus=	cardbus
786_cbb=		cbb
787_cfi=		cfi
788_cpufreq=	cpufreq
789_drm=		drm
790_exca=		exca
791_ffec=		ffec
792_nvd=		nvd
793_nvme=		nvme
794_pccard=	pccard
795_wi=		wi
796.endif
797
798.if ${MACHINE_ARCH} == "powerpc64"
799_drm2=		drm2
800.endif
801.if ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "powerpc"
802# Don't build powermac_nvram for powerpcspe, it's never supported.
803_nvram=		powermac_nvram
804.endif
805
806.if ${MACHINE_CPUARCH} == "sparc64"
807_auxio=		auxio
808_em=		em
809_epic=		epic
810.endif
811
812.if (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
813     ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "i386")
814_cloudabi32=	cloudabi32
815.endif
816.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
817_cloudabi64=	cloudabi64
818.endif
819
820.endif
821
822.if ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "aarch64"
823_bcm283x_clkman=  bcm283x_clkman
824_bcm283x_pwm=  bcm283x_pwm
825.endif
826
827SUBDIR+=${MODULES_EXTRA}
828
829.for reject in ${WITHOUT_MODULES}
830SUBDIR:= ${SUBDIR:N${reject}}
831.endfor
832
833# Calling kldxref(8) for each module is expensive.
834.if !defined(NO_XREF)
835.MAKEFLAGS+=	-DNO_XREF
836afterinstall: .PHONY
837	@if type kldxref >/dev/null 2>&1; then \
838		${ECHO} kldxref ${DESTDIR}${KMODDIR}; \
839		kldxref ${DESTDIR}${KMODDIR}; \
840	fi
841.endif
842
843.include "${SYSDIR}/conf/config.mk"
844
845SUBDIR:= ${SUBDIR:u:O}
846
847.include <bsd.subdir.mk>
848