3 .if !target(__<bsd.init.mk>__)
4 .error bsd.incs.mk cannot be included directly.
7 .if ${MK_INCLUDES} != "no"
12 .if !defined(TAGS) || ! ${TAGS:Mpackage=*}
13 TAGS+= package=${PACKAGE:Uruntime}
15 TAG_ARGS= -T ${TAGS:[*]:S/ /,/g}
18 .if !target(buildincludes)
19 .for group in ${INCSGROUPS}
20 buildincludes: ${${group}}
26 .if !target(installincludes)
27 .for group in ${INCSGROUPS}
28 .if defined(${group}) && !empty(${group})
30 ${group}OWN?= ${BINOWN}
31 ${group}GRP?= ${BINGRP}
32 ${group}MODE?= ${NOBINMODE}
33 ${group}DIR?= ${INCLUDEDIR}${PRIVATELIB:D/private/${LIB}}
35 STAGE_DIR.${group}= ${STAGE_OBJTOP}${${group}DIR}
36 STAGE_SYMLINKS_DIR.${group}= ${STAGE_OBJTOP}
39 .for header in ${${group}}
40 .if defined(${group}OWN_${header:T}) || defined(${group}GRP_${header:T}) || \
41 defined(${group}MODE_${header:T}) || defined(${group}DIR_${header:T}) || \
42 defined(${group}NAME_${header:T}) || defined(${group}NAME)
43 ${group}OWN_${header:T}?= ${${group}OWN}
44 ${group}GRP_${header:T}?= ${${group}GRP}
45 ${group}MODE_${header:T}?= ${${group}MODE}
46 ${group}DIR_${header:T}?= ${${group}DIR}
47 .if defined(${group}NAME)
48 ${group}NAME_${header:T}?= ${${group}NAME}
50 ${group}NAME_${header:T}?= ${header:T}
52 STAGE_AS_SETS+= ${group}
53 STAGE_AS_${header:T}= ${${group}NAME_${header:T}}
54 stage_as.${group}: ${header}
55 stage_includes: stage_as.${group}
57 installincludes: _${group}INS_${header:T}
58 _${group}INS_${header:T}: ${header}
59 ${INSTALL} -C -o ${${group}OWN_${.ALLSRC:T}} \
60 -g ${${group}GRP_${.ALLSRC:T}} -m ${${group}MODE_${.ALLSRC:T}} \
62 ${DESTDIR}${${group}DIR_${.ALLSRC:T}}/${${group}NAME_${.ALLSRC:T}}
64 _${group}INCS+= ${header}
67 .if !empty(_${group}INCS)
68 stage_files.${group}: ${_${group}INCS}
69 stage_includes: stage_files.${group}
71 installincludes: _${group}INS
72 _${group}INS: ${_${group}INCS}
73 .if defined(${group}NAME)
74 ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},development} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \
75 ${.ALLSRC} ${DESTDIR}${${group}DIR}/${${group}NAME}
77 ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},development} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \
78 ${.ALLSRC} ${DESTDIR}${${group}DIR}
82 .endif # defined(${group}) && !empty(${group})
85 .if defined(INCSLINKS) && !empty(INCSLINKS)
87 .for s t in ${INCSLINKS}
88 @${ECHO} "$t -> $s" ; \
89 ${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},development} $s ${DESTDIR}$t
92 .endif # !target(installincludes)
94 realinstall: installincludes
95 .ORDER: beforeinstall installincludes
97 .if ${MK_STAGING} != "no" && !defined(_SKIP_BUILD)
98 .if !defined(NO_STAGE_INCLUDES)
99 staging: stage_includes
100 .if !empty(INCSLINKS)
101 staging: stage_symlinks
102 STAGE_SYMLINKS.INCS= ${INCSLINKS}
107 .endif # ${MK_TOOLCHAIN} != "no"