xref: /freebsd/include/Makefile (revision 1554ba03b651319ab0e1cde8492ea4516afc648b)
1996997fdSBruce Evans#	@(#)Makefile	8.2 (Berkeley) 1/4/94
259deaec5SRodney W. Grimes#
3a270eca5SBruce Evans# Doing a "make install" builds /usr/include.
459deaec5SRodney W. Grimes
5c6063d0dSWarner Losh.include <src.opts.mk>
6e1fe3dbaSRuslan Ermilov
7bf24694cSGlen BarberPACKAGE=runtime
88e8319a6SBryan DreweryCLEANFILES= osreldate.h version
9dd987372STijl CoosemansSUBDIR= arpa protocols rpcsvc rpc xlocale
10a09ea2bbSBrooks Davis.if ${MACHINE_CPUARCH} == "amd64"
11a09ea2bbSBrooks DavisSUBDIR+=		i386
12d5d97bedSMike KarelsINCLUDE_SUBDIRS+=	i386
13d5d97bedSMike Karels.endif
14d5d97bedSMike Karels.if ${MACHINE_CPUARCH} == "aarch64"
15d5d97bedSMike KarelsSUBDIR+=		arm
16d5d97bedSMike KarelsINCLUDE_SUBDIRS+=	arm
17a09ea2bbSBrooks Davis.endif
18aa92269eSBryan DrewerySUBDIR_PARALLEL=
191761b09bSWarner LoshINCS=	a.out.h ar.h assert.h bitstring.h byteswap.h \
201761b09bSWarner Losh	complex.h cpio.h _ctype.h ctype.h \
2116133e15STim J. Robbins	db.h \
2230e0d2a5SWarner Losh	dirent.h dlfcn.h elf.h elf-hints.h endian.h err.h fmtmsg.h fnmatch.h \
2330e0d2a5SWarner Losh	fstab.h fts.h ftw.h getopt.h glob.h grp.h \
241e3f1446SDavid E. O'Brien	ieeefp.h ifaddrs.h \
25c544e42bSMarcel Moolenaar	inttypes.h iso646.h kenv.h langinfo.h libgen.h limits.h link.h \
266b2c15daSJason Evans	locale.h malloc.h malloc_np.h memory.h monetary.h mpool.h mqueue.h \
271332b4bdSRuslan Ermilov	ndbm.h netconfig.h \
28401a7f6fSPeter Wemm	netdb.h nl_types.h nlist.h nss.h nsswitch.h paths.h \
2975067f4fSPoul-Henning Kamp	printf.h proc_service.h pthread.h \
30763ed733SEd Schouten	pthread_np.h pwd.h ranlib.h readpassphrase.h regex.h \
31160b4b92SKonstantin Belousov	res_update.h resolv.h runetype.h sched.h \
32160b4b92SKonstantin Belousov	search.h semaphore.h setjmp.h \
3306bee445SEd Schouten	signal.h spawn.h stab.h stdalign.h stdbool.h stddef.h \
34367bebd4SEd Schouten	stdnoreturn.h stdio.h stdlib.h string.h stringlist.h \
35f14ad5faSEd Schouten	strings.h sysexits.h tar.h termios.h tgmath.h \
36b902e8b2SStefan Farfeleder	time.h timeconv.h timers.h ttyent.h \
3750c77c6eSEd Schouten	uchar.h ulimit.h unistd.h utime.h utmpx.h uuid.h varargs.h \
38a8ed63bbSDavid Chisnall	wchar.h wctype.h wordexp.h xlocale.h
3959deaec5SRodney W. Grimes
4028d60d6aSWarner Losh.PATH: ${SRCTOP}/contrib/libc-vis
418ccca122SBrooks DavisINCS+=	vis.h
428ccca122SBrooks Davis
43fefa0fd5SAlexander KabaevMHDRS=	float.h floatingpoint.h stdarg.h
44917e476dSPeter Dufault
45160b4b92SKonstantin BelousovPHDRS=	_semaphore.h
46917e476dSPeter Dufault
4706bee445SEd SchoutenLHDRS=	aio.h errno.h fcntl.h linker_set.h poll.h stdatomic.h stdint.h \
4806bee445SEd Schouten	syslog.h ucontext.h
4959deaec5SRodney W. Grimes
500594b287SEmmanuel VadotLDIRS=	geom net net80211 netgraph netinet netinet6 \
5111ca01e9SAlexander V. Chernikov	netipsec netlink netsmb nfs nfsclient nfsserver sys vm
5215f3c66cSMarcel Moolenaar
53663b174bSEmmanuel VadotLSUBDIRS=	dev/acpica dev/agp dev/ciss dev/filemon dev/firewire \
54060f0a17SEmmanuel Vadot	dev/hwpmc dev/hyperv \
551aaa8f67SJohn Baldwin	dev/ic dev/iicbus dev/io dev/mfi dev/mmc \
56060f0a17SEmmanuel Vadot	dev/ofw dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/pwm \
57744bfb21SJohn Baldwin	dev/smbus dev/speaker dev/tcp_log dev/veriexec dev/vkbd dev/wg \
58f5a95d9aSWarner Losh	fs/devfs fs/fdescfs fs/msdosfs fs/nfs fs/nullfs \
59237abf0cSDavide Italiano	fs/procfs fs/smbfs fs/udf fs/unionfs \
60f348204cSPawel Jakub Dawidek	geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \
61b3f9d8c8SEdward Tomasz Napierala	geom/mirror geom/mountver geom/multipath geom/nop \
62c7996ddfSKirk McKusick	geom/raid geom/raid3 geom/shsec geom/stripe geom/union geom/virstor \
63772e66a6SGleb Smirnoff	net/altq \
64a6663252SAlexander V. Chernikov	net/route \
6521735dfaSMichael Butler	netgraph/netflow \
66d519cedbSGleb Smirnoff	netinet/cc \
67e5054602SMark Johnston	netinet/netdump \
68d371ed1cSOlivier Cochard	netinet/tcp_stacks \
6911ca01e9SAlexander V. Chernikov	netlink/route \
70*1554ba03SSimon J. Gerraty	security/mac_biba security/mac_bsdextended \
71*1554ba03SSimon J. Gerraty	security/mac_grantbylabel \
72*1554ba03SSimon J. Gerraty	security/mac_lomac \
73fdbe44b0SGleb Smirnoff	security/mac_mls security/mac_partition \
74eb12b8eaSSimon J. Gerraty	security/mac_veriexec \
7550875ed2SMarcel Moolenaar	sys/disk \
7651be47e4SMark Murray	ufs/ffs ufs/ufs
7715f3c66cSMarcel Moolenaar
7811c63edeSAndrew ThompsonLSUBSUBDIRS=	dev/mpt/mpilib
79c16e2101SJohn Baldwin
80f61a3898SEmmanuel Vadot.PATH: ${SRCTOP}/sys/dev/acpica
81f61a3898SEmmanuel VadotACPICA=		acpi_hpet.h \
82f61a3898SEmmanuel Vadot		acpiio.h
83f61a3898SEmmanuel VadotACPICADIR=	${INCLUDEDIR}/dev/acpica
84f61a3898SEmmanuel Vadot
85f61a3898SEmmanuel Vadot.PATH: ${SRCTOP}/sys/dev/agp
86f61a3898SEmmanuel VadotAGP=		agpreg.h
87f61a3898SEmmanuel VadotAGPDIR=		${INCLUDEDIR}/dev/agp
88f61a3898SEmmanuel Vadot
898c3eaf24SEmmanuel Vadot.PATH: ${SRCTOP}/sys/bsm
908c3eaf24SEmmanuel VadotBSM=		audit.h \
918c3eaf24SEmmanuel Vadot		audit_errno.h \
928c3eaf24SEmmanuel Vadot		audit_internal.h \
938c3eaf24SEmmanuel Vadot		audit_record.h \
948c3eaf24SEmmanuel Vadot		audit_domain.h \
958c3eaf24SEmmanuel Vadot		audit_fcntl.h \
968c3eaf24SEmmanuel Vadot		audit_kevents.h \
978c3eaf24SEmmanuel Vadot		audit_socket_type.h
988c3eaf24SEmmanuel VadotBSMPACKAGE=	libbsm
998c3eaf24SEmmanuel VadotBSMDIR=		${INCLUDEDIR}/bsm
1008c3eaf24SEmmanuel Vadot
1018c3eaf24SEmmanuel Vadot.PATH: ${SRCTOP}/sys/security/audit
1028c3eaf24SEmmanuel VadotSECAUDIT=	audit.h \
1038c3eaf24SEmmanuel Vadot		audit_ioctl.h \
1048c3eaf24SEmmanuel Vadot		audit_private.h
1058c3eaf24SEmmanuel VadotSECAUDITPACKAGE=	libbsm
1068c3eaf24SEmmanuel VadotSECAUDITDIR=	${INCLUDEDIR}/security/audit
1078c3eaf24SEmmanuel Vadot
1080594b287SEmmanuel Vadot.PATH:	${SRCTOP}/sys/cam
1090594b287SEmmanuel VadotCAM=	cam.h \
1100594b287SEmmanuel Vadot	cam_ccb.h \
1110594b287SEmmanuel Vadot	cam_compat.h \
1120594b287SEmmanuel Vadot	cam_debug.h \
1130594b287SEmmanuel Vadot	cam_iosched.h \
1140594b287SEmmanuel Vadot	cam_periph.h \
1150594b287SEmmanuel Vadot	cam_queue.h \
1160594b287SEmmanuel Vadot	cam_sim.h \
1170594b287SEmmanuel Vadot	cam_xpt.h \
1180594b287SEmmanuel Vadot	cam_xpt_internal.h \
1190594b287SEmmanuel Vadot	cam_xpt_periph.h \
1200594b287SEmmanuel Vadot	cam_xpt_sim.h
1210594b287SEmmanuel VadotCAMDIR=	${INCLUDEDIR}/cam
1220594b287SEmmanuel Vadot
1230594b287SEmmanuel Vadot.PATH: ${SRCTOP}/sys/cam/ata
1240594b287SEmmanuel VadotCAMATA=		ata_all.h
1250594b287SEmmanuel VadotCAMATADIR=	${INCLUDEDIR}/cam/ata
1260594b287SEmmanuel Vadot
1270594b287SEmmanuel Vadot.PATH: ${SRCTOP}/sys/cam/mmc
1280594b287SEmmanuel VadotCAMMMC=		mmc.h \
1290594b287SEmmanuel Vadot		mmc_bus.h \
1300594b287SEmmanuel Vadot		mmc_all.h
1310594b287SEmmanuel VadotCAMMMCDIR=	${INCLUDEDIR}/cam/mmc
1320594b287SEmmanuel Vadot
1330594b287SEmmanuel Vadot.PATH: ${SRCTOP}/sys/cam/nvme
1340594b287SEmmanuel VadotCAMNVME=	nvme_all.h
1350594b287SEmmanuel VadotCAMNVMEDIR=	${INCLUDEDIR}/cam/nvme
1360594b287SEmmanuel Vadot
1370594b287SEmmanuel Vadot.PATH: ${SRCTOP}/sys/cam/scsi
1380594b287SEmmanuel VadotCAMSCSI=	scsi_all.h \
1390594b287SEmmanuel Vadot		scsi_cd.h \
1400594b287SEmmanuel Vadot		scsi_ch.h \
1410594b287SEmmanuel Vadot		scsi_da.h \
1420594b287SEmmanuel Vadot		scsi_enc.h \
1430594b287SEmmanuel Vadot		scsi_enc_internal.h \
1440594b287SEmmanuel Vadot		scsi_iu.h \
1450594b287SEmmanuel Vadot		scsi_message.h \
1460594b287SEmmanuel Vadot		scsi_pass.h \
1470594b287SEmmanuel Vadot		scsi_pt.h \
1480594b287SEmmanuel Vadot		scsi_sa.h \
1490594b287SEmmanuel Vadot		scsi_ses.h \
1500594b287SEmmanuel Vadot		scsi_sg.h \
1510594b287SEmmanuel Vadot		scsi_targetio.h \
1520594b287SEmmanuel Vadot		smp_all.h
1530594b287SEmmanuel VadotCAMSCSIDIR=	${INCLUDEDIR}/cam/scsi
1540594b287SEmmanuel Vadot
155f61a3898SEmmanuel Vadot.PATH: ${SRCTOP}/sys/fs/cd9660
156f61a3898SEmmanuel VadotFS9660=		cd9660_mount.h \
157f61a3898SEmmanuel Vadot		cd9660_node.h \
158f61a3898SEmmanuel Vadot		cd9660_rrip.h \
159f61a3898SEmmanuel Vadot		iso.h \
160f61a3898SEmmanuel Vadot		iso_rrip.h
161f61a3898SEmmanuel VadotFS9660DIR=	${INCLUDEDIR}/isofs/cd9660
162f61a3898SEmmanuel Vadot
163f61a3898SEmmanuel Vadot.PATH: ${SRCTOP}/sys/dev/evdev
164f61a3898SEmmanuel VadotEVDEV=		input.h \
165f61a3898SEmmanuel Vadot		input-event-codes.h \
166f61a3898SEmmanuel Vadot		uinput.h
167f61a3898SEmmanuel VadotEVDEVDIR=	${INCLUDEDIR}/dev/evdev
168f61a3898SEmmanuel Vadot
16967de2db2SVladimir Kondratyev.PATH: ${SRCTOP}/sys/dev/hid
17094773907SVladimir KondratyevHID=		hid.h \
17194773907SVladimir Kondratyev		hidraw.h
17267de2db2SVladimir KondratyevHIDDIR=		${INCLUDEDIR}/dev/hid
17367de2db2SVladimir Kondratyev
174f61a3898SEmmanuel Vadot.PATH: ${SRCTOP}/sys/dev/hyperv/include ${SRCTOP}/sys/dev/hyperv/utilities
175f61a3898SEmmanuel VadotHYPERV=		hv_snapshot.h \
176f61a3898SEmmanuel Vadot		hyperv.h
177f61a3898SEmmanuel VadotHYPERVDIR=	${INCLUDEDIR}/dev/hyperv
178f61a3898SEmmanuel Vadot
179f61a3898SEmmanuel Vadot.PATH: ${SRCTOP}/sys/opencrypto
180283352ddSJohn BaldwinOPENCRYPTO=	cryptodev.h
181f61a3898SEmmanuel VadotOPENCRYPTODIR=	${INCLUDEDIR}/crypto
182f61a3898SEmmanuel Vadot
1831aaa8f67SJohn Baldwin.PATH: ${SRCTOP}/sys/dev/nvme
1841aaa8f67SJohn BaldwinNVME=		nvme.h
1851aaa8f67SJohn BaldwinNVMEDIR=	${INCLUDEDIR}/dev/nvme
1861aaa8f67SJohn Baldwin
187f61a3898SEmmanuel Vadot.PATH: ${SRCTOP}/sys/dev/pci
188f61a3898SEmmanuel VadotPCI=		pcireg.h
189f61a3898SEmmanuel VadotPCIDIR=		${INCLUDEDIR}/dev/pci
190f61a3898SEmmanuel Vadot
191f61a3898SEmmanuel Vadot.PATH: ${SRCTOP}/sys/dev/veriexec
192f61a3898SEmmanuel VadotVERIEXEC=	veriexec_ioctl.h
193f61a3898SEmmanuel VadotVERIEXECDIR=	${INCLUDEDIR}/dev/veriexec
194f61a3898SEmmanuel Vadot
1953b9b51feSCy Schubert.PATH: ${SRCTOP}/sys/netpfil/ipfilter/netinet
196f61a3898SEmmanuel VadotIPFILTER=	ip_auth.h \
197f61a3898SEmmanuel Vadot		ip_compat.h \
198f61a3898SEmmanuel Vadot		ip_dstlist.h \
199f61a3898SEmmanuel Vadot		ip_fil.h \
200f61a3898SEmmanuel Vadot		ip_frag.h \
201f61a3898SEmmanuel Vadot		ip_htable.h \
202f61a3898SEmmanuel Vadot		ip_lookup.h \
203f61a3898SEmmanuel Vadot		ip_nat.h \
204f61a3898SEmmanuel Vadot		ip_pool.h \
205f61a3898SEmmanuel Vadot		ip_proxy.h \
206f61a3898SEmmanuel Vadot		ip_rules.h \
207f61a3898SEmmanuel Vadot		ip_scan.h \
208f61a3898SEmmanuel Vadot		ip_state.h \
209f61a3898SEmmanuel Vadot		ip_sync.h \
210f61a3898SEmmanuel Vadot		ipf_rb.h \
211f61a3898SEmmanuel Vadot		ipl.h \
212f61a3898SEmmanuel Vadot		radix_ipf.h
213f61a3898SEmmanuel VadotIPFILTERDIR=	${INCLUDEDIR}/netinet
214f61a3898SEmmanuel Vadot
215f61a3898SEmmanuel Vadot.PATH: ${SRCTOP}/sys/netpfil/pf
216f61a3898SEmmanuel VadotPF=		pf.h \
217f61a3898SEmmanuel Vadot		pf_altq.h \
218f61a3898SEmmanuel Vadot		pf_mtag.h
219f61a3898SEmmanuel VadotPFPACKAGE=	pf
220f61a3898SEmmanuel VadotPFDIR=	${INCLUDEDIR}/netpfil/pf
221f61a3898SEmmanuel Vadot
222f61a3898SEmmanuel Vadot.PATH: ${SRCTOP}/sys/rpc
223f61a3898SEmmanuel VadotRPC=		rpcsec_tls.h \
224f61a3898SEmmanuel Vadot		types.h
225f61a3898SEmmanuel VadotRPCDIR=		${INCLUDEDIR}/rpc
226f61a3898SEmmanuel Vadot
227f61a3898SEmmanuel Vadot.PATH: ${SRCTOP}/sys/teken
228f61a3898SEmmanuel VadotTEKEN=		teken.h
229f61a3898SEmmanuel VadotTEKENDIR=	${INCLUDEDIR}/teken
230f61a3898SEmmanuel Vadot
231f61a3898SEmmanuel Vadot.PATH: ${SRCTOP}/sys/contrib/openzfs/include/sys
232f61a3898SEmmanuel VadotNVPAIR=		nvpair.h
233f61a3898SEmmanuel VadotNVPAIRDIR=	${INCLUDEDIR}/sys
234f61a3898SEmmanuel Vadot
235f61a3898SEmmanuel Vadot.PATH: ${SRCTOP}/sys/dev/mlx5
236f61a3898SEmmanuel VadotMLX5=		mlx5io.h
237f61a3898SEmmanuel VadotMLX5DIR=	${INCLUDEDIR}/dev/mlx5
238f61a3898SEmmanuel Vadot
239744bfb21SJohn Baldwin.PATH: ${SRCTOP}/sys/dev/wg
240744bfb21SJohn BaldwinWG=		if_wg.h
241744bfb21SJohn BaldwinWGDIR=		${INCLUDEDIR}/dev/wg
242744bfb21SJohn Baldwin
243f61a3898SEmmanuel VadotINCSGROUPS=	INCS \
244f61a3898SEmmanuel Vadot		ACPICA \
245f61a3898SEmmanuel Vadot		AGP \
246f41efc45SEmmanuel Vadot		BSM \
2470594b287SEmmanuel Vadot		CAM \
2480594b287SEmmanuel Vadot		CAMATA \
2490594b287SEmmanuel Vadot		CAMMMC \
2500594b287SEmmanuel Vadot		CAMNVME \
2510594b287SEmmanuel Vadot		CAMSCSI \
252f61a3898SEmmanuel Vadot		CRYPTO \
253f61a3898SEmmanuel Vadot		EVDEV \
254f61a3898SEmmanuel Vadot		FS9660 \
25567de2db2SVladimir Kondratyev		HID \
256f61a3898SEmmanuel Vadot		HYPERV \
257f61a3898SEmmanuel Vadot		OPENCRYPTO \
2581aaa8f67SJohn Baldwin		NVME \
259f61a3898SEmmanuel Vadot		PCI \
260f61a3898SEmmanuel Vadot		RPC \
261f41efc45SEmmanuel Vadot		SECAUDIT \
262f61a3898SEmmanuel Vadot		TEKEN \
263744bfb21SJohn Baldwin		VERIEXEC \
264744bfb21SJohn Baldwin		WG
265f61a3898SEmmanuel Vadot
266f61a3898SEmmanuel Vadot.if ${MK_IPFILTER} != "no"
267f61a3898SEmmanuel VadotINCSGROUPS+=	IPFILTER
268f61a3898SEmmanuel Vadot.endif
269f61a3898SEmmanuel Vadot
270f61a3898SEmmanuel Vadot.if ${MK_PF} != "no"
271f61a3898SEmmanuel VadotINCSGROUPS+=	PF
272f61a3898SEmmanuel Vadot.endif
273f61a3898SEmmanuel Vadot
274f61a3898SEmmanuel Vadot.if ${MK_CDDL} != "no"
275f61a3898SEmmanuel VadotINCSGROUPS+=	NVPAIR
276f61a3898SEmmanuel Vadot.endif
277f61a3898SEmmanuel Vadot
278f61a3898SEmmanuel Vadot.if ${MK_MLX5TOOL} != "no"
279f61a3898SEmmanuel VadotINCSGROUPS+=	MLX5
280f61a3898SEmmanuel Vadot.endif
281f61a3898SEmmanuel Vadot
2827e4a2c28SEnji Cooper.if ${MK_BLUETOOTH} != "no"
2837e4a2c28SEnji CooperLSUBSUBDIRS+=	netgraph/bluetooth/include
2847e4a2c28SEnji Cooper.endif
2857e4a2c28SEnji Cooper
2868b77741eSEnji Cooper.if ${MK_CUSE} != "no"
2878b77741eSEnji CooperLSUBDIRS+=	fs/cuse
2888b77741eSEnji Cooper.endif
2898b77741eSEnji Cooper
290dd987372STijl Coosemans.if ${MK_GSSAPI} != "no"
291dd987372STijl CoosemansSUBDIR+=	gssapi
292dd987372STijl CoosemansINCS+=		gssapi.h
293dd987372STijl Coosemans.endif
294dd987372STijl Coosemans
295e1fe3dbaSRuslan Ermilov.if ${MK_HESIOD} != "no"
2963d86554cSPoul-Henning KampINCS+=	hesiod.h
2973d86554cSPoul-Henning Kamp.endif
2983d86554cSPoul-Henning Kamp
2990ff204bbSPeter Wemm# Handle the #define aliases for libiconv
3000ff204bbSPeter Wemm.if ${MK_ICONV} == "yes"
301912ce912SPeter WemmINCS+=		iconv.h
3020ff204bbSPeter Wemm.endif
3030ff204bbSPeter Wemm
3047e4a2c28SEnji Cooper.if ${MK_USB} != "no"
3057e4a2c28SEnji CooperLSUBDIRS+=	dev/usb
3067e4a2c28SEnji Cooper.endif
3077e4a2c28SEnji Cooper
308b963e10dSBrandon Bergren.if ${MACHINE_CPUARCH} == "powerpc" && ${MACHINE_ARCH} != "powerpcspe"
3097e4a2c28SEnji Cooper_dev_powermac_nvram=	dev/powermac_nvram
3107e4a2c28SEnji Cooper.endif
3110ff204bbSPeter Wemm
312060f0a17SEmmanuel Vadot# Define SHARED to indicate whether you want symbolic links to the system
313060f0a17SEmmanuel Vadot# source (``symlinks''), or a separate copy (``copies'').  ``symlinks'' is
314060f0a17SEmmanuel Vadot# probably only useful for developers and should be avoided if you do not
315060f0a17SEmmanuel Vadot# wish to tie your /usr/include and /usr/src together.
316060f0a17SEmmanuel Vadot#SHARED=	symlinks
317060f0a17SEmmanuel VadotSHARED?=	copies
318060f0a17SEmmanuel Vadot
319c7b111cbSRuslan ErmilovINCS+=	osreldate.h
3203672faeaSPeter Wemm
32128d60d6aSWarner LoshSYSDIR=			${SRCTOP}/sys
3220210509aSIan LeporeNEWVERS_SH=		${SYSDIR}/conf/newvers.sh
3230210509aSIan LeporePARAM_H=		${SYSDIR}/sys/param.h
324bfe5c479SIan LeporeMK_OSRELDATE_SH=	${.CURDIR}/mk-osreldate.sh
325bfe5c479SIan Lepore
32634ecf418SBryan DrewerySYMLINKS+= ${LIBDIR:C,[^/]+,..,g:C,^/,,}${INCLUDEDIR} ${LIBDIR}/include
327d32e83c2SBryan Drewery
3288e8319a6SBryan Dreweryosreldate.h: ${NEWVERS_SH} ${PARAM_H} ${MK_OSRELDATE_SH}
3298e8319a6SBryan Drewery	env NEWVERS_SH=${NEWVERS_SH} PARAMFILE=${PARAM_H} SYSDIR=${SYSDIR} \
330dd5f1297SIan Lepore	    sh ${MK_OSRELDATE_SH}
3313672faeaSPeter Wemm
332a7aaf57eSRuslan Ermilov.for i in ${LHDRS}
333c7b111cbSRuslan ErmilovINCSLINKS+=	sys/$i ${INCLUDEDIR}/$i
33402cca882SMarcel Moolenaar.endfor
335a7aaf57eSRuslan Ermilov.for i in ${MHDRS}
336c7b111cbSRuslan ErmilovINCSLINKS+=	machine/$i ${INCLUDEDIR}/$i
33702cca882SMarcel Moolenaar.endfor
338a7aaf57eSRuslan Ermilov.for i in ${PHDRS}
3396aeb05d7STom RhodesINCSLINKS+=	sys/$i ${INCLUDEDIR}/$i
34002cca882SMarcel Moolenaar.endfor
34115f3c66cSMarcel Moolenaar
34225faff34SWarner Losh.if ${MACHINE} != ${MACHINE_CPUARCH}
343544de89dSJohn Baldwin_MARCHS=	${MACHINE_CPUARCH}
344544de89dSJohn Baldwin.endif
345544de89dSJohn Baldwin.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
346544de89dSJohn Baldwin_MARCHS+=	x86
3478f3e5dd0SWarner Losh.endif
3488f3e5dd0SWarner Losh
349060f0a17SEmmanuel VadotMETA_TARGETS+=	compat
350060f0a17SEmmanuel Vadotstage_includes: ${SHARED}
351c99b67a7SBryan DrewerySDESTDIR=	${SYSROOT:U${DESTDIR}}
3527750ad47SMarcel Moolenaar
353a270eca5SBruce Evans# Take care of stale directory-level symlinks.
3548d30571dSAlex Richardson# Note: The "|| true" after find is needed in case one of the directories does
3558d30571dSAlex Richardson# not exist (yet).
356060f0a17SEmmanuel Vadotcompat:
3578d30571dSAlex Richardson	cd ${SDESTDIR}${INCLUDEDIR}; find ${LDIRS} ${LSUBDIRS} machine ${_MARCHS} \
3588d30571dSAlex Richardson	    crypto -maxdepth 0 -mindepth 0 -type l -print -delete || true
359a52fd948SAlex Richardson	mtree -deU ${NO_ROOT:D-W} ${MTREE_FOLLOWS_SYMLINKS} \
36028d60d6aSWarner Losh	    -f ${SRCTOP}/etc/mtree/BSD.include.dist \
361c99b67a7SBryan Drewery	    -p ${SDESTDIR}${INCLUDEDIR} > /dev/null
362d5d97bedSMike Karels.for d in ${INCLUDE_SUBDIRS}
363a09ea2bbSBrooks Davis	${INSTALL} -d ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 755 \
364d5d97bedSMike Karels	    ${SDESTDIR}${INCLUDEDIR}/${d}
365d5d97bedSMike Karels.endfor
366a270eca5SBruce Evans
367060f0a17SEmmanuel Vadotcopies: .PHONY .META
3688d30571dSAlex Richardson	cd ${SDESTDIR}${INCLUDEDIR}; find ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} crypto \
3698d30571dSAlex Richardson	    machine machine/pc ${_MARCHS} -maxdepth 1 -mindepth 1 -type l \
3708d30571dSAlex Richardson	    -name "*.h" -print -delete || true
371b6271cc0SEd Maste.for i in ${LDIRS} ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/evdev:Ndev/hid:Ndev/hyperv:Ndev/pci:Ndev/veriexec:Ndev/wg} ${LSUBSUBDIRS}
37228d60d6aSWarner Losh	cd ${SRCTOP}/sys; \
3738b8babf0SKyle Evans	${INSTALL} -C ${TAG_ARGS:D${TAG_ARGS},dev} -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
374c99b67a7SBryan Drewery	    ${SDESTDIR}${INCLUDEDIR}/$i
37515f3c66cSMarcel Moolenaar.endfor
37628d60d6aSWarner Losh	cd ${SRCTOP}/sys/${MACHINE}/include; \
3778b8babf0SKyle Evans	${INSTALL} -C ${TAG_ARGS:D${TAG_ARGS},dev} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
378c99b67a7SBryan Drewery	    ${SDESTDIR}${INCLUDEDIR}/machine
37928d60d6aSWarner Losh.if exists(${SRCTOP}/sys/${MACHINE}/include/pc)
38028d60d6aSWarner Losh	cd ${SRCTOP}/sys/${MACHINE}/include/pc; \
3818b8babf0SKyle Evans	${INSTALL} -C ${TAG_ARGS:D${TAG_ARGS},dev} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
382c99b67a7SBryan Drewery	    ${SDESTDIR}${INCLUDEDIR}/machine/pc
3839f1207d5SRuslan Ermilov.endif
384544de89dSJohn Baldwin.for _MARCH in ${_MARCHS}
38528d60d6aSWarner Losh.if exists(${SRCTOP}/sys/${_MARCH}/include)
3868b8babf0SKyle Evans	${INSTALL} -d ${TAG_ARGS:D${TAG_ARGS},dev} -o ${BINOWN} -g ${BINGRP} -m 755 \
387c99b67a7SBryan Drewery	    ${SDESTDIR}${INCLUDEDIR}/${_MARCH}; \
38828d60d6aSWarner Losh	cd ${SRCTOP}/sys/${_MARCH}/include; \
3898b8babf0SKyle Evans	${INSTALL} -C ${TAG_ARGS:D${TAG_ARGS},dev} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
390c99b67a7SBryan Drewery	    ${SDESTDIR}${INCLUDEDIR}/${_MARCH}
39128d60d6aSWarner Losh.if exists(${SRCTOP}/sys/${_MARCH}/include/pc)
3928b8babf0SKyle Evans	${INSTALL} -d ${TAG_ARGS:D${TAG_ARGS},dev} -o ${BINOWN} -g ${BINGRP} -m 755 \
393c99b67a7SBryan Drewery	    ${SDESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
39428d60d6aSWarner Losh	cd ${SRCTOP}/sys/${_MARCH}/include/pc; \
3958b8babf0SKyle Evans	${INSTALL} -C ${TAG_ARGS:D${TAG_ARGS},dev} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
396c99b67a7SBryan Drewery	    ${SDESTDIR}${INCLUDEDIR}/${_MARCH}/pc
3978f3e5dd0SWarner Losh.endif
3988f3e5dd0SWarner Losh.endif
399544de89dSJohn Baldwin.endfor
40059deaec5SRodney W. Grimes
401060f0a17SEmmanuel Vadotsymlinks: .PHONY .META
402060f0a17SEmmanuel Vadot	@${ECHO} "Setting up symlinks to kernel source tree..."
403060f0a17SEmmanuel Vadot.for i in ${LDIRS}
404060f0a17SEmmanuel Vadot	cd ${SRCTOP}; ${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} \
405060f0a17SEmmanuel Vadot	    $$(printf '../../../%s ' sys/$i/*.h) ${SDESTDIR}${INCLUDEDIR}/$i
406060f0a17SEmmanuel Vadot.endfor
407b6271cc0SEd Maste.for i in ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/evdev:Ndev/hid:Ndev/hyperv:Ndev/pci:Ndev/veriexec:Ndev/wg}
408060f0a17SEmmanuel Vadot	cd ${SRCTOP}; ${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} \
409060f0a17SEmmanuel Vadot	    $$(printf '../../../../%s ' sys/$i/*.h) ${SDESTDIR}${INCLUDEDIR}/$i
410060f0a17SEmmanuel Vadot.endfor
411060f0a17SEmmanuel Vadot	${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} \
412060f0a17SEmmanuel Vadot	    $$(printf '../../../../sys/dev/acpica/%s ' acpiio.h acpi_hpet.h) \
413060f0a17SEmmanuel Vadot	    ${SDESTDIR}${INCLUDEDIR}/dev/acpica; \
414060f0a17SEmmanuel Vadot	${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} ../../../../sys/dev/agp/agpreg.h \
415060f0a17SEmmanuel Vadot	    ${SDESTDIR}${INCLUDEDIR}/dev/agp; \
416060f0a17SEmmanuel Vadot	${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} \
417060f0a17SEmmanuel Vadot	    $$(printf '../../../../sys/dev/evdev/%s ' input.h input-event-codes.h uinput.h) \
418060f0a17SEmmanuel Vadot	    ${SDESTDIR}${INCLUDEDIR}/dev/evdev;
419060f0a17SEmmanuel Vadot	${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} \
420060f0a17SEmmanuel Vadot	    $$(printf '../../../../sys/dev/hid/%s ' hid.h hidraw.h) \
421060f0a17SEmmanuel Vadot	    ${SDESTDIR}${INCLUDEDIR}/dev/hid; \
422060f0a17SEmmanuel Vadot	${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} ../../../../sys/dev/hyperv/include/hyperv.h \
423060f0a17SEmmanuel Vadot	    ${SDESTDIR}${INCLUDEDIR}/dev/hyperv; \
424060f0a17SEmmanuel Vadot	${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} ../../../../sys/dev/hyperv/utilities/hv_snapshot.h \
425060f0a17SEmmanuel Vadot	    ${SDESTDIR}${INCLUDEDIR}/dev/hyperv; \
426060f0a17SEmmanuel Vadot	${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} ../../../../sys/dev/pci/pcireg.h \
427060f0a17SEmmanuel Vadot	    ${SDESTDIR}${INCLUDEDIR}/dev/pci; \
428060f0a17SEmmanuel Vadot	${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} ../../../../sys/dev/veriexec/veriexec_ioctl.h \
429060f0a17SEmmanuel Vadot	    ${SDESTDIR}${INCLUDEDIR}/dev/veriexec;
430060f0a17SEmmanuel Vadot.for i in ${LSUBSUBDIRS}
431060f0a17SEmmanuel Vadot	cd ${SRCTOP}; ${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} \
432060f0a17SEmmanuel Vadot	    $$(printf '../../../../../%s ' sys/$i/*.h) ${SDESTDIR}${INCLUDEDIR}/$i
433060f0a17SEmmanuel Vadot.endfor
434060f0a17SEmmanuel Vadot.if ${MK_IPFILTER} != "no"
435060f0a17SEmmanuel Vadot	cd ${SRCTOP}; ${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} \
4363b9b51feSCy Schubert	    $$(printf '../../../%s ' sys/netpfil/ipfilter/netinet/*.h) \
437060f0a17SEmmanuel Vadot	    ${SDESTDIR}${INCLUDEDIR}/netinet;
438060f0a17SEmmanuel Vadot.endif
439060f0a17SEmmanuel Vadot.if ${MK_PF} != "no"
440060f0a17SEmmanuel Vadot	cd ${SRCTOP}; ${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} \
441060f0a17SEmmanuel Vadot	    $$(printf '../../../../%s ' sys/netpfil/pf/*.h) \
442060f0a17SEmmanuel Vadot	    ${SDESTDIR}${INCLUDEDIR}/netpfil/pf;
443060f0a17SEmmanuel Vadot.endif
4447af04dffSJohn Baldwin	${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} ../../../sys/opencrypto/cryptodev.h \
445060f0a17SEmmanuel Vadot	    ${SDESTDIR}${INCLUDEDIR}/crypto; \
446060f0a17SEmmanuel Vadot	cd ${SRCTOP}; ${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} \
447060f0a17SEmmanuel Vadot	    $$(printf '../../../%s ' sys/${MACHINE}/include/*.h) \
448060f0a17SEmmanuel Vadot	    ${SDESTDIR}${INCLUDEDIR}/machine;
449060f0a17SEmmanuel Vadot.if exists(${SRCTOP}/sys/${MACHINE}/include/pc)
450060f0a17SEmmanuel Vadot	cd ${SRCTOP}; ${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} \
451060f0a17SEmmanuel Vadot	    $$(printf '../../../../%s ' sys/${MACHINE}/include/pc/*.h) \
452060f0a17SEmmanuel Vadot	    ${SDESTDIR}${INCLUDEDIR}/machine/pc;
453060f0a17SEmmanuel Vadot.endif
454060f0a17SEmmanuel Vadot.for _MARCH in ${_MARCHS}
455060f0a17SEmmanuel Vadot.if exists(${SRCTOP}/sys/${_MARCH}/include)
456060f0a17SEmmanuel Vadot	${INSTALL} -d ${TAG_ARGS:D${TAG_ARGS},dev} -o ${BINOWN} -g ${BINGRP} -m 755 \
457060f0a17SEmmanuel Vadot	    ${SDESTDIR}${INCLUDEDIR}/${_MARCH}; \
458060f0a17SEmmanuel Vadot	cd ${SRCTOP}; ${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} \
459060f0a17SEmmanuel Vadot	    $$(printf '../../../%s ' sys/${_MARCH}/include/*.h) \
460060f0a17SEmmanuel Vadot	    ${SDESTDIR}${INCLUDEDIR}/${_MARCH};
461060f0a17SEmmanuel Vadot.if exists(${SRCTOP}/sys/${_MARCH}/include/pc)
462060f0a17SEmmanuel Vadot	${INSTALL} -d ${TAG_ARGS:D${TAG_ARGS},dev} -o ${BINOWN} -g ${BINGRP} -m 755 \
463060f0a17SEmmanuel Vadot	    ${SDESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
464060f0a17SEmmanuel Vadot	cd ${SRCTOP}; ${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} \
465060f0a17SEmmanuel Vadot	    $$(printf '../../../../%s ' sys/${_MARCH}/include/pc/*.h) \
466060f0a17SEmmanuel Vadot	    ${SDESTDIR}${INCLUDEDIR}/${_MARCH}/pc;
467060f0a17SEmmanuel Vadot.endif
468060f0a17SEmmanuel Vadot.endif
469060f0a17SEmmanuel Vadot.endfor
470060f0a17SEmmanuel Vadot	cd ${SRCTOP}; ${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} \
471060f0a17SEmmanuel Vadot	    $$(printf '../../../../%s ' sys/fs/cd9660/*.h) \
472060f0a17SEmmanuel Vadot	    ${SDESTDIR}${INCLUDEDIR}/isofs/cd9660; \
473060f0a17SEmmanuel Vadot	cd ${SRCTOP}; ${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} \
474060f0a17SEmmanuel Vadot	    $$(printf '../../../sys/rpc/%s ' rpcsec_tls.h types.h) \
475060f0a17SEmmanuel Vadot	    ${SDESTDIR}${INCLUDEDIR}/rpc;
476060f0a17SEmmanuel Vadot	cd ${SRCTOP}/sys/rpc;
477060f0a17SEmmanuel Vadot.if ${MK_CDDL} != "no"
478060f0a17SEmmanuel Vadot	${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} \
479060f0a17SEmmanuel Vadot	    ../../../sys/contrib/openzfs/include/sys/nvpair.h \
480060f0a17SEmmanuel Vadot	    ${SDESTDIR}${INCLUDEDIR}/sys
481060f0a17SEmmanuel Vadot.endif
482060f0a17SEmmanuel Vadot.if ${MK_MLX5TOOL} != "no"
483060f0a17SEmmanuel Vadot	${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} ../../../../sys/dev/mlx5/mlx5io.h \
484060f0a17SEmmanuel Vadot	    ${SDESTDIR}${INCLUDEDIR}/dev/mlx5
485060f0a17SEmmanuel Vadot.endif
486060f0a17SEmmanuel Vadot
48794086ceaSBryan Drewery.include <bsd.prog.mk>
48894086ceaSBryan Drewery
489060f0a17SEmmanuel Vadotinstallincludes: ${SHARED}
490060f0a17SEmmanuel Vadot${SHARED}: compat
49194086ceaSBryan Drewery
492dbf5bd50SBryan Drewery.if ${MACHINE} == "host" && !defined(_SKIP_BUILD)
4931a682d2cSSimon J. Gerraty# we're here because we are building a sysroot...
4941a682d2cSSimon J. Gerraty# we need MACHINE et al set correctly
4951a682d2cSSimon J. GerratyHOST_MACHINE!= uname -m
4961a682d2cSSimon J. GerratyHOST_MACHINE_ARCH!= uname -p
4971a682d2cSSimon J. GerratyMACHINE:= ${HOST_MACHINE}
4981a682d2cSSimon J. GerratyMACHINE_ARCH:= ${HOST_MACHINE_ARCH}
4991a682d2cSSimon J. Gerraty.endif
5001a2249ffSBrooks Davis
5011a2249ffSBrooks Davischeck-ldirs:
5021a2249ffSBrooks Davis	missing_dirs=""; \
5031a2249ffSBrooks Davis	for dir in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS}; do \
5041a2249ffSBrooks Davis		if [ ! -d ${SRCTOP}/sys/$$dir ]; then \
5051a2249ffSBrooks Davis			echo "${SRCTOP}/sys/$$dir"; \
5061a2249ffSBrooks Davis			missing_dirs="$$missing_dirs $$dir"; \
5071a2249ffSBrooks Davis		fi; \
5081a2249ffSBrooks Davis	done; \
5091a2249ffSBrooks Davis	if [ -n "$$missing_dirs" ]; then \
5101a2249ffSBrooks Davis		echo "Nonexistant directories:" $$missing_dirs; \
5111a2249ffSBrooks Davis		false; \
5121a2249ffSBrooks Davis	fi
513