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