beta-0.89.2
[luatex.git] / source / libs / cairo / cairo-src / build / Makefile.am.gtk-doc
blobc3d642b097b630e037b9dc14281b17ad917eb30c
1 # BEFORE MODIFYING THIS FILE:
3 # This file is a descendant of an old copy of gtk-doc.make, modified for cairo minimally:
5 #   - Moved to build/
6 #   - Made it append to EXTRA_DIST and CLEANFILES
7 #   - Instead of all-local, make "doc" build docs, and err if gtk-doc not enabled
8 #   - Some other changed introduced in 7f114b781f5c530d57530e5f76402e41cdabac6b
10 # Before changing it, check to see if a newer gtk-doc.make has fixed the issue you are facing.
11 # From time to time, it would be nice to udpate this to the latest copy of gtk-doc.make, but
12 # please do review all the differences and port our modifications forward.
15 # -*- mode: makefile -*-
17 ####################################
18 # Everything below here is generic #
19 ####################################
21 if GTK_DOC_USE_LIBTOOL
22 GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
23 GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
24 else
25 GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
26 GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
27 endif
29 # We set GPATH here; this gives us semantics for GNU make
30 # which are more like other make's VPATH, when it comes to
31 # whether a source that is a target of one rule is then
32 # searched for in VPATH/GPATH.
34 GPATH = $(srcdir)
36 TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
38 EXTRA_DIST +=                           \
39         $(content_files)                \
40         $(HTML_IMAGES)                  \
41         $(DOC_MAIN_SGML_FILE)           \
42         $(DOC_MODULE)-sections.txt      \
43         $(DOC_MODULE)-overrides.txt
45 DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
46            $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp
48 SCANOBJ_FILES =                  \
49         $(DOC_MODULE).args       \
50         $(DOC_MODULE).hierarchy  \
51         $(DOC_MODULE).interfaces \
52         $(DOC_MODULE).prerequisites \
53         $(DOC_MODULE).signals
55 REPORT_FILES = \
56         $(DOC_MODULE)-undocumented.txt \
57         $(DOC_MODULE)-undeclared.txt \
58         $(DOC_MODULE)-unused.txt
60 CLEANFILES += $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS)
62 if ENABLE_GTK_DOC
63 doc: html-build.stamp
64 else
65 doc:
66         @echo "*** gtk-doc must be installed (and --enable-gtk-doc) in order to make doc"
67         @false
68 endif
70 docs: html-build.stamp
72 #### scan ####
74 scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) $(EXTRA_HFILES)
75         @echo 'gtk-doc: Scanning header files'
76         @-chmod -R u+w $(srcdir)
77         gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES) --output-dir=$(srcdir)
78         if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \
79             CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \
80         else \
81             cd $(srcdir) ; \
82             for i in $(SCANOBJ_FILES) ; do \
83                test -f $$i || touch $$i ; \
84             done \
85         fi
86         touch scan-build.stamp
88 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp
89         @true
91 #### templates ####
93 tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt
94         @echo 'gtk-doc: Rebuilding template files'
95         @-chmod -R u+w $(srcdir)
96         cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS)
97         touch tmpl-build.stamp
99 tmpl.stamp: tmpl-build.stamp
100         @true
102 tmpl/*.sgml:
103         @true
106 #### xml ####
108 # gtkdoc-mkdb is broken and requires a --root-dir=$(srcdir) option
109 # The _srcdir diversion is fragile but works for make check; make distcheck
110 sgml-build.stamp: tmpl.stamp $(HFILE_GLOB) $(CFILE_GLOB) $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files)
111         @echo 'gtk-doc: Building XML'
112         @-chmod -R u+w $(srcdir)
113         _srcdir="`pwd`/$(DOC_SOURCE_DIR)"; \
114         cd $(srcdir) && gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$$_srcdir --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS)
115         touch sgml-build.stamp
117 sgml.stamp: sgml-build.stamp
118         @true
120 #### html ####
122 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
123         @echo 'gtk-doc: Building HTML'
124         @-chmod -R u+w $(srcdir)
125         rm -rf $(srcdir)/html
126         mkdir $(srcdir)/html
127         cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
128         test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html )
129         @echo 'gtk-doc: Fixing cross-references'
130         cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
131         touch html-build.stamp
133 ##############
135 clean-local:
136         rm -f *~ *.bak
137         rm -rf .libs
139 distclean-local:
140         cd $(srcdir) && \
141           rm -rf xml $(REPORT_FILES) \
142                  $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
144 maintainer-clean-local: clean
145         cd $(srcdir) && rm -rf xml html
147 install-data-local:
148         -installfiles=`echo $(srcdir)/html/*`; \
149         if test "$$installfiles" = '$(srcdir)/html/*'; \
150         then echo '-- Nothing to install' ; \
151         else \
152           $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR); \
153           for i in $$installfiles; do \
154             echo '-- Installing '$$i ; \
155             $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
156           done; \
157           echo '-- Installing $(srcdir)/html/index.sgml' ; \
158           $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR) || :; \
159           which gtkdoc-rebase >/dev/null && \
160             gtkdoc-rebase --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR) ; \
161         fi
162         
164 uninstall-local:
165         rm -f $(DESTDIR)$(TARGET_DIR)/*
168 # Require gtk-doc when making dist
170 if ENABLE_GTK_DOC
171 dist-check-gtkdoc:
172 else
173 dist-check-gtkdoc:
174         @echo "*** gtk-doc must be installed (and --enable-gtk-doc) in order to make dist"
175         @false
176 endif
178 dist-hook: dist-check-gtkdoc dist-hook-local
179         mkdir $(distdir)/tmpl
180         mkdir $(distdir)/xml
181         mkdir $(distdir)/html
182         -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
183         -cp $(srcdir)/xml/*.xml $(distdir)/xml
184         cp $(srcdir)/html/* $(distdir)/html
185         -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/
186         -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/
187         cd $(distdir) && rm -f $(DISTCLEANFILES)
188         -gtkdoc-rebase --online --relative --html-dir=$(distdir)/html
190 .PHONY : dist-hook-local docs