source: trunk/third/libgsf/gtk-doc.make @ 22006

Revision 22006, 4.2 KB checked in by ghudson, 19 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r22005, which included commits to RCS files with non-trunk default branches.
Line 
1# -*- mode: makefile -*-
2
3####################################
4# Everything below here is generic #
5####################################
6
7if GTK_DOC_USE_LIBTOOL
8GTKDOC_CC = $(LIBTOOL) --mode=compile $(CC) $(INCLUDES) $(AM_CFLAGS) $(CFLAGS)
9GTKDOC_LD = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS)
10else
11GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CFLAGS) $(CFLAGS)
12GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS)
13endif
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#
20GPATH = $(srcdir)
21
22TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
23
24EXTRA_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
32DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
33           $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp
34
35SCANOBJ_FILES =                  \
36        $(DOC_MODULE).args       \
37        $(DOC_MODULE).hierarchy  \
38        $(DOC_MODULE).interfaces \
39        $(DOC_MODULE).prerequisites \
40        $(DOC_MODULE).signals
41
42CLEANFILES = $(SCANOBJ_FILES) $(DOC_MODULE)-unused.txt $(DOC_STAMPS)
43
44if ENABLE_GTK_DOC
45all-local: html-build.stamp
46
47#### scan ####
48
49scan-build.stamp: $(HFILE_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
69tmpl-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
75tmpl.stamp: tmpl-build.stamp
76        @true
77
78#### xml ####
79
80sgml-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
87sgml.stamp: sgml-build.stamp
88        @true
89
90#### html ####
91
92html-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
102else
103all-local:
104endif
105
106##############
107
108clean-local:
109        rm -f *~ *.bak
110        rm -rf .libs
111
112maintainer-clean-local: clean
113        cd $(srcdir) && rm -rf xml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
114
115install-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
129uninstall-local:
130        rm -f $(DESTDIR)$(TARGET_DIR)/*
131
132#
133# Require gtk-doc when making dist
134#
135if ENABLE_GTK_DOC
136dist-check-gtkdoc:
137else
138dist-check-gtkdoc:
139        @echo "*** gtk-doc must be installed and enabled in order to make dist"
140        @false
141endif
142
143dist-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
Note: See TracBrowser for help on using the repository browser.