xref: /freebsd/sys/modules/Makefile (revision 39ee7a7a6bdd1557b1c3532abf60d139798ac88b)
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_epair \
146	${_if_gif} \
147	${_if_gre} \
148	${_if_me} \
149	if_lagg \
150	${_if_ndis} \
151	${_if_stf} \
152	if_tap \
153	if_tun \
154	if_vlan \
155	if_vxlan \
156	${_igb} \
157	${_iir} \
158	imgact_binmisc \
159	${_io} \
160	${_ioat} \
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	${_iwm} \
178	${_iwmfw} \
179	${_iwn} \
180	${_iwnfw} \
181	${_ix} \
182	${_ixv} \
183	${_ixgb} \
184	${_ixl} \
185	${_ixlv} \
186	jme \
187	joy \
188	kbdmux \
189	kgssapi \
190	kgssapi_krb5 \
191	khelp \
192	krpc \
193	ksyms \
194	le \
195	lge \
196	libalias \
197	libiconv \
198	libmbpool \
199	libmchain \
200	${_linprocfs} \
201	${_linsysfs} \
202	${_linux} \
203	${_linux_common} \
204	${_linux64} \
205	linuxkpi \
206	lmc \
207	lpt \
208	mac_biba \
209	mac_bsdextended \
210	mac_ifoff \
211	mac_lomac \
212	mac_mls \
213	mac_none \
214	mac_partition \
215	mac_portacl \
216	mac_seeotheruids \
217	mac_stub \
218	mac_test \
219	malo \
220	mcd \
221	md \
222	mem \
223	mfi \
224	mii \
225	mlx \
226	${_mlx4} \
227	${_mlx4ib} \
228	${_mlxen} \
229	${_mly} \
230	mmc \
231	mmcsd \
232	mpr \
233	mps \
234	mpt \
235	mqueue \
236	mrsas \
237	msdosfs \
238	msdosfs_iconv \
239	${_mse} \
240	msk \
241	${_mthca} \
242	mvs \
243	mwl \
244	${_mwlfw} \
245	mxge \
246	my \
247	${_nandfs} \
248	${_nandsim} \
249	${_ncr} \
250	${_ncv} \
251	${_ndis} \
252	netfpga10g \
253	${_netgraph} \
254	${_nfe} \
255	nfscl \
256	nfscommon \
257	nfsd \
258	nfslock \
259	nfslockd \
260	nfssvc \
261	nge \
262	nmdm \
263	${_nsp} \
264	nullfs \
265	${_ntb} \
266	${_nvd} \
267	${_nvme} \
268	${_nvram} \
269	${_nxge} \
270	oce \
271	otus \
272	otusfw \
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	zlib
396
397.if ${MK_AUTOFS} != "no" || defined(ALL_MODULES)
398_autofs=	autofs
399.endif
400
401.if ${MK_CDDL} != "no" || defined(ALL_MODULES)
402.if ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" && \
403	${MACHINE_CPUARCH} != "sparc64"
404SUBDIR+=	dtrace
405.endif
406SUBDIR+=	opensolaris
407.endif
408
409.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
410.if exists(${.CURDIR}/../opencrypto)
411_crypto=	crypto
412_cryptodev=	cryptodev
413_random_fortuna=random_fortuna
414_random_yarrow=	random_yarrow
415_random_other=	random_other
416.endif
417.endif
418
419.if ${MK_CUSE} != "no" || defined(ALL_MODULES)
420SUBDIR+=	cuse
421.endif
422
423.if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \
424	defined(ALL_MODULES)
425_carp=		carp
426_toecore=	toecore
427_if_gif=	if_gif
428_if_gre=	if_gre
429.endif
430
431.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
432	defined(ALL_MODULES)
433_if_stf=	if_stf
434.endif
435
436.if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES)
437_if_me=		if_me
438_ipdivert=	ipdivert
439_ipfw=		ipfw
440.endif
441
442.if ${MK_IPFILTER} != "no" || defined(ALL_MODULES)
443_ipfilter=	ipfilter
444.endif
445
446.if ${MK_ISCSI} != "no" || defined(ALL_MODULES)
447SUBDIR+=	iscsi
448SUBDIR+=	iscsi_initiator
449.endif
450
451.if ${MK_NAND} != "no" || defined(ALL_MODULES)
452_nandfs=	nandfs
453_nandsim=	nandsim
454.endif
455
456.if ${MK_NETGRAPH} != "no" || defined(ALL_MODULES)
457_netgraph=	netgraph
458.endif
459
460.if (${MK_PF} != "no" && (${MK_INET_SUPPORT} != "no" || \
461	${MK_INET6_SUPPORT} != "no")) || defined(ALL_MODULES)
462_pf=		pf
463_pflog=		pflog
464.if ${MK_INET_SUPPORT} != "no"
465_pfsync=	pfsync
466.endif
467.endif
468
469.if ${MK_SOURCELESS_UCODE} != "no"
470_bce=		bce
471_fatm=		fatm
472_fxp=		fxp
473_ispfw=		ispfw
474_mwlfw=		mwlfw
475_ralfw=		ralfw
476_sf=		sf
477_ti=		ti
478_txp=		txp
479.endif
480
481.if ${MK_SOURCELESS_UCODE} != "no" && ${MACHINE_CPUARCH} != "arm" && \
482	${MACHINE_ARCH:C/mips(el)?/mips/} != "mips" && \
483	${MACHINE_ARCH} != "powerpc"
484_cxgbe=		cxgbe
485.endif
486
487.if ${MK_ZFS} != "no" || defined(ALL_MODULES)
488SUBDIR+=	zfs
489.endif
490
491.if ${MACHINE_CPUARCH} != "aarch64" && ${MACHINE_CPUARCH} != "arm" && \
492	${MACHINE_CPUARCH} != "mips" && ${MACHINE_CPUARCH} != "powerpc"
493_syscons=	syscons
494_vpo=		vpo
495.endif
496
497.if ${MACHINE_CPUARCH} != "mips"
498# no BUS_SPACE_UNSPECIFIED
499# No barrier instruction support (specific to this driver)
500_sym=		sym
501# intr_disable() is a macro, causes problems
502.if ${MK_SOURCELESS_UCODE} != "no"
503_cxgb=		cxgb
504.endif
505.endif
506
507.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
508_agp=		agp
509_an=		an
510_aout=		aout
511_bktr=		bktr
512_bxe=		bxe
513_cardbus=	cardbus
514_cbb=		cbb
515_cpuctl=	cpuctl
516_cpufreq=	cpufreq
517_cs=		cs
518_dpms=		dpms
519_drm=		drm
520_drm2=		drm2
521_ed=		ed
522_em=		em
523_ep=		ep
524_et=		et
525_exca=		exca
526_fe=		fe
527_filemon=	filemon
528.if ${MK_OFED} != "no" || defined(ALL_MODULES)
529_ibcore=        ibcore
530.endif
531_if_ndis=	if_ndis
532_igb=		igb
533_io=		io
534.if ${MK_OFED} != "no" || defined(ALL_MODULES)
535_ipoib=         ipoib
536.endif
537_ix=		ix
538_ixv=		ixv
539_linprocfs=	linprocfs
540_linsysfs=	linsysfs
541_linux=		linux
542_ndis=		ndis
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 ${MACHINE} != "pc98"
559_aac=		aac
560_aacraid=	aacraid
561_acpi=		acpi
562.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
563_aesni=		aesni
564.endif
565_amdsbwd=	amdsbwd
566_amdtemp=	amdtemp
567_arcmsr=	arcmsr
568_asmc=		asmc
569_ciss=		ciss
570_cmx=		cmx
571_coretemp=	coretemp
572.if ${MK_SOURCELESS_HOST} != "no"
573_hpt27xx=	hpt27xx
574.endif
575_hptiop=	hptiop
576.if ${MK_SOURCELESS_HOST} != "no"
577_hptmv=		hptmv
578_hptnr=		hptnr
579_hptrr=		hptrr
580.endif
581_hyperv=	hyperv
582_ichwd=		ichwd
583_ida=		ida
584_iir=		iir
585_ipmi=		ipmi
586_ips=		ips
587_isci=		isci
588_ipw=		ipw
589_iwi=		iwi
590_iwm=		iwm
591_iwn=		iwn
592_ixgb=		ixgb
593.if ${MK_SOURCELESS_UCODE} != "no"
594_ipwfw=		ipwfw
595_iwifw=		iwifw
596_iwmfw=		iwmfw
597_iwnfw=		iwnfw
598.endif
599.if ${MK_OFED} != "no" || defined(ALL_MODULES)
600_mlx4=		mlx4
601_mlx4ib=	mlx4ib
602_mlxen=		mlxen
603.endif
604_mly=		mly
605.if ${MK_OFED} != "no" || defined(ALL_MODULES)
606_mthca=		mthca
607.endif
608_nfe=		nfe
609_nvd=		nvd
610_nvme=		nvme
611_nvram=		nvram
612_nxge=		nxge
613.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
614_padlock=	padlock
615_padlock_rng=	padlock_rng
616_rdrand_rng=	rdrand_rng
617.endif
618_s3=		s3
619_tpm=		tpm
620_twa=		twa
621_vesa=		vesa
622_viawd=		viawd
623_virtio=	virtio
624_wpi=		wpi
625.if ${MK_SOURCELESS_UCODE} != "no"
626_wpifw=		wpifw
627.endif
628_x86bios=	x86bios
629.endif
630.endif
631
632.if ${MACHINE_CPUARCH} == "amd64"
633_ioat=		ioat
634_ixl=		ixl
635_ixlv=		ixlv
636_linux64=	linux64
637_linux_common=	linux_common
638_ntb=		ntb
639_pms=		pms
640_qlxge=		qlxge
641_qlxgb=		qlxgb
642_qlxgbe=	qlxgbe
643_sfxge=		sfxge
644
645.if ${MK_BHYVE} != "no" || defined(ALL_MODULES)
646_vmm=		vmm
647.endif
648.endif
649
650.if ${MACHINE_CPUARCH} == "i386"
651# XXX some of these can move to the general case when de-i386'ed
652# XXX some of these can move now, but are untested on other architectures.
653_3dfx=		3dfx
654_3dfx_linux=	3dfx_linux
655_aic=		aic
656_apm=		apm
657_arcnet=	arcnet
658.if ${MK_SOURCELESS_UCODE} != "no"
659_ce=		ce
660.endif
661_coff=		coff
662.if ${MK_SOURCELESS_UCODE} != "no"
663_cp=		cp
664.endif
665_elink=		elink
666_glxiic=	glxiic
667_glxsb=		glxsb
668_ibcs2=		ibcs2
669_ie=		ie
670_mse=		mse
671_ncr=		ncr
672_ncv=		ncv
673_nsp=		nsp
674_pcfclock=	pcfclock
675_pst=		pst
676_sbni=		sbni
677_streams=	streams
678_stg=		stg
679_svr4=		svr4
680_wds=		wds
681.if ${MACHINE} == "i386"
682.if ${MK_EISA} != "no"
683_ahb=		ahb
684.endif
685_bios=		bios
686_cm=		cm
687.if ${MK_SOURCELESS_UCODE} != "no"
688_ctau=		ctau
689.endif
690_dpt=		dpt
691_ex=		ex
692_wl=		wl
693.elif ${MACHINE} == "pc98"
694_canbepm=	canbepm
695_canbus=	canbus
696_ct=		ct
697_pmc=		pmc
698_snc=		snc
699.endif
700.endif
701
702.if ${MACHINE_CPUARCH} == "arm"
703_cfi=		cfi
704_cpsw=		cpsw
705.endif
706
707.if ${MACHINE_CPUARCH} == "powerpc"
708_agp=		agp
709_an=		an
710_bm=		bm
711_cardbus=	cardbus
712_cbb=		cbb
713_cfi=		cfi
714_cpufreq=	cpufreq
715_drm=		drm
716_exca=		exca
717_nvram=		powermac_nvram
718_pccard=	pccard
719_wi=		wi
720.endif
721
722.if ${MACHINE_ARCH} == "powerpc64"
723_drm2=		drm2
724.endif
725
726.if ${MACHINE_CPUARCH} == "sparc64"
727_auxio=		auxio
728_em=		em
729_epic=		epic
730_igb=		igb
731.endif
732
733.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
734_cloudabi64=	cloudabi64
735.endif
736
737.endif
738
739SUBDIR+=${MODULES_EXTRA}
740
741.for reject in ${WITHOUT_MODULES}
742SUBDIR:= ${SUBDIR:N${reject}}
743.endfor
744
745# Calling kldxref(8) for each module is expensive.
746.if !defined(NO_XREF)
747.MAKEFLAGS+=	-DNO_XREF
748afterinstall:
749	@if type kldxref >/dev/null 2>&1; then \
750		${ECHO} kldxref ${DESTDIR}${KMODDIR}; \
751		kldxref ${DESTDIR}${KMODDIR}; \
752	fi
753.endif
754
755.include "${SYSDIR}/conf/config.mk"
756
757SUBDIR:= ${SUBDIR:u:O}
758
759.include <bsd.subdir.mk>
760