lkdp-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[LKDP] preliminary build scripts


From: Boris Bezlaj
Subject: [LKDP] preliminary build scripts
Date: Thu, 6 Jun 2002 19:28:52 +0200
User-agent: Mutt/1.2.5.1i

hi all

These are preliminary sh scripts for building the books.
For now there is no "clean" function and no html format support.
They are slower than previous Makefiles as everything is rebuilt each time the 
script is run..

Standalone BUILD.sh : "one for all" approach; one top-level script that covers 
all books listed in BOOKS var.

Distributed BUILD.sh : these two are more useful for development as the sub 
BUILD.sh is actually standalone for the current dir it is run in; disadvantage: 
in every book dir, there has to be one of sub BUILD.sh ..

All scripts accept one parameter FORMAT  ..only ps for now

NOTE: troubles with stopping the scripts( <Ctrl> Z && kill -9 ...); not good

#---------------- snip snap --- standalone BUILD.sh -----------
#!/bin/sh

BOOKS="mm misc"
FORMAT=pdf

LATEX=latex             # or 'vlatex' if you use 'vtex' distribution
MKIDX=makeindex         # or 'vmakeindex' if you use 'vtex' distribution
DVI2PDF=dvipdf          # or 'dvipdfm'
DVIPS=dvips
L2H=latex2html
L2HOPTS="-nomath -html_version 4 -bottom_navigation -antialias -antialia s_text 
-mkdir"

# --- parameters ---

if [ $1 ]; then
        if [ $1 == "ps" ]; then
                FORMAT=$1
        fi
fi

# --- functions ---

function write_bb ()
{
        if [ -d ./graphics ]; then
                cd graphics
                ebb *           #TODO: only for files containing graphics
                cd ..
        fi
}

function build_dvi ()
{
        write_bb
        $LATEX $1
        $LATEX $1
        $MKIDX $1
        $LATEX $1
}

# --- build the books ---

for BOOK in $BOOKS; do
        cd $BOOK

# build books in Portable Document Format

        if [ $FORMAT == "pdf" ]; then
                build_dvi $BOOK
                $DVI2PDF $BOOK
        fi

# build books in PostScript

        if [ $FORMAT == "ps" ]; then
                build_dvi $BOOK
                $DVIPS $BOOK
        fi

        cd ..
done
#---------------- snip snap --- standalone BUILD.sh -----------

#---------------- snip snap --- distributed toplevel BUILD.sh -
#!/bin/sh

BOOKS="mm misc"
FORMAT=pdf

# --- parameters ---

if [ $1 ]; then
        if [ $1 == "ps" ]; then
                FORMAT=$1
        fi
fi

# --- build the books ---

for BOOK in $BOOKS; do
        cd $BOOK
        ./BUILD.sh $FORMAT
        cd ..
done

#---------------- snip snap --- distributed toplevel BUILD.sh -

#---------------- snip snap --- distributed subdir BUILD.sh ---
#!/bin/sh

FORMAT=pdf

LATEX=latex             # or 'vlatex' if you use 'vtex' distribution
MKIDX=makeindex         # or 'vmakeindex' if you use 'vtex' distribution
DVI2PDF=dvipdf          # or 'dvipdfm'
DVIPS=dvips
L2H=latex2html
L2HOPTS="-nomath -html_version 4 -bottom_navigation -antialias -antialia s_text 
-mkdir"

# --- parameters ---

if [ $1 ]; then
        if [ $1 == "ps" ]; then
                FORMAT=$1
        fi
fi

# --- functions ---

function write_bb ()
{
        if [ -d ./graphics ]; then
                cd graphics
                ebb *           #TODO: only for files containing graphics
                cd ..
        fi
}

function build_dvi ()
{
        write_bb
        $LATEX $1
        $LATEX $1
        $MKIDX $1
        $LATEX $1
}

# --- build the books ---

BOOK=`pwd | tr / "\n" | tail -n1`

# build books in Portable Document Format

        if [ $FORMAT == "pdf" ]; then
                build_dvi $BOOK
                $DVI2PDF $BOOK
        fi

# build books in PostScript

        if [ $FORMAT == "ps" ]; then
                build_dvi $BOOK
                $DVIPS $BOOK
        fi
#---------------- snip snap --- distributed subdir BUILD.sh ---

-- 

        Boris B.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]