summaryrefslogtreecommitdiff
path: root/build-0.3/install/install-functions.make
blob: 22f69a77b3255fb85437eb433d985535cb1608c1 (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
37
# file      : build/install/install-functions.make
# copyright : Copyright (c) 2004-2012 Code Synthesis Tools CC
# license   : GNU GPL v2; see accompanying LICENSE file

#@@ could just call it functions.make
#

$(out_base)/%: install-exec = \
$(call message,,$(install_dir) $(dir $2))$(literal_newline)\
$(literal_tab)$(call message,install $2,$(install_exec) $1 $2)


$(out_base)/%: install-lib = \
$(call message,install $2,$(install_dir) $(dir $2))$(literal_newline)\
$(literal_tab)$(call message,,$(value $(if $(patsubst %.so,,$(shell\
 sed -e '1q' <$1)),install_data,install_exec)) $(shell sed -e '1q' <$1) $2)


$(out_base)/%: install-data = \
$(call message,install $2,$(install_dir) $(dir $2))$(literal_newline)\
$(literal_tab)$(call message,,$(install_data) $1 $2)


$(out_base)/%: install-dir = \
$(call message,install $2/,find -L $1 $3 -type f -print \
| xargs -n 1 $(bld_root)/run-if-arg dirname \
| sort -u \
| sed -e 's%$1\(.*\)%$2/\1%' \
| xargs -n 1 $(bld_root)/run-if-arg "$(install_dir)")$(literal_newline)\
$(literal_tab)$(call message,,\
find -L $1 $3 -type f ! -perm -100 -print \
| sed -e 's%$1\(.*\)%$1/\1 $2/\1%' \
| xargs -n 2 $(bld_root)/run-if-arg "$(install_data)")$(literal_newline)\
$(literal_tab)$(call message,,\
find -L $1 $3 -type f -perm -100 -print  \
| sed -e 's%$1\(.*\)%$1/\1 $2/\1%' \
| xargs -n 2 $(bld_root)/run-if-arg "$(install_exec)")