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