Makefile.in 9.45 KB
Newer Older
1
### @configure_input@
Glenn Morris's avatar
Glenn Morris committed
2

3
# Copyright (C) 1994, 1996-2014 Free Software Foundation, Inc.
Glenn Morris's avatar
Glenn Morris committed
4 5 6

# This file is part of GNU Emacs.

7
# GNU Emacs is free software: you can redistribute it and/or modify
Glenn Morris's avatar
Glenn Morris committed
8
# it under the terms of the GNU General Public License as published by
9 10
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
Glenn Morris's avatar
Glenn Morris committed
11 12 13 14 15 16 17

# GNU Emacs is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
18
# along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
Glenn Morris's avatar
Glenn Morris committed
19

20
SHELL = @SHELL@
21

22 23
# Where to find the source code.  $(srcdir) will be the doc/misc subdirectory
# of the source tree.  This is set by configure's `--srcdir' option.
Glenn Morris's avatar
Glenn Morris committed
24 25
srcdir=@srcdir@

26 27
version=@version@

28
## Where the output files go.
29 30 31
## Note that all the Info targets build the Info files in srcdir.
## There is no provision for Info files to exist in the build directory.
## In a tarfile of Emacs, the Info files should be up to date.
32
buildinfodir = $(srcdir)/../../info
33

34 35
## Directory with emacsver.texi.
emacsdir = $(srcdir)/../emacs
Glenn Morris's avatar
Glenn Morris committed
36

37 38 39 40 41 42 43 44 45 46
prefix = @prefix@
datarootdir = @datarootdir@
datadir = @datadir@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
docdir = @docdir@
dvidir = @dvidir@
htmldir = @htmldir@
pdfdir = @pdfdir@
psdir = @psdir@

47 48
MKDIR_P = @MKDIR_P@

49 50 51 52
GZIP_PROG = @GZIP_PROG@

HTML_OPTS = --no-split --html

53
# Options used only when making info output.
54
# (Note that idlwave, info used --nosplit even without the .info extension.)
55
INFO_OPTS= --no-split
56

57 58 59
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@

Glenn Morris's avatar
Glenn Morris committed
60 61
# The makeinfo program is part of the Texinfo distribution.
# Use --force so that it generates output even if there are errors.
62
# (TODO?  Why is this appropriate?)
63 64
MAKEINFO = @MAKEINFO@
MAKEINFO_OPTS = --force -I$(emacsdir)
65

66
## On MS Windows, efaq-w32; otherwise blank.
67
DOCMISC_W32 = @DOCMISC_W32@
68 69 70

## Info files to build and install on all platforms.
INFO_COMMON = ada-mode auth autotype bovine calc ccmode cl \
71
	dbus dired-x ebrowse ede ediff edt eieio \
Rüdiger Sonderfeld's avatar
Rüdiger Sonderfeld committed
72
	emacs-mime epa erc ert eshell eudc efaq eww \
Glenn Morris's avatar
Glenn Morris committed
73
	flymake forms gnus emacs-gnutls htmlfontify idlwave ido info.info \
74
	mairix-el message mh-e newsticker nxml-mode octave-mode \
75
	org pcl-cvs pgg rcirc remember reftex sasl \
Stephen Berman's avatar
Stephen Berman committed
76
	sc semantic ses sieve smtpmail speedbar srecode todo-mode tramp \
77
	url vhdl-mode vip viper widget wisent woman
78

79
## Info files to install on current platform.
80
INFO_INSTALL = $(INFO_COMMON) $(DOCMISC_W32)
81 82 83 84 85 86

## Info files to build on current platform.
## This is all of them, even though they might not all get installed,
## because the info files are pre-built in release tarfiles.
INFO_TARGETS = $(INFO_COMMON) efaq-w32

87 88 89 90
# There are some naming differences between the info targets and the other
# targets, so let's resolve them here.
TARGETS_1 = $(INFO_INSTALL:ccmode=cc-mode)
TARGETS = $(TARGETS_1:info.info=info)
91

