diff options
author | Robert Schwebel <r.schwebel@pengutronix.de> | 2004-08-24 13:06:26 +0000 |
---|---|---|
committer | Robert Schwebel <r.schwebel@pengutronix.de> | 2004-08-24 13:06:26 +0000 |
commit | 32041308266d37a7b86f7df718acab90978399fd (patch) | |
tree | 4d2cc46ac53d54cb9b62db515312c0e5d61d1840 /rules/Rules.make | |
parent | 8df88c23a0380517d582de04be6975e526fba7da (diff) | |
download | ptxdist-32041308266d37a7b86f7df718acab90978399fd.tar.gz ptxdist-32041308266d37a7b86f7df718acab90978399fd.tar.xz |
added functions for file installation
git-svn-id: https://svn.pengutronix.de/svn/ptxdist/trunk@1595 33e552b5-05e3-0310-8538-816dae2090ed
Diffstat (limited to 'rules/Rules.make')
-rw-r--r-- | rules/Rules.make | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/rules/Rules.make b/rules/Rules.make index 669ee618e..3e35e679c 100644 --- a/rules/Rules.make +++ b/rules/Rules.make @@ -573,6 +573,44 @@ feature_patchin = \ fi; \ # +# Install function with user/group ownership and permissions via fakeroot +# +# $1 = UID +# $2 = GID +# $3 = permissions (octal) +# $4 = source (for files); directory (for directories) +# $5 = destination (for files); empty (for directories). Prefixed with $(ROOTDIR) +# +copy_root = \ + @OWN=`echo $(1) | sed -e 's/[[:space:]]//g'`; \ + GRP=`echo $(2) | sed -e 's/[[:space:]]//g'`; \ + PER=`echo $(3) | sed -e 's/[[:space:]]//g'`; \ + SRC=`echo $(4) | sed -e 's/[[:space:]]//g'`; \ + DST=`echo $(5) | sed -e 's/[[:space:]]//g'`; \ + [ -e $(TOPDIR)/permissions ] || touch $(TOPDIR)/permissions; \ + if [ -z "$(5)" ]; then \ + echo "copy_root dir=$$SRC owner=$$OWN group=$$GRP permissions=$$PER"; \ + fakeroot -s $(TOPDIR)/permissions -i $(TOPDIR)/permissions \ + install -o $$OWN -g $$GRP -m $$PER -d $(ROOTDIR)$$SRC; \ + else \ + echo "copy_root src=$$SRC dst=$$DST owner=$$OWN group=$$GRP permissions=$$PER"; \ + fakeroot -s $(TOPDIR)/permissions -i $(TOPDIR)/permissions \ + install -o $$OWN -g $$GRP -m $$PER $$SRC $(ROOTDIR)$$DST; \ + fi; + +# +# Link function: consistent syntax for soft links +# +# $1 = source +# $2 = destination +# +link_root = \ + @SRC=`echo $(1) | sed -e 's/[[:space:]]//g'`; \ + DST=`echo $(2) | sed -e 's/[[:space:]]//g'`; \ + echo "link_root src=$$SRC dst=$$DST "; \ + ln -sf $$SRC $(ROOTDIR)$$DST + +# # CFLAGS // CXXFLAGS # # the TARGET_CFLAGS and TARGET_CXXFLAGS are included from the architecture |