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