xref: /freebsd/sys/modules/Makefile (revision 7cafeaa1fde93dbefa40971343bf9a3bb92f2ede)
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	cam \
78	${_cardbus} \
79	${_carp} \
80	cas \
81	${_cbb} \
82	cc \
83	${_ccp} \
84	cd9660 \
85	cd9660_iconv \
86	${_ce} \
87	${_cfi} \
88	chacha20 \
89	${_chromebook_platform} \
90	${_ciss} \
91	cloudabi \
92	${_cloudabi32} \
93	${_cloudabi64} \
94	${_cm} \
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	${_ixgb} \
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	lmc \
231	lpt \
232	mac_biba \
233	mac_bsdextended \
234	mac_ifoff \
235	mac_lomac \
236	mac_mls \
237	mac_none \
238	mac_partition \
239	mac_portacl \
240	mac_seeotheruids \
241	mac_stub \
242	mac_test \
243	malo \
244	md \
245	mdio \
246	mem \
247	mfi \
248	mii \
249	mlx \
250	${_mlx4} \
251	${_mlx4ib} \
252	${_mlx4en} \
253	${_mlx5} \
254	${_mlx5en} \
255	${_mlx5ib} \
256	${_mly} \
257	mmc \
258	mmcsd \
259	mpr \
260	mps \
261	mpt \
262	mqueue \
263	mrsas \
264	msdosfs \
265	msdosfs_iconv \
266	${_mse} \
267	msk \
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	${_nxge} \
296	oce \
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	rtwn \
335	rtwn_pci \
336	rtwn_usb \
337	${_rtwnfw} \
338	${_s3} \
339	${_safe} \
340	${_sbni} \
341	scc \
342	${_scsi_low} \
343	sdhci \
344	${_sdhci_acpi} \
345	sdhci_pci \
346	sem \
347	send \
348	${_sf} \
349	${_sfxge} \
350	sge \
351	${_sgx} \
352	${_sgx_linux} \
353	siftr \
354	siis \
355	sis \
356	sk \
357	smbfs \
358	sn \
359	snp \
360	sound \
361	${_speaker} \
362	spigen \
363	${_splash} \
364	${_sppp} \
365	ste \
366	${_stg} \
367	stge \
368	${_sym} \
369	${_syscons} \
370	sysvipc \
371	tcp \
372	${_ti} \
373	tl \
374	tmpfs \
375	${_toecore} \
376	${_tpm} \
377	trm \
378	${_twa} \
379	twe \
380	tws \
381	tx \
382	${_txp} \
383	uart \
384	ubsec \
385	udf \
386	udf_iconv \
387	ufs \
388	uinput \
389	unionfs \
390	usb \
391	${_vesa} \
392	${_virtio} \
393	vge \
394	${_viawd} \
395	videomode \
396	vkbd \
397	${_vmm} \
398	${_vmware} \
399	${_vpo} \
400	vr \
401	vte \
402	vx \
403	${_vxge} \
404	wb \
405	${_wbwd} \
406	${_wi} \
407	wlan \
408	wlan_acl \
409	wlan_amrr \
410	wlan_ccmp \
411	wlan_rssadapt \
412	wlan_tkip \
413	wlan_wep \
414	wlan_xauth \
415	${_wpi} \
416	${_wpifw} \
417	${_x86bios} \
418	${_xe} \
419	xl \
420	zlib
421
422.if ${MK_AUTOFS} != "no" || defined(ALL_MODULES)
423_autofs=	autofs
424.endif
425
426.if ${MK_CDDL} != "no" || defined(ALL_MODULES)
427.if (${MACHINE_CPUARCH} != "arm" || ${MACHINE_ARCH:Marmv[67]*} != "") && \
428	${MACHINE_CPUARCH} != "mips" && \
429	${MACHINE_CPUARCH} != "sparc64"
430SUBDIR+=	dtrace
431.endif
432SUBDIR+=	opensolaris
433.endif
434
435.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
436.if exists(${SRCTOP}/sys/opencrypto)
437_crypto=	crypto
438_cryptodev=	cryptodev
439_random_fortuna=random_fortuna
440_random_yarrow=	random_yarrow
441_random_other=	random_other
442.endif
443.endif
444
445.if ${MK_CUSE} != "no" || defined(ALL_MODULES)
446SUBDIR+=	cuse
447.endif
448
449.if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \
450	defined(ALL_MODULES)
451_carp=		carp
452_toecore=	toecore
453_if_enc=	if_enc
454_if_gif=	if_gif
455_if_gre=	if_gre
456_ipfw_pmod=	ipfw_pmod
457.if ${MK_IPSEC_SUPPORT} != "no"
458_ipsec=		ipsec
459.endif
460.endif
461
462.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
463	defined(ALL_MODULES)
464_if_stf=	if_stf
465.endif
466
467.if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES)
468_if_me=		if_me
469_ipdivert=	ipdivert
470_ipfw=		ipfw
471.if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
472_ipfw_nat64=	ipfw_nat64
473.endif
474.endif
475
476.if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
477_ipfw_nptv6=	ipfw_nptv6
478.endif
479
480.if ${MK_IPFILTER} != "no" || defined(ALL_MODULES)
481_ipfilter=	ipfilter
482.endif
483
484.if ${MK_ISCSI} != "no" || defined(ALL_MODULES)
485SUBDIR+=	cfiscsi
486SUBDIR+=	iscsi
487SUBDIR+=	iscsi_initiator
488.endif
489
490.if ${MK_NAND} != "no" || defined(ALL_MODULES)
491_nandfs=	nandfs
492_nandsim=	nandsim
493.endif
494
495.if ${MK_NETGRAPH} != "no" || defined(ALL_MODULES)
496_netgraph=	netgraph
497.endif
498
499.if (${MK_PF} != "no" && (${MK_INET_SUPPORT} != "no" || \
500	${MK_INET6_SUPPORT} != "no")) || defined(ALL_MODULES)
501_pf=		pf
502_pflog=		pflog
503.if ${MK_INET_SUPPORT} != "no"
504_pfsync=	pfsync
505.endif
506.endif
507
508.if ${MK_SOURCELESS_UCODE} != "no"
509_bce=		bce
510_fxp=		fxp
511_ispfw=		ispfw
512_sf=		sf
513_ti=		ti
514_txp=		txp
515
516.if ${MACHINE_CPUARCH} != "mips"
517_mwlfw=		mwlfw
518_otusfw=	otusfw
519_ralfw=		ralfw
520_rtwnfw=	rtwnfw
521.endif
522.endif
523
524.if ${MK_SOURCELESS_UCODE} != "no" && ${MACHINE_CPUARCH} != "arm" && \
525	${MACHINE_CPUARCH} != "mips" && \
526	${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe" && \
527	${MACHINE_CPUARCH} != "riscv"
528_cxgbe=		cxgbe
529.endif
530
531.if ${MK_TESTS} != "no" || defined(ALL_MODULES)
532SUBDIR+=	tests
533.endif
534
535.if ${MK_ZFS} != "no" || defined(ALL_MODULES)
536SUBDIR+=	zfs
537.endif
538
539.if (${MACHINE_CPUARCH} == "mips" && ${MACHINE_ARCH:Mmips64} == "")
540_hwpmc_mips24k=	hwpmc_mips24k
541_hwpmc_mips74k=	hwpmc_mips74k
542.endif
543
544.if ${MACHINE_CPUARCH} != "aarch64" && ${MACHINE_CPUARCH} != "arm" && \
545	${MACHINE_CPUARCH} != "mips" && ${MACHINE_CPUARCH} != "powerpc" && \
546	${MACHINE_CPUARCH} != "riscv"
547_syscons=	syscons
548_vpo=		vpo
549.endif
550
551.if ${MACHINE_CPUARCH} != "mips"
552# no BUS_SPACE_UNSPECIFIED
553# No barrier instruction support (specific to this driver)
554_sym=		sym
555# intr_disable() is a macro, causes problems
556.if ${MK_SOURCELESS_UCODE} != "no"
557_cxgb=		cxgb
558.endif
559.endif
560
561.if ${MACHINE_CPUARCH} == "aarch64"
562_armv8crypto=	armv8crypto
563_efirt=		efirt
564_em=		em
565.endif
566
567.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
568_agp=		agp
569_an=		an
570_aout=		aout
571_bios=		bios
572_bktr=		bktr
573.if ${MK_SOURCELESS_UCODE} != "no"
574_bxe=		bxe
575.endif
576_cardbus=	cardbus
577_cbb=		cbb
578_cpuctl=	cpuctl
579_cpufreq=	cpufreq
580_cs=		cs
581_dpms=		dpms
582_drm=		drm
583_drm2=		drm2
584_ed=		ed
585_em=		em
586_ena=		ena
587_ep=		ep
588_et=		et
589_exca=		exca
590_fe=		fe
591.if ${MK_OFED} != "no" || defined(ALL_MODULES)
592_ibcore=        ibcore
593.endif
594_if_ndis=	if_ndis
595_io=		io
596.if ${MK_OFED} != "no" || defined(ALL_MODULES)
597_ipoib=         ipoib
598_iser=		iser
599.endif
600_ix=		ix
601_ixv=		ixv
602_linprocfs=	linprocfs
603_linsysfs=	linsysfs
604_linux=		linux
605.if ${MK_SOURCELESS_UCODE} != "no"
606_lio=		lio
607.endif
608_nctgpio=	nctgpio
609_ndis=		ndis
610_pccard=	pccard
611.if ${MK_OFED} != "no" || defined(ALL_MODULES)
612_rdma=		rdma
613.endif
614_safe=		safe
615_scsi_low=	scsi_low
616_speaker=	speaker
617_splash=	splash
618_sppp=		sppp
619_vmware=	vmware
620_vxge=  	vxge
621_wbwd=		wbwd
622_wi=		wi
623_xe=		xe
624
625_aac=		aac
626_aacraid=	aacraid
627_acpi=		acpi
628.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
629_aesni=		aesni
630.endif
631_amd_ecc_inject=amd_ecc_inject
632_amdsbwd=	amdsbwd
633_amdsmn=	amdsmn
634_amdtemp=	amdtemp
635_arcmsr=	arcmsr
636_asmc=		asmc
637_bytgpio=	bytgpio
638_ciss=		ciss
639_chromebook_platform=	chromebook_platform
640_cmx=		cmx
641_coretemp=	coretemp
642.if ${MK_SOURCELESS_HOST} != "no"
643_hpt27xx=	hpt27xx
644.endif
645_hptiop=	hptiop
646.if ${MK_SOURCELESS_HOST} != "no"
647_hptmv=		hptmv
648_hptnr=		hptnr
649_hptrr=		hptrr
650.endif
651_hyperv=	hyperv
652_ichwd=		ichwd
653_ida=		ida
654_iir=		iir
655_intelspi=	intelspi
656_ipmi=		ipmi
657_ips=		ips
658_isci=		isci
659_ipw=		ipw
660_iwi=		iwi
661_iwm=		iwm
662_iwn=		iwn
663_ixgb=		ixgb
664.if ${MK_SOURCELESS_UCODE} != "no"
665_ipwfw=		ipwfw
666_iwifw=		iwifw
667_iwmfw=		iwmfw
668_iwnfw=		iwnfw
669.endif
670_mlx4=		mlx4
671_mlx5=		mlx5
672.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
673	defined(ALL_MODULES)
674_mlx4en=	mlx4en
675_mlx5en=	mlx5en
676.endif
677.if ${MK_OFED} != "no" || defined(ALL_MODULES)
678_mlx4ib=	mlx4ib
679_mlx5ib=	mlx5ib
680.endif
681_mly=		mly
682_nfe=		nfe
683_nvd=		nvd
684_nvme=		nvme
685_nvram=		nvram
686_nxge=		nxge
687.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
688_padlock=	padlock
689_padlock_rng=	padlock_rng
690_rdrand_rng=	rdrand_rng
691.endif
692_s3=		s3
693_sdhci_acpi=	sdhci_acpi
694_tpm=		tpm
695_twa=		twa
696_vesa=		vesa
697_viawd=		viawd
698_virtio=	virtio
699_wpi=		wpi
700.if ${MK_SOURCELESS_UCODE} != "no"
701_wpifw=		wpifw
702.endif
703_x86bios=	x86bios
704.endif
705
706.if ${MACHINE_CPUARCH} == "amd64"
707_ccp=		ccp
708_efirt=		efirt
709_ioat=		ioat
710_ixl=		ixl
711_ixlv=		ixlv
712_linux64=	linux64
713_linux_common=	linux_common
714_ntb=		ntb
715_pms=		pms
716_qlxge=		qlxge
717_qlxgb=		qlxgb
718.if ${MK_SOURCELESS_UCODE} != "no"
719_qlxgbe=	qlxgbe
720_qlnx=		qlnx
721.endif
722_sfxge=		sfxge
723_sgx=		sgx
724_sgx_linux=	sgx_linux
725
726.if ${MK_BHYVE} != "no" || defined(ALL_MODULES)
727_vmm=		vmm
728.endif
729.endif
730
731.if ${MACHINE_CPUARCH} == "i386"
732# XXX some of these can move to the general case when de-i386'ed
733# XXX some of these can move now, but are untested on other architectures.
734_3dfx=		3dfx
735_3dfx_linux=	3dfx_linux
736_aic=		aic
737_apm=		apm
738_arcnet=	arcnet
739.if ${MK_SOURCELESS_UCODE} != "no"
740_ce=		ce
741.endif
742_coff=		coff
743.if ${MK_SOURCELESS_UCODE} != "no"
744_cp=		cp
745.endif
746_glxiic=	glxiic
747_glxsb=		glxsb
748#_ibcs2=		ibcs2
749_mse=		mse
750_ncr=		ncr
751_ncv=		ncv
752_nsp=		nsp
753_pcfclock=	pcfclock
754_pst=		pst
755_sbni=		sbni
756_stg=		stg
757_cm=		cm
758.if ${MK_SOURCELESS_UCODE} != "no"
759_ctau=		ctau
760.endif
761_dpt=		dpt
762_ex=		ex
763.endif
764
765.if ${MACHINE_CPUARCH} == "arm"
766_cfi=		cfi
767_cpsw=		cpsw
768.endif
769
770.if ${MACHINE_CPUARCH} == "powerpc"
771_agp=		agp
772_an=		an
773_bm=		bm
774_cardbus=	cardbus
775_cbb=		cbb
776_cfi=		cfi
777_cpufreq=	cpufreq
778_drm=		drm
779_exca=		exca
780_ffec=		ffec
781_pccard=	pccard
782_wi=		wi
783.endif
784
785.if ${MACHINE_ARCH} == "powerpc64"
786_drm2=		drm2
787.endif
788.if ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "powerpc"
789# Don't build powermac_nvram for powerpcspe, it's never supported.
790_nvram=		powermac_nvram
791.endif
792
793.if ${MACHINE_CPUARCH} == "sparc64"
794_auxio=		auxio
795_em=		em
796_epic=		epic
797.endif
798
799.if (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
800     ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "i386")
801_cloudabi32=	cloudabi32
802.endif
803.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
804_cloudabi64=	cloudabi64
805.endif
806
807.endif
808
809.if ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "aarch64"
810_bcm283x_clkman=  bcm283x_clkman
811_bcm283x_pwm=  bcm283x_pwm
812.endif
813
814.if ${MACHINE_ARCH:Marmv[67]*} != ""
815_ffec=		ffec
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