summaryrefslogtreecommitdiff
path: root/doc/hackersguide/Makefile.am
blob: 02a4332993375e9c15eb5e0c683187c106911c86 (plain)
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
include $(top_srcdir)/misc/Makefile.common

hackersguide_sgml = hackersguide.sgml \
		    intro.sgml \
		    library.sgml \
		    overview.sgml \
		    internals.sgml \
		    stream.sgml \
		    output.sgml
hackersguide_fig = architecture.fig \
		   library.fig \
		   overlays.fig \
		   post_frame.fig

hackersguide_DATA = hackersguide.html \
            architecture.png library.png overlays.png post_frame.png

EXTRA_DIST = README $(hackersguide_sgml) $(hackersguide_fig) \
	 $(hackersguide_DATA)

hackersguidedir = $(htmldir)/hackersguide

docs: $(hackersguide_DATA)

distclean-local: clean-docs

docs-prepare: $(addprefix $(srcdir)/, $(hackersguide_sgml))
	if test "$(srcdir)" != "."  -a "$(srcdir)" != "`pwd`"; then \
	  for file in $(hackersguide_sgml) ; do \
	    test -f ./$$file -a ./$$file -nt $(srcdir)/$$file || cp $(srcdir)/$$file .; \
	  done ; \
	fi

clean-docs:
	rm -f $(hackersguide_DATA)
	test "x$(srcdir)" = x. || rm -f $(hackersguide_sgml) *.fig

dist-hook:
	@if test x"$(distcheck_lax)" = x ; then \
	  $(MAKE) fail_if_missing=yes docs ; \
	else \
	  $(MAKE) docs ; \
	fi

if HAVE_SGMLTOOLS
hackersguide.html: $(hackersguide_sgml)
	@$(MAKE) docs-prepare
	$(SGMLTOOLS) -b onehtml hackersguide.sgml;
else
hackersguide.html: $(hackersguide_sgml)
	@$(MAKE) docs-prepare
	if test x"$(fail_if_missing)" = x"yes"; then \
	  echo "Please install sgmltools-lite."; \
	  exit 1; \
	fi
	if test x"$(fail_if_missing)" != x"yes"; then \
	  touch $@; \
	  sleep 1; \
	  touch $(notdir $^); \
	fi
endif

if HAVE_FIG2DEV
%.png: %.fig
	$(FIG2DEV) -L png -S 4 $< $@;
else
%.png: %.fig
	if test x"$(fail_if_missing)" = x"yes"; then \
	  echo "Please install fig2dev."; \
	  exit 1; \
	fi
	if test x"$(fail_if_missing)" != x"yes"; then \
	  touch $@; \
	  sleep 1; \
	  touch $(notdir $^); \
	fi
endif