1 # $NetBSD: bsd.files.mk,v 1.39 2008/08/25 08:11:04 lukem 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}: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}: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 cleandir
: cleanbuildsymlinks
122 cleanbuildsymlinks
: .PHONY
123 rm -f
${BUILDSYMLINKS.t
}
128 # .uue -> "" handling (i.e. decode a given binary/object)
130 # UUDECODE_FILES - List of files which are stored in the source tree
131 # as <file>.uue and should be uudecoded.
133 # UUDECODE_FILES_RENAME_fn - For this file, rename its output to the provided
134 # name (handled via -p and redirecting stdout)
136 .if defined
(UUDECODE_FILES
) # {
141 rm -f
${.TARGET
} ${.TARGET
}.tmp
142 ${TOOL_UUDECODE} -p
${.IMPSRC
} > ${.TARGET
}.tmp \
143 && mv
${.TARGET
}.tmp
${UUDECODE_FILES_RENAME_
${.TARGET
}:U
${.TARGET
}}
145 realall
: ${UUDECODE_FILES}
147 CLEANUUDECODE_FILES
=${UUDECODE_FILES} ${UUDECODE_FILES
:=.tmp
}
148 .for i in
${UUDECODE_FILES}
149 CLEANUUDECODE_FILES
+=${UUDECODE_FILES_RENAME_
${i}}
152 clean: cleanuudecodefiles
153 cleanuudecodefiles
: .PHONY
154 rm -f
${CLEANUUDECODE_FILES}
157 ##### Pull in related .mk logic
158 .
include <bsd.obj.mk
>
159 .
include <bsd.sys.mk
>
161 .
endif # !defined(_BSD_FILES_MK_)