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