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