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