Repository navigation
Expand file tree
/
Copy pathbsd.files.mk
More file actions
161 lines (126 loc) · 3.62 KB
/
Copy pathbsd.files.mk
File metadata and controls
161 lines (126 loc) · 3.62 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# $NetBSD: bsd.files.mk,v 1.40 2008/12/05 18:51:16 cube Exp $
.if !defined(_MINIX_FILES_MK_)
_MINIX_FILES_MK_=1
.include <bsd.init.mk>
.if !target(__fileinstall)
##### Basic targets
realinstall: filesinstall
realall: filesbuild
##### Default values
FILESDIR?= ${BINDIR}
FILESOWN?= ${BINOWN}
FILESGRP?= ${BINGRP}
FILESMODE?= ${NONBINMODE}
##### Build rules
filesbuild:
.PHONY: filesbuild
##### Install rules
filesinstall:: # ensure existence
.PHONY: filesinstall
configfilesinstall:: .PHONY
__fileinstall: .USE
${_MKTARGET_INSTALL}
${INSTALL_FILE} \
-o ${FILESOWN_${.ALLSRC:T}:U${FILESOWN}} \
-g ${FILESGRP_${.ALLSRC:T}:U${FILESGRP}} \
-m ${FILESMODE_${.ALLSRC:T}:U${FILESMODE}} \
${SYSPKGTAG} ${.ALLSRC} ${.TARGET}
.endif # !target(__fileinstall)
.for F in ${FILES:O:u}
_FDIR:= ${FILESDIR_${F}:U${FILESDIR}} # dir override
_FNAME:= ${FILESNAME_${F}:U${FILESNAME:U${F:T}}} # name override
_F:= ${DESTDIR}${_FDIR}/${_FNAME} # installed path
_FDOBUILD:= ${FILESBUILD_${F}:Uno}
.if ${MKUPDATE} == "no"
${_F}! ${F} __fileinstall # install rule
.if !defined(BUILD) && !make(all) && !make(${F}) && (${_FDOBUILD} == "no")
${_F}! .MADE # no build at install
.endif
.else
${_F}: ${F} __fileinstall # install rule
.if !defined(BUILD) && !make(all) && !make(${F}) && (${_FDOBUILD} == "no")
${_F}: .MADE # no build at install
.endif
.endif
.if ${_FDOBUILD} != "no"
filesbuild: ${F}
CLEANFILES+= ${F}
.endif
filesinstall:: ${_F}
.PRECIOUS: ${_F} # keep if install fails
.endfor
#
# CONFIGFILES
#
configinstall: configfilesinstall
.for F in ${CONFIGFILES:O:u}
_FDIR:= ${FILESDIR_${F}:U${FILESDIR}} # dir override
_FNAME:= ${FILESNAME_${F}:U${FILESNAME:U${F:T}}} # name override
_F:= ${DESTDIR}${_FDIR}/${_FNAME} # installed path
_FDOBUILD:= ${FILESBUILD_${F}:Uno}
.if ${MKUPDATE} == "no"
${_F}! ${F} __fileinstall # install rule
.if !defined(BUILD) && !make(all) && !make(${F}) && (${_FDOBUILD} == "no")
${_F}! .MADE # no build at install
.endif
.else
${_F}: ${F} __fileinstall # install rule
.if !defined(BUILD) && !make(all) && !make(${F}) && (${_FDOBUILD} == "no")
${_F}: .MADE # no build at install
.endif
.endif
.if ${_FDOBUILD} != "no"
filesbuild: ${F}
CLEANFILES+= ${F}
.endif
configfilesinstall:: ${_F}
.PRECIOUS: ${_F} # keep if install fails
.endfor
.undef _FDIR
.undef _FNAME
.undef _F
#
# BUILDSYMLINKS
#
.if defined(BUILDSYMLINKS) # {
.for _SL _TL in ${BUILDSYMLINKS}
BUILDSYMLINKS.s+= ${_SL}
BUILDSYMLINKS.t+= ${_TL}
${_TL}: ${_SL}
${_MKMSG} "symlink " ${.CURDIR:T}/${.TARGET}
rm -f ${.TARGET}
ln -s ${.ALLSRC} ${.TARGET}
.endfor
realall: ${BUILDSYMLINKS.t}
cleandir: cleanbuildsymlinks
cleanbuildsymlinks: .PHONY
rm -f ${BUILDSYMLINKS.t}
.endif # }
#
# .uue -> "" handling (i.e. decode a given binary/object)
#
# UUDECODE_FILES - List of files which are stored in the source tree
# as <file>.uue and should be uudecoded.
#
# UUDECODE_FILES_RENAME_fn - For this file, rename its output to the provided
# name (handled via -p and redirecting stdout)
.if defined(UUDECODE_FILES) # {
.SUFFIXES: .uue
.uue:
${_MKTARGET_CREATE}
rm -f ${.TARGET} ${.TARGET}.tmp
${TOOL_UUDECODE} -p ${.IMPSRC} > ${.TARGET}.tmp \
&& mv ${.TARGET}.tmp ${UUDECODE_FILES_RENAME_${.TARGET}:U${.TARGET}}
realall: ${UUDECODE_FILES}
CLEANUUDECODE_FILES=${UUDECODE_FILES} ${UUDECODE_FILES:=.tmp}
.for i in ${UUDECODE_FILES}
CLEANUUDECODE_FILES+=${UUDECODE_FILES_RENAME_${i}}
.endfor
clean: cleanuudecodefiles
cleanuudecodefiles: .PHONY
rm -f ${CLEANUUDECODE_FILES}
.endif # }
##### Pull in related .mk logic
.include <bsd.obj.mk>
#.include <bsd.sys.mk>
.endif # !defined(_MINIX_FILES_MK_)