build 1.39 KB
Newer Older
Clément Stenac's avatar
Clément Stenac committed
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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
#! /bin/sh
# $Id$
# Build script for VideoLAN documentation
# Written by Clment Stenac <zorglub@via.ecp.fr>

DOC="play-howto"
ALL_LANG="en fr"
DEFAULT_LANG="en"

if test "$1" = help
then
 echo "./build TARGET [LANG]"
 echo "LANG can be: $ALL_LANG. Default is $DEFAULT_LANG"
 echo "TARGET can be one of: html, pdf, rtf, txt, clean"
 exit 0
fi

echo "+ Finding for which langage we are building"

if test -n "$2"
then

 if test "$2" = all
 then
  for lang in `echo $ALL_LANG`
  do
   echo "+ Recursive call for $lang"
   $0 $1 $lang
  done
  exit 0
 fi
 
 build_lang=""
 
 for lang in `echo $ALL_LANG`
 do
  if test $2 = $lang
  then
   build_lang=$lang
  fi
 done
   
 if [ $build_lang = "" ]
 then
  echo "- Lang $2 not found"
  build_lang=$DEFAULT_LANG
 fi

else
 echo "- No lang. Using default"
 build_lang=$DEFAULT_LANG
fi
 
echo "+ Building for $build_lang"

echo -n "+ Building the target: "

case $1 in
	html)
		TARGET="$build_lang/$DOC-$build_lang.html";;
	pdf)
		TARGET="$build_lang/$DOC-$build_lang.pdf";;
        rtf)
                TARGET="$build_lang/$DOC-$build_lang.rtf";;
        txt)
                TARGET="$build_lang/$DOC-$build_lang.rtf";;
	clean)
		TARGET="clean";;
	all)
		TARGET="all";;
	*)
		echo ""
		echo -n "- Error: unknown target. Building "
		TARGET="all";;
esac

echo $TARGET

export ALL_LANG=$ALL_LANG

COMMAND="make $TARGET DOC=$DOC LANG=$build_lang"

echo "+ Executing $COMMAND"
$COMMAND