[www-doc] Doc Build system

Clément Stenac zorglub at via.ecp.fr
Wed Aug 13 12:37:37 CEST 2003


Hello,

The VideoLAN documentation is now composed of five documents, which
have rather annoying Makefiles, du to the multilingual features, and
maintaining these five Makefiles is sort of a wast of time.

I propose that from now, we had only one in
/www.videolan.org/doc/common, and a build script (eg, the one below)
that calls it with good parameters.

I had first tried to majke a script that could be run from anywhere, but
it's definitely too much work (on the makefile, mainly) for not much

This way, we only have one Makefile to change, and we don't have to type
long targets (like "make f/videolan-quickstart-fr.pdf LANG=fr" will for
exemple be replaced by ./build pdf fr)





----

#! /bin/sh

# Build script for VideoLAN documentation
# Written by Clément Stenac <zorglub at via.ecp.fr>

DOC="videolan-quickstart"
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 $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 -f ../common/Makefile $TARGET DOC=$DOC LANG=$build_lang"

echo "+ Executing $COMMAND"
$COMMAND


-- 
Zorglub
Clément Stenac
-- 
This is the www-doc mailing-list, see http://www.videolan.org/doc/
To unsubscribe, please read http://developers.videolan.org/lists.html
If you are in trouble, please contact <postmaster at videolan.org>



More information about the www-doc mailing list