#$Header: /home2/cvsroot/LogTrend/Doc/Makefile,v 1.1.2.1 2002/02/08 18:12:52 lsimonneau Exp $
####################################################
##  Makefile for Logtrend's doc in SGML/Docbook   ##
##        Frdric Dubuy - July, 18 2001          ##
####################################################
#$Log: Makefile,v $
#Revision 1.1.2.1  2002/02/08 18:12:52  lsimonneau
#*** empty log message ***
#
#Revision 1.1  2002/02/08 18:01:02  lsimonneau
#*** empty log message ***
#
#Revision 1.2  2002/02/07 14:00:37  lsimonneau
#*** empty log message ***
#
#Revision 1.1.4.1  2002/02/07 13:20:39  lsimonneau
#*** empty log message ***
#
#Revision 1.1  2001/09/27 16:42:46  slhullier
#*** empty log message ***
#
#Revision 1.1  2001/09/25 08:15:33  lsimonneau
#rename complex_alarm_doc as complex-alarm
#
#Revision 1.1  2001/09/24 16:29:33  lsimonneau
#First release of the complex alarm documentation.
#
#Revision 1.1  2001/09/24 14:02:33  slhullier
#First Doc version in CVS
#


SOURCES = Agent/developer-guide/agent-developer-guide.sgml \
	  Agent/install-guide/agent-install-guide.sgml \
          ComplexAlarm/ComplexAlarmDevel.sgml ComplexAlarm/ComplexAlarm.sgml \
          Consolidation/Consolidation.sgml LogTrend/Presentation.sgml \
	  StorageServer/StorageServer.sgml \
	  Visu/visu.sgml


# Program paths
SHELL =`which bash`
SGMLTOOLS =`which sgmltools` 
PS2PDF = `which ps2pdf`

# File where global variables can be found
VARDEFS = tools/global.ent

#Logo for HTML version
LOGOHTML = logo.jpg

#Logo for PS/PDF versions
LOGOPS = tools/logo_logtrend.eps

#DSSSL Stylesheet
DSSSL = tools/logtrend.dsl


all : all_pdf all_ps all_txt 

all_pdf : $(SOURCES:.sgml=.pdf)

all_ps : $(SOURCES:.sgml=.ps)

all_html : $(SOURCES:.sgml=.html)

all_txt : $(SOURCES:.sgml=.txt)

%.ps : %.sgml $(LOGOPS) $(DSSSL)
	@echo "<!ENTITY % output.html  \"IGNORE\">" >$(VARDEFS) 
	@echo "<!ENTITY % output.print \"INCLUDE\">" >>$(VARDEFS)
	@echo "<!ENTITY logo \""$(LOGOPS)"\">" >>$(VARDEFS)
	@$(SGMLTOOLS) -b ps -s $(DSSSL)  $*.sgml


%.html : %.sgml  $(DSSSL)
	@echo "<!ENTITY % output.html  \"INCLUDE\">" >$(VARDEFS)
	@echo "<!ENTITY % output.print \"IGNORE\">" >>$(VARDEFS)
	@echo "<!ENTITY logo \""$(LOGOHTML)"\">" >>$(VARDEFS)
	@$(SGMLTOOLS) -b onehtml -s $(DSSSL) $*.sgml 
	@rm -Rf `dirname $*`/html
	@mkdir `dirname $*`/html
	@mv *.html `dirname $*`/html	
	@cp tools/$(LOGOHTML) `dirname $*`/html	
	@(cp -f `dirname $*`/*.jpg `dirname $*`/html 2>/dev/null ; true)

%.pdf : %.ps
	@$(PS2PDF) $*.ps

%.txt : %.sgml
	@echo "<!ENTITY % output.html  \"INCLUDE\">" >$(VARDEFS)
	@echo "<!ENTITY % output.print \"IGNORE\">" >>$(VARDEFS)
	@echo "<!ENTITY logo \""$(LOGOHTML)"\">" >>$(VARDEFS)
	@$(SGMLTOOLS) -b txt $*.sgml


