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