One day this will make ps2pdf optmimize the output PDF...
[platform/upstream/nasm.git] / doc / Makefile.in
1 # $Id$
2 #
3 # UNIX Makefile for NASM documentation
4 #
5
6 srcdir          = @srcdir@
7 VPATH           = @srcdir@
8 prefix          = @prefix@
9 exec_prefix     = @exec_prefix@
10 bindir          = @bindir@
11 mandir          = @mandir@
12 docdir          = $(prefix)/doc/nasm
13 infodir         = @infodir@
14
15 INSTALL         = @INSTALL@
16 INSTALL_PROGRAM = @INSTALL_PROGRAM@
17 INSTALL_DATA    = @INSTALL_DATA@
18
19 PERL            = perl
20 MAKEINFO        = makeinfo
21 TEXI2DVI        = texi2dvi
22 PS2PDF          = ps2pdf -dOptimize=true        # Part of GhostScript
23
24 SRCS            = nasmdoc.src
25 OUT             = nasm.info nasmdoc.ps nasmdoc.pdf
26
27 all: $(OUT)
28
29 os2: nasm.inf
30
31 # Consider html, txt and ps output a side effect
32 nasmdoc.dip: nasmdoc.src rdsrc.pl
33         mkdir -p html
34         $(PERL) $(srcdir)/rdsrc.pl < $<
35         mv -f *.html html
36
37 nasmdoc.ps: nasmdoc.dip
38         : Generated by side effect
39
40 nasmdoc.texi: nasmdoc.dip
41         : Generated by side effect
42
43 new: nasmdocx.ps nasmdocx.pdf
44
45 nasmdocx.ps: nasmdoc.dip nasmlogo.eps genps.pl psfonts.ph pswidth.ph head.ps
46         $(PERL) $(srcdir)/genps.pl > nasmdocx.ps
47
48 nasmdocx.pdf: nasmdocx.ps
49         $(PS2PDF) nasmdocx.ps nasmdocx.pdf
50
51 nasm.info: info/nasm.info
52
53 info/nasm.info: nasmdoc.texi
54         mkdir -p info
55         $(MAKEINFO) $<
56         mv -f *.info *.info-* info
57
58 # DVI output from texinfo (optional)
59 nasmdoc.dvi: nasmdoc.texi
60         $(TEXI2DVI) nasmdoc.texi
61
62 # PDF output
63 nasmdoc.pdf: nasmdoc.ps
64         $(PS2PDF) nasmdoc.ps nasmdoc.pdf
65
66 # Rules for building an OS/2 book
67 nasmdoc.ipf: nasmdoc.texi
68         texi2ipf $< >$@
69
70 nasm.inf: nasmdoc.ipf
71         ipfc -i -s $< $@
72
73 clean:
74         -rm -f *.rtf *.hpj *.texi *.gid *.ipf *.dip
75         -rm -f *.aux *.cp *.fn *.ky *.pg *.log *.toc *.tp *.vr
76
77 spotless: clean
78         -rm -rf html info
79         -rm -f *.hlp *.txt *.inf *.pdf *.dvi
80         -rm -f nasmdoc.ps nasmdocx.ps
81
82 install: all
83         $(INSTALL_DATA) info/* $(INSTALLROOT)$(infodir)
84         mkdir -p $(INSTALLROOT)$(docdir)/html
85         $(INSTALL_DATA) html/* $(INSTALLROOT)$(docdir)/html
86         $(INSTALL_DATA) nasmdoc.ps nasmdoc.pdf nasmdoc.txt $(INSTALLROOT)$(docdir)