Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 22338dde33
Fetching contributors…

Cannot retrieve contributors at this time

file 271 lines (215 sloc) 6.902 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271
# $Id$

MANPAGE_SRC = tsung.1.sgml tsplot.1.sgml tsung-recorder.1.sgml
MANPAGE = tsung.1 tsplot.1 tsung-recorder.1

TOPDIR=.
IMG_TOPDIR=.
LOGO_DIR=$(TOPDIR)/logos

FILES=$(wildcard *.tex)

# classe et styles latex
INCLUDES=shortcuts.sty TSUNG-en.cls

# chemin des fichiers de style
STYLE=$(TOPDIR)/styles
CSS=IDXDOC.css

# classe et styles hevea
HEVEA_INC=TSUNG.hva
HEVEAOPTS=-fix -I $(STYLE) -exec xxdate.exe -pedantic
LANGUAGE=

# logos
LOGOS_JPG=
LOGOS_EPS = $(LOGOS_JPG:.jpg=.eps)

##############

# remove image.tex generated by hevea
TEXFILES=$(sort $(subst image.,,$(FILES)))
DVIFILES=$(TEXFILES:.tex=.dvi)
PSFILES=$(TEXFILES:.tex=.ps)
PDFFILES=$(TEXFILES:.tex=.pdf)
HTMLFILES=$(TEXFILES:.tex=.html)
HTML_INDEXFILES=$(TEXFILES:.tex=_index.html)

