-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.mk
More file actions
47 lines (43 loc) · 1013 Bytes
/
Copy pathinstall.mk
File metadata and controls
47 lines (43 loc) · 1013 Bytes
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
ifeq (${INSTALL_VERBOSE},yes)
INSTALL_VPRFX :=
else
INSTALL_VPRFX := @
endif
%.mk: %.tree
${INSTALL_VPRFX}\mkdir -p $(dir $@)
${INSTALL_VPRFX}\awk 'BEGIN { \
printf toupper("$(basename $(notdir $@))") "_DEPS = $@" \
} \
{ \
if (NF == 2) { \
printf " " $$2 \
} \
} \
END { \
print "" \
}' $< > $@.tmp
${INSTALL_VPRFX}\awk 'BEGIN { \
print "define " toupper("$(basename $(notdir $@))") "_RECIPE" \
} \
{ \
if(NF == 2) { \
if ($$1 ~ /\/$$/) { \
print "\t$${INSTALL_VPRFX}\\mkdir -p $$1" $$1 " $${LF}" \
} else {\
print "\t$${INSTALL_VPRFX}\\mkdir -p $$(dir $$1" $$1 ") $${LF}" \
} \
print "\t$${INSTALL_VPRFX}\\cp $$2/" $$2 " $$1" $$1 " $${LF}" \
} else if ($$1 ~ /^-/) { \
print "\t$${INSTALL_VPRFX}\\rm -rf $$1" substr($$1, 2) " $${LF}" \
} else { \
print "\t$${INSTALL_VPRFX}\\mkdir -p $$1" $$1 " $${LF}" \
} \
} \
END { \
print "endef" \
}' $< >> $@.tmp
${INSTALL_VPRFX}\mv $@.tmp $@
ifndef LF
define LF
endef
endif