doxy: helper script to generate imgs from macros
[u/mrichter/AliRoot.git] / doxygen / alidoxyimg.sh
CommitLineData
6cbb53dc 1#!/bin/bash
2
3# Usage:
4# alidoxyimg.sh <macro>.C
5#
6# Generates <macro>.png image as the output of <macro>.
7#
8# Needs aliroot executable.
9
10if [[ $1 == '' ]] ; then
11 echo 'Usage:'
12 echo ' alidoxyimg.sh <macro>.C'
13 echo ''
14 echo 'The output will be a file named <macro>.png.'
15 exit 1
16fi
17
18if ! which aliroot > /dev/null 2>&1 ; then
19 echo 'Error: aliroot executable not found in $PATH'
20 exit 2
21fi
22
23base=${1%.*}
24ext='png'
25
26aliroot -b "$1" <<EOF
27gPad->Print("$base.$ext");
28EOF
29
30if [[ ! -e "${base}.${ext}" ]] ; then
31 echo "Error: output file ${base}.${ext} not generated!"
32 exit 3
33fi