Fix regular expression at doc/rdsrc.pl
[platform/upstream/nasm.git] / doc / Makefile.in
1 #
2 # UNIX Makefile for NASM documentation
3 #
4
5 srcdir          = @srcdir@
6 VPATH           = @srcdir@
7 prefix          = @prefix@
8 exec_prefix     = @exec_prefix@
9 bindir          = @bindir@
10 mandir          = @mandir@
11 docdir          = $(prefix)/doc/nasm
12 infodir         = @infodir@
13 datarootdir     = @datarootdir@
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 TEXI2IPF        = texi2ipf
23 IPFC            = ipfc
24
25 ACRODIST        = @ACRODIST@            # Acrobat Distiller
26 PSTOPDF         = @PSTOPDF@             # BSD/MacOS X utility
27 PS2PDF          = @PS2PDF@              # Part of GhostScript
28
29 SRCS            = nasmdoc.src inslist.src changes.src
30 OUT             = info html nasmdoc.txt nasmdoc.ps nasmdoc.pdf
31
32 # exports
33 export srcdir
34 export PERL
35
36 all: $(OUT)
37
38 os2: nasm.inf
39
40 inslist.src: inslist.pl ../insns.dat
41         $(PERL) $(srcdir)/inslist.pl
42
43 .PHONY: html
44 html: html/nasmdoc0.html
45
46 html/nasmdoc0.html: $(SRCS) rdsrc.pl
47         mkdir -p html
48         $(PERL) $(srcdir)/rdsrc.pl html < $<
49         mv -f *.html html
50
51 nasmdoc.dip: $(SRCS) rdsrc.pl
52         $(PERL) $(srcdir)/rdsrc.pl dip < $<
53
54 nasmdoc.texi: $(SRCS) rdsrc.pl
55         $(PERL) $(srcdir)/rdsrc.pl texi < $<
56
57 nasmdoc.txt: $(SRCS) rdsrc.pl
58         $(PERL) $(srcdir)/rdsrc.pl txt < $<
59
60 nasmdoc.ps: nasmdoc.dip nasmlogo.eps $(srcdir)/../version genpsdriver.pl \
61             genps.pl psfonts.ph pswidth.ph head.ps
62         $(PERL) $(srcdir)/genpsdriver.pl > nasmdoc.ps
63
64 nasmdoc.pdf: nasmdoc.ps
65         $(ACRODIST) -n -q --nosecurity -o $@ $< || \
66         $(PS2PDF) $< $@ || \
67         $(PSTOPDF) $< -o $@ 
68
69 .PHONY: info
70 info: info/nasm.info
71
72 info/nasm.info: nasmdoc.texi
73         mkdir -p info
74         $(MAKEINFO) $<
75         mv -f *.info *.info-* info
76
77 # DVI output from texinfo (optional)
78 nasmdoc.dvi: nasmdoc.texi
79         $(TEXI2DVI) nasmdoc.texi
80
81 # Rules for building an OS/2 book
82 nasmdoc.ipf: nasmdoc.texi
83         $(TEXI2IPF) $< >$@
84
85 nasm.inf: nasmdoc.ipf
86         $(IPFC) -i -s $< $@
87
88 clean:
89         -rm -f *.rtf *.hpj *.texi *.gid *.ipf *.dip
90         -rm -f *.aux *.cp *.fn *.ky *.pg *.log *.toc *.tp *.vr
91         -rm -f inslist.src
92
93 spotless: clean
94         -rm -rf html info
95         -rm -f *.hlp nasmdoc.txt *.inf *.pdf *.dvi
96         -rm -f nasmdoc*.ps
97
98 install: all
99         mkdir -p $(INSTALLROOT)$(infodir)
100         $(INSTALL_DATA) info/* $(INSTALLROOT)$(infodir)
101         mkdir -p $(INSTALLROOT)$(docdir)/html
102         $(INSTALL_DATA) html/* $(INSTALLROOT)$(docdir)/html
103         $(INSTALL_DATA) nasmdoc.ps nasmdoc.pdf nasmdoc.txt $(INSTALLROOT)$(docdir)