+ifdef INDICES
+# We need to be able to build the index source files without involving
+# the main $(PN).pdf rule, in order to avoid a chicken-and-egg problem.
+# This is similar to the $(PN).aux rule above, except that an index is
+# optional and there might be more than one of them.
+$(INDEX_SRCS): $(PN).tex
+ $(LATEX) $(PN).tex
+endif
+
+ifdef INDICES
+# Create real indices from source files by running "makeindex" on them.
+%.ind: %.idx
+ makeindex $<
+endif
+