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