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