2 # Makefile (now .in) for the documentation directory
4 # Copyright 1994,2000 rubini@gnu.org (Alessandro Rubini)
8 # BE CAREFUL in editing:
9 # due to the large number of index files, and my use of a non standard
10 # info input file, any file $(TARGET).* is removed by "make clean"
12 # I chose to use a prefix for the input file ("doc.$(TARGET)"), to ease
13 # makeing clean and applying my own rules.
15 ###################################################################
17 # First of all, retrieve features of makeinfo, to know if we can do images
18 # and --html. Also, allow MAKEINFO to be specified on the commandline to
19 # allow me testing with various versions.
21 # NOTE: it looks like semi-old versions can do images too, so CANDOIMAGES
26 # According to whether this makeinfo can output html, autoconf define these
27 REMOVEHTMLTAGS = @REMOVEHTMLTAGS@
28 INFOTOHTML = @INFOTOHTML@
30 ##############################################
34 ALL = $(TARGET).ps $(TARGET).info $(TARGET)doc.txt $(TARGET).html \
41 $(TARGET)doc.txt: mktxt
44 mv $(TARGET).ps $(TARGET)1.ps
45 mpage -2A $(TARGET)1.ps > $(TARGET)2.ps && rm $(TARGET)1.ps
48 # preserve the pdf copy
49 -mv -f $(TARGET).pdf PDF 2> /dev/null && \
50 rm -f *~ *.dvi *.log *.aux \
51 $(TARGET).*.bak $(TARGET).??? $(TARGET).texinfo && \
54 # preserve the ps copy
60 rm -f $(ALL) $(TARGET)_toc.html
63 ####################################################
65 # These rules used to be expressed as "%.texinfo: doc.%" etc. However, this
66 # is gmake-specific, so I turned every % to $(TARGET), thus loosing generality
67 # but gaining portability. I also had to drop "$^": it worked with gmake
68 # and not pmake, while "$<" worked with pmake and not gmake.
69 # with gmake and not pmake.
72 $(TARGET).texinfo: doc.$(TARGET)
73 @rm -f $@ 2> /dev/null
74 sed -f ./infofilter doc.$(TARGET) | $(REMOVEHTMLTAGS) > $@
78 # This rule is somewhat a rewrite of texi2dvi. I like make more than sh :-)
79 # This had to be rewritten too, as "$*" is different in gmake and pmake
81 $(TARGET).dvi: $(TARGET).texinfo
83 # create a spurious index file to please silly sh (bash will work anyway)
87 if test "x`ls $(TARGET).?? $(TARGET).aux`" != "x"; then \
88 for i in `ls $(TARGET).?? $(TARGET).aux`; do \
94 #check the file list, the file and if needed run TeX again
95 old="`ls $(TARGET).??~ $(TARGET).aux~ | sed 's/~//g'`"; \
96 new="`ls $(TARGET).?? $(TARGET).aux`"; \
98 if test "$$old" != "$$new"; then need="y"; \
100 for i in `ls $(TARGET).?? $(TARGET).aux`; do \
101 cmp -s $$i $$i~; if test $$? -ne 0; then need="y" break; fi; \
104 if test "$$need" = "y"; then \
105 texindex $(TARGET).?? && tex $(TARGET).texinfo; \
109 $(TARGET).ps: $(TARGET).dvi
110 dvips -f $(TARGET).dvi > $@
112 $(TARGET).pdf: $(TARGET).ps
113 ps2pdf $(TARGET).ps > $@
115 $(TARGET).lj: $(TARGET).dvi
116 dvilj -e- $(TARGET).dvi > $@
118 $(TARGET).info: $(TARGET).texinfo
119 makeinfo $(TARGET).texinfo -o $@
121 $(TARGET).html: $(TARGET).texinfo
122 $(INFOTOHTML) -o $@ $<
124 #$(TARGET).man: doc.$(TARGET)
125 # manpages are created by the toplevel Makefile
127 $(TARGET)doc.txt: $(TARGET).info
128 awk -f ./mktxt $(TARGET).info > $@