destdir=
includeLibCSrc=false
-readonly scripts="obncdoc-extract obncdoc-index obncdoc-markup"
readonly basicModules="Files In Input Input0 Math Out Strings XYplane"
-readonly docFiles="oberon-report.html"
-readonly man1Files="obnc.1 obnc-compile.1 obnc-path.1 obncdoc.1"
+readonly man1Files="obnc.1 obnc-compile.1"
EchoAndRun()
{
EchoAndRun mkdir -p "$destdir$prefix/bin"
EchoAndRun cp "bin/obnc" "$destdir$prefix/bin"
EchoAndRun cp "bin/obnc-compile" "$destdir$prefix/bin"
- EchoAndRun cp "bin/obnc-path" "$destdir$prefix/bin"
- EchoAndRun cp "bin/obncdoc" "$destdir$prefix/bin"
local file=
- for file in $scripts; do
- EchoAndRun sed -e '"s|^\(readonly defaultPrefix=\).*$|\1'"'$prefix'"'|"' \
- -e '"s|^\(readonly defaultLibDir=\).*$|\1'"'$libdir'"'|"' \
- '"bin/'$file'"' \> '"'$destdir$prefix/bin/$file'"'
- EchoAndRun chmod +x "$destdir$prefix/bin/$file"
- done
EchoAndRun mkdir -p "$destdir$prefix/include/obnc"
EchoAndRun cp "lib/obnc/OBNCConfig.h" "$destdir$prefix/include/obnc"
EchoAndRun cp "lib/obnc/OBNC.h" "$destdir$prefix/include/obnc"
done
rm -r "lib/obnc/.obnc"
- #install documentation
- EchoAndRun mkdir -p "$destdir$prefix/share/doc/obnc"
- for file in $docFiles; do
- EchoAndRun cp "share/doc/obnc/$file" "$destdir$prefix/share/doc/obnc"
- done
- (cd "lib/obnc" && OBNC_PREFIX="$selfDirPath" ../../bin/obncdoc)
- EchoAndRun mkdir -p "$destdir$prefix/share/doc/obnc/obncdoc/obnc"
- for file in "lib/obnc/obncdoc"/*; do
- EchoAndRun cp "$file" "$destdir$prefix/share/doc/obnc/obncdoc/obnc"
- done
- EchoAndRun cd "$destdir$prefix/share/doc/obnc/obncdoc"
- EchoAndRun "$selfDirPath/bin/obncdoc-index" \> index.html
- EchoAndRun cp "$selfDirPath/share/obnc/style.css" .
- cd - >/dev/null
- rm -r lib/obnc/obncdoc
-
#install man pages
EchoAndRun mkdir -p "$destdir$prefix/share/man/man1"
for file in $man1Files; do
EchoAndRun cp "share/man/man1/$file" "$destdir$prefix/share/man/man1"
done
-
- #install obncdoc style file
- EchoAndRun mkdir -p "$destdir$prefix/share/obnc"
- EchoAndRun cp "$selfDirPath/share/obnc/style.css" "$destdir$prefix/share/obnc"
}
#delete executables
EchoAndRun rm -f "$destdir$prefix/bin/obnc"
EchoAndRun rm -f "$destdir$prefix/bin/obnc-compile"
- EchoAndRun rm -f "$destdir$prefix/bin/obnc-path"
- EchoAndRun rm -f "$destdir$prefix/bin/obncdoc"
- local file=
- for file in $scripts; do
- EchoAndRun rm -f "$destdir$prefix/bin/$file"
- done
#delete library files
local module=
EchoAndRun rm -f "$destdir$prefix/$libdir/obnc/OBNC.env"
EchoAndRun rm -f "$destdir$prefix/$libdir/obnc/OBNC.c"
- #delete documentation
- for file in $docFiles; do
- EchoAndRun rm -f "$destdir$prefix/share/doc/obnc/$file"
- done
- EchoAndRun rm -f "$destdir$prefix/share/doc/obnc/obncdoc/obnc/"*
- EchoAndRun rm -f "$destdir$prefix/share/doc/obnc/obncdoc/index.html"
- EchoAndRun rm -f "$destdir$prefix/share/doc/obnc/obncdoc/style.css"
-
#delete man pages
for file in $man1Files; do
EchoAndRun rm -f "$destdir$prefix/share/man/man1/$file"
done
-
- #delete obncdoc style file
- EchoAndRun rm -f "$destdir$prefix/share/obnc/style.css"
}