summaryrefslogtreecommitdiff
path: root/doc/doxygen/Makefile.am
blob: 276a395bfbf781bf5dc66d0f8f4bd019d876ca47 (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
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

.SUFFIXES = .gv .png .map

noinst_DATA = \
              xml/Client/index.xml \
              xml/Server/index.xml \
              html/Client/index.html \
              html/Server/index.html
dist_noinst_DATA = wayland.doxygen.in

scanned_src_files_shared = 				\
	$(top_srcdir)/src/wayland-util.h

scanned_src_files_Client = 				\
	$(scanned_src_files_shared)			\
	$(top_srcdir)/src/wayland-client.c	\
	$(top_srcdir)/src/wayland-client.h	\
	$(top_srcdir)/src/wayland-client-core.h

scanned_src_files_Server = 				\
	$(scanned_src_files_shared)			\
	$(top_srcdir)/src/wayland-server.c	\
	$(top_srcdir)/src/wayland-server.h	\
	$(top_srcdir)/src/wayland-server-core.h	\
	$(top_srcdir)/src/wayland-shm.c

scanned_src_files_man =					\
	$(scanned_src_files_Server)			\
	$(top_srcdir)/src/wayland-client.c	\
	$(top_srcdir)/src/wayland-client.h	\
	$(top_srcdir)/src/wayland-client-core.h

extra_doxygen = \
	mainpage.dox

extra_doxygen_Server = \
	$(top_builddir)/protocol/wayland-server-protocol.h \
	$(extra_doxygen)

extra_doxygen_Client = \
	$(top_builddir)/protocol/wayland-client-protocol.h \
	$(extra_doxygen)

diagramsdir := $(srcdir)/dot
diagramssrc := $(wildcard $(diagramsdir)/*.gv)
diagrams := $(patsubst $(diagramsdir)/%,xml/%,$(diagramssrc:.gv=.png))
diagram_maps := $(patsubst $(diagramsdir)/%,xml/%,$(diagramssrc:.gv=.map))

# find all man/man3/wl_foo.3 pages
# for this to work, we need to create them before the man target (hence
# all-local below)
dist_man3_MANS = $(shell test -d man && find man/man3 -name "wl_*.3" -printf "man/man3/%P\n")

# Listing various directories that might need to be created.
alldirs := xml xml/Client xml/Server man/man3 html/Client html/Server

$(diagrams): $(diagramssrc)

$(diagram_maps):  $(diagramssrc)

xml/%/index.xml: $(top_srcdir)/src/scanner.c $(scanned_src_files_%) wayland.doxygen $(diagrams) $(diagram_maps) | xml/%
	$(AM_V_GEN)(cat wayland.doxygen; \
          echo "GENERATE_XML=YES"; \
          echo "XML_OUTPUT=xml/$*"; \
          echo "INPUT= $(scanned_src_files_$*)"; \
          ) | $(DOXYGEN) -

html/%/index.html: $(scanned_src_files_%) wayland.doxygen $(diagrams) $(diagram_maps) | html/%
	$(AM_V_GEN)(cat wayland.doxygen; \
          echo "PROJECT_NAME=\"Wayland $* API\""; \
          echo "GENERATE_HTML=YES"; \
          echo "HTML_OUTPUT=html/$*"; \
          echo "INPUT= $(scanned_src_files_$*) $(extra_doxygen_$*)"; \
          ) | $(DOXYGEN) -

man/man3/wl_display.3: $(top_srcdir)/src/scanner.c $(scanned_src_files_man) wayland.doxygen | man/man3
	$(AM_V_GEN)(cat wayland.doxygen; \
          echo "GENERATE_MAN=YES"; \
          echo "MAN_OUTPUT=man"; \
          echo "JAVADOC_AUTOBRIEF=NO"; \
          echo "INPUT= $(scanned_src_files_man)"; \
          ) | $(DOXYGEN) -

xml/%.png: $(diagramsdir)/%.gv | xml
	$(AM_V_GEN)$(DOT) -Tpng -o$@ $<

xml/%.map: $(diagramsdir)/%.gv | xml
	$(AM_V_GEN)$(DOT) -Tcmapx_np -o$@ $<

# general rule to create one of the listed directories.
$(alldirs):
	$(AM_V_GEN)$(MKDIR_P) $@

# there is no man-local
all-local: man/man3/wl_display.3

clean-local:
	rm -rf xml/
	rm -rf html/
	rm -rf man/

EXTRA_DIST = $(diagramssrc)