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