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