aboutsummaryrefslogtreecommitdiff
path: root/clean
diff options
context:
space:
mode:
authorCamil Staps2018-10-30 09:31:57 +0100
committerCamil Staps2018-10-30 09:31:57 +0100
commit8df1fb761397cd2aecaa8123a5dd8aa8ecc7fef4 (patch)
tree9e2e63274d5e36621b4b4ed0430e4ce5670fa841 /clean
parentinstall_clean: improved linking of completion scripts; local versions of cpm,... (diff)
install_clean: neater linking of local files
Diffstat (limited to 'clean')
-rwxr-xr-xclean/bin/install_clean58
1 files changed, 33 insertions, 25 deletions
diff --git a/clean/bin/install_clean b/clean/bin/install_clean
index 8c66097..c315eee 100755
--- a/clean/bin/install_clean
+++ b/clean/bin/install_clean
@@ -17,40 +17,48 @@ grep -h '^[[:space:]]' /opt/clean/etc/*.env >> /opt/clean/etc/IDEEnvs
cat ~/.clean/iTasksDev.env >> /opt/clean/etc/IDEEnvs
sed -i 's=lib/exe/linker=lib/exe/linker:-no-pie=' /opt/clean/etc/IDEEnvs
-mv /opt/clean/lib/exe /opt/clean/exe
-ln -s /opt/clean/exe /opt/clean/lib/exe
+ln -s lib/exe /opt/clean/exe
# cloogletags
cloogletags -a -c -d /opt/clean/lib -o /opt/clean/lib/tags
+link_local_file(){
+ echo "$1 -> $2"
+ mkdir -p "$(dirname "$CLEAN_HOME/$1")"
+ if [ -f "$CLEAN_HOME/$1" ]; then
+ mv "$CLEAN_HOME/$1" "$CLEAN_HOME/$1.org"
+ ln -s "$(realpath --no-symlinks "$2")" "$CLEAN_HOME/$1.new"
+ ln -s "$(basename "$1").new" "$CLEAN_HOME/$1"
+ else
+ ln -s "$(realpath --no-symlinks "$2")" "$CLEAN_HOME/$1"
+ fi
+}
+
+# Local versions of binaries
+link_local_file bin/clm ~/VersionControl/clean-tools-git/clm/clm
+link_local_file bin/cpm ~/VersionControl/clean-ide/cpm/cpm
+
+link_local_file lib/exe/cocl /home/camil/VersionControl/clean-compiler/cocl
+
+link_local_file bin/cleantest ~/VersionControl/clean-test/cleantest
+link_local_file bin/testproperties ~/VersionControl/clean-test-properties/src/testproperties
+
+link_local_file data/cleandoc-default ~/VersionControl/clean-doc/data/cleandoc-default
+link_local_file bin/cleandoc ~/VersionControl/clean-doc/src/cleandoc
+
+link_local_file bin/cleanprof2callgrind ~/VersionControl/cleanprof2callgrind/cleanprof2callgrind
+
+# ABC interpreter binaries
+link_local_file lib/exe/optimise ~/VersionControl/abc-interpreter/src/optimise
+link_local_file lib/exe/bcgen ~/VersionControl/abc-interpreter/src/bcgen
+link_local_file lib/exe/bclink ~/VersionControl/abc-interpreter/src/link
+
# completion
-mkdir -p /opt/clean/etc/completion
for f in ~/VersionControl/clean-completion/*; do
[ -f "$f" ] || continue
base="$(basename "$f")"
if [[ "$base" == "Makefile" ]] || [[ "$base" == "README.md" ]] || [[ "$base" =~ .tar.gz$ ]]; then
continue
fi
- ln -s "$(ls -1 "$f")" /opt/clean/etc/completion/$base
+ link_local_file "etc/completion/$base" "$f"
done
-
-# clm
-rm /opt/clean/bin/clm; ln -s /home/camil/VersionControl/clean-tools-git/clm/clm /opt/clean/bin/clm
-# cpm
-rm /opt/clean/bin/cpm; ln -s /home/camil/VersionControl/clean-ide/cpm/cpm /opt/clean/bin/cpm
-# cocl
-rm /opt/clean/exe/cocl; ln -s /home/camil/VersionControl/clean-compiler/cocl /opt/clean/exe/cocl
-# clean-test
-rm /opt/clean/bin/cleantest; ln -s /home/camil/VersionControl/clean-test/cleantest /opt/clean/bin/cleantest
-# clean-test-properties
-ln -s /home/camil/VersionControl/clean-test-properties/src/testproperties /opt/clean/bin/testproperties
-# clean-doc
-mkdir /opt/clean/data
-ln -s /home/camil/VersionControl/clean-doc/data/cleandoc-default /opt/clean/data/cleandoc-default
-ln -s /home/camil/VersionControl/clean-doc/src/cleandoc /opt/clean/bin/cleandoc
-# cleanprof2callgrind
-ln -s /home/camil/VersionControl/cleanprof2callgrind/cleanprof2callgrind /opt/clean/bin/cleanprof2callgrind
-# abc-interpreter
-ln -s /home/camil/VersionControl/abc-interpreter/src/optimise /opt/clean/exe/optimise
-ln -s /home/camil/VersionControl/abc-interpreter/src/bcgen /opt/clean/exe/bcgen
-ln -s /home/camil/VersionControl/abc-interpreter/src/link /opt/clean/exe/bclink