summaryrefslogtreecommitdiff
path: root/Build/source/texk/msvc/texi.mak
blob: ca625c46c7dacbec6d92d7313d14f1102ca06417 (plain)
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
################################################################################
#
# Makefile  : texi, build info, pdf and html files out of texinfo files
# Author    : Fabrice Popineau <Fabrice.Popineau@supelec.fr>
# Platform  : Win32, Microsoft VC++ 6.0, depends upon fpTeX 0.5 sources
# Time-stamp: <04/03/20 15:52:19 popineau>
#
################################################################################

# paths to doc directories

!ifndef docdir
docdir = $(texmf)\doc
!endif

!ifndef infodir
infodir = $(docdir)\info
!endif

!ifndef htmldocdir
htmldocdir = $(docdir)\$(docsubdir)
!endif

!ifndef pdfdocdir
pdfdocdir = $(docdir)\$(docsubdir)
!endif

#
# Only if infofiles has been defined
#

!if ("$(infofiles)" != "" || "$(pdfdocfiles)" != "" || "$(htmldocfiles)" != "")

makeinfo = makeinfo
makeinfo_flags = --paragraph-indent=2 --no-split -I$(srcdir)

texi2html = perl $(texk_srcdir)\tetex\texi2html
texi2html_flags = -expandinfo -number -menu -split_chapter
# If you prefer one big .html file instead of several, remove
# -split-node or replace it by -split_chapter.

# For making normal text files out of Texinfo source.
one_info = --no-headers --no-split --no-validate

dvips = dvips
dvipsflags =
texflags=-interaction=batchmode

.SUFFIXES: .info .dvi .html .texi .txi .pdf .tex .texinfo

.texinfo.texi:
	-@$(copy) $< $@

.texi.info:
	-$(silent)$(makeinfo) $(makeinfo_flags) $< -o $@

.texi.dvi:
#	$(TEXI2DVI) $(TEXI2DVI_FLAGS) $<
	-@echo $(verbose) & echo "Compiling $@ out of $<" & ( \
	tex $(texflags) $< & \
	tex $(texflags) $< & \
	texindex $(<:.texi=.??) & \
	tex $(texflags) $< ) $(redir_stdout)
	-@$(del) $(<:.texi=.aux) $(<:.texi=.log) $(<:.texi=.toc)

.texi.html:
	$(silent)$(texi2html) $(texi2html_flags) $< 

.texi.pdf:
	-@echo $(verbose) & echo "Compiling $@ out of $<" & ( \
	pdftex $(texflags) $< & \
	pdftex $(texflags) $< & \
	texindex $(<:.texi=.??) & \
	pdftex $(texflags) $< )
	-@$(del) $(<:.texi=.aux) $(<:.texi=.log) $(<:.texi=.toc)

.txi.info:
	-$(makeinfo) $(makeinfo_flags) $< -o $@

.txi.dvi:
#	$(TEXI2DVI) $(TEXI2DVI_FLAGS) $<
	-tex $(texflags) $<
	-tex $(texflags) $<
	-texindex $(<:.txi=.??)
	-tex $(texflags) $<
	$(del) $(<:.txi=.aux) $(<:.txi=.log) $(<:.txi=.toc)

.txi.html:
	$(texi2html) $(texi2html_flags) $< 

.txi.pdf:
	-pdftex $(texflags) $<
	-pdftex $(texflags) $<
	-texindex $(<:.txi=.??)
	-pdftex $(texflags) $<
	-@$(del) $(<:.txi=.aux) $(<:.txi=.log) $(<:.txi=.toc)

.tex.pdf:
	-pdflatex $(texflags) $<
	-pdflatex $(texflags) $<

.tex.html:
	-if NOT exist "$(htmldocdir)" mkdir "$(htmldocdir)"
	-htlatex --force --output-dir "$(htmldocdir)" $<

.dvi.ps:
	-$(dvips) $(dvipsflags) $< -o

doc: $(infofiles) $(htmldocfiles) $(pdfdocfiles)

installdirs = $(installdirs) "$(infodir)" "$(docdir)" "$(htmldocdir)" "$(pdfdocdir)"

install:: install-info install-doc

install-info:: $(infofiles)
!if !exist("$(infodir)\dir") && exist($(texk_srcdir)\dir-example)
	if NOT EXIST "$(infodir)\dir" \
	    $(copy) $(texk_srcdir)\dir-example "$(infodir)\dir"
!endif
	-@echo $(verbose) & ( \
		for %i in ($(infofiles)) do ( \
			$(copy) %i "$(infodir)\%i" & \
			install-info --version > nul & \
		if ERRORLEVEL 0 \
	 		install-info --info-dir="$(infodir)" $(installinfoflags) "$(infodir)/%i" \
		) \
	)

install-doc:: $(pdfdocfiles) $(htmldocfiles)
	-@echo $(verbose) & ( \
		if "$(pdfdocfiles)" neq "" ( \
			for %i in ($(pdfdocfiles)) do ( \
				$(copy) %i "$(pdfdocdir)\%i" $(redir_stdout) ) ) & \
		if "$(htmldocfiles)" neq "" ( \
			for %i in ($(htmldocfiles:.html=*.html)) do ( \
				$(copy) %i "$(htmldocdir)\%i" $(redir_stdout) ) ) \
	)

extraclean::
	-@echo $(verbose) & ( \
	for %i in (cm cp fl fn ky op pg toc tp vr) do \
	$(del) *.%i *.%is ) 2>nul

distclean::
	-@echo $(verbose) & ( \
		for %i in ($(infofiles)) do $(del) %i $(redir_stderr) \
	)
	-@echo $(verbose) & ( \
		for %i in ($(htmldocfiles:.html=*.html)) do $(del) %i $(redir_stderr) \
	)
	-@echo $(verbose) & ( \
		for %i in ($(pdfdocfiles)) do $(del) %i $(redir_stderr) \
	)
	-@$(del) *.info-? *.info-??

!else
#
# Do nothing if no info files
#
doc:

install-info::

install-doc::

!endif

# End of texi.mak.
#
# Local Variables:
# mode: Makefile
# End: