summaryrefslogtreecommitdiffstats
path: root/doc/project.am
blob: 3bb32a5b8fb183e2e612950754cba4eba0804eda (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
## $Id$

SUFFIXES += .t

## Texinfo support
TEXINFO_TEX = ../texinfo/texinfo.tex
## TEXINPUTS = $(srcdir):$(top_srcdir)
TEXI_COMMON = -I ..

.texi:
	@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
	cd $(srcdir) && \
	  $(MAKEINFO) $(TEXI_COMMON) `echo $< | sed 's,.*/,,'`

$(srcdir)/stamp-vti: $(PROJECT).texi $(top_srcdir)/configure.in
	@echo "@set UPDATED `$(SHELL) $(srcdir)/mdate-sh \
	  $(srcdir)/$(PROJECT).texi`" > vti.tmp
	@echo "@set EDITION $(EDITION)" >> vti.tmp
	@echo "@set VERSION $(VERSION)" >> vti.tmp
	@cmp -s vti.tmp $(srcdir)/version.texi \
	  || (echo "Updating $(srcdir)/version.texi"; \
	      cp vti.tmp $(srcdir)/version.texi)
	-@rm -f vti.tmp
	@cp $(srcdir)/version.texi $@

MAINTAINERCLEANFILES += $(PROJECT) $(PROJECT)-[0-9] $(PROJECT)-[0-9][0-9]
MAINTAINERCLEANFILES += $(GENERATED_FILES)

## DVI support
dvidir = $(pkgdatadir)/dvi
## dvi_projectdir = $(dvidir)/$(PROJECT)

## PS support
psdir = $(pkgdatadir)/ps
## ps_projectdir = $(psdir)/$(PROJECT)

## PDF support
SUFFIXES += .pdf

pdfdir = $(pkgdatadir)/pdf
## pdf_projectdir = $(pdfdir)/$(PROJECT)

SUFFIXES += .eps

if EPSTOPDF
.eps.pdf:
	$(EPSTOPDF) $< --outfile=$@
endif

$(PROJECT).pdf: $(PROJECT).texi $($(PROJECT)_TEXINFOS) $(PDF_IMAGES)
CLEANFILES += $(PROJECT).pdf

MOSTLYCLEANFILES += $(PDF_IMAGES)

## HTML 
SUFFIXES += .html

html_projectdir = $(htmldir)/$(PROJECT)

TEXI2WWW_ARGS=\
-I $(srcdir) \
-I $(top_srcdir) \
-dirfile ../index.html \
-header rtems_header.html \
-footer rtems_footer.html \
-icons $(top_builddir)/images

rtems_header.html: $(top_srcdir)/rtems_header.html.in version.texi
	@sed -e s%\.\./images/%$(top_builddir)/images/%g \
	-e s%\@VERSION\@%@VERSION@%g \
	< $< > $@
rtems_footer.html: $(top_srcdir)/rtems_footer.html.in version.texi
	@sed -e s%\.\./images/%$(top_builddir)/%g \
	-e s%\@VERSION\@%@VERSION@%g \
	< $< > $@

index.html $(PROJECT)*.html: $(PROJECT).texi \
    rtems_header.html rtems_footer.html
	$(TEXI2WWW) $(TEXI2WWW_ARGS) -base $(PROJECT) $<

MOSTLYCLEANFILES += index.html $(PROJECT)*.html rtems_header.html \
   rtems_footer.html

## Common installation points
if USE_HTML
html_project_DATA += index.html $(PROJECT)*.html
endif

if USE_DVI
dvi_DATA += $(PROJECT).dvi

.texi.dvi:
	$(TEXI2DVI) -I $(srcdir) -I $(top_srcdir) $<

if USE_PS
ps_DATA += $(PROJECT).ps
.dvi.ps:
	TEXINPUTS=$(srcdir):$$TEXINPUTS \
	$(DVIPS) $< -o $@
endif # USE_PS

endif # USE_DVI

if USE_PDF
pdf_DATA += $(PROJECT).pdf

if TEXI2PDF
.texi.pdf:
	$(TEXI2PDF) -I $(srcdir) -I $(top_srcdir) $<
endif

endif