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