xref: /freebsd/sys/modules/Makefile (revision 119b75925c562202145d7bac7b676b98029c6cb9)
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        ${_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	${_iwn} \
178	${_iwnfw} \
179	${_ix} \
180	${_ixv} \
181	${_ixgb} \
182	${_ixl} \
183	${_ixlv} \
184	jme \
185	joy \
186	kbdmux \
187	kgssapi \
188	kgssapi_krb5 \
189	khelp \
190	krpc \
191	ksyms \
192	le \
193	lge \
194	libalias \
195	libiconv \
196	libmbpool \
197	libmchain \
198	${_linprocfs} \
199	${_linsysfs} \
200	${_linux} \
201	${_linux_common} \
202	${_linux64} \
203	${_linuxapi} \
204	lmc \
205	lpt \
206	mac_biba \
207	mac_bsdextended \
208	mac_ifoff \
209	mac_lomac \
210	mac_mls \
211	mac_none \
212	mac_partition \
213	mac_portacl \
214	mac_seeotheruids \
215	mac_stub \
216	mac_test \
217	malo \
218	mcd \
219	md \
220	mem \
221	mfi \
222	mii \
223	mlx \
224	${_mlx4} \
225	${_mlx4ib} \
226	${_mlxen} \
227	${_mly} \
228	mmc \
229	mmcsd \
230	mpr \
231	mps \
232	mpt \
233	mqueue \
234	mrsas \
235	msdosfs \
236	msdosfs_iconv \
237	${_mse} \
238	msk \
239	${_mthca} \
240	mvs \
241	mwl \
242	${_mwlfw} \
243	mxge \
244	my \
245	${_nandfs} \
246	${_nandsim} \
247	${_ncr} \
248	${_ncv} \
249	${_ndis} \
250	netfpga10g \
251	${_netgraph} \
252	${_nfe} \
253	nfscl \
254	nfscommon \
255	nfsd \
256	nfslock \
257	nfslockd \
258	nfssvc \
259	nge \
260	nmdm \
261	${_nsp} \
262	nullfs \
263	${_ntb} \
264	${_nvd} \
265	${_nvme} \
266	${_nvram} \
267	${_nxge} \
268	${_opensolaris} \
269	oce \
270	${_padlock} \
271	${_padlock_rng} \
272	patm \
273	${_pccard} \
274	${_pcfclock} \
275	pcn \
276	${_pf} \
277	${_pflog} \
278	${_pfsync} \
279	plip \
280	${_pmc} \
281	${_pms} \
282	ppbus \
283	ppc \
284	ppi \
285	pps \
286	procfs \
287	proto \
288	pseudofs \
289	${_pst} \
290	pty  \
291	puc \
292	${_qlxge} \
293	${_qlxgb} \
294	${_qlxgbe} \
295	ral \
296	${_ralfw} \
297	rc4 \
298	${_rdma} \
299	${_rdrand_rng} \
300	re \
301	reiserfs \
302	rl \
303	${_s3} \
304	${_safe} \
305	${_sbni} \
306	scc \
307	scd \
308	${_scsi_low} \
309	sdhci \
310	sdhci_pci \
311	sem \
312	send \
313	${_sf} \
314	${_sfxge} \
315	sge \
316	${_si} \
317	siba_bwn \
318	siftr \
319	siis \
320	sis \
321	sk \
322	smbfs \
323	sn \
324	${_snc} \
325	snp \
326	sound \
327	${_speaker} \
328	${_splash} \
329	${_sppp} \
330	ste \
331	${_stg} \
332	stge \
333	${_streams} \
334	${_svr4} \
335	${_sym} \
336	${_syscons} \
337	sysvipc \
338	${_ti} \
339	tl \
340	tmpfs \
341	${_toecore} \
342	${_tpm} \
343	trm \
344	${_twa} \
345	twe \
346	tws \
347	tx \
348	${_txp} \
349	uart \
350	ubsec \
351	udf \
352	udf_iconv \
353	ufs \
354	unionfs \
355	usb \
356	utopia \
357	${_vesa} \
358	${_virtio} \
359	vge \
360	${_viawd} \
361	videomode \
362	vkbd \
363	${_vmm} \
364	${_vmware} \
365	${_vpo} \
366	vr \
367	vte \
368	vx \
369	${_vxge} \
370	wb \
371	${_wbwd} \
372	${_wds} \
373	${_wi} \
374	${_wl} \
375	wlan \
376	wlan_acl \
377	wlan_amrr \
378	wlan_ccmp \
379	wlan_rssadapt \
380	wlan_tkip \
381	wlan_wep \
382	wlan_xauth \
383	${_wpi} \
384	${_wpifw} \
385	${_x86bios} \
386	${_xe} \
387	xl \
388	${_zfs} \
389	zlib
390
391.if ${MK_AUTOFS} != "no" || defined(ALL_MODULES)
392_autofs=	autofs
393.endif
394
395.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
396.if exists(${.CURDIR}/../opencrypto)
397_crypto=	crypto
398_cryptodev=	cryptodev
399.endif
400.endif
401
402.if ${MK_CUSE} != "no" || defined(ALL_MODULES)
403SUBDIR+=	cuse
404.endif
405
406.if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \
407	defined(ALL_MODULES)
408_carp=		carp
409_toecore=	toecore
410_if_gif=	if_gif
411_if_gre=	if_gre
412.endif
413
414.if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES)
415_if_me=		if_me
416_ipdivert=	ipdivert
417_ipfw=		ipfw
418.endif
419
420.if ${MK_IPFILTER} != "no" || defined(ALL_MODULES)
421_ipfilter=	ipfilter
422.endif
423
424.if ${MK_ISCSI} != "no" || defined(ALL_MODULES)
425SUBDIR+=	iscsi
426SUBDIR+=	iscsi_initiator
427.endif
428
429.if ${MK_NAND} != "no" || defined(ALL_MODULES)
430_nandfs=	nandfs
431_nandsim=	nandsim
432.endif
433
434.if ${MK_NETGRAPH} != "no" || defined(ALL_MODULES)
435_netgraph=	netgraph
436.endif
437
438.if (${MK_PF} != "no" && (${MK_INET_SUPPORT} != "no" || \
439	${MK_INET6_SUPPORT} != "no")) || defined(ALL_MODULES)
440_pf=		pf
441_pflog=		pflog
442.if ${MK_INET_SUPPORT} != "no"
443_pfsync=	pfsync
444.endif
445.endif
446
447.if ${MK_SOURCELESS_UCODE} != "no"
448_bce=		bce
449_fatm=		fatm
450_fxp=		fxp
451_ispfw=		ispfw
452_mwlfw=		mwlfw
453_ralfw=		ralfw
454_sf=		sf
455_ti=		ti
456_txp=		txp
457.endif
458
459.if ${MK_SOURCELESS_UCODE} != "no" && ${MACHINE_CPUARCH} != "arm" && \
460	${MACHINE_ARCH:C/mips(el)?/mips/} != "mips" && \
461	${MACHINE_ARCH} != "powerpc"
462_cxgbe=		cxgbe
463.endif
464
465.if ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" && \
466	${MACHINE_CPUARCH} != "powerpc"
467_syscons=	syscons
468_vpo=		vpo
469.endif
470
471.if ${MACHINE_CPUARCH} != "mips"
472# no BUS_SPACE_UNSPECIFIED
473# No barrier instruction support (specific to this driver)
474_sym=		sym
475# intr_disable() is a macro, causes problems
476.if ${MK_SOURCELESS_UCODE} != "no"
477_cxgb=		cxgb
478.endif
479.endif
480
481.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
482_agp=		agp
483_an=		an
484_aout=		aout
485_bktr=		bktr
486_bxe=		bxe
487_cardbus=	cardbus
488_cbb=		cbb
489_cpuctl=	cpuctl
490_cpufreq=	cpufreq
491_cs=		cs
492_dpms=		dpms
493_drm=		drm
494_drm2=		drm2
495.if ${MK_CDDL} != "no" || defined(ALL_MODULES)
496_dtrace=	dtrace
497.endif
498_ed=		ed
499_em=		em
500_ep=		ep
501_et=		et
502_exca=		exca
503_fe=		fe
504_filemon=	filemon
505.if ${MK_OFED} != "no" || defined(ALL_MODULES)
506_ibcore=        ibcore
507.endif
508_if_ndis=	if_ndis
509_igb=		igb
510_io=		io
511.if ${MK_OFED} != "no" || defined(ALL_MODULES)
512_ipoib=         ipoib
513.endif
514_ix=		ix
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_cloudabi64=	cloudabi64
622_ixl=		ixl
623_ixlv=		ixlv
624_linux64=	linux64
625_linux_common=	linux_common
626_ntb=		ntb
627_pms=		pms
628_qlxge=		qlxge
629_qlxgb=		qlxgb
630_qlxgbe=	qlxgbe
631_sfxge=		sfxge
632
633.if ${MK_BHYVE} != "no" || defined(ALL_MODULES)
634_vmm=		vmm
635.endif
636.endif
637
638.if ${MACHINE_CPUARCH} == "i386"
639# XXX some of these can move to the general case when de-i386'ed
640# XXX some of these can move now, but are untested on other architectures.
641_3dfx=		3dfx
642_3dfx_linux=	3dfx_linux
643_aic=		aic
644_apm=		apm
645_arcnet=	arcnet
646.if ${MK_SOURCELESS_UCODE} != "no"
647_ce=		ce
648.endif
649_coff=		coff
650.if ${MK_SOURCELESS_UCODE} != "no"
651_cp=		cp
652.endif
653_elink=		elink
654_glxiic=	glxiic
655_glxsb=		glxsb
656_ibcs2=		ibcs2
657_ie=		ie
658_mse=		mse
659_ncr=		ncr
660_ncv=		ncv
661_nsp=		nsp
662_pcfclock=	pcfclock
663_pst=		pst
664_sbni=		sbni
665_streams=	streams
666_stg=		stg
667_svr4=		svr4
668_wds=		wds
669.if ${MACHINE} == "i386"
670.if ${MK_EISA} != "no"
671_ahb=		ahb
672.endif
673_bios=		bios
674_cm=		cm
675.if ${MK_SOURCELESS_UCODE} != "no"
676_ctau=		ctau
677.endif
678_dpt=		dpt
679_ex=		ex
680_wl=		wl
681.elif ${MACHINE} == "pc98"
682_canbepm=	canbepm
683_canbus=	canbus
684_ct=		ct
685_pmc=		pmc
686_snc=		snc
687.endif
688.endif
689
690.if ${MACHINE_CPUARCH} == "arm"
691_cfi=		cfi
692_cpsw=		cpsw
693.endif
694
695.if ${MACHINE_CPUARCH} == "powerpc"
696_agp=		agp
697_an=		an
698_bm=		bm
699_cardbus=	cardbus
700_cbb=		cbb
701_cfi=		cfi
702_cpufreq=	cpufreq
703_drm=		drm
704.if ${MK_CDDL} != "no" || defined(ALL_MODULES)
705_dtrace=	dtrace
706.endif
707_exca=		exca
708_nvram=		powermac_nvram
709.if ${MK_CDDL} != "no" || defined(ALL_MODULES)
710_opensolaris=	opensolaris
711.endif
712_pccard=	pccard
713_wi=		wi
714.endif
715
716.if ${MACHINE_ARCH} == "powerpc64"
717_drm2=		drm2
718.if ${MK_ZFS} != "no" || defined(ALL_MODULES)
719_zfs=		zfs
720.endif
721.endif
722
723.if ${MACHINE_CPUARCH} == "sparc64"
724_auxio=		auxio
725_em=		em
726_epic=		epic
727_igb=		igb
728.if ${MK_CDDL} != "no" || defined(ALL_MODULES)
729_opensolaris=	opensolaris
730.endif
731.if ${MK_ZFS} != "no" || defined(ALL_MODULES)
732_zfs=		zfs
733.endif
734.endif
735
736.endif
737
738SUBDIR+=${MODULES_EXTRA}
739
740.for reject in ${WITHOUT_MODULES}
741SUBDIR:= ${SUBDIR:N${reject}}
742.endfor
743
744# Calling kldxref(8) for each module is expensive.
745.if !defined(NO_XREF)
746.MAKEFLAGS+=	-DNO_XREF
747afterinstall:
748	@if type kldxref >/dev/null 2>&1; then \
749		${ECHO} kldxref ${DESTDIR}${KMODDIR}; \
750		kldxref ${DESTDIR}${KMODDIR}; \
751	fi
752.endif
753
754.include "${SYSDIR}/conf/config.mk"
755
756SUBDIR:= ${SUBDIR:u:O}
757
758.include <bsd.subdir.mk>
759