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