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