1 # -*- mode: makefile -*-
3 ####################################
4 # Everything below here is generic #
5 ####################################
8 GTKDOC_CC
= $(LIBTOOL
) --mode
=compile
$(CC
) $(INCLUDES
) $(AM_CFLAGS
) $(CFLAGS
)
9 GTKDOC_LD
= $(LIBTOOL
) --mode
=link
$(CC
) $(AM_CFLAGS
) $(CFLAGS
) $(LDFLAGS
)
11 GTKDOC_CC
= $(CC
) $(INCLUDES
) $(AM_CFLAGS
) $(CFLAGS
)
12 GTKDOC_LD
= $(CC
) $(AM_CFLAGS
) $(CFLAGS
) $(LDFLAGS
)
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.
22 TARGET_DIR
=$(HTML_DIR
)/$(DOC_MODULE
)
27 $(DOC_MAIN_SGML_FILE
) \
28 $(DOC_MODULE
)-sections.txt \
29 $(DOC_MODULE
)-overrides.txt
31 DOC_STAMPS
=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
32 $(srcdir)/tmpl.stamp
$(srcdir)/sgml.stamp
$(srcdir)/html.stamp
36 $(DOC_MODULE
).hierarchy \
37 $(DOC_MODULE
).interfaces \
38 $(DOC_MODULE
).prerequisites \
41 CLEANFILES
= $(SCANOBJ_FILES
) $(DOC_MODULE
)-unused.txt
$(DOC_STAMPS
)
44 all-local
: html-build.stamp
49 docs
: html-build.stamp
53 scan-build.stamp
: $(HFILE_GLOB
) $(CFILE_GLOB
)
54 @echo
'gtk-doc: Scanning header files'
55 @
-chmod
-R u
+w
$(srcdir)
57 gtkdoc-scan
--module
=$(DOC_MODULE
) --source-dir
=$(DOC_SOURCE_DIR
) --ignore-headers
="$(IGNORE_HFILES)" $(SCAN_OPTIONS
) $(EXTRA_HFILES
)
58 if grep
-l
'^..*$$' $(srcdir)/$(DOC_MODULE
).types
> /dev
/null
2>&1 ; then \
59 CC
="$(GTKDOC_CC)" LD
="$(GTKDOC_LD)" CFLAGS
="$(GTKDOC_CFLAGS)" LDFLAGS
="$(GTKDOC_LIBS)" gtkdoc-scangobj
$(SCANGOBJ_OPTIONS
) --module
=$(DOC_MODULE
) --output-dir
=$(srcdir) ; \
62 for i in
$(SCANOBJ_FILES
) ; do \
63 test -f
$$i || touch
$$i ; \
66 touch scan-build.stamp
68 $(DOC_MODULE
)-decl.txt
$(SCANOBJ_FILES
) $(DOC_MODULE
)-sections.txt
$(DOC_MODULE
)-overrides.txt
: scan-build.stamp
73 tmpl-build.stamp
: $(DOC_MODULE
)-decl.txt
$(SCANOBJ_FILES
) $(DOC_MODULE
)-sections.txt
$(DOC_MODULE
)-overrides.txt
74 @echo
'gtk-doc: Rebuilding template files'
75 @
-chmod
-R u
+w
$(srcdir)
76 cd
$(srcdir) && gtkdoc-mktmpl
--module
=$(DOC_MODULE
) $(MKTMPL_OPTIONS
)
77 touch tmpl-build.stamp
79 tmpl.stamp
: tmpl-build.stamp
84 sgml-build.stamp
: tmpl.stamp
$(HFILE_GLOB
) $(CFILE_GLOB
) $(DOC_MODULE
)-sections.txt
$(srcdir)/tmpl
/*.sgml
$(expand_content_files
)
85 @echo
'gtk-doc: Building XML'
86 @
-chmod
-R u
+w
$(srcdir)
88 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
)
89 touch sgml-build.stamp
91 sgml.stamp
: sgml-build.stamp
96 html-build.stamp
: sgml.stamp
$(DOC_MAIN_SGML_FILE
) $(content_files
)
97 @echo
'gtk-doc: Building HTML'
98 @
-chmod
-R u
+w
$(srcdir)
101 cd
$(srcdir)/html
&& gtkdoc-mkhtml
$(DOC_MODULE
) ..
/$(DOC_MAIN_SGML_FILE
)
102 test "x$(HTML_IMAGES)" = "x" ||
( cd
$(srcdir) && cp
$(HTML_IMAGES
) html
)
103 @echo
'gtk-doc: Fixing cross-references'
104 cd
$(srcdir) && gtkdoc-fixxref
--module-dir
=html
--html-dir
=$(HTML_DIR
) $(FIXXREF_OPTIONS
)
105 touch html-build.stamp
113 maintainer-clean-local
: clean
114 cd
$(srcdir) && rm -rf xml html
$(DOC_MODULE
)-decl-list.txt
$(DOC_MODULE
)-decl.txt
$(DOC_MODULE
)-undocumented.txt
117 installfiles
=`echo $(srcdir)/html/*`; \
118 if
test "$$installfiles" = '$(srcdir)/html/*'; \
119 then echo
'-- Nothing to install' ; \
121 $(mkinstalldirs
) $(DESTDIR
)$(TARGET_DIR
); \
122 for i in
$$installfiles; do \
123 echo
'-- Installing '$$i ; \
124 $(INSTALL_DATA
) $$i $(DESTDIR
)$(TARGET_DIR
); \
126 echo
'-- Installing $(srcdir)/html/index.sgml' ; \
127 $(INSTALL_DATA
) $(srcdir)/html
/index.sgml
$(DESTDIR
)$(TARGET_DIR
) ||
:; \
131 rm -f
$(DESTDIR
)$(TARGET_DIR
)/*
134 # Require gtk-doc when making dist
140 @echo
"*** gtk-doc must be installed and enabled in order to make dist"
144 dist-hook
: dist-check-gtkdoc dist-hook-local
145 mkdir
$(distdir
)/tmpl
147 mkdir
$(distdir
)/html
148 -cp
$(srcdir)/tmpl
/*.sgml
$(distdir
)/tmpl
149 -cp
$(srcdir)/xml
/*.xml
$(distdir
)/xml
150 cp
$(srcdir)/html
/* $(distdir
)/html
151 if
test -f
$(srcdir)/$(DOC_MODULE
).types
; then \
152 cp
$(srcdir)/$(DOC_MODULE
).types
$(distdir
)/$(DOC_MODULE
).types
; \
155 .PHONY
: dist-hook-local docs