xref: /freebsd-12.1/sys/modules/Makefile (revision 1031d839)
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	epoch_test \
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	${_ixl} \
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	libmchain \
222	${_linprocfs} \
223	${_linsysfs} \
224	${_linux} \
225	${_linux_common} \
226	${_linux64} \
227	linuxkpi \
228	${_lio} \
229	lpt \
230	mac_biba \
231	mac_bsdextended \
232	mac_ifoff \
233	mac_lomac \
234	mac_mls \
235	mac_none \
236	mac_partition \
237	mac_portacl \
238	mac_seeotheruids \
239	mac_stub \
240	mac_test \
241	malo \
242	md \
243	mdio \
244	mem \
245	mfi \
246	mii \
247	mlx \
248	${_mlx4} \
249	${_mlx4ib} \
250	${_mlx4en} \
251	${_mlx5} \
252	${_mlx5en} \
253	${_mlx5ib} \
254	${_mly} \
255	mmc \
256	mmcsd \
257	mpr \
258	mps \
259	mpt \
260	mqueue \
261	mrsas \
262	msdosfs \
263	msdosfs_iconv \
264	${_mse} \
265	msk \
266	${_mthca} \
267	mvs \
268	mwl \
269	${_mwlfw} \
270	mxge \
271	my \
272	${_nandfs} \
273	${_nandsim} \
274	${_ncr} \
275	${_nctgpio} \
276	${_ncv} \
277	${_ndis} \
278	${_netgraph} \
279	${_nfe} \
280	nfscl \
281	nfscommon \
282	nfsd \
283	nfslock \
284	nfslockd \
285	nfssvc \
286	nge \
287	nmdm \
288	${_nsp} \
289	nullfs \
290	${_ntb} \
291	${_nvd} \
292	${_nvme} \
293	${_nvram} \
294	oce \
295	${_ocs_fc} \
296	otus \
297	${_otusfw} \
298	ow \
299	${_padlock} \
300	${_padlock_rng} \
301	${_pccard} \
302	${_pcfclock} \
303	pcn \
304	${_pf} \
305	${_pflog} \
306	${_pfsync} \
307	plip \
308	${_pms} \
309	ppbus \
310	ppc \
311	ppi \
312	pps \
313	procfs \
314	proto \
315	pseudofs \
316	${_pst} \
317	pty  \
318	puc \
319	${_qlxge} \
320	${_qlxgb} \
321	${_qlxgbe} \
322	${_qlnx} \
323	ral \
324	${_ralfw} \
325	${_random_fortuna} \
326	${_random_yarrow} \
327	${_random_other} \
328	rc4 \
329	${_rdma} \
330	${_rdrand_rng} \
331	re \
332	rl \
333	${_rockchip} \
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	${_smartpqi} \
358	smbfs \
359	sn \
360	snp \
361	sound \
362	${_speaker} \
363	spi \
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	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_allwinner=	allwinner
563_armv8crypto=	armv8crypto
564_efirt=		efirt
565_em=		em
566_rockchip=	rockchip
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_ocs_fc=	ocs_fc
613_pccard=	pccard
614.if ${MK_OFED} != "no" || defined(ALL_MODULES)
615_rdma=		rdma
616.endif
617_safe=		safe
618_scsi_low=	scsi_low
619_speaker=	speaker
620_splash=	splash
621_sppp=		sppp
622_vmware=	vmware
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.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} > 40201
632_aesni=		aesni
633.endif
634.endif
635_amd_ecc_inject=amd_ecc_inject
636_amdsbwd=	amdsbwd
637_amdsmn=	amdsmn
638_amdtemp=	amdtemp
639_arcmsr=	arcmsr
640_asmc=		asmc
641.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
642_blake2=	blake2
643.endif
644_bytgpio=	bytgpio
645_chvgpio=	chvgpio
646_ciss=		ciss
647_chromebook_platform=	chromebook_platform
648_cmx=		cmx
649_coretemp=	coretemp
650.if ${MK_SOURCELESS_HOST} != "no"
651_hpt27xx=	hpt27xx
652.endif
653_hptiop=	hptiop
654.if ${MK_SOURCELESS_HOST} != "no"
655_hptmv=		hptmv
656_hptnr=		hptnr
657_hptrr=		hptrr
658.endif
659_hyperv=	hyperv
660_ichwd=		ichwd
661_ida=		ida
662_iir=		iir
663_intelspi=	intelspi
664_ipmi=		ipmi
665_ips=		ips
666_isci=		isci
667_ipw=		ipw
668_iwi=		iwi
669_iwm=		iwm
670_iwn=		iwn
671.if ${MK_SOURCELESS_UCODE} != "no"
672_ipwfw=		ipwfw
673_iwifw=		iwifw
674_iwmfw=		iwmfw
675_iwnfw=		iwnfw
676.endif
677_mlx4=		mlx4
678_mlx5=		mlx5
679.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
680	defined(ALL_MODULES)
681_mlx4en=	mlx4en
682_mlx5en=	mlx5en
683.endif
684.if ${MK_OFED} != "no" || defined(ALL_MODULES)
685_mthca=		mthca
686_mlx4ib=	mlx4ib
687_mlx5ib=	mlx5ib
688.endif
689_mly=		mly
690_nfe=		nfe
691_nvd=		nvd
692_nvme=		nvme
693_nvram=		nvram
694.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
695_padlock=	padlock
696_padlock_rng=	padlock_rng
697_rdrand_rng=	rdrand_rng
698.endif
699_s3=		s3
700_sdhci_acpi=	sdhci_acpi
701_tpm=		tpm
702_twa=		twa
703_vesa=		vesa
704_viawd=		viawd
705_virtio=	virtio
706_wpi=		wpi
707.if ${MK_SOURCELESS_UCODE} != "no"
708_wpifw=		wpifw
709.endif
710_x86bios=	x86bios
711.endif
712
713.if ${MACHINE_CPUARCH} == "amd64"
714_ccp=		ccp
715_efirt=		efirt
716_ioat=		ioat
717_ixl=		ixl
718_ixlv=		ixlv
719_linux64=	linux64
720_linux_common=	linux_common
721_ntb=		ntb
722_pms=		pms
723_qlxge=		qlxge
724_qlxgb=		qlxgb
725.if ${MK_SOURCELESS_UCODE} != "no"
726_qlxgbe=	qlxgbe
727_qlnx=		qlnx
728.endif
729_sfxge=		sfxge
730_sgx=		sgx
731_sgx_linux=	sgx_linux
732_smartpqi=	smartpqi
733
734.if ${MK_BHYVE} != "no" || defined(ALL_MODULES)
735_vmm=		vmm
736.endif
737.endif
738
739.if ${MACHINE_CPUARCH} == "i386"
740# XXX some of these can move to the general case when de-i386'ed
741# XXX some of these can move now, but are untested on other architectures.
742_3dfx=		3dfx
743_3dfx_linux=	3dfx_linux
744_aic=		aic
745_apm=		apm
746.if ${MK_SOURCELESS_UCODE} != "no"
747_ce=		ce
748.endif
749_coff=		coff
750.if ${MK_SOURCELESS_UCODE} != "no"
751_cp=		cp
752.endif
753_glxiic=	glxiic
754_glxsb=		glxsb
755#_ibcs2=		ibcs2
756_mse=		mse
757_ncr=		ncr
758_ncv=		ncv
759_nsp=		nsp
760_pcfclock=	pcfclock
761_pst=		pst
762_sbni=		sbni
763_stg=		stg
764.if ${MK_SOURCELESS_UCODE} != "no"
765_ctau=		ctau
766.endif
767_dpt=		dpt
768_ex=		ex
769.endif
770
771.if ${MACHINE_CPUARCH} == "arm"
772_cfi=		cfi
773_cpsw=		cpsw
774.endif
775
776.if ${MACHINE_CPUARCH} == "powerpc"
777_agp=		agp
778_an=		an
779_bm=		bm
780_cardbus=	cardbus
781_cbb=		cbb
782_cfi=		cfi
783_cpufreq=	cpufreq
784_drm=		drm
785_exca=		exca
786_ffec=		ffec
787_nvd=		nvd
788_nvme=		nvme
789_pccard=	pccard
790_wi=		wi
791.endif
792
793.if ${MACHINE_ARCH} == "powerpc64"
794_drm2=		drm2
795.endif
796.if ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "powerpc"
797# Don't build powermac_nvram for powerpcspe, it's never supported.
798_nvram=		powermac_nvram
799.endif
800
801.if ${MACHINE_CPUARCH} == "sparc64"
802_auxio=		auxio
803_em=		em
804_epic=		epic
805.endif
806
807.if (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
808     ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "i386")
809_cloudabi32=	cloudabi32
810.endif
811.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
812_cloudabi64=	cloudabi64
813.endif
814
815.endif
816
817.if ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "aarch64"
818_bcm283x_clkman=  bcm283x_clkman
819_bcm283x_pwm=  bcm283x_pwm
820.endif
821
822SUBDIR+=${MODULES_EXTRA}
823
824.for reject in ${WITHOUT_MODULES}
825SUBDIR:= ${SUBDIR:N${reject}}
826.endfor
827
828# Calling kldxref(8) for each module is expensive.
829.if !defined(NO_XREF)
830.MAKEFLAGS+=	-DNO_XREF
831afterinstall: .PHONY
832	@if type kldxref >/dev/null 2>&1; then \
833		${ECHO} kldxref ${DESTDIR}${KMODDIR}; \
834		kldxref ${DESTDIR}${KMODDIR}; \
835	fi
836.endif
837
838.include "${SYSDIR}/conf/config.mk"
839
840SUBDIR:= ${SUBDIR:u:O}
841
842.include <bsd.subdir.mk>
843