1 | # -*- mode: makefile -*- |
---|
2 | |
---|
3 | #################################### |
---|
4 | # Everything below here is generic # |
---|
5 | #################################### |
---|
6 | |
---|
7 | if GTK_DOC_USE_LIBTOOL |
---|
8 | GTKDOC_CC = $(LIBTOOL) --mode=compile $(CC) $(INCLUDES) $(AM_CFLAGS) $(CFLAGS) |
---|
9 | GTKDOC_LD = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) |
---|
10 | else |
---|
11 | GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CFLAGS) $(CFLAGS) |
---|
12 | GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) |
---|
13 | endif |
---|
14 | |
---|
15 | # We set GPATH here; this gives us semantics for GNU make |
---|
16 | # which are more like other make's VPATH, when it comes to |
---|
17 | # whether a source that is a target of one rule is then |
---|
18 | # searched for in VPATH/GPATH. |
---|
19 | # |
---|
20 | GPATH = $(srcdir) |
---|
21 | |
---|
22 | TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE) |
---|
23 | |
---|
24 | EXTRA_DIST = \ |
---|
25 | $(content_files) \ |
---|
26 | $(HTML_IMAGES) \ |
---|
27 | $(DOC_MAIN_SGML_FILE) \ |
---|
28 | $(DOC_MODULE).types \ |
---|
29 | $(DOC_MODULE)-sections.txt \ |
---|
30 | $(DOC_MODULE)-overrides.txt |
---|
31 | |
---|
32 | DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \ |
---|
33 | $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp |
---|
34 | |
---|
35 | SCANOBJ_FILES = \ |
---|
36 | $(DOC_MODULE).args \ |
---|
37 | $(DOC_MODULE).hierarchy \ |
---|
38 | $(DOC_MODULE).interfaces \ |
---|
39 | $(DOC_MODULE).prerequisites \ |
---|
40 | $(DOC_MODULE).signals |
---|
41 | |
---|
42 | CLEANFILES = $(SCANOBJ_FILES) $(DOC_MODULE)-unused.txt $(DOC_STAMPS) |
---|
43 | |
---|
44 | if ENABLE_GTK_DOC |
---|
45 | all-local: html-build.stamp |
---|
46 | |
---|
47 | #### scan #### |
---|
48 | |
---|
49 | scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) |
---|
50 | @echo '*** Scanning header files ***' |
---|
51 | @-chmod -R u+w $(srcdir) |
---|
52 | if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null ; then \ |
---|
53 | CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \ |
---|
54 | else \ |
---|
55 | cd $(srcdir) ; \ |
---|
56 | for i in $(SCANOBJ_FILES) ; do \ |
---|
57 | test -f $$i || touch $$i ; \ |
---|
58 | done \ |
---|
59 | fi |
---|
60 | cd $(srcdir) && \ |
---|
61 | gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES) |
---|
62 | touch scan-build.stamp |
---|
63 | |
---|
64 | $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES): scan-build.stamp |
---|
65 | @true |
---|
66 | |
---|
67 | #### templates #### |
---|
68 | |
---|
69 | tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt |
---|
70 | @echo '*** Rebuilding template files ***' |
---|
71 | @-chmod -R u+w $(srcdir) |
---|
72 | cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) |
---|
73 | touch tmpl-build.stamp |
---|
74 | |
---|
75 | tmpl.stamp: tmpl-build.stamp |
---|
76 | @true |
---|
77 | |
---|
78 | #### xml #### |
---|
79 | |
---|
80 | sgml-build.stamp: tmpl.stamp $(CFILE_GLOB) $(srcdir)/tmpl/*.sgml |
---|
81 | @echo '*** Building XML ***' |
---|
82 | @-chmod -R u+w $(srcdir) |
---|
83 | cd $(srcdir) && \ |
---|
84 | gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --output-format=xml $(MKDB_OPTIONS) |
---|
85 | touch sgml-build.stamp |
---|
86 | |
---|
87 | sgml.stamp: sgml-build.stamp |
---|
88 | @true |
---|
89 | |
---|
90 | #### html #### |
---|
91 | |
---|
92 | html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) |
---|
93 | @echo '*** Building HTML ***' |
---|
94 | @-chmod -R u+w $(srcdir) |
---|
95 | rm -rf $(srcdir)/html |
---|
96 | mkdir $(srcdir)/html |
---|
97 | cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) |
---|
98 | test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html ) |
---|
99 | @echo '-- Fixing Crossreferences' |
---|
100 | cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) |
---|
101 | touch html-build.stamp |
---|
102 | else |
---|
103 | all-local: |
---|
104 | endif |
---|
105 | |
---|
106 | ############## |
---|
107 | |
---|
108 | clean-local: |
---|
109 | rm -f *~ *.bak |
---|
110 | rm -rf .libs |
---|
111 | |
---|
112 | maintainer-clean-local: clean |
---|
113 | cd $(srcdir) && rm -rf xml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt |
---|
114 | |
---|
115 | install-data-local: |
---|
116 | installfiles=`echo $(srcdir)/html/*`; \ |
---|
117 | if test "$$installfiles" = '$(srcdir)/html/*'; \ |
---|
118 | then echo '-- Nothing to install' ; \ |
---|
119 | else \ |
---|
120 | $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR); \ |
---|
121 | for i in $$installfiles; do \ |
---|
122 | echo '-- Installing '$$i ; \ |
---|
123 | $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \ |
---|
124 | done; \ |
---|
125 | echo '-- Installing $(srcdir)/html/index.sgml' ; \ |
---|
126 | $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR) || :; \ |
---|
127 | fi |
---|
128 | |
---|
129 | uninstall-local: |
---|
130 | rm -f $(DESTDIR)$(TARGET_DIR)/* |
---|
131 | |
---|
132 | # |
---|
133 | # Require gtk-doc when making dist |
---|
134 | # |
---|
135 | if ENABLE_GTK_DOC |
---|
136 | dist-check-gtkdoc: |
---|
137 | else |
---|
138 | dist-check-gtkdoc: |
---|
139 | @echo "*** gtk-doc must be installed and enabled in order to make dist" |
---|
140 | @false |
---|
141 | endif |
---|
142 | |
---|
143 | dist-hook: dist-check-gtkdoc dist-hook-local |
---|
144 | mkdir $(distdir)/tmpl |
---|
145 | mkdir $(distdir)/xml |
---|
146 | mkdir $(distdir)/html |
---|
147 | -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl |
---|
148 | -cp $(srcdir)/xml/*.xml $(distdir)/xml |
---|
149 | -cp $(srcdir)/html/* $(distdir)/html |
---|
150 | |
---|
151 | .PHONY : dist-hook-local |
---|