1 # $FreeBSD: src/share/mk/bsd.incs.mk,v 1.3.2.1 2002/07/22 14:21:51 ru Exp $
2 # $DragonFly: src/share/mk/bsd.incs.mk,v 1.6 2005/07/07 11:49:56 corecode Exp $
4 .if
!target
(__
<bsd.init.mk
>__
)
5 .error bsd.incs.mk cannot be included directly.
10 .if
!target
(buildincludes
)
11 .for group in
${INCSGROUPS}
12 buildincludes
: ${${group}}
18 .if
!target
(installincludes
)
19 .for group in
${INCSGROUPS}
20 .if defined
(${group}) && !empty
(${group})
22 ${group}OWN?
= ${BINOWN}
23 ${group}GRP?
= ${BINGRP}
24 ${group}MODE?
= ${NOBINMODE}
25 ${group}DIR?
= ${INCLUDEDIR}
28 .for header in
${${group}}
29 .if defined
(${group}OWN_
${header
:T
}) || defined
(${group}GRP_
${header
:T
}) || \
30 defined
(${group}MODE_
${header
:T
}) || defined
(${group}DIR_
${header
:T
}) || \
31 defined
(${group}NAME_
${header
:T
})
32 ${group}OWN_
${header
:T
}?
= ${${group}OWN
}
33 ${group}GRP_
${header
:T
}?
= ${${group}GRP
}
34 ${group}MODE_
${header
:T
}?
= ${${group}MODE
}
35 ${group}DIR_
${header
:T
}?
= ${${group}DIR
}
36 .if defined
(${group}NAME
)
37 ${group}NAME_
${header
:T
}?
= ${${group}NAME
}
39 ${group}NAME_
${header
:T
}?
= ${header
:T
}
41 installincludes
: _
${group}INS_
${header
:T
}
42 _
${group}INS_
${header
:T
}: ${header}
43 ${INSTALL} -C
-o
${${group}OWN_
${.ALLSRC
:T
}} \
44 -g
${${group}GRP_
${.ALLSRC
:T
}} -m
${${group}MODE_
${.ALLSRC
:T
}} \
46 ${DESTDIR}${${group}DIR_
${.ALLSRC
:T
}}/${${group}NAME_
${.ALLSRC
:T
}}
48 _
${group}INCS
+= ${header}
51 .if
!empty
(_
${group}INCS
)
52 installincludes
: _
${group}INS
53 _
${group}INS
: ${_
${group}INCS
}
54 .if defined
(${group}NAME
)
55 ${INSTALL} -C
-o
${${group}OWN
} -g
${${group}GRP
} -m
${${group}MODE
} \
56 ${.ALLSRC
} ${DESTDIR}${${group}DIR
}/${${group}NAME
}
58 ${INSTALL} -C
-o
${${group}OWN
} -g
${${group}GRP
} -m
${${group}MODE
} \
59 ${.ALLSRC
} ${DESTDIR}${${group}DIR
}
63 .
endif # defined(${group}) && !empty(${group})
66 .if defined
(INCSLINKS
) && !empty
(INCSLINKS
)
69 while
test $$# -ge 2; do \
74 ${ECHO} $$t -\
> $$l; \
78 .
endif # !target(installincludes)
80 # include files are not installed when building bootstrap programs
82 .if
!defined
(BOOTSTRAPPING
)
83 realinstall
: installincludes
84 .ORDER
: beforeinstall installincludes