xref: /freebsd/sys/modules/Makefile (revision da3086df1863e9aed45eb14e265c306f8bb27d80)
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	bfe \
64	bge \
65	bhnd \
66	${_bxe} \
67	${_bios} \
68	${_bktr} \
69	${_bm} \
70	bnxt \
71	bridgestp \
72	bwi \
73	bwn \
74	bwn_pci \
75	${_bytgpio} \
76	cam \
77	${_cardbus} \
78	${_carp} \
79	cas \
80	${_cbb} \
81	cc \
82	cd9660 \
83	cd9660_iconv \
84	${_ce} \
85	${_cfi} \
86	chacha20 \
87	${_chromebook_platform} \
88	${_ciss} \
89	cloudabi \
90	${_cloudabi32} \
91	${_cloudabi64} \
92	${_cm} \
93	${_cmx} \
94	${_coff} \
95	${_coretemp} \
96	${_cp} \
97	${_cpsw} \
98	${_cpuctl} \
99	${_cpufreq} \
100	${_crypto} \
101	${_cryptodev} \
102	${_cs} \
103	${_ctau} \
104	ctl \
105	${_cxgb} \
106	${_cxgbe} \
107	dc \
108	dcons \
109	dcons_crom \
110	de \
111	${_dpms} \
112	${_dpt} \
113	${_drm} \
114	${_drm2} \
115	dummynet \
116	${_ed} \
117	${_efirt} \
118	${_elink} \
119	${_em} \
120	${_ena} \
121	${_ep} \
122	${_epic} \
123	esp \
124	${_et} \
125	evdev \
126	${_ex} \
127	${_exca} \
128	ext2fs \
129	fdc \
130	fdescfs \
131	${_fe} \
132	${_ffec} \
133	filemon \
134	firewire \
135	firmware \
136	fuse \
137	${_fxp} \
138	gem \
139	geom \
140	${_glxiic} \
141	${_glxsb} \
142	gpio \
143	hifn \
144	hme \
145	${_hpt27xx} \
146	${_hptiop} \
147	${_hptmv} \
148	${_hptnr} \
149	${_hptrr} \
150	hwpmc \
151	${_hwpmc_mips24k} \
152	${_hwpmc_mips74k} \
153	${_hyperv} \
154	i2c \
155        ${_ibcore} \
156	${_ibcs2} \
157	${_ichwd} \
158	${_ida} \
159	if_bridge \
160	if_disc \
161	if_edsc \
162	${_if_enc} \
163	if_epair \
164	${_if_gif} \
165	${_if_gre} \
166	${_if_me} \
167	if_lagg \
168	${_if_ndis} \
169	${_if_stf} \
170	if_tap \
171	if_tun \
172	if_vlan \
173	if_vxlan \
174	${_iir} \
175	imgact_binmisc \
176	${_intelspi} \
177	${_io} \
178	${_ioat} \
179        ${_ipoib} \
180	${_ipdivert} \
181	${_ipfilter} \
182	${_ipfw} \
183	ipfw_nat \
184	${_ipfw_nat64} \
185	${_ipfw_nptv6} \
186	${_ipfw_pmod} \
187	${_ipmi} \
188	ip6_mroute_mod \
189	ip_mroute_mod \
190	${_ips} \
191	${_ipsec} \
192	${_ipw} \
193	${_ipwfw} \
194	${_isci} \
195	${_iser} \
196	isp \
197	${_ispfw} \
198	${_iwi} \
199	${_iwifw} \
200	${_iwm} \
201	${_iwmfw} \
202	${_iwn} \
203	${_iwnfw} \
204	${_ix} \
205	${_ixv} \
206	${_ixgb} \
207	${_ixl} \
208	${_ixlv} \
209	jme \
210	joy \
211	kbdmux \
212	kgssapi \
213	kgssapi_krb5 \
214	khelp \
215	krpc \
216	ksyms \
217	le \
218	lge \
219	libalias \
220	libiconv \
221	libmbpool \
222	libmchain \
223	${_linprocfs} \
224	${_linsysfs} \
225	${_linux} \
226	${_linux_common} \
227	${_linux64} \
228	linuxkpi \
229	lmc \
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	${_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	siba_bwn \
354	siftr \
355	siis \
356	sis \
357	sk \
358	smbfs \
359	sn \
360	snp \
361	sound \
362	${_speaker} \
363	spigen \
364	${_splash} \
365	${_sppp} \
366	ste \
367	${_stg} \
368	stge \
369	${_sym} \
370	${_syscons} \
371	sysvipc \
372	tcp \
373	${_ti} \
374	tl \
375	tmpfs \
376	${_toecore} \
377	${_tpm} \
378	trm \
379	${_twa} \
380	twe \
381	tws \
382	tx \
383	${_txp} \
384	uart \
385	ubsec \
386	udf \
387	udf_iconv \
388	ufs \
389	uinput \
390	unionfs \
391	usb \
392	${_vesa} \
393	${_virtio} \
394	vge \
395	${_viawd} \
396	videomode \
397	vkbd \
398	${_vmm} \
399	${_vmware} \
400	${_vpo} \
401	vr \
402	vte \
403	vx \
404	${_vxge} \
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:Marmv6*} != "") && \
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_armv8crypto=	armv8crypto
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_nctgpio=	nctgpio
606_ndis=		ndis
607_pccard=	pccard
608.if ${MK_OFED} != "no" || defined(ALL_MODULES)
609_rdma=		rdma
610.endif
611_safe=		safe
612_scsi_low=	scsi_low
613_speaker=	speaker
614_splash=	splash
615_sppp=		sppp
616_vmware=	vmware
617_vxge=  	vxge
618_wbwd=		wbwd
619_wi=		wi
620_xe=		xe
621
622_aac=		aac
623_aacraid=	aacraid
624_acpi=		acpi
625.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
626_aesni=		aesni
627.endif
628_amd_ecc_inject=amd_ecc_inject
629_amdsbwd=	amdsbwd
630_amdsmn=	amdsmn
631_amdtemp=	amdtemp
632_arcmsr=	arcmsr
633_asmc=		asmc
634_bytgpio=	bytgpio
635_ciss=		ciss
636_chromebook_platform=	chromebook_platform
637_cmx=		cmx
638_coretemp=	coretemp
639.if ${MK_SOURCELESS_HOST} != "no"
640_hpt27xx=	hpt27xx
641.endif
642_hptiop=	hptiop
643.if ${MK_SOURCELESS_HOST} != "no"
644_hptmv=		hptmv
645_hptnr=		hptnr
646_hptrr=		hptrr
647.endif
648_hyperv=	hyperv
649_ichwd=		ichwd
650_ida=		ida
651_iir=		iir
652_intelspi=	intelspi
653_ipmi=		ipmi
654_ips=		ips
655_isci=		isci
656_ipw=		ipw
657_iwi=		iwi
658_iwm=		iwm
659_iwn=		iwn
660_ixgb=		ixgb
661.if ${MK_SOURCELESS_UCODE} != "no"
662_ipwfw=		ipwfw
663_iwifw=		iwifw
664_iwmfw=		iwmfw
665_iwnfw=		iwnfw
666.endif
667_mlx4=		mlx4
668_mlx5=		mlx5
669.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
670	defined(ALL_MODULES)
671_mlx4en=	mlx4en
672_mlx5en=	mlx5en
673.endif
674.if ${MK_OFED} != "no" || defined(ALL_MODULES)
675_mlx4ib=	mlx4ib
676_mlx5ib=	mlx5ib
677.endif
678_mly=		mly
679.if ${MK_OFED} != "no" || defined(ALL_MODULES)
680_mthca=		mthca
681.endif
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_efirt=		efirt
708_ioat=		ioat
709_ixl=		ixl
710_ixlv=		ixlv
711_linux64=	linux64
712_linux_common=	linux_common
713_ntb=		ntb
714_pms=		pms
715_qlxge=		qlxge
716_qlxgb=		qlxgb
717.if ${MK_SOURCELESS_UCODE} != "no"
718_qlxgbe=	qlxgbe
719.endif
720_qlnx=		qlnx
721_sfxge=		sfxge
722_sgx=		sgx
723_sgx_linux=	sgx_linux
724
725.if ${MK_BHYVE} != "no" || defined(ALL_MODULES)
726_vmm=		vmm
727.endif
728.endif
729
730.if ${MACHINE_CPUARCH} == "i386"
731# XXX some of these can move to the general case when de-i386'ed
732# XXX some of these can move now, but are untested on other architectures.
733_3dfx=		3dfx
734_3dfx_linux=	3dfx_linux
735_aic=		aic
736_apm=		apm
737_arcnet=	arcnet
738.if ${MK_SOURCELESS_UCODE} != "no"
739_ce=		ce
740.endif
741_coff=		coff
742.if ${MK_SOURCELESS_UCODE} != "no"
743_cp=		cp
744.endif
745_elink=		elink
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} == "amd64" || ${MACHINE_ARCH} == "armv6" || \
800     ${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} == "armv6"
810_ffec=		ffec
811.endif
812
813SUBDIR+=${MODULES_EXTRA}
814
815.for reject in ${WITHOUT_MODULES}
816SUBDIR:= ${SUBDIR:N${reject}}
817.endfor
818
819# Calling kldxref(8) for each module is expensive.
820.if !defined(NO_XREF)
821.MAKEFLAGS+=	-DNO_XREF
822afterinstall: .PHONY
823	@if type kldxref >/dev/null 2>&1; then \
824		${ECHO} kldxref ${DESTDIR}${KMODDIR}; \
825		kldxref ${DESTDIR}${KMODDIR}; \
826	fi
827.endif
828
829.include "${SYSDIR}/conf/config.mk"
830
831SUBDIR:= ${SUBDIR:u:O}
832
833.include <bsd.subdir.mk>
834