92 93 94 95
DVI_TARGETS  = $(TARGETS:=.dvi)
HTML_TARGETS = $(TARGETS:=.html)
PDF_TARGETS  = $(TARGETS:=.pdf)
PS_TARGETS   = $(TARGETS:=.ps)
96

97
TEXI2DVI = texi2dvi
98
TEXI2PDF = texi2pdf
99
DVIPS = dvips
Glenn Morris's avatar
Glenn Morris committed
100

101 102
ENVADD = TEXINPUTS="$(srcdir):$(emacsdir):$(TEXINPUTS)" \
         MAKEINFO="$(MAKEINFO) $(MAKEINFO_OPTS)"
Glenn Morris's avatar
Glenn Morris committed
103

104 105
gfdl = ${srcdir}/doclicense.texi

106
.PHONY: info dvi html pdf ps echo-info $(INFO_TARGETS)
107 108
## Prevent implicit rule triggering for foo.info.
.SUFFIXES:
109

110 111 112
## Disable implicit rules.
%.texi: ;

113 114 115
# Default.
info: $(INFO_TARGETS)

116
## Used by top-level Makefile.
117
## Base file names of output info files.
118
echo-info:
119
	@echo "$(INFO_INSTALL) " | \
120
	  sed -e 's|[^ ]*/||g' -e 's/\.info//g' -e "s/  */.info /g"
Glenn Morris's avatar
Glenn Morris committed
121

Glenn Morris's avatar
Glenn Morris committed
122 123
dvi: $(DVI_TARGETS)

124 125
html: $(HTML_TARGETS)

126
pdf: $(PDF_TARGETS)
127

128 129
ps: $(PS_TARGETS)

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
${buildinfodir}:
	${MKDIR_P} $@

### The general case.

EXTRA_OPTS =

${buildinfodir}/%.info: ${srcdir}/%.texi ${gfdl} | ${buildinfodir}
	$(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) $(EXTRA_OPTS) -o $@ $<

## The short aliases, eg efaq = $(buildinfodir)/efaq.info.
define info_template
 $(1): $$(buildinfodir)/$(1).info
endef

## "info" is already taken.
info.info: $(buildinfodir)/info.info

$(foreach ifile,$(filter-out info.info,$(INFO_TARGETS)),$(eval $(call info_template,$(ifile))))


%.dvi: ${srcdir}/%.texi ${gfdl}
	$(ENVADD) $(TEXI2DVI) $<

%.pdf: ${srcdir}/%.texi ${gfdl}
	$(ENVADD) $(TEXI2PDF) $<

%.html: ${srcdir}/%.texi ${gfdl}
	$(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) $(EXTRA_OPTS) -o $@ $<

%.ps: %.dvi
	$(DVIPS) -o $@ $<


### The exceptions.

## Extra dependencies.

need_emacsver = calc cl dired-x efaq efaq-w32 erc ido reftex woman
need_emacsver_prefix = $(addprefix ${buildinfodir}/,${need_emacsver})

$(need_emacsver_prefix:=.info) $(need_emacsver:=.dvi) $(need_emacsver:=.pdf) $(need_emacsver:=.html) : ${emacsdir}/emacsver.texi

$(buildinfodir)/gnus.info gnus.html: ${srcdir}/gnus-faq.texi

$(buildinfodir)/semantic.info semantic.dvi semantic.pdf semantic.html: ${srcdir}/sem-user.texi


