BIBHTML=perl C:/localtexmf/bibtex/contrib/bibhtml/bibhtml.pl -q
BIBFOLDER=C:/localtexmf/bibtex

MERGE_CV=perl merge-CV.pl -q

DEFAULT:
        @echo ;
        @echo " Makefile for my Curriculum Vitae" ;
        @echo " --------------------------------" ;
        @echo " usage  : make [target]" ;
        @echo " targets:" ;
        @echo "   - all         : update all deps" ;
        @echo "   - force-all   : rebuild everything" ;
        @echo "   - astoria     : rebuild astoria.html" ;
        @echo "   - edonis      : rebuild edonis.html" ;
        @echo "   - CV          : rebuild CV.html" ;
        @echo ;

# update all
all: astoria.html edonis.html CV.html

# force to rebuild every thing
force-all: astoria edonis CV

# rules for ASTORIA bibliography
astoria.html astoria: $(BIBFOLDER)/ASTORIA/astoria.bib
        @echo "____[$@]____"
        @# @echo "<!-- bibhtml:start -->\n<!-- bibhtml:end -->" > astoria.html
        @echo "<!-- bibhtml:start -->" > astoria.html
        @echo "<!-- bibhtml:end -->"  >> astoria.html
        @$(BIBHTML) -a +3 -r astoria -b astoria astoria.html
        @rm astoria.html.old astoria.bbl astoria.blg astoria.aux
        @echo

# rules for EDONIS bibliography
edonis.html edonis: $(BIBFOLDER)/EDONIS/edonis.bib
        @echo "____[$@]____"
        @#echo "<!-- bibhtml:start -->\n<!-- bibhtml:end -->" > edonis.html
        @echo "<!-- bibhtml:start -->" > edonis.html
        @echo "<!-- bibhtml:end -->"  >> edonis.html
        @$(BIBHTML) -a +3 -r edonis -b edonis edonis.html
        @rm edonis.html.old edonis.bbl edonis.blg edonis.aux
        @echo

# rules for the HTML version of the CV
CV.html CV: CV.php3 edonis.html astoria.html
        @echo "____[$@]____"
        @$(MERGE_CV) -o CV.html CV.php3
        @rm CV.html.old
        @echo