mdr_list = $(filter-out docs/09_Benchmarks.mdr, $(shell find docs -type f -name "*.mdr"))
md_list = $(mdr_list:.mdr=.md)
-_docserver_config = bash help/doc-config.sh > mkdocs.yml
+_docserver_config = bash scripts/doc-config.sh > mkdocs.yml
_docserver_serve = $(call _docserver_config); $(DOCTOOL) -q serve
_docserver_launch = $(call _docserver_serve)& echo $$! > .server_pid
_docserver_kill = [ -f .server_pid ] && (kill $$(cat .server_pid); rm .server_pid) || true
--- /dev/null
+: "${GWION_PLUG_PATH:=$PWD}"
+declare -A magic_variable=()
+
+read_manifest() {
+ name=$(basename $1 .manifest)
+ magic_variable[$name]=$((magic_variable[$name]))
+ [ -f $1 ] || return
+ while read LINE
+ do
+ [ "${LINE:0:1}" = "#" ] && continue
+ magic_variable[$LINE]=$((magic_variable[$LINE] + 1))
+ find_manifest $LINE.manifest
+ done < $1
+}
+
+find_manifest() {
+ for DIR in $GWION_PLUG_PATH
+ do
+ [ -f DIR/$1 ] || continue
+ read_manifest $1
+ return
+ done
+}
+
+install_plug() {
+ [ -d .gwion-pkg ] || mkdir .gwion-pkg
+ echo "installing $2 $3"
+ index=$(printf "%04i" $3)
+ [ -f .gwion-pkg/${index}_$(basename $1 .manifest).so ] && rm .gwion-pkg/${index}_$(basename $1 .manifest).so
+ ln $PLUG .gwion-pkg/${index}_$(basename $1 .manifest).so
+}
+
+install_manifest() {
+ for DIR in $GWION_PLUG_PATH
+ do
+ [ -d $DIR ] || continue
+ PLUG=$DIR/$(basename $1 .manifest).so
+ if [ -f $PLUG ]
+ then
+ install_plug "$1" "$PLUG" $2
+ return
+ fi
+ done
+}
+
+if [ "$1" = "list" ]
+then # clear
+ [ -d .gwion-pkg ] && ls .gwion-pkg | sort -u | cut -d_ -f 2
+elif [ "$1" = "run" ]
+then # run
+ shift
+ gwion -p .gwion-pkg $@
+elif [ "$1" = "clear" ]
+then rm -rf .gwion-pkg
+else
+for FILE in *.manifest
+do read_manifest $FILE
+done
+
+MAX=0
+for i in "${!magic_variable[@]}"
+do [ "${magic_variable[$i]}" -gt "$MAX" ] && MAX="${magic_variable[$i]}"
+done
+
+
+for i in "${!magic_variable[@]}"
+do
+ install_manifest "$i" $(( MAX - ${magic_variable[$i]}))
+done
+fi
+
if [ "$VALGRIND" == "NO_VALGRIND" ]
then LANG=C ./"$PRG" "$GWOPT" -d "$DRIVER" "$file" > "$slog" 2>"$elog" |:
else
- LANG=C "$VALGRIND" --suppressions=help/supp --log-file="$vlog" \
+ LANG=C "$VALGRIND" --suppressions=scripts/supp --log-file="$vlog" \
./"$PRG" "$GWOPT" -d "$DRIVER" "$file" > "$slog" 2>"$elog" |:
fi
ret=$?
test_plugin() {
export NAME=$"$1"
export PRG=$"../../gwion"
- export SUPP=$"../../help/supp"
+ export SUPP=$"../../scripts/supp"
make
if [ -f "$NAME.gw" ]
then GWOPT+=-p. test_gw "$NAME.gw" "$n"