summaryrefslogtreecommitdiff
path: root/utils/generate-ttl.sh
blob: 98d451cb0ede5e4f184cfec36312b5163868c791 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash

set -e

if [ -d bin ]; then
  cd bin
else
  echo "Please run this script from the source root folder"
  exit
fi

PWD=`dirname $0`

if [ -f $PWD/lv2_ttl_generator32.exe ]; then
  GEN=$PWD/lv2_ttl_generator32.exe
  EXT=dll
  OSX=
  WIN32=1
  WIN64=
elif [ -f $PWD/lv2_ttl_generator64.exe ]; then
  GEN=$PWD/lv2_ttl_generator64.exe
  EXT=dll
  OSX=
  WIN32=
  WIN64=1
elif [ -f $PWD/lv2_ttl_generatorosx ]; then
  GEN=$PWD/lv2_ttl_generatorosx
  EXT=dylib
  OSX=1
  WIN32=
  WIN64=
else
  GEN=$PWD/lv2_ttl_generator
  EXT=so
fi

FOLDERS=`find . -type d -name \*.lv2`

for i in $FOLDERS; do
  cd $i
  FILE=`ls *.$EXT | sort | head -n 1`
  if [ "x$WIN64" == "x1" ]; then
    #wine64 $GEN ./$FILE
    echo "Not generating ttl for WIN64 yet"
  elif [ "x$WIN32" == "x1" ]; then
    #wine $GEN ./$FILE
    echo "Not generating ttl for WIN32 yet"
  elif [ "x$OSX" == "x1" ]; then
    echo "Not generating ttl for OSX yet"
  else
    $GEN ./$FILE
  fi
  cd ..
done