xref: /freebsd/include/Makefile (revision d371ed1c4bb6f62b7cfbe8734589a26a9435289d)
1996997fdSBruce Evans#	@(#)Makefile	8.2 (Berkeley) 1/4/94
2a4add9a9SPeter Wemm# $FreeBSD$
359deaec5SRodney W. Grimes#
4a270eca5SBruce Evans# Doing a "make install" builds /usr/include.
559deaec5SRodney W. Grimes
6c6063d0dSWarner Losh.include <src.opts.mk>
7e1fe3dbaSRuslan Ermilov
8bf24694cSGlen BarberPACKAGE=runtime
98e8319a6SBryan DreweryCLEANFILES= osreldate.h version
10dd987372STijl CoosemansSUBDIR= arpa protocols rpcsvc rpc xlocale
11aa92269eSBryan DrewerySUBDIR_PARALLEL=
128bdfc6bfSTim J. RobbinsINCS=	a.out.h ar.h assert.h bitstring.h complex.h cpio.h _ctype.h ctype.h \
1316133e15STim J. Robbins	db.h \
14c544e42bSMarcel Moolenaar	dirent.h dlfcn.h elf.h elf-hints.h err.h fmtmsg.h fnmatch.h fstab.h \
15dd987372STijl Coosemans	fts.h ftw.h getopt.h glob.h grp.h \
161e3f1446SDavid E. O'Brien	ieeefp.h ifaddrs.h \
17c544e42bSMarcel Moolenaar	inttypes.h iso646.h kenv.h langinfo.h libgen.h limits.h link.h \
186b2c15daSJason Evans	locale.h malloc.h malloc_np.h memory.h monetary.h mpool.h mqueue.h \
191332b4bdSRuslan Ermilov	ndbm.h netconfig.h \
20401a7f6fSPeter Wemm	netdb.h nl_types.h nlist.h nss.h nsswitch.h paths.h \
2175067f4fSPoul-Henning Kamp	printf.h proc_service.h pthread.h \
22763ed733SEd Schouten	pthread_np.h pwd.h ranlib.h readpassphrase.h regex.h \
239b0f1823SDavid Xu	res_update.h resolv.h runetype.h search.h semaphore.h setjmp.h \
2406bee445SEd Schouten	signal.h spawn.h stab.h stdalign.h stdbool.h stddef.h \
25367bebd4SEd Schouten	stdnoreturn.h stdio.h stdlib.h string.h stringlist.h \
26f14ad5faSEd Schouten	strings.h sysexits.h tar.h termios.h tgmath.h \
27b902e8b2SStefan Farfeleder	time.h timeconv.h timers.h ttyent.h \
2850c77c6eSEd Schouten	uchar.h ulimit.h unistd.h utime.h utmpx.h uuid.h varargs.h \
29a8ed63bbSDavid Chisnall	wchar.h wctype.h wordexp.h xlocale.h
3059deaec5SRodney W. Grimes
3128d60d6aSWarner Losh.PATH: ${SRCTOP}/contrib/libc-vis
328ccca122SBrooks DavisINCS+=	vis.h
338ccca122SBrooks Davis
34fefa0fd5SAlexander KabaevMHDRS=	float.h floatingpoint.h stdarg.h
35917e476dSPeter Dufault
369b0f1823SDavid XuPHDRS=	sched.h _semaphore.h
37917e476dSPeter Dufault
3806bee445SEd SchoutenLHDRS=	aio.h errno.h fcntl.h linker_set.h poll.h stdatomic.h stdint.h \
3906bee445SEd Schouten	syslog.h ucontext.h
4059deaec5SRodney W. Grimes
4145c203fcSGleb SmirnoffLDIRS=	bsm cam geom net net80211 netgraph netinet netinet6 \
42a7dc3128SBrooks Davis	netipsec netsmb nfs nfsclient nfsserver sys vm
4315f3c66cSMarcel Moolenaar
44a94a63f0SWarner LoshLSUBDIRS=	cam/ata cam/mmc cam/nvme cam/scsi \
45daba5aceSWarner Losh	dev/acpica dev/agp dev/an dev/ciss dev/filemon dev/firewire \
46168fce73SSepherosa Ziehau	dev/hwpmc dev/hyperv \
47e6a376d1SEd Maste	dev/ic dev/iicbus dev/io dev/mfi dev/mmc dev/nvme \
4871fb3739SIan Lepore	dev/ofw dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/pwm \
4971fb3739SIan Lepore	dev/smbus dev/speaker dev/tcp_log dev/veriexec dev/vkbd dev/wi \
50f5a95d9aSWarner Losh	fs/devfs fs/fdescfs fs/msdosfs fs/nfs fs/nullfs \
51237abf0cSDavide Italiano	fs/procfs fs/smbfs fs/udf fs/unionfs \
52f348204cSPawel Jakub Dawidek	geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \
53b3f9d8c8SEdward Tomasz Napierala	geom/mirror geom/mountver geom/multipath geom/nop \
5489b17223SAlexander Motin	geom/raid geom/raid3 geom/shsec geom/stripe geom/virstor \
55772e66a6SGleb Smirnoff	net/altq \
56a6663252SAlexander V. Chernikov	net/route \
57fdbe44b0SGleb Smirnoff	netgraph/atm netgraph/netflow \
58d519cedbSGleb Smirnoff	netinet/cc \
59e5054602SMark Johnston	netinet/netdump \
60*d371ed1cSOlivier Cochard	netinet/tcp_stacks \
61013f1b34SRobert Watson	security/audit \
62fdbe44b0SGleb Smirnoff	security/mac_biba security/mac_bsdextended security/mac_lomac \
63fdbe44b0SGleb Smirnoff	security/mac_mls security/mac_partition \
64eb12b8eaSSimon J. Gerraty	security/mac_veriexec \
6550875ed2SMarcel Moolenaar	sys/disk \
6651be47e4SMark Murray	ufs/ffs ufs/ufs
6715f3c66cSMarcel Moolenaar
6811c63edeSAndrew ThompsonLSUBSUBDIRS=	dev/mpt/mpilib
69c16e2101SJohn Baldwin
707e4a2c28SEnji Cooper.if ${MK_BLUETOOTH} != "no"
717e4a2c28SEnji CooperLSUBSUBDIRS+=	netgraph/bluetooth/include
727e4a2c28SEnji Cooper.endif
737e4a2c28SEnji Cooper
748b77741eSEnji Cooper.if ${MK_CUSE} != "no"
758b77741eSEnji CooperLSUBDIRS+=	fs/cuse
768b77741eSEnji Cooper.endif
778b77741eSEnji Cooper
78dd987372STijl Coosemans.if ${MK_GSSAPI} != "no"
79dd987372STijl CoosemansSUBDIR+=	gssapi
80dd987372STijl CoosemansINCS+=		gssapi.h
81dd987372STijl Coosemans.endif
82dd987372STijl Coosemans
83e1fe3dbaSRuslan Ermilov.if ${MK_HESIOD} != "no"
843d86554cSPoul-Henning KampINCS+=	hesiod.h
853d86554cSPoul-Henning Kamp.endif
863d86554cSPoul-Henning Kamp
870ff204bbSPeter Wemm# Handle the #define aliases for libiconv
880ff204bbSPeter Wemm.if ${MK_ICONV} == "yes"
89912ce912SPeter WemmINCS+=		iconv.h
900ff204bbSPeter Wemm.endif
910ff204bbSPeter Wemm
927e4a2c28SEnji Cooper.if ${MK_USB} != "no"
937e4a2c28SEnji CooperLSUBDIRS+=	dev/usb
947e4a2c28SEnji Cooper.endif
957e4a2c28SEnji Cooper
967e4a2c28SEnji Cooper.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64"
977e4a2c28SEnji Cooper_dev_powermac_nvram=	dev/powermac_nvram
987e4a2c28SEnji Cooper.endif
990ff204bbSPeter Wemm
10015f3c66cSMarcel Moolenaar# Define SHARED to indicate whether you want symbolic links to the system
10115f3c66cSMarcel Moolenaar# source (``symlinks''), or a separate copy (``copies'').  ``symlinks'' is
10215f3c66cSMarcel Moolenaar# probably only useful for developers and should be avoided if you do not
10315f3c66cSMarcel Moolenaar# wish to tie your /usr/include and /usr/src together.
10415f3c66cSMarcel Moolenaar#SHARED=	symlinks
10515f3c66cSMarcel MoolenaarSHARED?=	copies
10659deaec5SRodney W. Grimes
107c7b111cbSRuslan ErmilovINCS+=	osreldate.h
1083672faeaSPeter Wemm
10928d60d6aSWarner LoshSYSDIR=			${SRCTOP}/sys
1100210509aSIan LeporeNEWVERS_SH=		${SYSDIR}/conf/newvers.sh
1110210509aSIan LeporePARAM_H=		${SYSDIR}/sys/param.h
112bfe5c479SIan LeporeMK_OSRELDATE_SH=	${.CURDIR}/mk-osreldate.sh
113bfe5c479SIan Lepore
11434ecf418SBryan DrewerySYMLINKS+= ${LIBDIR:C,[^/]+,..,g:C,^/,,}${INCLUDEDIR} ${LIBDIR}/include
115d32e83c2SBryan Drewery
1168e8319a6SBryan Dreweryosreldate.h: ${NEWVERS_SH} ${PARAM_H} ${MK_OSRELDATE_SH}
1178e8319a6SBryan Drewery	env NEWVERS_SH=${NEWVERS_SH} PARAMFILE=${PARAM_H} SYSDIR=${SYSDIR} \
118dd5f1297SIan Lepore	    sh ${MK_OSRELDATE_SH}
1193672faeaSPeter Wemm
120a7aaf57eSRuslan Ermilov.for i in ${LHDRS}
121c7b111cbSRuslan ErmilovINCSLINKS+=	sys/$i ${INCLUDEDIR}/$i
12202cca882SMarcel Moolenaar.endfor
123a7aaf57eSRuslan Ermilov.for i in ${MHDRS}
124c7b111cbSRuslan ErmilovINCSLINKS+=	machine/$i ${INCLUDEDIR}/$i
12502cca882SMarcel Moolenaar.endfor
126a7aaf57eSRuslan Ermilov.for i in ${PHDRS}
1276aeb05d7STom RhodesINCSLINKS+=	sys/$i ${INCLUDEDIR}/$i
12802cca882SMarcel Moolenaar.endfor
12915f3c66cSMarcel Moolenaar
13025faff34SWarner Losh.if ${MACHINE} != ${MACHINE_CPUARCH}
131544de89dSJohn Baldwin_MARCHS=	${MACHINE_CPUARCH}
132544de89dSJohn Baldwin.endif
133544de89dSJohn Baldwin.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
134544de89dSJohn Baldwin_MARCHS+=	x86
1358f3e5dd0SWarner Losh.endif
1368f3e5dd0SWarner Losh
1379ea89f32SBryan DreweryMETA_TARGETS+=	compat
138f883c0adSBryan Drewerystage_includes: ${SHARED}
139c99b67a7SBryan DrewerySDESTDIR=	${SYSROOT:U${DESTDIR}}
1407750ad47SMarcel Moolenaar
141a270eca5SBruce Evans# Take care of stale directory-level symlinks.
14294086ceaSBryan Drewerycompat:
143544de89dSJohn Baldwin.for i in ${LDIRS} ${LSUBDIRS} machine ${_MARCHS} crypto
144c99b67a7SBryan Drewery	if [ -L ${SDESTDIR}${INCLUDEDIR}/$i ]; then \
145c99b67a7SBryan Drewery		rm -f ${SDESTDIR}${INCLUDEDIR}/$i; \
14615f3c66cSMarcel Moolenaar	fi
14715f3c66cSMarcel Moolenaar.endfor
148a52fd948SAlex Richardson	mtree -deU ${NO_ROOT:D-W} ${MTREE_FOLLOWS_SYMLINKS} \
14928d60d6aSWarner Losh	    -f ${SRCTOP}/etc/mtree/BSD.include.dist \
150c99b67a7SBryan Drewery	    -p ${SDESTDIR}${INCLUDEDIR} > /dev/null
151a270eca5SBruce Evans
1529ea89f32SBryan Drewerycopies: .PHONY .META
153772e66a6SGleb Smirnoff.for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} crypto machine machine/pc \
154544de89dSJohn Baldwin	${_MARCHS}
155c99b67a7SBryan Drewery	if [ -d ${SDESTDIR}${INCLUDEDIR}/$i ]; then \
156c99b67a7SBryan Drewery		cd ${SDESTDIR}${INCLUDEDIR}/$i; \
157a270eca5SBruce Evans		for h in *.h; do \
158a270eca5SBruce Evans			if [ -L $$h ]; then rm -f $$h; fi; \
159df884b5cSBryan Drewery		done; \
160df884b5cSBryan Drewery	fi
161a270eca5SBruce Evans.endfor
162daba5aceSWarner Losh.for i in ${LDIRS} ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/evdev:Ndev/hyperv:Ndev/pci:Ndev/veriexec} ${LSUBSUBDIRS}
16328d60d6aSWarner Losh	cd ${SRCTOP}/sys; \
164bf24694cSGlen Barber	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
165c99b67a7SBryan Drewery	    ${SDESTDIR}${INCLUDEDIR}/$i
16615f3c66cSMarcel Moolenaar.endfor
16728d60d6aSWarner Losh	cd ${SRCTOP}/sys/dev/acpica; \
168bf24694cSGlen Barber	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 acpiio.h \
169c99b67a7SBryan Drewery	    ${SDESTDIR}${INCLUDEDIR}/dev/acpica; \
170bf24694cSGlen Barber	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 acpi_hpet.h \
171c99b67a7SBryan Drewery	    ${SDESTDIR}${INCLUDEDIR}/dev/acpica
17228d60d6aSWarner Losh	cd ${SRCTOP}/sys/dev/agp; \
173bf24694cSGlen Barber	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 agpreg.h \
174c99b67a7SBryan Drewery	    ${SDESTDIR}${INCLUDEDIR}/dev/agp
17528d60d6aSWarner Losh	cd ${SRCTOP}/sys/dev/evdev; \
1763c886805SEmmanuel Vadot	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 input.h \
177c99b67a7SBryan Drewery	    ${SDESTDIR}${INCLUDEDIR}/dev/evdev; \
1783c886805SEmmanuel Vadot	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 input-event-codes.h \
179c99b67a7SBryan Drewery	    ${SDESTDIR}${INCLUDEDIR}/dev/evdev; \
1803c886805SEmmanuel Vadot	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 uinput.h \
181c99b67a7SBryan Drewery	    ${SDESTDIR}${INCLUDEDIR}/dev/evdev
18228d60d6aSWarner Losh	cd ${SRCTOP}/sys/dev/hyperv/include; \
1839622c93aSSepherosa Ziehau	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 hyperv.h \
184c99b67a7SBryan Drewery	    ${SDESTDIR}${INCLUDEDIR}/dev/hyperv
18528d60d6aSWarner Losh	cd ${SRCTOP}/sys/dev/hyperv/utilities; \
186168fce73SSepherosa Ziehau	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 hv_snapshot.h \
187c99b67a7SBryan Drewery	    ${SDESTDIR}${INCLUDEDIR}/dev/hyperv
18828d60d6aSWarner Losh	cd ${SRCTOP}/sys/dev/pci; \
189bf24694cSGlen Barber	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 pcireg.h \
190c99b67a7SBryan Drewery	    ${SDESTDIR}${INCLUDEDIR}/dev/pci
191eb12b8eaSSimon J. Gerraty	cd ${SRCTOP}/sys/dev/veriexec; \
1923c886805SEmmanuel Vadot	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 veriexec_ioctl.h \
193eb12b8eaSSimon J. Gerraty	    ${SDESTDIR}${INCLUDEDIR}/dev/veriexec
19428d60d6aSWarner Losh	cd ${SRCTOP}/sys/fs/cd9660/; \
195bf24694cSGlen Barber	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
196c99b67a7SBryan Drewery	    ${SDESTDIR}${INCLUDEDIR}/isofs/cd9660
197e1fe3dbaSRuslan Ermilov.if ${MK_IPFILTER} != "no"
19828d60d6aSWarner Losh	cd ${SRCTOP}/sys/contrib/ipfilter/netinet; \
199bf24694cSGlen Barber	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
200c99b67a7SBryan Drewery	    ${SDESTDIR}${INCLUDEDIR}/netinet
201f98a656cSScott Long.endif
202b6883113SSean Bruno.if ${MK_PF} != "no"
20328d60d6aSWarner Losh	cd ${SRCTOP}/sys/netpfil/pf; \
204bf24694cSGlen Barber	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
205c99b67a7SBryan Drewery	    ${SDESTDIR}${INCLUDEDIR}/netpfil/pf
206b6883113SSean Bruno.endif
20728d60d6aSWarner Losh	cd ${SRCTOP}/sys/crypto; \
208bf24694cSGlen Barber	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 rijndael/rijndael.h \
209c99b67a7SBryan Drewery	    ${SDESTDIR}${INCLUDEDIR}/crypto
21028d60d6aSWarner Losh	cd ${SRCTOP}/sys/opencrypto; \
211bf24694cSGlen Barber	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
212c99b67a7SBryan Drewery	    ${SDESTDIR}${INCLUDEDIR}/crypto
21328d60d6aSWarner Losh	cd ${SRCTOP}/sys/${MACHINE}/include; \
214bf24694cSGlen Barber	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
215c99b67a7SBryan Drewery	    ${SDESTDIR}${INCLUDEDIR}/machine
21628d60d6aSWarner Losh.if exists(${SRCTOP}/sys/${MACHINE}/include/pc)
21728d60d6aSWarner Losh	cd ${SRCTOP}/sys/${MACHINE}/include/pc; \
218bf24694cSGlen Barber	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
219c99b67a7SBryan Drewery	    ${SDESTDIR}${INCLUDEDIR}/machine/pc
2209f1207d5SRuslan Ermilov.endif
221544de89dSJohn Baldwin.for _MARCH in ${_MARCHS}
22228d60d6aSWarner Losh.if exists(${SRCTOP}/sys/${_MARCH}/include)
223bf24694cSGlen Barber	${INSTALL} -d ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 755 \
224c99b67a7SBryan Drewery	    ${SDESTDIR}${INCLUDEDIR}/${_MARCH}; \
22528d60d6aSWarner Losh	cd ${SRCTOP}/sys/${_MARCH}/include; \
226bf24694cSGlen Barber	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
227c99b67a7SBryan Drewery	    ${SDESTDIR}${INCLUDEDIR}/${_MARCH}
22828d60d6aSWarner Losh.if exists(${SRCTOP}/sys/${_MARCH}/include/pc)
229bf24694cSGlen Barber	${INSTALL} -d ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 755 \
230c99b67a7SBryan Drewery	    ${SDESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
23128d60d6aSWarner Losh	cd ${SRCTOP}/sys/${_MARCH}/include/pc; \
232bf24694cSGlen Barber	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
233c99b67a7SBryan Drewery	    ${SDESTDIR}${INCLUDEDIR}/${_MARCH}/pc
2348f3e5dd0SWarner Losh.endif
2358f3e5dd0SWarner Losh.endif
236544de89dSJohn Baldwin.endfor
23728d60d6aSWarner Losh	cd ${SRCTOP}/sys/rpc; \
2386ecaf8f4SRick Macklem	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 rpcsec_tls.h \
2396ecaf8f4SRick Macklem	    ${SDESTDIR}${INCLUDEDIR}/rpc
24031e71d07SRick Macklem	cd ${SRCTOP}/sys/rpc; \
241bf24694cSGlen Barber	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 types.h \
242c99b67a7SBryan Drewery	    ${SDESTDIR}${INCLUDEDIR}/rpc
24328d60d6aSWarner Losh	cd ${SRCTOP}/sys/teken; \
244bf24694cSGlen Barber	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 teken.h \
245c99b67a7SBryan Drewery	    ${SDESTDIR}${INCLUDEDIR}/teken
246dca5dd68SAndriy Gapon.if ${MK_CDDL} != "no"
24728d60d6aSWarner Losh	cd ${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys; \
248dca5dd68SAndriy Gapon	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 nvpair.h \
249c99b67a7SBryan Drewery	    ${SDESTDIR}${INCLUDEDIR}/sys
250dca5dd68SAndriy Gapon.endif
251e808190aSHans Petter Selasky.if ${MK_MLX5TOOL} != "no"
252e808190aSHans Petter Selasky	cd ${SRCTOP}/sys/dev/mlx5; \
253e808190aSHans Petter Selasky	${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 mlx5io.h \
254e808190aSHans Petter Selasky	    ${SDESTDIR}${INCLUDEDIR}/dev/mlx5
255e808190aSHans Petter Selasky.endif
25659deaec5SRodney W. Grimes
2579ea89f32SBryan Drewerysymlinks: .PHONY .META
25815f3c66cSMarcel Moolenaar	@${ECHO} "Setting up symlinks to kernel source tree..."
259400dc950SPeter Wemm.for i in ${LDIRS}
26028d60d6aSWarner Losh	cd ${SRCTOP}/sys/$i; \
261a270eca5SBruce Evans	for h in *.h; do \
262c99b67a7SBryan Drewery		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../sys/$i/$$h ${SDESTDIR}${INCLUDEDIR}/$i; \
263a270eca5SBruce Evans	done
26415f3c66cSMarcel Moolenaar.endfor
265daba5aceSWarner Losh.for i in ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/evdev:Ndev/hyperv:Ndev/pci:Ndev/veriexec}
26628d60d6aSWarner Losh	cd ${SRCTOP}/sys/$i; \
267a270eca5SBruce Evans	for h in *.h; do \
268c99b67a7SBryan Drewery		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/$i/$$h ${SDESTDIR}${INCLUDEDIR}/$i; \
269a270eca5SBruce Evans	done
270400dc950SPeter Wemm.endfor
27128d60d6aSWarner Losh	cd ${SRCTOP}/sys/dev/acpica; \
2723149cc9dSRui Paulo	for h in acpiio.h acpi_hpet.h; do \
273bf24694cSGlen Barber		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/dev/acpica/$$h \
274c99b67a7SBryan Drewery		    ${SDESTDIR}${INCLUDEDIR}/dev/acpica; \
2759f97a43bSNate Lawson	done
27628d60d6aSWarner Losh	cd ${SRCTOP}/sys/dev/agp; \
2770895e9c7SJohn Baldwin	for h in agpreg.h; do \
278bf24694cSGlen Barber		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/dev/agp/$$h \
279c99b67a7SBryan Drewery		    ${SDESTDIR}${INCLUDEDIR}/dev/agp; \
2800895e9c7SJohn Baldwin	done
28128d60d6aSWarner Losh	cd ${SRCTOP}/sys/dev/evdev; \
2822b3f6d66SOleksandr Tymoshenko	for h in input.h input-event-codes.h uinput.h; do \
2832b3f6d66SOleksandr Tymoshenko		ln -fs ../../../../sys/dev/evdev/$$h \
284c99b67a7SBryan Drewery		    ${SDESTDIR}${INCLUDEDIR}/dev/evdev; \
2852b3f6d66SOleksandr Tymoshenko	done
28628d60d6aSWarner Losh	cd ${SRCTOP}/sys/dev/hyperv/include; \
2879622c93aSSepherosa Ziehau	for h in hyperv.h; do \
2889622c93aSSepherosa Ziehau		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/dev/hyperv/include/$$h \
289c99b67a7SBryan Drewery		    ${SDESTDIR}${INCLUDEDIR}/dev/hyperv; \
2909622c93aSSepherosa Ziehau	done
29128d60d6aSWarner Losh	cd ${SRCTOP}/sys/dev/hyperv/utilities; \
292168fce73SSepherosa Ziehau	for h in hv_snapshot.h; do \
293168fce73SSepherosa Ziehau		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/dev/hyperv/utilities/$$h \
294c99b67a7SBryan Drewery		    ${SDESTDIR}${INCLUDEDIR}/dev/hyperv; \
295168fce73SSepherosa Ziehau	done
29628d60d6aSWarner Losh	cd ${SRCTOP}/sys/dev/pci; \
2970895e9c7SJohn Baldwin	for h in pcireg.h; do \
298bf24694cSGlen Barber		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/dev/pci/$$h \
299c99b67a7SBryan Drewery		    ${SDESTDIR}${INCLUDEDIR}/dev/pci; \
3000895e9c7SJohn Baldwin	done
301eb12b8eaSSimon J. Gerraty	cd ${SRCTOP}/sys/dev/veriexec; \
302eb12b8eaSSimon J. Gerraty	for h in veriexec_ioctl.h; do \
303eb12b8eaSSimon J. Gerraty		ln -fs ../../../../sys/dev/veriexec/$$h \
304eb12b8eaSSimon J. Gerraty		    ${SDESTDIR}${INCLUDEDIR}/dev/veriexec; \
305eb12b8eaSSimon J. Gerraty	done
306a270eca5SBruce Evans.for i in ${LSUBSUBDIRS}
30728d60d6aSWarner Losh	cd ${SRCTOP}/sys/$i; \
308a270eca5SBruce Evans	for h in *.h; do \
309c99b67a7SBryan Drewery		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../../sys/$i/$$h ${SDESTDIR}${INCLUDEDIR}/$i; \
310a270eca5SBruce Evans	done
311a270eca5SBruce Evans.endfor
312e1fe3dbaSRuslan Ermilov.if ${MK_IPFILTER} != "no"
31328d60d6aSWarner Losh	cd ${SRCTOP}/sys/contrib/ipfilter/netinet; \
314a97ec006SRuslan Ermilov	for h in *.h; do \
315bf24694cSGlen Barber		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../sys/contrib/ipfilter/netinet/$$h \
316c99b67a7SBryan Drewery		    ${SDESTDIR}${INCLUDEDIR}/netinet; \
317a97ec006SRuslan Ermilov	done
318f98a656cSScott Long.endif
31975bf2db3SGleb Smirnoff.if ${MK_PF} != "no"
32028d60d6aSWarner Losh	cd ${SRCTOP}/sys/netpfil/pf; \
32175bf2db3SGleb Smirnoff	for h in *.h; do \
322bf24694cSGlen Barber		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/netpfil/pf/$$h \
323c99b67a7SBryan Drewery		    ${SDESTDIR}${INCLUDEDIR}/netpfil/pf; \
32475bf2db3SGleb Smirnoff	done
32575bf2db3SGleb Smirnoff.endif
32628d60d6aSWarner Losh	cd ${SRCTOP}/sys/crypto; \
327df3c03a7SHajimu UMEMOTO	for h in rijndael/rijndael.h; do \
328bf24694cSGlen Barber		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../sys/crypto/$$h \
329c99b67a7SBryan Drewery		    ${SDESTDIR}${INCLUDEDIR}/crypto; \
330df3c03a7SHajimu UMEMOTO	done
33128d60d6aSWarner Losh	cd ${SRCTOP}/sys/opencrypto; \
332a270eca5SBruce Evans	for h in *.h; do \
333bf24694cSGlen Barber		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../sys/opencrypto/$$h \
334c99b67a7SBryan Drewery		    ${SDESTDIR}${INCLUDEDIR}/crypto; \
335a270eca5SBruce Evans	done
33628d60d6aSWarner Losh	cd ${SRCTOP}/sys/${MACHINE}/include; \
337a270eca5SBruce Evans	for h in *.h; do \
338bf24694cSGlen Barber		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../sys/${MACHINE}/include/$$h \
339c99b67a7SBryan Drewery		    ${SDESTDIR}${INCLUDEDIR}/machine; \
340a270eca5SBruce Evans	done
34128d60d6aSWarner Losh.if exists(${SRCTOP}/sys/${MACHINE}/include/pc)
34228d60d6aSWarner Losh	cd ${SRCTOP}/sys/${MACHINE}/include/pc; \
343a270eca5SBruce Evans	for h in *.h; do \
344bf24694cSGlen Barber		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/${MACHINE}/include/pc/$$h \
345c99b67a7SBryan Drewery		    ${SDESTDIR}${INCLUDEDIR}/machine/pc; \
346a270eca5SBruce Evans	done
347a270eca5SBruce Evans.endif
348544de89dSJohn Baldwin.for _MARCH in ${_MARCHS}
34928d60d6aSWarner Losh.if exists(${SRCTOP}/sys/${_MARCH}/include)
350bf24694cSGlen Barber	${INSTALL} -d ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 755 \
351c99b67a7SBryan Drewery	    ${SDESTDIR}${INCLUDEDIR}/${_MARCH}; \
35228d60d6aSWarner Losh	cd ${SRCTOP}/sys/${_MARCH}/include; \
3538f3e5dd0SWarner Losh	for h in *.h; do \
354bf24694cSGlen Barber		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../sys/${_MARCH}/include/$$h \
355c99b67a7SBryan Drewery		    ${SDESTDIR}${INCLUDEDIR}/${_MARCH}; \
3568f3e5dd0SWarner Losh	done
35728d60d6aSWarner Losh.if exists(${SRCTOP}/sys/${_MARCH}/include/pc)
358bf24694cSGlen Barber	${INSTALL} -d ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 755 \
359c99b67a7SBryan Drewery	    ${SDESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
36028d60d6aSWarner Losh	cd ${SRCTOP}/sys/${_MARCH}/include/pc; \
3618f3e5dd0SWarner Losh	for h in *.h; do \
362bf24694cSGlen Barber		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/${_MARCH}/include/pc/$$h \
363c99b67a7SBryan Drewery		    ${SDESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
3648f3e5dd0SWarner Losh	done
3658f3e5dd0SWarner Losh.endif
3668f3e5dd0SWarner Losh.endif
367544de89dSJohn Baldwin.endfor
36828d60d6aSWarner Losh	cd ${SRCTOP}/sys/fs/cd9660; \
369d139ce67SCraig Rodrigues	for h in *.h; do \
370bf24694cSGlen Barber		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/fs/cd9660/$$h \
371c99b67a7SBryan Drewery		    ${SDESTDIR}${INCLUDEDIR}/isofs/cd9660; \
372d139ce67SCraig Rodrigues	done
37328d60d6aSWarner Losh	cd ${SRCTOP}/sys/rpc; \
3746ecaf8f4SRick Macklem	for h in rpcsec_tls.h types.h; do \
375bf24694cSGlen Barber		${INSTALL_SYMLINK} ${TAG_ARGS} ../../../sys/rpc/$$h \
376c99b67a7SBryan Drewery		    ${SDESTDIR}${INCLUDEDIR}/rpc; \
3770fdce727SPawel Jakub Dawidek	done
378cd87846eSKyle Evans.if ${MK_CDDL} != "no"
379cd87846eSKyle Evans	${INSTALL_SYMLINK} ${TAG_ARGS} \
380cd87846eSKyle Evans	    ../../../sys/cddl/contrib/opensolaris/uts/common/sys/nvpair.h \
381cd87846eSKyle Evans	    ${SDESTDIR}${INCLUDEDIR}/sys
382cd87846eSKyle Evans.endif
383e808190aSHans Petter Selasky.if ${MK_MLX5TOOL} != "no"
384e808190aSHans Petter Selasky	${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/dev/mlx5/mlx5io.h \
385e808190aSHans Petter Selasky	    ${SDESTDIR}${INCLUDEDIR}/dev/mlx5
386e808190aSHans Petter Selasky.endif
3871a682d2cSSimon J. Gerraty
38894086ceaSBryan Drewery.include <bsd.prog.mk>
38994086ceaSBryan Drewery
39094086ceaSBryan Dreweryinstallincludes: ${SHARED}
39194086ceaSBryan Drewery${SHARED}: compat
39294086ceaSBryan Drewery
393dbf5bd50SBryan Drewery.if ${MACHINE} == "host" && !defined(_SKIP_BUILD)
3941a682d2cSSimon J. Gerraty# we're here because we are building a sysroot...
3951a682d2cSSimon J. Gerraty# we need MACHINE et al set correctly
3961a682d2cSSimon J. GerratyHOST_MACHINE!= uname -m
3971a682d2cSSimon J. GerratyHOST_MACHINE_ARCH!= uname -p
3981a682d2cSSimon J. GerratyMACHINE:= ${HOST_MACHINE}
3991a682d2cSSimon J. GerratyMACHINE_ARCH:= ${HOST_MACHINE_ARCH}
4001a682d2cSSimon J. Gerraty.endif
401