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