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