1 ################################################################################ 31 ################################################################################ 35 # $(call copySrcDst,src,dst) 36 # Template to a copy source file to destination file. The file is copied iff 37 # the destination does not exists or if the source is newer. 39 @
if [
"$(1)" !=
"" ]; \
41 if [ ! -f
"$(2)" -o
"$(1)" -nt
"$(2)" ]; \
44 test -d $$d || $(MKDIR) $$d; \
51 # $(call copySrcDir,srcfile...,dir) 52 # Template to copy source files to the destination directory. Each source 53 # file is copied iff the destination file does not exists or if the source is 54 # newer. Subdirectories of the destination directory are created as needed. 57 # $(call copySrcDir,foo bar,egg) --> 59 # $(call copySrcDir,lode of/the/bride,mother) --> 60 # mother/lode mother/of/the/bride 62 @
if [
"$(1)" !=
"" ]; \
64 flist=
"$(wildcard $(1))"; \
65 for src in $${flist}; \
68 if [ ! -f
"$${dst}" -o
"$${src}" -nt
"$${dst}" ]; \
70 d=$$(dirname $${dst}); \
71 test -d $${d} || $(MKDIR) $${d}; \
72 printf
" $${src}\n"; \
73 $(CP) $${src} $${dst}; \
79 # $(call copySrcDirRel,srcfile...,dir[,prefix]) 80 # Template to copy source files to the destination directory. Each source 81 # file is copied iff the destination file does not exists or if the source is 82 # newer. Subdirectories of the destination directory are created as needed. 83 # If the prefix paramter is specified, string up to prefix is stripped off 84 # the source files prior to copying. Otherwise the common directory part 85 # between the target and source are removed. 88 # srcfiles = share/etc/rules.d/my.rules share/etc/ld.so.conf.d/my.conf 89 # etcdir = /path/to/mypkg/dist/dist.arch/etc 90 # $(call copySrcDirRel,$(srcfiles),$(etcdir) --> 91 # /path/to/mypkg/dist/dist.arch/etc/rules.d/my.rules 92 # /path/to/mypkg/dist/dist.arch/etc/ld.so.conf.d/my.conf 94 # srcfile = share/lib/cmake/mypkg-config.cmake 95 # libdir = /path/to/mypkg/dist/dist.arch/lib 96 # $(call copySrcDirRel,$(srcfile),$(libdir)) --> 97 # /path/to/mypkg/dist/dist.arch/lib/cmake/mypkg-config.cmake 99 # srcfiles = share/theroad share/food/cake 100 # sharedir = /path/to/mypkg/dist/dist.arch/share/mypkg-x.y.z 101 # $(call copySrcDirRel,$(srcfiles),$(sharedir),share) --> 102 # /path/to/mypkg/dist/dist.arch/share/mypkg-x.y.z/theroad 103 # /path/to/mypkg/dist/dist.arch/share/mypkg-x.y.z/food/cake 105 @
if [
"$(1)" !=
"" ]; \
107 dstbase=$(notdir $(2)); \
108 flist=
"$(wildcard $(addprefix $(RNMAKE_PKG_ROOT)/,$(1)))"; \
109 for src in $${flist}; \
113 dst=$(2)/$${src##*$${dstbase}/}; \
115 dst=$(2)/$${src##*$(3)/}; \
117 if [ ! -f
"$${dst}" -o
"$${src}" -nt
"$${dst}" ]; \
119 dstdir=$$(dirname $${dst}); \
120 test -d $${dstdir} || $(MKDIR) $${dstdir}; \
121 printf
" $${src}\n"; \
122 $(CP) $${src} $${dst}; \
128 # $(call copySrcDirRel,srcfile...,dir,prefix) 129 # Three argument version. 131 # Template to copy source files to the destination directory. Each source 132 # file is copied iff the destination file does not exists or if the source is 133 # newer. Subdirectories of the destination directory are created as needed. 135 #define copySrcDirRel 136 # $(info rdk: here 3: '$(3)') 137 # @if [ "$(1)" != "" ]; \ 139 # flist="$(wildcard $(addprefix $(RNMAKE_PKG_ROOT)/,$(1)))"; \ 140 # for src in $${flist}; \ 142 # dst=$(2)/$${src##*$(3)/}; \ 143 # if [ ! -f "$${dst}" -o "$${src}" -nt "$${dst}" ]; \ 145 # dstdir=$$(dirname $${dst}); \ 146 # test -d $${dstdir} || $(MKDIR) $${dstdir}; \ 147 # printf " $${src}\n"; \ 148 # $(CP) $${src} $${dst}; \