summaryrefslogtreecommitdiff
path: root/mk/mkc_imp.inc.mk
blob: c05d443e89c05ad1c18be6b43610f300e6887bf8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Copyright (c) 2009-2010 by Aleksey Cheusov
# Copyright (c) 1994-2009 The NetBSD Foundation, Inc.
# Copyright (c) 1988, 1989, 1993 The Regents of the University of California
# Copyright (c) 1988, 1989 by Adam de Boor
# Copyright (c) 1989 by Berkeley Softworks
#
# See LICENSE file in the distribution.
############################################################

do_install1:	incinstall
incinstall:	.PHONY # ensure existence

.if defined(INCS)
INCSSRCDIR  ?=	.
CPPFLAGS0   +=	-I${INCSSRCDIR}

.if ${MKINSTALL:tl} == "yes"
destination_incs =	${INCS:@I@${DESTDIR}${INCSDIR}/$I@}

incinstall: ${destination_incs}
.PRECIOUS: ${destination_incs}
.PHONY: ${destination_incs}

__incinstall: .USE
	${INSTALL}  ${INSTALL_FLAGS} \
	    -o ${BINOWN:Q} \
	    -g ${BINGRP:Q} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET}

.for I in ${INCS:O:u}
${DESTDIR}${INCSDIR}/$I: ${"${INCSSRCDIR}" != ".":?${INCSSRCDIR}/$I:$I} __incinstall
.endfor

UNINSTALLFILES  +=	${destination_incs}
INSTALLDIRS     +=	${destination_incs:H}
.endif # MKINSTALL
.endif # INCS