Makefile 14 KB

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