1 # $NetBSD: bsd.files.mk,v 1.42 2011/09/10 16:57:35 apb Exp $
3 .if
!defined
(_BSD_FILES_MK_
)
8 .if
!target
(__fileinstall
)
10 realinstall
: filesinstall
17 FILESMODE?
= ${NONBINMODE}
24 filesinstall
:: # ensure existence
27 configfilesinstall
:: .PHONY
32 -o
${FILESOWN_
${.ALLSRC
:T
}:U
${FILESOWN}} \
33 -g
${FILESGRP_
${.ALLSRC
:T
}:U
${FILESGRP}} \
34 -m
${FILESMODE_
${.ALLSRC
:T
}:U
${FILESMODE}} \
35 ${SYSPKGTAG} ${.ALLSRC
} ${.TARGET
}
37 .
endif # !target(__fileinstall)
40 .for F in
${FILES
:O
:u
}
41 _FDIR
:= ${FILESDIR_
${F}:U
${FILESDIR}} # dir override
42 _FNAME
:= ${FILESNAME_
${F}:U
${FILESNAME
:U
${F
:T
}}} # name override
43 _F
:= ${DESTDIR}${_FDIR}/${_FNAME} # installed path
44 _FDOBUILD
:= ${FILESBUILD_
${F}:U
${FILESBUILD
:Uno
}}
46 .if
${MKUPDATE} == "no"
47 ${_F}! ${F} __fileinstall
# install rule
48 .if
!defined
(BUILD
) && !make
(all) && !make
(${F}) && (${_FDOBUILD} == "no")
49 ${_F}! .MADE
# no build at install
52 ${_F}: ${F} __fileinstall
# install rule
53 .if
!defined
(BUILD
) && !make
(all) && !make
(${F}) && (${_FDOBUILD} == "no")
54 ${_F}: .MADE
# no build at install
58 .if
${_FDOBUILD} != "no"
64 .PRECIOUS
: ${_F} # keep if install fails
71 configinstall
: configfilesinstall
73 .for F in
${CONFIGFILES
:O
:u
}
74 _FDIR
:= ${FILESDIR_
${F}:U
${FILESDIR}} # dir override
75 _FNAME
:= ${FILESNAME_
${F}:U
${FILESNAME
:U
${F
:T
}}} # name override
76 _F
:= ${DESTDIR}${_FDIR}/${_FNAME} # installed path
77 _FDOBUILD
:= ${FILESBUILD_
${F}:U
${FILESBUILD
:Uno
}}
79 .if
${MKUPDATE} == "no"
80 ${_F}! ${F} __fileinstall
# install rule
81 .if
!defined
(BUILD
) && !make
(all) && !make
(${F}) && (${_FDOBUILD} == "no")
82 ${_F}! .MADE
# no build at install
85 ${_F}: ${F} __fileinstall
# install rule
86 .if
!defined
(BUILD
) && !make
(all) && !make
(${F}) && (${_FDOBUILD} == "no")
87 ${_F}: .MADE
# no build at install
91 .if
${_FDOBUILD} != "no"
96 configfilesinstall
:: ${_F}
97 .PRECIOUS
: ${_F} # keep if install fails
108 .if defined
(BUILDSYMLINKS
) # {
110 .for _SL _TL in
${BUILDSYMLINKS}
111 BUILDSYMLINKS.s
+= ${_SL}
112 BUILDSYMLINKS.t
+= ${_TL}
114 ${_MKMSG} "symlink " ${.CURDIR
:T
}/${.TARGET
}
116 ln
-s
${.ALLSRC
} ${.TARGET
}
119 realall
: ${BUILDSYMLINKS.t
}
121 CLEANDIRFILES
+= ${BUILDSYMLINKS.t
}
126 # .uue -> "" handling (i.e. decode a given binary/object)
128 # UUDECODE_FILES - List of files which are stored in the source tree
129 # as <file>.uue and should be uudecoded.
131 # UUDECODE_FILES_RENAME_fn - For this file, rename its output to the provided
132 # name (handled via -p and redirecting stdout)
134 .if defined
(UUDECODE_FILES
) # {
139 rm -f
${.TARGET
} ${.TARGET
}.tmp
140 ${TOOL_UUDECODE} -p
${.IMPSRC
} > ${.TARGET
}.tmp \
141 && mv
${.TARGET
}.tmp
${UUDECODE_FILES_RENAME_
${.TARGET
}:U
${.TARGET
}}
143 realall
: ${UUDECODE_FILES}
145 CLEANUUDECODE_FILES
=${UUDECODE_FILES} ${UUDECODE_FILES
:=.tmp
}
146 .for i in
${UUDECODE_FILES}
147 CLEANUUDECODE_FILES
+=${UUDECODE_FILES_RENAME_
${i}}
150 CLEANFILES
+= ${CLEANUUDECODE_FILES}
153 ##### Pull in related .mk logic
154 .
include <bsd.obj.mk
>
155 .
include <bsd.sys.mk
>
156 .
include <bsd.
clean.mk
>
158 .
endif # !defined(_BSD_FILES_MK_)