summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2011-01-10 12:45:47 (GMT)
committerWaldemar Brodkorb <wbx@openadk.org>2011-01-10 12:45:47 (GMT)
commitfa330c259421fad6bd1968ece48f66cc90a171de (patch)
treeac1435c9cb6bb15c692503f1d8f74a3c4eace9a2
parent377aefacd0109640c9929ce0611a7e05e4d63f49 (diff)
fix some files, when someone moves the top directory
-rw-r--r--Makefile7
-rwxr-xr-xscripts/reloc.sh16
2 files changed, 21 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index d7b0e9f..da620cb 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@
_UNLIMIT= __limit=$$(ulimit -dH 2>/dev/null); \
test -n "$$__limit" && ulimit -dS $$__limit;
-all: .prereq_done
+all: checkreloc .prereq_done
@${_UNLIMIT} ${GMAKE_INV} all
v: .prereq_done
@@ -224,4 +224,7 @@ NO_ERROR=0
@touch .adkinit
@touch $@
-.PHONY: prereq prereq-noerror
+checkreloc:
+ @bash scripts/reloc.sh
+
+.PHONY: prereq prereq-noerror checkreloc
diff --git a/scripts/reloc.sh b/scripts/reloc.sh
new file mode 100755
index 0000000..f7a0a1e
--- /dev/null
+++ b/scripts/reloc.sh
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+# execute this after relocation of adk directory
+
+olddir=$(grep "^TOPDIR" prereq.mk |cut -d '=' -f 2)
+newdir=$(pwd)
+
+if [ "$olddir" != "$newdir" ];then
+ echo "adk directory relocated!"
+ echo "old directory: $olddir"
+ echo "new directory: $newdir"
+ sed -i -e "s#$olddir#$newdir#g" $(find target_* -name \*.pc|xargs)
+ sed -i -e "s#$olddir#$newdir#g" $(find target_* -name \*.la|xargs)
+ sed -i -e "s#$olddir#$newdir#g" $(find target_*/scripts -type f|xargs)
+ sed -i -e "s#$olddir#$newdir#" target_*/etc/ipkg.conf
+ sed -i -e "s#$olddir#$newdir#" prereq.mk
+fi