# get figures to be generated from gnuplot file
PLOT_DIR = $(IMG_TOPDIR)/plot
PLOT_PS = $(shell grep -s output $(PLOT_DIR)/*.gplot | cut -f3 -d" " | perl -e '{ while (<>) {chomp; s/"//;s/"/ /; print} }')
PLOT=$(addprefix $(PLOT_DIR)/,$(PLOT_PS))
#PLOT = $(wildcard $(PLOT_DIR)/*.ps)
PLOT_PNG = $(PLOT:.ps=.png)
PLOT_PDF = $(PLOT:.ps=.pdf)

# figures
FIGURES_DIR = $(IMG_TOPDIR)/figures
FIGURES = $(wildcard $(FIGURES_DIR)/*.fig)
FIGURES_PNG = $(FIGURES:.fig=.png)
#FIGURES_JPG = $(FIGURES:.fig=.jpg)
FIGURES_EPS = $(FIGURES_PNG:.png=.eps)

# images
IMAGES_DIR = $(IMG_TOPDIR)/images
IMAGES_PNG = $(wildcard $(IMAGES_DIR)/*.png)
IMAGES_EPS = $(IMAGES_PNG:.png=.eps)

ALL_IMG = $(notdir $(FIGURES))
ALL_IMG += $(notdir $(IMAGES_PNG))
ALL_IMG += $(notdir $(PLOT))

# pour recompiler le doc latex autant de fois que necessaire :
RERUN = "(There were undefined references|Rerun to get (cross-references|the bars) right)"
RERUNBIB = "No file.*\.bbl|Citation.*undefined"

#'-nopostscript' afin de ne pas subir l'interprétation/rendu des fichiers PS inclus
XDVI=xdvi -s 0 -geometry -0+0 -margins 0cm -nopostscript
XPDF=xpdf -geometry 600x768+0+0 -z page
GV=gv
CONVERT=convert
GNUPLOT=gnuplot
PDFLATEX=pdflatex --interaction=batchmode
EPS2PDF=epstopdf
DVIPS=dvips
LATEX=latex --interaction=batchmode
BIBTEX=bibtex
FIG2DEV=fig2dev
VIEWER=gv
HEVEA=hevea
HACHA=hacha
IMAGEN=imagen
MAKEINDEX=makeindex
TIDY=tidy
XSLTPROC=xsltproc

XSL=$(HOME)/cvs/web/idealx3.org/xhtml.xsl

# On rajoute les fichiers templates de LaTeX dans le VPATH pour make
# et dans TEXINPUTS pour LaTeX
TEXINPUTS = :.:$(STYLE):$(LOGO_DIR):$(IMAGES_DIR):$(FIGURES_DIR):$(PLOT_DIR):
BSTINPUTS = :.:$(STYLE)
VPATH = $(TEXINPUTS)

# pour exporter TEXINPUTS
.EXPORT_ALL_VARIABLES:

.PHONY: clean distclean pdf dvi ps all html htmlsingle

# Stop GNU make from overzealous deletion of intermediate files
.PRECIOUS: %.dvi $(FIGURES_PNG) $(FIGURES_JPG) $(IMAGES_EPS) $(LOGOS_EPS) $(PLOT) $(PLOT_PNG) $(PLOT_PDF)

all: man

man: $(MANPAGE)

%.1: %.1.sgml
docbook2man $< >/dev/null 2>&1


psimages: $(FIGURES_EPS) $(IMAGES_EPS) $(LOGOS_EPS)

pngimages: $(FIGURES_PNG)

show:
@echo INC = $(INCLUDES)
@echo FIG = $(FIGURES_PNG)
@echo IMG= $(IMAGES_PNG)
@echo HEVEA= $(HEVEA_INC)
@echo PLOT= $(PLOT_PNG)
@echo TEX = $(TEXFILES)
@echo HTML = $(HTMLFILES)
@echo LOGOS = $(LOGOS_EPS)
@echo ALL_IMG = $(ALL_IMG)
@echo TEXINPUTS = $(TEXINPUTS)

dist: pdf html
tar zvcfh archive.tgz *.html *.pdf $(ALL_IMG) $(CSS)


dvi: $(DVIFILES)
ps: $(PSFILES)
pdf: $(PDFFILES)
html: $(HTMLFILES)
htmlsplit: $(HTML_INDEXFILES)
print: $(PSFILES)
@echo "printing $<"
a2ps $<

#glossaire:
# $(MAKEINDEX) -s tlglo.ist -o these.gls these.glo
# makeindex these
#makeindex -s tlglo.ist -o these.gls these.glo

%_index.html: %.html
@echo splitting $@ ...
@$(HACHA) $(LANGUAGE) -o $@ $<

#%.html: %.tex $(INCLUDES) $(FIGURES_PNG) $(IMAGES_PNG) $(HEVEA_INC) $(LOGOS_EPS) $(PLOT_PNG)

user_manual.html: user_manual.tex ../CHANGES $(INCLUDES) $(FIGURES_PNG) $(IMAGES_PNG) $(HEVEA_INC) $(LOGOS_EPS) $(PLOT_PNG)
@echo Generating $@...
@$(HEVEA) $(HEVEAOPTS) $(LANGUAGE) $(HEVEA_INC) $<
ifeq ($(strip $(IMAGES_PNG)),)
@echo no images
else
@echo Generating images for html...
@ln -sf $(IMAGES_DIR)/*.png .
endif
ifeq ($(strip $(FIGURES_PNG)),)
@echo no figures
else
@echo Generating figures for html...
@ln -sf $(FIGURES_DIR)/*.png .
endif
ifeq ($(strip $(PLOT_PNG)),)
@echo no plot
else
@echo Generating plot for html...
@ln -sf $(PLOT_DIR)/*.png .
endif
@echo done

%.xhtml: %.html
@echo "Generating XHTML"
@$(TIDY) -latin1 -f $*.tidy_log -c -asxml $*.html > $*.xhtml ; true

%.xml: %.xhtml $(XSL)
@echo Generating $@...
@$(XSLTPROC) -o $*.xml $(XSL) $*.xhtml
@perl -i -pe 's@idxwebml-xhtml.dtd">@../../idxwebml.dtd" [<!ENTITY leftbar SYSTEM "menu.xml">]>@g' $*.xml
@echo "done"

## remove builtin GNU-make implicit rule for dvi
%.dvi : %.tex

gv: ps
@$(GV) $(FILE) &

xpdf: pdf
@$(XPDF) $(FILE).pdf &

%.dvi: %.tex Makefile $(INCLUDES) $(LOGOS_EPS) $(FIGURES_EPS) $(IMAGES_EPS) $(PLOT)
@echo Generating $@...
@echo
@$(LATEX) $<
@egrep -c $(RERUNBIB) $*.log && ($(BIBTEX) $*;$(LATEX) $<) ; true
@egrep $(RERUN) $*.log && $(LATEX) $< ; true
@egrep $(RERUN) $*.log && $(LATEX) $< ; true
# Display relevant warnings
@egrep -i "(Reference|Citation).*undefined" $*.log ; true

%.ps: %.dvi
@echo Generating $@...
@dvips -q -t a4 -o $@ $<
@echo done.

%.pdf: %.tex ../CHANGES $(INCLUDES) $(LOGOS_JPG) $(FIGURES_PNG) $(IMAGES_PNG) $(PLOT_PDF)
@echo Generating $@...
@echo
@$(PDFLATEX) $<
@egrep -c $(RERUNBIB) $*.log && ($(BIBTEX) $*;$(LATEX) $<) ; true
@egrep $(RERUN) $*.log && $(PDFLATEX) $< ; true
@egrep $(RERUN) $*.log && $(PDFLATEX) $< ; true
# Display relevant warnings
@egrep -i "(Reference|Citation).*undefined" $*.log ; true

%.eps: %.jpg
@echo convert $< $@
@$(CONVERT) $< $@

%.eps: %.png
@echo convert $< $@
@$(CONVERT) $< $@

clean:
@echo -n Cleaning intermediate files...
@rm -f *.{aux,log,toc,bak,haux,lof,out,htoc,ps,links,refs,1} $(LOGOS_EPS)
@echo " done."

$(PLOT_DIR)/%.ps: $(PLOT_DIR)/*.gplot
@echo \* Producing ps files $< with data with gnuplot
@cd $(PLOT_DIR); $(GNUPLOT) *.gplot ; cd -

$(PLOT_DIR)/%.png: $(PLOT_DIR)/%.ps
@echo Generating $@
@$(CONVERT) $< $@

$(PLOT_DIR)/%.pdf: $(PLOT_DIR)/%.ps
@echo Generating $@
@$(EPS2PDF) $<

$(FIGURES_DIR)/%.png: $(FIGURES_DIR)/%.fig
@echo Generating $@
@$(FIG2DEV) -L png $< $@

$(FIGURES_DIR)/%.jpg: $(FIGURES_DIR)/%.fig
@echo Generating $@
@$(FIG2DEV) -L jpeg $< $@

$(FIGURES_DIR)/%.eps: $(FIGURES_DIR)/%.fig
@echo Generating $@
@$(FIG2DEV) -L eps $< $@

$(IMAGES_DIR)/%.jpg: $(IMAGES_DIR)/%.png
@echo Generating $@
@$(CONVERT) $< $@

$(IMAGES_DIR)/%.eps: $(IMAGES_DIR)/%.png
@echo Generating $@
@$(CONVERT) $< $@

$(LOGO_DIR)/%.eps: $(IMAGES_DIR)/%.jpg
@echo Generating $@
@$(CONVERT) $< $@

mrproper: distclean

distclean: clean
@echo -n Cleaning result files...
@rm -f $(DVIFILES) $(PSFILES) $(PDFFILES) $(LOGOS_EPS) $(FIGURES_EPS) $(FIGURES_PNG) *.html *motif.gif $(IMAGES_DIR)/*.eps *.png *.image.tex $(PLOT_PNG) $(PLOT_PDF) $(PLOT) *.bbl *.blg''
@echo " done."
Something went wrong with that request. Please try again.