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