1 # -*- mode: makefile -*-
3 ####################################
4 # Everything below here is generic #
5 ####################################
8 GTKDOC_CC
= $(LIBTOOL
) --tag
=CC
--mode
=compile
$(CC
) $(INCLUDES
) $(AM_CPPFLAGS
) $(CPPFLAGS
) $(AM_CFLAGS
) $(CFLAGS
)
9 GTKDOC_LD
= $(LIBTOOL
) --tag
=CC
--mode
=link
$(CC
) $(AM_CFLAGS
) $(CFLAGS
) $(AM_LDFLAGS
) $(LDFLAGS
)
10 GTKDOC_RUN
= $(LIBTOOL
) --mode
=execute
12 GTKDOC_CC
= $(CC
) $(INCLUDES
) $(AM_CPPFLAGS
) $(CPPFLAGS
) $(AM_CFLAGS
) $(CFLAGS
)
13 GTKDOC_LD
= $(CC
) $(AM_CFLAGS
) $(CFLAGS
) $(AM_LDFLAGS
) $(LDFLAGS
)
17 # We set GPATH here; this gives us semantics for GNU make
18 # which are more like other make's VPATH, when it comes to
19 # whether a source that is a target of one rule is then
20 # searched for in VPATH/GPATH.
24 TARGET_DIR
=$(HTML_DIR
)/$(DOC_MODULE
)
29 $(DOC_MAIN_SGML_FILE
) \
30 $(DOC_MODULE
)-sections.txt \
31 $(DOC_MODULE
)-overrides.txt
33 DOC_STAMPS
=scan-build.stamp sgml-build.stamp html-build.stamp \
34 $(srcdir)/sgml.stamp
$(srcdir)/html.stamp
38 $(DOC_MODULE
).hierarchy \
39 $(DOC_MODULE
).interfaces \
40 $(DOC_MODULE
).prerequisites \
44 $(DOC_MODULE
)-undocumented.txt \
45 $(DOC_MODULE
)-undeclared.txt \
46 $(DOC_MODULE
)-unused.txt
48 CLEANFILES
= $(SCANOBJ_FILES
) $(REPORT_FILES
) $(DOC_STAMPS
)
51 all-local
: html-build.stamp
56 docs
: html-build.stamp
58 $(REPORT_FILES
): sgml-build.stamp
62 scan-build.stamp
: $(HFILE_GLOB
) $(CFILE_GLOB
)
63 @echo
'gtk-doc: Scanning header files'
64 @
-chmod
-R u
+w
$(srcdir)
66 gtkdoc-scan
--module
=$(DOC_MODULE
) --source-dir
=$(DOC_SOURCE_DIR
) --ignore-headers
="$(IGNORE_HFILES)" $(SCAN_OPTIONS
) $(EXTRA_HFILES
)
67 if grep
-l
'^..*$$' $(srcdir)/$(DOC_MODULE
).types
> /dev
/null
2>&1 ; then \
68 CC
="$(GTKDOC_CC)" LD
="$(GTKDOC_LD)" RUN
="$(GTKDOC_RUN)" CFLAGS
="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS
="$(GTKDOC_LIBS) $(LDFLAGS)" gtkdoc-scangobj
$(SCANGOBJ_OPTIONS
) --module
=$(DOC_MODULE
) --output-dir
=$(srcdir) ; \
71 for i in
$(SCANOBJ_FILES
) ; do \
72 test -f
$$i || touch
$$i ; \
75 touch scan-build.stamp
77 $(DOC_MODULE
)-decl.txt
$(SCANOBJ_FILES
) $(DOC_MODULE
)-sections.txt
$(DOC_MODULE
)-overrides.txt
: scan-build.stamp
82 sgml-build.stamp
: $(DOC_MODULE
)-decl.txt
$(HFILE_GLOB
) $(CFILE_GLOB
) $(DOC_MODULE
)-sections.txt
$(DOC_MODULE
)-overrides.txt
$(expand_content_files
)
83 @echo
'gtk-doc: Building XML'
84 @
-chmod
-R u
+w
$(srcdir)
86 gtkdoc-mkdb
--module
=$(DOC_MODULE
) --source-dir
=$(DOC_SOURCE_DIR
) --output-format
=xml
--expand-content-files
="$(expand_content_files)" --main-sgml-file
=$(DOC_MAIN_SGML_FILE
) $(MKDB_OPTIONS
)
87 touch sgml-build.stamp
89 sgml.stamp
: sgml-build.stamp
94 html-build.stamp
: sgml.stamp
$(DOC_MAIN_SGML_FILE
) $(content_files
)
95 @echo
'gtk-doc: Building HTML'
96 @
-chmod
-R u
+w
$(srcdir)
100 gtkdoc-mkhtml
2>&1 --help | grep
>/dev
/null
"\-\-path"; \
101 if
test "$(?)" = "0"; then \
102 mkhtml_options
=--path
="$(srcdir)"; \
104 cd
$(srcdir)/html
&& gtkdoc-mkhtml
$(mkhtml_options
) $(MKHTML_OPTIONS
) $(DOC_MODULE
) ..
/$(DOC_MAIN_SGML_FILE
)
105 test "x$(HTML_IMAGES)" = "x" ||
( cd
$(srcdir) && cp
$(HTML_IMAGES
) html
)
106 @echo
'gtk-doc: Fixing cross-references'
107 cd
$(srcdir) && gtkdoc-fixxref
--module-dir
=html
--html-dir
=$(HTML_DIR
) $(FIXXREF_OPTIONS
)
108 touch html-build.stamp
118 rm -rf xml
$(REPORT_FILES
) \
119 $(DOC_MODULE
)-decl-list.txt
$(DOC_MODULE
)-decl.txt
121 maintainer-clean-local
: clean
122 cd
$(srcdir) && rm -rf html
125 installfiles
=`echo $(srcdir)/html/*`; \
126 if
test "$$installfiles" = '$(srcdir)/html/*'; \
127 then echo
'-- Nothing to install' ; \
129 if
test -n
"$(DOC_MODULE_VERSION)"; then \
130 installdir
="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \
132 installdir
="$(DESTDIR)$(TARGET_DIR)"; \
134 $(mkinstalldirs
) $${installdir} ; \
135 for i in
$$installfiles; do \
136 echo
'-- Installing '$$i ; \
137 $(INSTALL_DATA
) $$i $${installdir}; \
139 if
test -n
"$(DOC_MODULE_VERSION)"; then \
140 mv
-f
$${installdir}/$(DOC_MODULE
).devhelp2 \
141 $${installdir}/$(DOC_MODULE
)-$(DOC_MODULE_VERSION
).devhelp2
; \
142 mv
-f
$${installdir}/$(DOC_MODULE
).devhelp \
143 $${installdir}/$(DOC_MODULE
)-$(DOC_MODULE_VERSION
).devhelp
; \
145 ! which gtkdoc-rebase
>/dev
/null
2>&1 || \
146 gtkdoc-rebase
--relative
--dest-dir
=$(DESTDIR
) --html-dir
=$${installdir} ; \
150 if
test -n
"$(DOC_MODULE_VERSION)"; then \
151 installdir
="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \
153 installdir
="$(DESTDIR)$(TARGET_DIR)"; \
155 rm -rf
$${installdir}
158 # Require gtk-doc when making dist
164 @echo
"*** gtk-doc must be installed and enabled in order to make dist"
168 dist-hook
: dist-check-gtkdoc dist-hook-local
169 mkdir
$(distdir
)/html
170 cp
$(srcdir)/html
/* $(distdir
)/html
171 -cp
$(srcdir)/$(DOC_MODULE
).types
$(distdir
)/
172 -cp
$(srcdir)/$(DOC_MODULE
)-sections.txt
$(distdir
)/
173 cd
$(distdir
) && rm -f
$(DISTCLEANFILES
)
174 ! which gtkdoc-rebase
>/dev
/null
2>&1 || \
175 gtkdoc-rebase
--online
--relative
--html-dir
=$(distdir
)/html
177 .PHONY
: dist-hook-local docs