/[volute]/trunk/projects/ivoapub/ivoatex/Makefile
ViewVC logotype

Contents of /trunk/projects/ivoapub/ivoatex/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3015 - (show annotations)
Sat Jun 27 22:32:33 2015 UTC (5 years, 3 months ago) by jdswinbank@gmail.com
File size: 4964 byte(s)
ivoatex: Building $(DOCNAME).bbl depends on ivoatexmeta.tex.

1 # ivoatex control makefile
2 #
3 # This is for inclusion into a main Makefile from one level up.
4 # This main Makefile must define DOCNAME, DOCVERSION, DOCDATE, DOCTYPE
5 # SOURCES; also, FIGURES as needed.
6 #
7 # See http://ivoa.net/documents/Notes/IVOATex/index.html
8 # for the targets in here useful to the user.
9 #
10 # You should *not* need to change anything here while authoring documents.
11 # All customisation should happen in the user Makefile
12
13 IVOATEX_VERSION = 0.4
14
15 CSS_HREF = http://www.ivoa.net/misc/ivoa_doc.css
16 TTH = ivoatex/tth_C/tth
17 ARCHIVE_FILES = $(DOCNAME).tex $(DOCNAME).pdf $(DOCNAME).html $(FIGURES)
18
19 # Requirements:
20 # XSLT processor
21 # C compiler
22 # GNU make (or another sufficiently powerful make)
23 # pdflatex
24 # ghostscript (if you plan on postscript/pdf figures)
25 # zip
26 # All most likely present on, e.g., a linux disribution.
27 # Could use substitites for some of these if they are not available.
28 XSLTPROC = xsltproc
29 XMLLINT = xmllint -noout
30 PDFLATEX = pdflatex
31 CONVERT = convert
32 ZIP = zip
33
34 export TEXINPUTS=.:ivoatex:
35
36 # standard file name according to S&D standards
37 versionedName:=$(DOCTYPE)-$(DOCNAME)-$(DOCVERSION)
38 ifneq "$(DOCTYPE)" "REC"
39 versionedName:=$(versionedName)-$(subst -,,$(DOCDATE))
40 endif
41
42 GENERATED_PNGS = $(addsuffix .png, $(VECTORFIGURES))
43
44 .SUFFIXES: .pdf .gif .tex .png
45 .PHONY: biblio
46
47 %.pdffig.png: %.pdffig
48 # # simple ImageMagic -antialias didn't work too well
49 $(CONVERT) -density 300 $< temp-$@
50 $(CONVERT) temp-$@ -scale 25% $@
51 rm temp-$@
52
53 $(DOCNAME).pdf: ivoatexmeta.tex $(SOURCES) $(FIGURES) $(VECTORFIGURES)
54 $(PDFLATEX) $(DOCNAME)
55
56
57 forcetex:
58 $(PDFLATEX) $(DOCNAME) # && $(PDFLATEX) $(DOCNAME) && $(PDFLATEX) $(DOCNAME)
59
60
61 archive: $(DOC).pdf $(DOC).html $(UPLOAD).zip $(ARCHIVE).zip
62
63 clean:
64 rm -f $(DOCNAME).pdf $(DOCNAME).aux $(DOCNAME).log $(DOCNAME).toc texput.log
65 rm -f $(DOCNAME).html $(DOCNAME).xhtml
66 rm -f *.bbl *.blg *.out debug.html
67 rm -f *.pdffig.png
68
69 ivoatexmeta.tex: Makefile
70 rm -f $@
71 touch $@
72 echo '% GENERATED FILE -- edit this in the Makefile' >>$@
73 /bin/echo '\newcommand{\ivoaDocversion}{$(DOCVERSION)}' >>$@
74 /bin/echo '\newcommand{\ivoaDocdate}{$(DOCDATE)}' >>$@
75 /bin/echo '\newcommand{\ivoaDocdatecode}{$(DOCDATE)}' | sed -e 's/-//g' >>$@
76 /bin/echo '\newcommand{\ivoaDoctype}{$(DOCTYPE)}' >>$@
77 /bin/echo '\newcommand{\ivoaDocname}{$(DOCNAME)}' >>$@
78
79 $(DOCNAME).html: $(DOCNAME).pdf ivoatex/tth-ivoa.xslt $(TTH) \
80 $(GENERATED_PNGS)
81 $(TTH) -w2 -e2 -u2 -pivoatex -L$(DOCNAME) <$(DOCNAME).tex \
82 | $(XSLTPROC) --html \
83 --stringparam CSS_HREF $(CSS_HREF) \
84 ivoatex/tth-ivoa.xslt - \
85 >$(DOCNAME).html
86
87
88 $(DOCNAME).bbl: $(DOCNAME).tex ivoatex/ivoabib.bib ivoatexmeta.tex
89 $(PDFLATEX) $(DOCNAME).tex
90 bibtex $(DOCNAME).aux
91 $(PDFLATEX) $(DOCNAME).tex 2>&1 >/dev/null
92 touch $(DOCNAME).tex
93
94 # We don't let the pdf depend on .bbl, as we don't want to run BibTeX
95 # everytime the TeX input is changed. The idea is that when people do
96 # bibliography-relevant changes, they run make biblio manually.
97 biblio: $(DOCNAME).bbl
98
99
100 package: $(DOCNAME).html $(DOCNAME).pdf \
101 $(GENERATED_PNGS) $(FIGURES) $(AUX_FILES)
102 rm -rf -- $(versionedName)
103 mkdir $(versionedName)
104 cp $(DOCNAME).html $(versionedName)/$(versionedName).html
105 cp $(DOCNAME).pdf $(versionedName)/$(versionedName).pdf
106
107 ifneq ($(strip $(FIGURES)),)
108 cp $(FIGURES) $(versionedName)
109 endif
110 ifneq ($(strip $(GENERATED_PNGS)),)
111 cp $(GENERATED_PNGS) $(versionedName)
112 endif
113 ifneq ($(strip $(AUX_FILES)),)
114 cp $(AUX_FILES) $(versionedName)
115 endif
116 # # make sure files will be readable by the web server later on
117 chmod -R go+w $(versionedName)
118 zip -r $(versionedName).zip $(versionedName)
119 rm -rf -- $(versionedName)
120
121
122 # Build TtH from source. See http://hutchinson.belmont.ma.us/tth/.
123 # TtH source seems to be highly portable, so compilation should be easy
124 # as long as you have a C compiler.
125 $(TTH): ivoatex/tth_C/tth.c
126 $(CC) -o $(TTH) ivoatex/tth_C/tth.c
127
128 ############# below here: building an ivoatex distribution
129
130 IVOATEX_FILES = archdiag.png fromivoadoc.xslt Makefile COPYING \
131 ivoabib.bib Makefile.template tthdefs.tex document.template \
132 ivoa.cls README tth-ivoa.xslt IVOA.jpg \
133 svn-ignore.txt tthntbib.sty
134 TTH_FILES= tth_C/CHANGES tth_C/latex2gif tth_C/ps2gif tth_C/tth.c \
135 tth_C/tth_manual.html tth_C/INSTALL tth_C/license.txt tth_C/ps2png \
136 tth_C/tth.1 tth_C/tth.gif
137
138 IVOATEX_ARCHIVE = ivoatex-$(IVOATEX_VERSION).tar.gz
139
140 .PHONY: ivoatex-install
141
142 $(IVOATEX_ARCHIVE): $(IVOATEX_FILES)
143 @echo "This target must be run inside *ivoatex*"
144 -mkdir ivoatex
145 cp $(IVOATEX_FILES) ivoatex
146 -mkdir ivoatex/tth_C
147 cp $(TTH_FILES) ivoatex/tth_C
148 tar -czf ivoatex-$(IVOATEX_VERSION).tar.gz ivoatex
149 rm -rf ivoatex
150
151
152 ivoatex-installdist: $(IVOATEX_ARCHIVE)
153 @echo "This target will only work for Markus"
154 scp $(IVOATEX_ARCHIVE) alnilam:/var/www/soft/ivoatex/
155 ssh alnilam "cd /var/www/soft/ivoatex/; ln -sf $(IVOATEX_ARCHIVE) ivoatex-latest.tar.gz"

msdemlei@ari.uni-heidelberg.de
ViewVC Help
Powered by ViewVC 1.1.26