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