## Please can we just rename cc-mode.texi to ccmode.texi...
179
${buildinfodir}/ccmode.info: ${srcdir}/cc-mode.texi ${gfdl} | ${buildinfodir}
180 181 182 183
	$(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ $<

## efaq, efaq_w32 do not depend on gfdl.
## Maybe we can use .SECONDEXPANSION for this.
184
${buildinfodir}/efaq%.info: ${srcdir}/efaq%.texi | ${buildinfodir}
185 186 187 188 189 190 191 192 193 194 195 196 197
	$(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ $<

efaq%.dvi: ${srcdir}/efaq%.texi
	$(ENVADD) $(TEXI2DVI) $<

efaq%.pdf: ${srcdir}/efaq%.texi
	$(ENVADD) $(TEXI2PDF) $<

efaq%.html: ${srcdir}/efaq%.texi
	$(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ $<

${buildinfodir}/emacs-mime.info emacs-mime.html: EXTRA_OPTS = --enable-encoding

198 199
gnus_deps = ${srcdir}/gnus.texi ${srcdir}/gnus-faq.texi ${gfdl}
gnus.dvi: $(gnus_deps)
200 201 202 203 204
	sed -e '/@iflatex/,/@end iflatex/d' $< > gnustmpdvi.texi
	$(ENVADD) $(TEXI2DVI) gnustmpdvi.texi
	cp gnustmpdvi.dvi $@
	rm gnustmpdvi.*

205
gnus.pdf: $(gnus_deps)
206 207 208 209 210 211 212 213
	sed -e '/@iflatex/,/@end iflatex/d' $< > gnustmppdf.texi
	$(ENVADD) $(TEXI2PDF) gnustmppdf.texi
	cp gnustmppdf.pdf $@
	rm gnustmppdf.*

${buildinfodir}/tramp.info tramp.html: EXTRA_OPTS = -D emacs
${buildinfodir}/tramp.info tramp.html: ${srcdir}/trampver.texi

Glenn Morris's avatar
Glenn Morris committed
214

215
.PHONY: mostlyclean clean distclean bootstrap-clean maintainer-clean
Glenn Morris's avatar
Glenn Morris committed
216

Glenn Morris's avatar
Glenn Morris committed
217
mostlyclean:
218
	rm -f *.aux *.log *.toc *.c[mp] *.c[mp]s *.fn *.fns \
219
	  *.ky *.kys *.op *.ops *.p[gj] *.p[gj]s *.sc *.scs *.ss \
220
	  *.t[gp] *.t[gp]s *.vr *.vrs
221
	rm -f gnustmp*
Glenn Morris's avatar
Glenn Morris committed
222 223

clean: mostlyclean
Paul Eggert's avatar
Paul Eggert committed
224
	rm -f *.dvi *.html *.pdf *.ps
225
	rm -f emacs-misc-${version}.tar*
Glenn Morris's avatar
Glenn Morris committed
226 227

distclean: clean
228
	rm -f Makefile
Glenn Morris's avatar
Glenn Morris committed
229

230
## buildinfodir is relative to srcdir.
231
infoclean:
232
	for file in $(INFO_TARGETS); do \
233
	  file=`echo $${file} | sed 's/\.info$$//'`.info; \
234 235 236 237
	  rm -f \
	    $(buildinfodir)/$${file} \
	    $(buildinfodir)/$${file}-[1-9] \
	    $(buildinfodir)/$${file}-[1-9][0-9]; \
238
	done
Glenn Morris's avatar
Glenn Morris committed
239

240
bootstrap-clean maintainer-clean: distclean infoclean
241 242 243 244 245 246 247 248 249 250 251 252 253 254

dist:
	rm -rf emacs-misc-${version}
	mkdir emacs-misc-${version}
	cp ${srcdir}/*.texi ${srcdir}/texinfo.tex \
	  $(emacsdir)/emacsver.texi ${srcdir}/ChangeLog* \
	  emacs-misc-${version}/
	sed -e 's/@sr[c]dir@/./' \
	  -e 's/^\(emacsdir *=\).*/\1 ./' \
	  -e 's/^\(buildinfodir *=\).*/\1 ./' \
	  -e 's/^\(clean:.*\)/\1 infoclean/' \
	  -e "s/@ver[s]ion@/${version}/" \
	  -e 's/@MAKE[I]NFO@/makeinfo/' -e 's/@MK[D]IR_P@/mkdir -p/' \
	  -e 's/@IN[F]O_EXT@/.info/' -e 's/@IN[F]O_OPTS@//' \
Glenn Morris's avatar
Glenn Morris committed
255 256 257 258 259 260 261 262 263 264 265 266 267 268
	  -e 's|@SH[E]LL@|/bin/bash|' \
	  -e 's|@[p]refix@|/usr/local|' \
	  -e 's|@[d]atarootdir@|$${prefix}/share|' \
	  -e 's|@[d]atadir@|$${datarootdir}|' \
	  -e 's|@[P]ACKAGE_TARNAME@|emacs|' \
	  -e 's|@[d]ocdir@|$${datarootdir}/doc/$${PACKAGE_TARNAME}|' \
	  -e 's|@[d]vidir@|$${docdir}|' \
	  -e 's|@[h]tmldir@|$${docdir}|' \
	  -e 's|@[p]dfdir@|$${docdir}|' \
	  -e 's|@[p]sdir@|$${docdir}|' \
	  -e 's|@[G]ZIP_PROG@|gzip|' \
	  -e 's|@IN[S]TALL@|install -c|' \
	  -e 's|@IN[S]TALL_DATA@|$${INSTALL} -m 644|' \
	  -e '/@[c]onfigure_input@/d' \
269 270 271 272 273 274 275
	  ${srcdir}/Makefile.in > emacs-misc-${version}/Makefile
	@if grep '@[a-zA-Z_]*@' emacs-misc-${version}/Makefile; then \
	  echo "Unexpanded configure variables in Makefile?" 1>&2; exit 1; \
	fi
	tar -cf emacs-misc-${version}.tar emacs-misc-${version}
	rm -rf emacs-misc-${version}

276 277 278 279

.PHONY: install-dvi install-html install-pdf install-ps install-doc

install-dvi: dvi
280 281
	umask 022; $(MKDIR_P) "$(DESTDIR)$(dvidir)"
	$(INSTALL_DATA) $(DVI_TARGETS) "$(DESTDIR)$(dvidir)"
282
install-html: html
283 284
	umask 022; $(MKDIR_P) "$(DESTDIR)$(htmldir)"
	$(INSTALL_DATA) $(HTML_TARGETS) "$(DESTDIR)$(htmldir)"
285
install-pdf: pdf
286 287
	 umask 022;$(MKDIR_P) "$(DESTDIR)$(pdfdir)"
	$(INSTALL_DATA) $(PDF_TARGETS) "$(DESTDIR)$(pdfdir)"
288
install-ps: ps
289
	umask 022; $(MKDIR_P) "$(DESTDIR)$(psdir)"
290
	for file in $(PS_TARGETS); do \
291
	  $(INSTALL_DATA) $${file} "$(DESTDIR)$(psdir)"; \
292
	  [ -n "${GZIP_PROG}" ] || continue; \
293 294
	  rm -f "$(DESTDIR)$(psdir)/$${file}.gz"; \
	  ${GZIP_PROG} -9n "$(DESTDIR)$(psdir)/$${file}"; \
295 296 297 298 299 300 301 302 303 304 305
	done

## Top-level Makefile installs the info pages.
install-doc: install-dvi install-html install-pdf install-ps



.PHONY: uninstall-dvi uninstall-html uninstall-pdf uninstall-ps uninstall-doc

uninstall-dvi:
	for file in $(DVI_TARGETS); do \
306
	  rm -f "$(DESTDIR)$(dvidir)/$${file}"; \
307 308 309
	done
uninstall-html:
	for file in $(HTML_TARGETS); do \
310
	  rm -f "$(DESTDIR)$(htmldir)/$${file}"; \
311 312 313 314
	done
uninstall-ps:
	ext= ; [ -n "${GZIP_PROG}" ] && ext=.gz; \
	for file in $(PS_TARGETS); do \
315
	  rm -f "$(DESTDIR)$(psdir)/$${file}$${ext}"; \
316 317 318
	done
uninstall-pdf:
	for file in $(PDF_TARGETS); do \
319
	  rm -f "$(DESTDIR)$(pdfdir)/$${file}"; \
320 321 322 323 324
	done

uninstall-doc: uninstall-dvi uninstall-html uninstall-pdf uninstall-ps


325
### Makefile ends here