xref: /freebsd-11-stable/sys/modules/Makefile (revision f2369adeb5e330158ea0cb804fff62dec5591cca)
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.include "${SYSDIR}/conf/config.mk"
12
13.if defined(MODULES_OVERRIDE) && !defined(ALL_MODULES)
14SUBDIR=${MODULES_OVERRIDE}
15.else
16SUBDIR=	\
17	${_3dfx} \
18	${_3dfx_linux} \
19	${_aac} \
20	${_aacraid} \
21	accf_data \
22	accf_dns \
23	accf_http \
24	acl_nfs4 \
25	acl_posix1e \
26	${_acpi} \
27	ae \
28	${_aesni} \
29	age \
30	${_agp} \
31	aha \
32	${_ahb} \
33	ahci \
34	${_aic} \
35	aic7xxx \
36	alc \
37	ale \
38	alq \
39	${_amd_ecc_inject} \
40	${_amdgpio} \
41	${_amdsbwd} \
42	${_amdsmn} \
43	${_amdtemp} \
44	amr \
45	${_an} \
46	${_aout} \
47	${_apm} \
48	${_arcmsr} \
49	${_arcnet} \
50	${_asmc} \
51	ata \
52	ath \
53	ath_pci \
54	${_autofs} \
55	${_auxio} \
56	${_bce} \
57	bfe \
58	bge \
59	bhnd \
60	${_bxe} \
61	${_bios} \
62	${_bktr} \
63	${_bm} \
64	bnxt \
65	bridgestp \
66	bwi \
67	bwn \
68	bwn_pci \
69	${_bytgpio} \
70	${_chvgpio} \
71	cam \
72	${_canbepm} \
73	${_canbus} \
74	${_cardbus} \
75	${_carp} \
76	cas \
77	${_cbb} \
78	cc \
79	cd9660 \
80	cd9660_iconv \
81	${_ce} \
82	${_cfi} \
83	${_chromebook_platform} \
84	${_ciss} \
85	cloudabi \
86	${_cloudabi32} \
87	${_cloudabi64} \
88	${_cm} \
89	${_cmx} \
90	${_coff} \
91	${_coretemp} \
92	${_cp} \
93	${_cpsw} \
94	${_cpuctl} \
95	${_cpufreq} \
96	${_crypto} \
97	${_cryptodev} \
98	${_cs} \
99	${_ct} \
100	${_ctau} \
101	ctl \
102	${_cxgb} \
103	${_cxgbe} \
104	dc \
105	dcons \
106	dcons_crom \
107	de \
108	${_dpms} \
109	${_dpt} \
110	${_drm} \
111	${_drm2} \
112	dummynet \
113	${_ed} \
114	${_efirt} \
115	${_elink} \
116	${_em} \
117	${_ena} \
118	en \
119	${_ep} \
120	${_epic} \
121	esp \
122	${_et} \
123	evdev \
124	${_ex} \
125	${_exca} \
126	ext2fs \
127	${_fatm} \
128	fdc \
129	fdescfs \
130	${_fe} \
131	${_ffec} \
132	filemon \
133	firewire \
134	firmware \
135	fuse \
136	${_fxp} \
137	gem \
138	geom \
139	${_glxiic} \
140	${_glxsb} \
141	gpio \
142	hatm \
143	hifn \
144	hme \
145	${_hpt27xx} \
146	${_hptiop} \
147	${_hptmv} \
148	${_hptnr} \
149	${_hptrr} \
150	hwpmc \
151	${_hyperv} \
152	i2c \
153        ${_ibcore} \
154	${_ibcs2} \
155	${_ichwd} \
156	${_ida} \
157	${_ie} \
158	if_bridge \
159	if_disc \
160	if_edsc \
161	${_if_enc} \
162	if_epair \
163	${_if_gif} \
164	${_if_gre} \
165	${_if_me} \
166	if_lagg \
167	${_if_ndis} \
168	${_if_stf} \
169	if_tap \
170	if_tun \
171	if_vlan \
172	if_vxlan \
173	${_igb} \
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	${_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	mcd \
245	md \
246	mdio \
247	mem \
248	mfi \
249	mii \
250	mlx \
251	mlxfw \
252	${_mlx4} \
253	${_mlx4ib} \
254	${_mlx4en} \
255	${_mlx5} \
256	${_mlx5en} \
257	${_mlx5ib} \
258	${_mly} \
259	mmc \
260	mmcsd \
261	mpr \
262	mps \
263	mpt \
264	mqueue \
265	mrsas \
266	msdosfs \
267	msdosfs_iconv \
268	${_mse} \
269	msk \
270	${_mthca} \
271	mvs \
272	mwl \
273	${_mwlfw} \
274	mxge \
275	my \
276	${_nandfs} \
277	${_nandsim} \
278	${_ncr} \
279	${_nctgpio} \
280	${_ncv} \
281	${_ndis} \
282	netfpga10g \
283	${_netgraph} \
284	${_nfe} \
285	nfscl \
286	nfscommon \
287	nfsd \
288	nfslock \
289	nfslockd \
290	nfssvc \
291	nge \
292	nmdm \
293	${_nsp} \
294	nullfs \
295	${_ntb} \
296	${_nvd} \
297	${_nvme} \
298	${_nvram} \
299	${_nxge} \
300	oce \
301	${_ocs_fc} \
302	otus \
303	${_otusfw} \
304	ow \
305	${_padlock} \
306	${_padlock_rng} \
307	patm \
308	${_pccard} \
309	${_pcfclock} \
310	pcn \
311	${_pf} \
312	${_pflog} \
313	${_pfsync} \
314	plip \
315	${_pmc} \
316	${_pms} \
317	ppbus \
318	ppc \
319	ppi \
320	pps \
321	procfs \
322	proto \
323	pseudofs \
324	${_pst} \
325	pty  \
326	puc \
327	${_qlxge} \
328	${_qlxgb} \
329	${_qlxgbe} \
330	${_qlnx} \
331	ral \
332	${_ralfw} \
333	${_random_fortuna} \
334	${_random_yarrow} \
335	${_random_other} \
336	rc4 \
337	${_rdma} \
338	${_rdrand_rng} \
339	re \
340	rl \
341	rtwn \
342	${_rtwnfw} \
343	${_s3} \
344	${_safe} \
345	${_sbni} \
346	scc \
347	scd \
348	${_scsi_low} \
349	sdhci \
350	${_sdhci_acpi} \
351	sdhci_pci \
352	sem \
353	send \
354	${_sf} \
355	${_sfxge} \
356	sge \
357	${_si} \
358	siba_bwn \
359	siftr \
360	siis \
361	sis \
362	sk \
363	${_smartpqi} \
364	smbfs \
365	sn \
366	${_snc} \
367	snp \
368	sound \
369	${_speaker} \
370	spi \
371	${_splash} \
372	${_sppp} \
373	ste \
374	${_stg} \
375	stge \
376	${_streams} \
377	${_sume} \
378	${_svr4} \
379	${_sym} \
380	${_syscons} \
381	sysvipc \
382	tcp \
383	${_ti} \
384	tl \
385	tmpfs \
386	${_toecore} \
387	${_tpm} \
388	trm \
389	${_twa} \
390	twe \
391	tws \
392	tx \
393	${_txp} \
394	uart \
395	ubsec \
396	udf \
397	udf_iconv \
398	ufs \
399	uinput \
400	unionfs \
401	urtwn \
402	${_urtwnfw} \
403	usb \
404	utopia \
405	${_vesa} \
406	${_virtio} \
407	vge \
408	${_viawd} \
409	videomode \
410	vkbd \
411	${_vmm} \
412	${_vmware} \
413	${_vpo} \
414	vr \
415	vte \
416	vx \
417	${_vxge} \
418	wb \
419	${_wbwd} \
420	${_wds} \
421	${_wi} \
422	${_wl} \
423	wlan \
424	wlan_acl \
425	wlan_amrr \
426	wlan_ccmp \
427	wlan_rssadapt \
428	wlan_tkip \
429	wlan_wep \
430	wlan_xauth \
431	${_wpi} \
432	${_wpifw} \
433	${_x86bios} \
434	${_xe} \
435	xl \
436	xz \
437	zlib
438
439.if ${MK_AUTOFS} != "no" || defined(ALL_MODULES)
440_autofs=	autofs
441.endif
442
443.if ${MK_CDDL} != "no" || defined(ALL_MODULES)
444.if (${MACHINE_CPUARCH} != "arm" || ${MACHINE_ARCH:Marmv6*} != "") && \
445	${MACHINE_CPUARCH} != "mips" && \
446	${MACHINE_CPUARCH} != "sparc64"
447SUBDIR+=	dtrace
448.endif
449SUBDIR+=	opensolaris
450.endif
451
452.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
453.if exists(${SRCTOP}/sys/opencrypto)
454_crypto=	crypto
455_cryptodev=	cryptodev
456_random_fortuna=random_fortuna
457_random_yarrow=	random_yarrow
458_random_other=	random_other
459.endif
460.endif
461
462.if ${MK_CUSE} != "no" || defined(ALL_MODULES)
463SUBDIR+=	cuse
464.endif
465
466.if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \
467	defined(ALL_MODULES)
468_carp=		carp
469_toecore=	toecore
470_if_enc=	if_enc
471_if_gif=	if_gif
472_if_gre=	if_gre
473_ipfw_pmod=	ipfw_pmod
474.if ${KERN_OPTS:MIPSEC_SUPPORT} && !${KERN_OPTS:MIPSEC}
475_ipsec=		ipsec
476.endif
477.endif
478
479.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
480	defined(ALL_MODULES)
481_if_stf=	if_stf
482.endif
483
484.if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES)
485_if_me=		if_me
486_ipdivert=	ipdivert
487_ipfw=		ipfw
488.if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
489_ipfw_nat64=	ipfw_nat64
490.endif
491.endif
492
493.if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
494_ipfw_nptv6=	ipfw_nptv6
495.endif
496
497.if ${MK_IPFILTER} != "no" || defined(ALL_MODULES)
498_ipfilter=	ipfilter
499.endif
500
501.if ${MK_ISCSI} != "no" || defined(ALL_MODULES)
502SUBDIR+=	cfiscsi
503SUBDIR+=	iscsi
504SUBDIR+=	iscsi_initiator
505.endif
506
507.if !empty(OPT_FDT)
508SUBDIR+=	fdt
509.endif
510
511.if ${MK_NAND} != "no" || defined(ALL_MODULES)
512_nandfs=	nandfs
513_nandsim=	nandsim
514.endif
515
516.if ${MK_NETGRAPH} != "no" || defined(ALL_MODULES)
517_netgraph=	netgraph
518.endif
519
520.if (${MK_PF} != "no" && (${MK_INET_SUPPORT} != "no" || \
521	${MK_INET6_SUPPORT} != "no")) || defined(ALL_MODULES)
522_pf=		pf
523_pflog=		pflog
524.if ${MK_INET_SUPPORT} != "no"
525_pfsync=	pfsync
526.endif
527.endif
528
529.if ${MK_SOURCELESS_UCODE} != "no"
530_bce=		bce
531_fatm=		fatm
532_fxp=		fxp
533_ispfw=		ispfw
534_mwlfw=		mwlfw
535_otusfw=	otusfw
536_ralfw=		ralfw
537_rtwnfw=	rtwnfw
538_urtwnfw=	urtwnfw
539_sf=		sf
540_ti=		ti
541_txp=		txp
542.endif
543
544.if ${MK_SOURCELESS_UCODE} != "no" && ${MACHINE_CPUARCH} != "arm" && \
545	${MACHINE_ARCH:C/mips(el)?/mips/} != "mips" && \
546	${MACHINE_ARCH} != "powerpc" && ${MACHINE_CPUARCH} != "riscv"
547_cxgbe=		cxgbe
548.endif
549
550.if ${MK_TESTS} != "no" || defined(ALL_MODULES)
551SUBDIR+=	tests
552.endif
553
554.if ${MK_ZFS} != "no" || defined(ALL_MODULES)
555SUBDIR+=	zfs
556.endif
557
558.if ${MACHINE_CPUARCH} != "aarch64" && ${MACHINE_CPUARCH} != "arm" && \
559	${MACHINE_CPUARCH} != "mips" && ${MACHINE_CPUARCH} != "powerpc" && \
560	${MACHINE_CPUARCH} != "riscv"
561_syscons=	syscons
562_vpo=		vpo
563.endif
564
565.if ${MACHINE_CPUARCH} != "mips"
566# no BUS_SPACE_UNSPECIFIED
567# No barrier instruction support (specific to this driver)
568_sym=		sym
569# intr_disable() is a macro, causes problems
570.if ${MK_SOURCELESS_UCODE} != "no"
571_cxgb=		cxgb
572.endif
573.endif
574
575.if ${MACHINE_CPUARCH} == "aarch64"
576_em=		em
577_igb=		igb
578.endif
579
580.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
581_agp=		agp
582_an=		an
583_aout=		aout
584_bios=		bios
585_bktr=		bktr
586.if ${MK_SOURCELESS_UCODE} != "no"
587_bxe=		bxe
588.endif
589_cardbus=	cardbus
590_cbb=		cbb
591_cpuctl=	cpuctl
592_cpufreq=	cpufreq
593_cs=		cs
594_dpms=		dpms
595_drm=		drm
596_drm2=		drm2
597_ed=		ed
598_em=		em
599_ena=		ena
600_ep=		ep
601_et=		et
602_exca=		exca
603_fe=		fe
604.if ${MK_OFED} != "no" || defined(ALL_MODULES)
605_ibcore=        ibcore
606.endif
607_if_ndis=	if_ndis
608_igb=		igb
609_io=		io
610.if ${MK_OFED} != "no" || defined(ALL_MODULES)
611_ipoib=         ipoib
612_iser=		iser
613.endif
614_ix=		ix
615_ixv=		ixv
616_linprocfs=	linprocfs
617_linsysfs=	linsysfs
618_linux=		linux
619.if ${MK_SOURCELESS_UCODE} != "no"
620_lio=		lio
621.endif
622_nctgpio=	nctgpio
623_ndis=		ndis
624_ocs_fc=	ocs_fc
625_pccard=	pccard
626.if ${MK_OFED} != "no" || defined(ALL_MODULES)
627_rdma=		rdma
628.endif
629_safe=		safe
630_scsi_low=	scsi_low
631_si=		si
632_speaker=	speaker
633_splash=	splash
634_sppp=		sppp
635_vmware=	vmware
636_vxge=  	vxge
637_wbwd=		wbwd
638_wi=		wi
639_xe=		xe
640.if ${MACHINE} != "pc98"
641_aac=		aac
642_aacraid=	aacraid
643_acpi=		acpi
644.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
645.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} > 40201
646_aesni=		aesni
647.endif
648.endif
649_amd_ecc_inject=amd_ecc_inject
650_amdsbwd=	amdsbwd
651_amdsmn=	amdsmn
652_amdtemp=	amdtemp
653_arcmsr=	arcmsr
654_asmc=		asmc
655_bytgpio=	bytgpio
656_chvgpio=	chvgpio
657_ciss=		ciss
658_chromebook_platform=	chromebook_platform
659_cmx=		cmx
660_coretemp=	coretemp
661.if ${MK_SOURCELESS_HOST} != "no"
662_hpt27xx=	hpt27xx
663.endif
664_hptiop=	hptiop
665.if ${MK_SOURCELESS_HOST} != "no"
666_hptmv=		hptmv
667_hptnr=		hptnr
668_hptrr=		hptrr
669.endif
670_hyperv=	hyperv
671_ichwd=		ichwd
672_ida=		ida
673_iir=		iir
674_intelspi=	intelspi
675_ipmi=		ipmi
676_ips=		ips
677_isci=		isci
678_ipw=		ipw
679_iwi=		iwi
680_iwm=		iwm
681_iwn=		iwn
682_ixgb=		ixgb
683.if ${MK_SOURCELESS_UCODE} != "no"
684_ipwfw=		ipwfw
685_iwifw=		iwifw
686_iwmfw=		iwmfw
687_iwnfw=		iwnfw
688.endif
689_mlx4=		mlx4
690_mlx5=		mlx5
691.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
692	defined(ALL_MODULES)
693_mlx4en=	mlx4en
694_mlx5en=	mlx5en
695.endif
696.if ${MK_OFED} != "no" || defined(ALL_MODULES)
697_mthca=		mthca
698_mlx4ib=	mlx4ib
699_mlx5ib=	mlx5ib
700.endif
701_mly=		mly
702_nfe=		nfe
703_nvd=		nvd
704_nvme=		nvme
705_nvram=		nvram
706_nxge=		nxge
707.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
708_padlock=	padlock
709_padlock_rng=	padlock_rng
710_rdrand_rng=	rdrand_rng
711.endif
712_s3=		s3
713_sdhci_acpi=	sdhci_acpi
714_tpm=		tpm
715_twa=		twa
716_vesa=		vesa
717_viawd=		viawd
718_virtio=	virtio
719_wpi=		wpi
720.if ${MK_SOURCELESS_UCODE} != "no"
721_wpifw=		wpifw
722.endif
723_x86bios=	x86bios
724.endif
725.endif
726
727.if ${MACHINE_CPUARCH} == "amd64"
728_amdgpio=	amdgpio
729_efirt=		efirt
730_ioat=		ioat
731_ixl=		ixl
732_ixlv=		ixlv
733_linux64=	linux64
734_linux_common=	linux_common
735_ntb=		ntb
736_pms=		pms
737_qlxge=		qlxge
738_qlxgb=		qlxgb
739_sume=		sume
740.if ${MK_SOURCELESS_UCODE} != "no"
741_qlxgbe=	qlxgbe
742_qlnx=		qlnx
743.endif
744_sfxge=		sfxge
745_smartpqi=	smartpqi
746
747.if ${MK_BHYVE} != "no" || defined(ALL_MODULES)
748_vmm=		vmm
749.endif
750.endif
751
752.if ${MACHINE_CPUARCH} == "i386"
753# XXX some of these can move to the general case when de-i386'ed
754# XXX some of these can move now, but are untested on other architectures.
755_3dfx=		3dfx
756_3dfx_linux=	3dfx_linux
757_aic=		aic
758_apm=		apm
759_arcnet=	arcnet
760.if ${MK_SOURCELESS_UCODE} != "no"
761_ce=		ce
762.endif
763_coff=		coff
764.if ${MK_SOURCELESS_UCODE} != "no"
765_cp=		cp
766.endif
767_elink=		elink
768_glxiic=	glxiic
769_glxsb=		glxsb
770#_ibcs2=		ibcs2
771_ie=		ie
772_mse=		mse
773_ncr=		ncr
774_ncv=		ncv
775_nsp=		nsp
776_pcfclock=	pcfclock
777_pst=		pst
778_sbni=		sbni
779_streams=	streams
780_stg=		stg
781_svr4=		svr4
782_wds=		wds
783.if ${MACHINE} == "i386"
784.if ${MK_EISA} != "no"
785_ahb=		ahb
786.endif
787_cm=		cm
788.if ${MK_SOURCELESS_UCODE} != "no"
789_ctau=		ctau
790.endif
791_dpt=		dpt
792_ex=		ex
793_wl=		wl
794.elif ${MACHINE} == "pc98"
795_canbepm=	canbepm
796_canbus=	canbus
797_ct=		ct
798_pmc=		pmc
799_snc=		snc
800.endif
801.endif
802
803.if ${MACHINE_CPUARCH} == "arm"
804_cfi=		cfi
805_cpsw=		cpsw
806.endif
807
808.if ${MACHINE_CPUARCH} == "powerpc"
809_agp=		agp
810_an=		an
811_bm=		bm
812_cardbus=	cardbus
813_cbb=		cbb
814_cfi=		cfi
815_cpufreq=	cpufreq
816_drm=		drm
817_exca=		exca
818_nvram=		powermac_nvram
819_ffec=		ffec
820_pccard=	pccard
821_wi=		wi
822.endif
823
824.if ${MACHINE_ARCH} == "powerpc64"
825_drm2=		drm2
826.endif
827
828.if ${MACHINE_CPUARCH} == "sparc64"
829_auxio=		auxio
830_em=		em
831_epic=		epic
832_igb=		igb
833.endif
834
835.if (${MACHINE_CPUARCH} == "amd64" || ${MACHINE_ARCH} == "armv6" || \
836     ${MACHINE_CPUARCH} == "i386")
837_cloudabi32=	cloudabi32
838.endif
839.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
840_cloudabi64=	cloudabi64
841.endif
842
843.endif
844
845SUBDIR+=${MODULES_EXTRA}
846
847.for reject in ${WITHOUT_MODULES}
848SUBDIR:= ${SUBDIR:N${reject}}
849.endfor
850
851# Calling kldxref(8) for each module is expensive.
852.if !defined(NO_XREF)
853.MAKEFLAGS+=	-DNO_XREF
854afterinstall: .PHONY
855	@if type kldxref >/dev/null 2>&1; then \
856		${ECHO} kldxref ${DESTDIR}${KMODDIR}; \
857		kldxref ${DESTDIR}${KMODDIR}; \
858	fi
859.endif
860
861SUBDIR:= ${SUBDIR:u:O}
862
863.include <bsd.subdir.mk>
864