xref: /freebsd/include/Makefile (revision 8aac90f18aef7c9eea906c3ff9a001ca7b94f375)
1# Doing a "make install" builds /usr/include.
2
3.include <src.opts.mk>
4
5PACKAGE=clibs
6CLEANFILES= osreldate.h version
7SUBDIR= arpa protocols rpcsvc rpc ssp xlocale
8.if ${MACHINE_CPUARCH} == "amd64"
9SUBDIR+=		i386
10INCLUDE_SUBDIRS+=	i386
11.endif
12.if ${MACHINE_CPUARCH} == "aarch64"
13SUBDIR+=		arm
14INCLUDE_SUBDIRS+=	arm
15.endif
16SUBDIR_PARALLEL=
17INCS=	a.out.h ar.h assert.h bitstring.h byteswap.h \
18	complex.h cpio.h _ctype.h ctype.h \
19	db.h \
20	dirent.h dlfcn.h elf.h elf-hints.h endian.h err.h fmtmsg.h fnmatch.h \
21	fstab.h fts.h ftw.h getopt.h glob.h grp.h \
22	ieeefp.h ifaddrs.h \
23	inttypes.h iso646.h kenv.h langinfo.h libgen.h limits.h link.h \
24	locale.h malloc.h malloc_np.h memory.h monetary.h mpool.h mqueue.h \
25	ndbm.h netconfig.h \
26	netdb.h nl_types.h nlist.h nss.h nsswitch.h paths.h \
27	printf.h proc_service.h pthread.h \
28	pthread_np.h pwd.h ranlib.h readpassphrase.h regex.h \
29	res_update.h resolv.h runetype.h sched.h \
30	search.h semaphore.h setjmp.h \
31	signal.h spawn.h stab.h stdalign.h stdbool.h stdckdint.h stddef.h \
32	stdnoreturn.h stdio.h stdlib.h string.h stringlist.h \
33	strings.h sysexits.h tar.h termios.h tgmath.h \
34	time.h timeconv.h timers.h ttyent.h \
35	uchar.h ulimit.h unistd.h utime.h utmpx.h uuid.h varargs.h \
36	wchar.h wctype.h wordexp.h xlocale.h
37
38.PATH: ${SRCTOP}/contrib/libc-vis
39INCS+=	vis.h
40
41MHDRS=	float.h floatingpoint.h stdarg.h
42
43PHDRS=	_semaphore.h
44
45LHDRS=	aio.h errno.h fcntl.h linker_set.h poll.h stdatomic.h stdint.h \
46	syslog.h ucontext.h
47
48LDIRS=	geom net net80211 netgraph netinet netinet6 \
49	netipsec netlink netsmb nfs nfsclient nfsserver sys vm
50
51LSUBDIRS=	dev/acpica dev/agp dev/ciss dev/filemon dev/firewire \
52	dev/hwpmc dev/hyperv \
53	dev/ic dev/iicbus dev/io dev/mfi dev/mmc \
54	dev/ofw dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/pwm \
55	dev/smbus dev/speaker dev/tcp_log dev/veriexec dev/vkbd dev/wg \
56	fs/devfs fs/fdescfs fs/msdosfs fs/nfs fs/nullfs \
57	fs/procfs fs/smbfs fs/udf fs/unionfs \
58	geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \
59	geom/mirror geom/mountver geom/multipath geom/nop \
60	geom/raid geom/raid3 geom/shsec geom/stripe geom/union geom/virstor \
61	net/altq \
62	net/route \
63	netgraph/netflow \
64	netinet/cc \
65	netinet/netdump \
66	netinet/tcp_stacks \
67	netlink/route \
68	security/mac_biba security/mac_bsdextended \
69	security/mac_grantbylabel \
70	security/mac_lomac \
71	security/mac_mls security/mac_partition \
72	security/mac_veriexec \
73	sys/disk \
74	ufs/ffs ufs/ufs
75
76LSUBSUBDIRS=	dev/mpt/mpilib
77
78.PATH: ${SRCTOP}/sys/dev/acpica
79ACPICA=		acpi_hpet.h \
80		acpiio.h
81ACPICADIR=	${INCLUDEDIR}/dev/acpica
82
83.PATH: ${SRCTOP}/sys/dev/agp
84AGP=		agpreg.h
85AGPDIR=		${INCLUDEDIR}/dev/agp
86
87.PATH: ${SRCTOP}/sys/bsm
88BSM=		audit.h \
89		audit_errno.h \
90		audit_internal.h \
91		audit_record.h \
92		audit_domain.h \
93		audit_fcntl.h \
94		audit_kevents.h \
95		audit_socket_type.h
96BSMPACKAGE=	libbsm
97BSMDIR=		${INCLUDEDIR}/bsm
98
99.PATH: ${SRCTOP}/sys/security
100SECAUDIT=	audit/audit.h \
101		audit/audit_ioctl.h \
102		audit/audit_private.h
103SECAUDITPACKAGE=	libbsm
104SECAUDITDIR=	${INCLUDEDIR}/security/audit
105
106.PATH:	${SRCTOP}/sys/cam
107CAM=	cam.h \
108	cam_ccb.h \
109	cam_compat.h \
110	cam_debug.h \
111	cam_iosched.h \
112	cam_periph.h \
113	cam_queue.h \
114	cam_sim.h \
115	cam_xpt.h \
116	cam_xpt_internal.h \
117	cam_xpt_periph.h \
118	cam_xpt_sim.h
119CAMDIR=	${INCLUDEDIR}/cam
120
121.PATH: ${SRCTOP}/sys/cam/ata
122CAMATA=		ata_all.h
123CAMATADIR=	${INCLUDEDIR}/cam/ata
124
125.PATH: ${SRCTOP}/sys/cam/mmc
126CAMMMC=		mmc.h \
127		mmc_bus.h \
128		mmc_all.h
129CAMMMCDIR=	${INCLUDEDIR}/cam/mmc
130
131.PATH: ${SRCTOP}/sys/cam/nvme
132CAMNVME=	nvme_all.h
133CAMNVMEDIR=	${INCLUDEDIR}/cam/nvme
134
135.PATH: ${SRCTOP}/sys/cam/scsi
136CAMSCSI=	scsi_all.h \
137		scsi_cd.h \
138		scsi_ch.h \
139		scsi_da.h \
140		scsi_enc.h \
141		scsi_enc_internal.h \
142		scsi_iu.h \
143		scsi_message.h \
144		scsi_pass.h \
145		scsi_pt.h \
146		scsi_sa.h \
147		scsi_ses.h \
148		scsi_sg.h \
149		scsi_targetio.h \
150		smp_all.h
151CAMSCSIDIR=	${INCLUDEDIR}/cam/scsi
152
153.PATH: ${SRCTOP}/sys/fs/cd9660
154FS9660=		cd9660_mount.h \
155		cd9660_node.h \
156		cd9660_rrip.h \
157		iso.h \
158		iso_rrip.h
159FS9660DIR=	${INCLUDEDIR}/isofs/cd9660
160
161.PATH: ${SRCTOP}/sys/dev/evdev
162EVDEV=		input.h \
163		input-event-codes.h \
164		uinput.h
165EVDEVDIR=	${INCLUDEDIR}/dev/evdev
166
167.PATH: ${SRCTOP}/sys/dev/hid
168HID=		hid.h \
169		hidraw.h
170HIDDIR=		${INCLUDEDIR}/dev/hid
171
172.PATH: ${SRCTOP}/sys/dev/hyperv/include ${SRCTOP}/sys/dev/hyperv/utilities
173HYPERV=		hv_snapshot.h \
174		hyperv.h
175HYPERVDIR=	${INCLUDEDIR}/dev/hyperv
176
177.PATH: ${SRCTOP}/sys/opencrypto
178OPENCRYPTO=	cryptodev.h
179OPENCRYPTODIR=	${INCLUDEDIR}/crypto
180
181.PATH: ${SRCTOP}/sys/dev/nvme
182NVME=		nvme.h
183NVMEDIR=	${INCLUDEDIR}/dev/nvme
184
185.PATH: ${SRCTOP}/sys/dev/nvmf
186NVMF=		nvmf.h \
187		nvmf_proto.h
188NVMFDIR=	${INCLUDEDIR}/dev/nvmf
189
190.PATH: ${SRCTOP}/sys/dev/pci
191PCI=		pcireg.h
192PCIDIR=		${INCLUDEDIR}/dev/pci
193
194.PATH: ${SRCTOP}/sys/dev/veriexec
195VERIEXEC=	veriexec_ioctl.h
196VERIEXECDIR=	${INCLUDEDIR}/dev/veriexec
197
198.PATH: ${SRCTOP}/sys/netpfil/ipfilter/netinet
199IPFILTER=	ip_auth.h \
200		ip_compat.h \
201		ip_dstlist.h \
202		ip_fil.h \
203		ip_frag.h \
204		ip_htable.h \
205		ip_lookup.h \
206		ip_nat.h \
207		ip_pool.h \
208		ip_proxy.h \
209		ip_rules.h \
210		ip_scan.h \
211		ip_state.h \
212		ip_sync.h \
213		ipf_rb.h \
214		ipl.h \
215		radix_ipf.h
216IPFILTERDIR=	${INCLUDEDIR}/netinet
217
218.PATH: ${SRCTOP}/sys/netpfil/pf
219PF=		pf.h \
220		pf_altq.h \
221		pf_mtag.h \
222		pf_nl.h
223PFPACKAGE=	pf
224PFDIR=	${INCLUDEDIR}/netpfil/pf
225
226.PATH: ${SRCTOP}/sys/rpc
227RPC=		rpcsec_tls.h \
228		types.h
229RPCDIR=		${INCLUDEDIR}/rpc
230
231.PATH: ${SRCTOP}/sys/teken
232TEKEN=		teken.h
233TEKENDIR=	${INCLUDEDIR}/teken
234
235.PATH: ${SRCTOP}/sys/contrib/openzfs/include/sys
236NVPAIR=		nvpair.h
237NVPAIRDIR=	${INCLUDEDIR}/sys
238
239.PATH: ${SRCTOP}/sys/dev/mlx5
240MLX5=		mlx5io.h
241MLX5DIR=	${INCLUDEDIR}/dev/mlx5
242
243.PATH: ${SRCTOP}/sys/dev/wg
244WG=		if_wg.h
245WGDIR=		${INCLUDEDIR}/dev/wg
246
247INCSGROUPS=	INCS \
248		ACPICA \
249		AGP \
250		BSM \
251		CAM \
252		CAMATA \
253		CAMMMC \
254		CAMNVME \
255		CAMSCSI \
256		CRYPTO \
257		EVDEV \
258		FS9660 \
259		HID \
260		HYPERV \
261		OPENCRYPTO \
262		NVME \
263		NVMF \
264		PCI \
265		RPC \
266		SECAUDIT \
267		TEKEN \
268		VERIEXEC \
269		WG
270
271.if ${MK_IPFILTER} != "no"
272INCSGROUPS+=	IPFILTER
273.endif
274
275.if ${MK_PF} != "no"
276INCSGROUPS+=	PF
277.endif
278
279.if ${MK_CDDL} != "no"
280INCSGROUPS+=	NVPAIR
281.endif
282
283.if ${MK_MLX5TOOL} != "no"
284INCSGROUPS+=	MLX5
285.endif
286
287.if ${MK_BLUETOOTH} != "no"
288LSUBSUBDIRS+=	netgraph/bluetooth/include
289.endif
290
291.if ${MK_CUSE} != "no"
292LSUBDIRS+=	fs/cuse
293.endif
294
295.if ${MK_GSSAPI} != "no"
296SUBDIR+=	gssapi
297INCS+=		gssapi.h
298.endif
299
300.if ${MK_HESIOD} != "no"
301INCS+=	hesiod.h
302.endif
303
304# Handle the #define aliases for libiconv
305.if ${MK_ICONV} == "yes"
306INCS+=		iconv.h
307.endif
308
309.if ${MK_USB} != "no"
310LSUBDIRS+=	dev/usb
311.endif
312
313.if ${MACHINE_CPUARCH} == "powerpc" && ${MACHINE_ARCH} != "powerpcspe"
314_dev_powermac_nvram=	dev/powermac_nvram
315.endif
316
317# Define SHARED to indicate whether you want symbolic links to the system
318# source (``symlinks''), or a separate copy (``copies'').  ``symlinks'' is
319# probably only useful for developers and should be avoided if you do not
320# wish to tie your /usr/include and /usr/src together.
321#SHARED=	symlinks
322SHARED?=	copies
323
324INCS+=	osreldate.h
325
326SYSDIR=			${SRCTOP}/sys
327NEWVERS_SH=		${SYSDIR}/conf/newvers.sh
328PARAM_H=		${SYSDIR}/sys/param.h
329MK_OSRELDATE_SH=	${.CURDIR}/mk-osreldate.sh
330
331SYMLINKS+= ${LIBDIR:C,[^/]+,..,g:C,^/,,}${INCLUDEDIR} ${LIBDIR}/include
332
333osreldate.h: ${NEWVERS_SH} ${PARAM_H} ${MK_OSRELDATE_SH}
334	env NEWVERS_SH=${NEWVERS_SH} PARAMFILE=${PARAM_H} SYSDIR=${SYSDIR} \
335	    sh ${MK_OSRELDATE_SH}
336
337.for i in ${LHDRS}
338INCSLINKS+=	sys/$i ${INCLUDEDIR}/$i
339.endfor
340.for i in ${MHDRS}
341INCSLINKS+=	machine/$i ${INCLUDEDIR}/$i
342.endfor
343.for i in ${PHDRS}
344INCSLINKS+=	sys/$i ${INCLUDEDIR}/$i
345.endfor
346
347.if ${MACHINE} != ${MACHINE_CPUARCH}
348_MARCHS=	${MACHINE_CPUARCH}
349.endif
350.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
351_MARCHS+=	x86
352.endif
353
354META_TARGETS+=	compat
355stage_includes: ${SHARED}
356SDESTDIR?=	${SYSROOT:U${DESTDIR}}
357
358# Take care of stale directory-level symlinks.
359# Note: The "|| true" after find is needed in case one of the directories does
360# not exist (yet).
361compat:
362	cd ${SDESTDIR}${INCLUDEDIR}; find ${LDIRS} ${LSUBDIRS} machine ${_MARCHS} \
363	    crypto -maxdepth 0 -mindepth 0 -type l -print -delete || true
364	mtree -deU ${NO_ROOT:D-W} ${MTREE_FOLLOWS_SYMLINKS} \
365	    -f ${SRCTOP}/etc/mtree/BSD.include.dist \
366	    -p ${SDESTDIR}${INCLUDEDIR} > /dev/null
367.for d in ${INCLUDE_SUBDIRS}
368	${INSTALL} -d ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 755 \
369	    ${SDESTDIR}${INCLUDEDIR}/${d}
370.endfor
371
372copies: .PHONY .META
373	cd ${SDESTDIR}${INCLUDEDIR}; find ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} crypto \
374	    machine machine/pc ${_MARCHS} -maxdepth 1 -mindepth 1 -type l \
375	    -name "*.h" -print -delete || true
376.for i in ${LDIRS} ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/evdev:Ndev/hid:Ndev/hyperv:Ndev/pci:Ndev/veriexec:Ndev/wg} ${LSUBSUBDIRS}
377	cd ${SRCTOP}/sys; \
378	${INSTALL} -C ${TAG_ARGS:D${TAG_ARGS},dev} -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
379	    ${SDESTDIR}${INCLUDEDIR}/$i
380.endfor
381	cd ${SRCTOP}/sys/${MACHINE}/include; \
382	${INSTALL} -C ${TAG_ARGS:D${TAG_ARGS},dev} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
383	    ${SDESTDIR}${INCLUDEDIR}/machine
384.if exists(${SRCTOP}/sys/${MACHINE}/include/pc)
385	cd ${SRCTOP}/sys/${MACHINE}/include/pc; \
386	${INSTALL} -C ${TAG_ARGS:D${TAG_ARGS},dev} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
387	    ${SDESTDIR}${INCLUDEDIR}/machine/pc
388.endif
389.for _MARCH in ${_MARCHS}
390.if exists(${SRCTOP}/sys/${_MARCH}/include)
391	${INSTALL} -d ${TAG_ARGS:D${TAG_ARGS},dev} -o ${BINOWN} -g ${BINGRP} -m 755 \
392	    ${SDESTDIR}${INCLUDEDIR}/${_MARCH}; \
393	cd ${SRCTOP}/sys/${_MARCH}/include; \
394	${INSTALL} -C ${TAG_ARGS:D${TAG_ARGS},dev} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
395	    ${SDESTDIR}${INCLUDEDIR}/${_MARCH}
396.if exists(${SRCTOP}/sys/${_MARCH}/include/pc)
397	${INSTALL} -d ${TAG_ARGS:D${TAG_ARGS},dev} -o ${BINOWN} -g ${BINGRP} -m 755 \
398	    ${SDESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
399	cd ${SRCTOP}/sys/${_MARCH}/include/pc; \
400	${INSTALL} -C ${TAG_ARGS:D${TAG_ARGS},dev} -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
401	    ${SDESTDIR}${INCLUDEDIR}/${_MARCH}/pc
402.endif
403.endif
404.endfor
405
406symlinks: .PHONY .META
407	@${ECHO} "Setting up symlinks to kernel source tree..."
408.for i in ${LDIRS}
409	cd ${SRCTOP}; ${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} \
410	    $$(printf '../../../%s ' sys/$i/*.h) ${SDESTDIR}${INCLUDEDIR}/$i
411.endfor
412.for i in ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/evdev:Ndev/hid:Ndev/hyperv:Ndev/pci:Ndev/veriexec:Ndev/wg}
413	cd ${SRCTOP}; ${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} \
414	    $$(printf '../../../../%s ' sys/$i/*.h) ${SDESTDIR}${INCLUDEDIR}/$i
415.endfor
416	${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} \
417	    $$(printf '../../../../sys/dev/acpica/%s ' acpiio.h acpi_hpet.h) \
418	    ${SDESTDIR}${INCLUDEDIR}/dev/acpica; \
419	${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} ../../../../sys/dev/agp/agpreg.h \
420	    ${SDESTDIR}${INCLUDEDIR}/dev/agp; \
421	${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} \
422	    $$(printf '../../../../sys/dev/evdev/%s ' input.h input-event-codes.h uinput.h) \
423	    ${SDESTDIR}${INCLUDEDIR}/dev/evdev;
424	${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} \
425	    $$(printf '../../../../sys/dev/hid/%s ' hid.h hidraw.h) \
426	    ${SDESTDIR}${INCLUDEDIR}/dev/hid; \
427	${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} ../../../../sys/dev/hyperv/include/hyperv.h \
428	    ${SDESTDIR}${INCLUDEDIR}/dev/hyperv; \
429	${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} ../../../../sys/dev/hyperv/utilities/hv_snapshot.h \
430	    ${SDESTDIR}${INCLUDEDIR}/dev/hyperv; \
431	${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} ../../../../sys/dev/pci/pcireg.h \
432	    ${SDESTDIR}${INCLUDEDIR}/dev/pci; \
433	${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} ../../../../sys/dev/veriexec/veriexec_ioctl.h \
434	    ${SDESTDIR}${INCLUDEDIR}/dev/veriexec;
435.for i in ${LSUBSUBDIRS}
436	cd ${SRCTOP}; ${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} \
437	    $$(printf '../../../../../%s ' sys/$i/*.h) ${SDESTDIR}${INCLUDEDIR}/$i
438.endfor
439.if ${MK_IPFILTER} != "no"
440	cd ${SRCTOP}; ${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} \
441	    $$(printf '../../../%s ' sys/netpfil/ipfilter/netinet/*.h) \
442	    ${SDESTDIR}${INCLUDEDIR}/netinet;
443.endif
444.if ${MK_PF} != "no"
445	cd ${SRCTOP}; ${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} \
446	    $$(printf '../../../../%s ' sys/netpfil/pf/*.h) \
447	    ${SDESTDIR}${INCLUDEDIR}/netpfil/pf;
448.endif
449	${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} ../../../sys/opencrypto/cryptodev.h \
450	    ${SDESTDIR}${INCLUDEDIR}/crypto; \
451	cd ${SRCTOP}; ${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} \
452	    $$(printf '../../../%s ' sys/${MACHINE}/include/*.h) \
453	    ${SDESTDIR}${INCLUDEDIR}/machine;
454.if exists(${SRCTOP}/sys/${MACHINE}/include/pc)
455	cd ${SRCTOP}; ${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} \
456	    $$(printf '../../../../%s ' sys/${MACHINE}/include/pc/*.h) \
457	    ${SDESTDIR}${INCLUDEDIR}/machine/pc;
458.endif
459.for _MARCH in ${_MARCHS}
460.if exists(${SRCTOP}/sys/${_MARCH}/include)
461	${INSTALL} -d ${TAG_ARGS:D${TAG_ARGS},dev} -o ${BINOWN} -g ${BINGRP} -m 755 \
462	    ${SDESTDIR}${INCLUDEDIR}/${_MARCH}; \
463	cd ${SRCTOP}; ${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} \
464	    $$(printf '../../../%s ' sys/${_MARCH}/include/*.h) \
465	    ${SDESTDIR}${INCLUDEDIR}/${_MARCH};
466.if exists(${SRCTOP}/sys/${_MARCH}/include/pc)
467	${INSTALL} -d ${TAG_ARGS:D${TAG_ARGS},dev} -o ${BINOWN} -g ${BINGRP} -m 755 \
468	    ${SDESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \
469	cd ${SRCTOP}; ${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} \
470	    $$(printf '../../../../%s ' sys/${_MARCH}/include/pc/*.h) \
471	    ${SDESTDIR}${INCLUDEDIR}/${_MARCH}/pc;
472.endif
473.endif
474.endfor
475	cd ${SRCTOP}; ${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} \
476	    $$(printf '../../../../%s ' sys/fs/cd9660/*.h) \
477	    ${SDESTDIR}${INCLUDEDIR}/isofs/cd9660; \
478	cd ${SRCTOP}; ${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} \
479	    $$(printf '../../../sys/rpc/%s ' rpcsec_tls.h types.h) \
480	    ${SDESTDIR}${INCLUDEDIR}/rpc;
481	cd ${SRCTOP}/sys/rpc;
482.if ${MK_CDDL} != "no"
483	${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} \
484	    ../../../sys/contrib/openzfs/include/sys/nvpair.h \
485	    ${SDESTDIR}${INCLUDEDIR}/sys
486.endif
487.if ${MK_MLX5TOOL} != "no"
488	${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},dev} ../../../../sys/dev/mlx5/mlx5io.h \
489	    ${SDESTDIR}${INCLUDEDIR}/dev/mlx5
490.endif
491
492.include <bsd.prog.mk>
493
494installincludes: ${SHARED}
495${SHARED}: compat
496
497.if ${MACHINE} == "host" && !defined(_SKIP_BUILD)
498# we're here because we are building a sysroot...
499# we need MACHINE et al set correctly
500HOST_MACHINE!= uname -m
501HOST_MACHINE_ARCH!= uname -p
502MACHINE:= ${HOST_MACHINE}
503MACHINE_ARCH:= ${HOST_MACHINE_ARCH}
504.endif
505
506check-ldirs:
507	missing_dirs=""; \
508	for dir in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS}; do \
509		if [ ! -d ${SRCTOP}/sys/$$dir ]; then \
510			echo "${SRCTOP}/sys/$$dir"; \
511			missing_dirs="$$missing_dirs $$dir"; \
512		fi; \
513	done; \
514	if [ -n "$$missing_dirs" ]; then \
515		echo "Nonexistant directories:" $$missing_dirs; \
516		false; \
517	fi
518