xref: /freebsd/sys/modules/Makefile (revision 118063fb70c3f74f16678dc7ddbc8528c483a528)
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	${_arcnet} \
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	${_bm} \
72	bnxt \
73	bridgestp \
74	bwi \
75	bwn \
76	${_bytgpio} \
77	${_chvgpio} \
78	cam \
79	${_cardbus} \
80	${_carp} \
81	cas \
82	${_cbb} \
83	cc \
84	${_ccp} \
85	cd9660 \
86	cd9660_iconv \
87	${_ce} \
88	${_cfi} \
89	chacha20 \
90	${_chromebook_platform} \
91	${_ciss} \
92	cloudabi \
93	${_cloudabi32} \
94	${_cloudabi64} \
95	${_cm} \
96	${_cmx} \
97	${_coff} \
98	${_coretemp} \
99	${_cp} \
100	${_cpsw} \
101	${_cpuctl} \
102	${_cpufreq} \
103	${_crypto} \
104	${_cryptodev} \
105	${_cs} \
106	${_ctau} \
107	ctl \
108	${_cxgb} \
109	${_cxgbe} \
110	dc \
111	dcons \
112	dcons_crom \
113	de \
114	${_dpms} \
115	${_dpt} \
116	${_drm} \
117	${_drm2} \
118	dummynet \
119	${_ed} \
120	${_efirt} \
121	${_em} \
122	${_ena} \
123	${_ep} \
124	${_epic} \
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	${_ixgb} \
209	${_ixl} \
210	${_ixlv} \
211	jme \
212	joy \
213	kbdmux \
214	kgssapi \
215	kgssapi_krb5 \
216	khelp \
217	krpc \
218	ksyms \
219	le \
220	lge \
221	libalias \
222	libiconv \
223	libmchain \
224	${_linprocfs} \
225	${_linsysfs} \
226	${_linux} \
227	${_linux_common} \
228	${_linux64} \
229	linuxkpi \
230	${_lio} \
231	lmc \
232	lpt \
233	mac_biba \
234	mac_bsdextended \
235	mac_ifoff \
236	mac_lomac \
237	mac_mls \
238	mac_none \
239	mac_partition \
240	mac_portacl \
241	mac_seeotheruids \
242	mac_stub \
243	mac_test \
244	malo \
245	md \
246	mdio \
247	mem \
248	mfi \
249	mii \
250	mlx \
251	${_mlx4} \
252	${_mlx4ib} \
253	${_mlx4en} \
254	${_mlx5} \
255	${_mlx5en} \
256	${_mlx5ib} \
257	${_mly} \
258	mmc \
259	mmcsd \
260	mpr \
261	mps \
262	mpt \
263	mqueue \
264	mrsas \
265	msdosfs \
266	msdosfs_iconv \
267	${_mse} \
268	msk \
269	${_mthca} \
270	mvs \
271	mwl \
272	${_mwlfw} \
273	mxge \
274	my \
275	${_nandfs} \
276	${_nandsim} \
277	${_ncr} \
278	${_nctgpio} \
279	${_ncv} \
280	${_ndis} \
281	${_netgraph} \
282	${_nfe} \
283	nfscl \
284	nfscommon \
285	nfsd \
286	nfslock \
287	nfslockd \
288	nfssvc \
289	nge \
290	nmdm \
291	${_nsp} \
292	nullfs \
293	${_ntb} \
294	${_nvd} \
295	${_nvme} \
296	${_nvram} \
297	${_nxge} \
298	oce \
299	otus \
300	${_otusfw} \
301	ow \
302	${_padlock} \
303	${_padlock_rng} \
304	${_pccard} \
305	${_pcfclock} \
306	pcn \
307	${_pf} \
308	${_pflog} \
309	${_pfsync} \
310	plip \
311	${_pms} \
312	ppbus \
313	ppc \
314	ppi \
315	pps \
316	procfs \
317	proto \
318	pseudofs \
319	${_pst} \
320	pty  \
321	puc \
322	${_qlxge} \
323	${_qlxgb} \
324	${_qlxgbe} \
325	${_qlnx} \
326	ral \
327	${_ralfw} \
328	${_random_fortuna} \
329	${_random_yarrow} \
330	${_random_other} \
331	rc4 \
332	${_rdma} \
333	${_rdrand_rng} \
334	re \
335	rl \
336	rtwn \
337	rtwn_pci \
338	rtwn_usb \
339	${_rtwnfw} \
340	${_s3} \
341	${_safe} \
342	${_sbni} \
343	scc \
344	${_scsi_low} \
345	sdhci \
346	${_sdhci_acpi} \
347	sdhci_pci \
348	sem \
349	send \
350	${_sf} \
351	${_sfxge} \
352	sge \
353	${_sgx} \
354	${_sgx_linux} \
355	siftr \
356	siis \
357	sis \
358	sk \
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	${_vxge} \
406	wb \
407	${_wbwd} \
408	${_wi} \
409	wlan \
410	wlan_acl \
411	wlan_amrr \
412	wlan_ccmp \
413	wlan_rssadapt \
414	wlan_tkip \
415	wlan_wep \
416	wlan_xauth \
417	${_wpi} \
418	${_wpifw} \
419	${_x86bios} \
420	${_xe} \
421	xl \
422	zlib
423
424.if ${MK_AUTOFS} != "no" || defined(ALL_MODULES)
425_autofs=	autofs
426.endif
427
428.if ${MK_CDDL} != "no" || defined(ALL_MODULES)
429.if (${MACHINE_CPUARCH} != "arm" || ${MACHINE_ARCH:Marmv[67]*} != "") && \
430	${MACHINE_CPUARCH} != "mips" && \
431	${MACHINE_CPUARCH} != "sparc64"
432SUBDIR+=	dtrace
433.endif
434SUBDIR+=	opensolaris
435.endif
436
437.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
438.if exists(${SRCTOP}/sys/opencrypto)
439_crypto=	crypto
440_cryptodev=	cryptodev
441_random_fortuna=random_fortuna
442_random_yarrow=	random_yarrow
443_random_other=	random_other
444.endif
445.endif
446
447.if ${MK_CUSE} != "no" || defined(ALL_MODULES)
448SUBDIR+=	cuse
449.endif
450
451.if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \
452	defined(ALL_MODULES)
453_carp=		carp
454_toecore=	toecore
455_if_enc=	if_enc
456_if_gif=	if_gif
457_if_gre=	if_gre
458_ipfw_pmod=	ipfw_pmod
459.if ${MK_IPSEC_SUPPORT} != "no"
460_ipsec=		ipsec
461.endif
462.endif
463
464.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
465	defined(ALL_MODULES)
466_if_stf=	if_stf
467.endif
468
469.if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES)
470_if_me=		if_me
471_ipdivert=	ipdivert
472_ipfw=		ipfw
473.if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
474_ipfw_nat64=	ipfw_nat64
475.endif
476.endif
477
478.if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
479_ipfw_nptv6=	ipfw_nptv6
480.endif
481
482.if ${MK_IPFILTER} != "no" || defined(ALL_MODULES)
483_ipfilter=	ipfilter
484.endif
485
486.if ${MK_ISCSI} != "no" || defined(ALL_MODULES)
487SUBDIR+=	cfiscsi
488SUBDIR+=	iscsi
489SUBDIR+=	iscsi_initiator
490.endif
491
492.if ${MK_NAND} != "no" || defined(ALL_MODULES)
493_nandfs=	nandfs
494_nandsim=	nandsim
495.endif
496
497.if ${MK_NETGRAPH} != "no" || defined(ALL_MODULES)
498_netgraph=	netgraph
499.endif
500
501.if (${MK_PF} != "no" && (${MK_INET_SUPPORT} != "no" || \
502	${MK_INET6_SUPPORT} != "no")) || defined(ALL_MODULES)
503_pf=		pf
504_pflog=		pflog
505.if ${MK_INET_SUPPORT} != "no"
506_pfsync=	pfsync
507.endif
508.endif
509
510.if ${MK_SOURCELESS_UCODE} != "no"
511_bce=		bce
512_fxp=		fxp
513_ispfw=		ispfw
514_sf=		sf
515_ti=		ti
516_txp=		txp
517
518.if ${MACHINE_CPUARCH} != "mips"
519_mwlfw=		mwlfw
520_otusfw=	otusfw
521_ralfw=		ralfw
522_rtwnfw=	rtwnfw
523.endif
524.endif
525
526.if ${MK_SOURCELESS_UCODE} != "no" && ${MACHINE_CPUARCH} != "arm" && \
527	${MACHINE_CPUARCH} != "mips" && \
528	${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe" && \
529	${MACHINE_CPUARCH} != "riscv"
530_cxgbe=		cxgbe
531.endif
532
533.if ${MK_TESTS} != "no" || defined(ALL_MODULES)
534SUBDIR+=	tests
535.endif
536
537.if ${MK_ZFS} != "no" || defined(ALL_MODULES)
538SUBDIR+=	zfs
539.endif
540
541.if (${MACHINE_CPUARCH} == "mips" && ${MACHINE_ARCH:Mmips64} == "")
542_hwpmc_mips24k=	hwpmc_mips24k
543_hwpmc_mips74k=	hwpmc_mips74k
544.endif
545
546.if ${MACHINE_CPUARCH} != "aarch64" && ${MACHINE_CPUARCH} != "arm" && \
547	${MACHINE_CPUARCH} != "mips" && ${MACHINE_CPUARCH} != "powerpc" && \
548	${MACHINE_CPUARCH} != "riscv"
549_syscons=	syscons
550_vpo=		vpo
551.endif
552
553.if ${MACHINE_CPUARCH} != "mips"
554# no BUS_SPACE_UNSPECIFIED
555# No barrier instruction support (specific to this driver)
556_sym=		sym
557# intr_disable() is a macro, causes problems
558.if ${MK_SOURCELESS_UCODE} != "no"
559_cxgb=		cxgb
560.endif
561.endif
562
563.if ${MACHINE_CPUARCH} == "aarch64"
564_armv8crypto=	armv8crypto
565_efirt=		efirt
566_em=		em
567.endif
568
569.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
570_agp=		agp
571_an=		an
572_aout=		aout
573_bios=		bios
574_bktr=		bktr
575.if ${MK_SOURCELESS_UCODE} != "no"
576_bxe=		bxe
577.endif
578_cardbus=	cardbus
579_cbb=		cbb
580_cpuctl=	cpuctl
581_cpufreq=	cpufreq
582_cs=		cs
583_dpms=		dpms
584_drm=		drm
585_drm2=		drm2
586_ed=		ed
587_em=		em
588_ena=		ena
589_ep=		ep
590_et=		et
591_exca=		exca
592_fe=		fe
593.if ${MK_OFED} != "no" || defined(ALL_MODULES)
594_ibcore=        ibcore
595.endif
596_if_ndis=	if_ndis
597_io=		io
598.if ${MK_OFED} != "no" || defined(ALL_MODULES)
599_ipoib=         ipoib
600_iser=		iser
601.endif
602_ix=		ix
603_ixv=		ixv
604_linprocfs=	linprocfs
605_linsysfs=	linsysfs
606_linux=		linux
607.if ${MK_SOURCELESS_UCODE} != "no"
608_lio=		lio
609.endif
610_nctgpio=	nctgpio
611_ndis=		ndis
612_pccard=	pccard
613.if ${MK_OFED} != "no" || defined(ALL_MODULES)
614_rdma=		rdma
615.endif
616_safe=		safe
617_scsi_low=	scsi_low
618_speaker=	speaker
619_splash=	splash
620_sppp=		sppp
621_vmware=	vmware
622_vxge=  	vxge
623_wbwd=		wbwd
624_wi=		wi
625_xe=		xe
626
627_aac=		aac
628_aacraid=	aacraid
629_acpi=		acpi
630.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
631_aesni=		aesni
632.endif
633_amd_ecc_inject=amd_ecc_inject
634_amdsbwd=	amdsbwd
635_amdsmn=	amdsmn
636_amdtemp=	amdtemp
637_arcmsr=	arcmsr
638_asmc=		asmc
639_bytgpio=	bytgpio
640_chvgpio=	chvgpio
641_ciss=		ciss
642_chromebook_platform=	chromebook_platform
643_cmx=		cmx
644_coretemp=	coretemp
645.if ${MK_SOURCELESS_HOST} != "no"
646_hpt27xx=	hpt27xx
647.endif
648_hptiop=	hptiop
649.if ${MK_SOURCELESS_HOST} != "no"
650_hptmv=		hptmv
651_hptnr=		hptnr
652_hptrr=		hptrr
653.endif
654_hyperv=	hyperv
655_ichwd=		ichwd
656_ida=		ida
657_iir=		iir
658_intelspi=	intelspi
659_ipmi=		ipmi
660_ips=		ips
661_isci=		isci
662_ipw=		ipw
663_iwi=		iwi
664_iwm=		iwm
665_iwn=		iwn
666_ixgb=		ixgb
667.if ${MK_SOURCELESS_UCODE} != "no"
668_ipwfw=		ipwfw
669_iwifw=		iwifw
670_iwmfw=		iwmfw
671_iwnfw=		iwnfw
672.endif
673_mlx4=		mlx4
674_mlx5=		mlx5
675.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
676	defined(ALL_MODULES)
677_mlx4en=	mlx4en
678_mlx5en=	mlx5en
679.endif
680.if ${MK_OFED} != "no" || defined(ALL_MODULES)
681_mthca=		mthca
682_mlx4ib=	mlx4ib
683_mlx5ib=	mlx5ib
684.endif
685_mly=		mly
686_nfe=		nfe
687_nvd=		nvd
688_nvme=		nvme
689_nvram=		nvram
690_nxge=		nxge
691.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
692_padlock=	padlock
693_padlock_rng=	padlock_rng
694_rdrand_rng=	rdrand_rng
695.endif
696_s3=		s3
697_sdhci_acpi=	sdhci_acpi
698_tpm=		tpm
699_twa=		twa
700_vesa=		vesa
701_viawd=		viawd
702_virtio=	virtio
703_wpi=		wpi
704.if ${MK_SOURCELESS_UCODE} != "no"
705_wpifw=		wpifw
706.endif
707_x86bios=	x86bios
708.endif
709
710.if ${MACHINE_CPUARCH} == "amd64"
711_ccp=		ccp
712_efirt=		efirt
713_ioat=		ioat
714_ixl=		ixl
715_ixlv=		ixlv
716_linux64=	linux64
717_linux_common=	linux_common
718_ntb=		ntb
719_pms=		pms
720_qlxge=		qlxge
721_qlxgb=		qlxgb
722.if ${MK_SOURCELESS_UCODE} != "no"
723_qlxgbe=	qlxgbe
724_qlnx=		qlnx
725.endif
726_sfxge=		sfxge
727_sgx=		sgx
728_sgx_linux=	sgx_linux
729
730.if ${MK_BHYVE} != "no" || defined(ALL_MODULES)
731_vmm=		vmm
732.endif
733.endif
734
735.if ${MACHINE_CPUARCH} == "i386"
736# XXX some of these can move to the general case when de-i386'ed
737# XXX some of these can move now, but are untested on other architectures.
738_3dfx=		3dfx
739_3dfx_linux=	3dfx_linux
740_aic=		aic
741_apm=		apm
742_arcnet=	arcnet
743.if ${MK_SOURCELESS_UCODE} != "no"
744_ce=		ce
745.endif
746_coff=		coff
747.if ${MK_SOURCELESS_UCODE} != "no"
748_cp=		cp
749.endif
750_glxiic=	glxiic
751_glxsb=		glxsb
752#_ibcs2=		ibcs2
753_mse=		mse
754_ncr=		ncr
755_ncv=		ncv
756_nsp=		nsp
757_pcfclock=	pcfclock
758_pst=		pst
759_sbni=		sbni
760_stg=		stg
761_cm=		cm
762.if ${MK_SOURCELESS_UCODE} != "no"
763_ctau=		ctau
764.endif
765_dpt=		dpt
766_ex=		ex
767.endif
768
769.if ${MACHINE_CPUARCH} == "arm"
770_cfi=		cfi
771_cpsw=		cpsw
772.endif
773
774.if ${MACHINE_CPUARCH} == "powerpc"
775_agp=		agp
776_an=		an
777_bm=		bm
778_cardbus=	cardbus
779_cbb=		cbb
780_cfi=		cfi
781_cpufreq=	cpufreq
782_drm=		drm
783_exca=		exca
784_ffec=		ffec
785_pccard=	pccard
786_wi=		wi
787.endif
788
789.if ${MACHINE_ARCH} == "powerpc64"
790_drm2=		drm2
791.endif
792.if ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "powerpc"
793# Don't build powermac_nvram for powerpcspe, it's never supported.
794_nvram=		powermac_nvram
795.endif
796
797.if ${MACHINE_CPUARCH} == "sparc64"
798_auxio=		auxio
799_em=		em
800_epic=		epic
801.endif
802
803.if (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
804     ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "i386")
805_cloudabi32=	cloudabi32
806.endif
807.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
808_cloudabi64=	cloudabi64
809.endif
810
811.endif
812
813.if ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "aarch64"
814_bcm283x_clkman=  bcm283x_clkman
815_bcm283x_pwm=  bcm283x_pwm
816.endif
817
818SUBDIR+=${MODULES_EXTRA}
819
820.for reject in ${WITHOUT_MODULES}
821SUBDIR:= ${SUBDIR:N${reject}}
822.endfor
823
824# Calling kldxref(8) for each module is expensive.
825.if !defined(NO_XREF)
826.MAKEFLAGS+=	-DNO_XREF
827afterinstall: .PHONY
828	@if type kldxref >/dev/null 2>&1; then \
829		${ECHO} kldxref ${DESTDIR}${KMODDIR}; \
830		kldxref ${DESTDIR}${KMODDIR}; \
831	fi
832.endif
833
834.include "${SYSDIR}/conf/config.mk"
835
836SUBDIR:= ${SUBDIR:u:O}
837
838.include <bsd.subdir.mk>
839