xref: /freebsd-12.1/sys/modules/Makefile (revision 8a9ab042)
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	${_armv8crypto} \
46	${_asmc} \
47	ata \
48	ath \
49	ath_dfs \
50	ath_hal \
51	ath_hal_ar5210 \
52	ath_hal_ar5211 \
53	ath_hal_ar5212 \
54	ath_hal_ar5416 \
55	ath_hal_ar9300 \
56	ath_main \
57	ath_rate \
58	ath_pci \
59	${_autofs} \
60	${_auxio} \
61	${_bce} \
62	${_bcm283x_clkman} \
63	${_bcm283x_pwm} \
64	bfe \
65	bge \
66	bhnd \
67	${_bxe} \
68	${_bios} \
69	${_bktr} \
70	${_blake2} \
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	${_chromebook_platform} \
90	${_ciss} \
91	cloudabi \
92	${_cloudabi32} \
93	${_cloudabi64} \
94	${_cmx} \
95	${_coff} \
96	${_coretemp} \
97	${_cp} \
98	${_cpsw} \
99	${_cpuctl} \
100	${_cpufreq} \
101	${_crypto} \
102	${_cryptodev} \
103	${_cs} \
104	${_ctau} \
105	ctl \
106	${_cxgb} \
107	${_cxgbe} \
108	dc \
109	dcons \
110	dcons_crom \
111	de \
112	${_dpms} \
113	${_dpt} \
114	${_drm} \
115	${_drm2} \
116	dummynet \
117	${_ed} \
118	${_efirt} \
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	${_ixl} \
207	${_ixlv} \
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	${_nxge} \
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	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	${_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_ocs_fc=	ocs_fc
611_pccard=	pccard
612.if ${MK_OFED} != "no" || defined(ALL_MODULES)
613_rdma=		rdma
614.endif
615_safe=		safe
616_scsi_low=	scsi_low
617_speaker=	speaker
618_splash=	splash
619_sppp=		sppp
620_vmware=	vmware
621_vxge=  	vxge
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_aesni=		aesni
631.endif
632_amd_ecc_inject=amd_ecc_inject
633_amdsbwd=	amdsbwd
634_amdsmn=	amdsmn
635_amdtemp=	amdtemp
636_arcmsr=	arcmsr
637_asmc=		asmc
638.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
639_blake2=	blake2
640.endif
641_bytgpio=	bytgpio
642_chvgpio=	chvgpio
643_ciss=		ciss
644_chromebook_platform=	chromebook_platform
645_cmx=		cmx
646_coretemp=	coretemp
647.if ${MK_SOURCELESS_HOST} != "no"
648_hpt27xx=	hpt27xx
649.endif
650_hptiop=	hptiop
651.if ${MK_SOURCELESS_HOST} != "no"
652_hptmv=		hptmv
653_hptnr=		hptnr
654_hptrr=		hptrr
655.endif
656_hyperv=	hyperv
657_ichwd=		ichwd
658_ida=		ida
659_iir=		iir
660_intelspi=	intelspi
661_ipmi=		ipmi
662_ips=		ips
663_isci=		isci
664_ipw=		ipw
665_iwi=		iwi
666_iwm=		iwm
667_iwn=		iwn
668.if ${MK_SOURCELESS_UCODE} != "no"
669_ipwfw=		ipwfw
670_iwifw=		iwifw
671_iwmfw=		iwmfw
672_iwnfw=		iwnfw
673.endif
674_mlx4=		mlx4
675_mlx5=		mlx5
676.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
677	defined(ALL_MODULES)
678_mlx4en=	mlx4en
679_mlx5en=	mlx5en
680.endif
681.if ${MK_OFED} != "no" || defined(ALL_MODULES)
682_mthca=		mthca
683_mlx4ib=	mlx4ib
684_mlx5ib=	mlx5ib
685.endif
686_mly=		mly
687_nfe=		nfe
688_nvd=		nvd
689_nvme=		nvme
690_nvram=		nvram
691_nxge=		nxge
692.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
693_padlock=	padlock
694_padlock_rng=	padlock_rng
695_rdrand_rng=	rdrand_rng
696.endif
697_s3=		s3
698_sdhci_acpi=	sdhci_acpi
699_tpm=		tpm
700_twa=		twa
701_vesa=		vesa
702_viawd=		viawd
703_virtio=	virtio
704_wpi=		wpi
705.if ${MK_SOURCELESS_UCODE} != "no"
706_wpifw=		wpifw
707.endif
708_x86bios=	x86bios
709.endif
710
711.if ${MACHINE_CPUARCH} == "amd64"
712_ccp=		ccp
713_efirt=		efirt
714_ioat=		ioat
715_ixl=		ixl
716_ixlv=		ixlv
717_linux64=	linux64
718_linux_common=	linux_common
719_ntb=		ntb
720_pms=		pms
721_qlxge=		qlxge
722_qlxgb=		qlxgb
723.if ${MK_SOURCELESS_UCODE} != "no"
724_qlxgbe=	qlxgbe
725_qlnx=		qlnx
726.endif
727_sfxge=		sfxge
728_sgx=		sgx
729_sgx_linux=	sgx_linux
730_smartpqi=	smartpqi
731
732.if ${MK_BHYVE} != "no" || defined(ALL_MODULES)
733_vmm=		vmm
734.endif
735.endif
736
737.if ${MACHINE_CPUARCH} == "i386"
738# XXX some of these can move to the general case when de-i386'ed
739# XXX some of these can move now, but are untested on other architectures.
740_3dfx=		3dfx
741_3dfx_linux=	3dfx_linux
742_aic=		aic
743_apm=		apm
744.if ${MK_SOURCELESS_UCODE} != "no"
745_ce=		ce
746.endif
747_coff=		coff
748.if ${MK_SOURCELESS_UCODE} != "no"
749_cp=		cp
750.endif
751_glxiic=	glxiic
752_glxsb=		glxsb
753#_ibcs2=		ibcs2
754_mse=		mse
755_ncr=		ncr
756_ncv=		ncv
757_nsp=		nsp
758_pcfclock=	pcfclock
759_pst=		pst
760_sbni=		sbni
761_stg=		stg
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