Makefile.am 5.72 KB
Newer Older
Owen Taylor's avatar
Owen Taylor committed
1 2 3 4 5 6 7 8
## Process this file with automake to produce Makefile.in

# The name of the module.
DOC_MODULE=gtk

# The top-level SGML file.
DOC_MAIN_SGML_FILE=gtk-docs.sgml

9 10 11 12 13 14 15 16
# The directory containing the source code. Relative to $(srcdir)
DOC_SOURCE_DIR=../../../gtk

# Extra options to supply to gtkdoc-scan
SCAN_OPTIONS=--deprecated-guards="GTK_ENABLE_BROKEN|GTK_DISABLE_DEPRECATED" 

# Extra options to supply to gtkdoc-mkdb
MKDB_OPTIONS=
17 18 19 20

# Extra options to supply to gtkdoc-fixref
FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html

21 22 23 24
# Used for dependencies
HFILE_GLOB=$(top_srcdir)/gtk/*.h
CFILE_GLOB=$(top_srcdir)/gtk/*.c

25 26 27 28 29 30
# Header files to ignore when scanning
IGNORE_HFILES=			\
	fnmatch.h		\
	gdk-pixbuf-loader.h	\
	gtkdebug.h		\
	gtkhsv.h		\
31
	gtkimmodule.h		\
32 33
	gtkimcontextsimple.h	\
	gtkintl.h		\
34
	gtkmarshal.h		\
35
	gtkprivate.h		\
Jonathan Blandford's avatar
Jonathan Blandford committed
36 37 38
	gtktreeprivate.h	\
	gtkrbtree.h		\
	gtktreedatalist.h	\
39 40 41 42 43 44 45 46 47 48 49
	gtktextbtree.h		\
	gtktextchild.h		\
	gtktextdisplay.h	\
	gtktextiterprivate.h	\
	gtktextlayout.h		\
	gtktextmarkprivate.h	\
	gtktextsegment.h	\
	gtktexttagprivate.h	\
	gtktexttypes.h		\
	gtktypebuiltins.h

50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
# Images to copy into HTML directory
HTML_IMAGES =

# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE)
content_files = 		\
	compiling.sgml		\
	framebuffer.sgml	\
	objects_grouped.sgml	\
	text_widget.sgml	\
	tree_widget.sgml

# Other files to distribute
extra_files =

# CFLAGS and LDFLAGS for compiling scan program. Only needed
# if $(DOC_MODULE).types is non-empty.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
GTKDOC_CFLAGS = @STRIP_BEGIN@ 				\
	@CFLAGS@					\
	-I$(top_srcdir) 				\
	-I$(top_builddir)/gdk				\
	-DGTK_DISABLE_COMPAT_H				\
	@GTK_DEBUG_FLAGS@				\
	@GTK_XIM_FLAGS@					\
	@GTK_LOCALE_FLAGS@				\
	@PANGO_CFLAGS@					\
	@GLIB_CFLAGS@					\
	@more_cflags@					\
@STRIP_END@

GTKDOC_LIBS = @STRIP_BEGIN@ 				\
	$(top_builddir)/gdk-pixbuf/libgdk_pixbuf-1.3.la	\
	$(top_builddir)/gdk/@gdktargetlib@        	\
	$(top_builddir)/gtk/@gtktargetlib@ 		\
	@more_ldflags@					\
	@more_libs@					\
	@GDK_WLIBS@					\
	@PANGO_LIBS@					\
	@GLIB_LIBS@					\
	@GTK_LIBS_EXTRA@				\
	-lm						\
@STRIP_END@

GTKDOC_CC=$(LIBTOOL) --mode=compile $(CC)
GTKDOC_LD=$(LIBTOOL) --mode=link $(CC)

Owen Taylor's avatar
Owen Taylor committed
95

96 97 98
####################################
# Everything below here is generic #
####################################
Owen Taylor's avatar
Owen Taylor committed
99 100 101

TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)

102 103
EXTRA_DIST = 				\
	$(content_files)		\
104 105 106 107
	$(extra_files)			\
	$(HTML_IMAGES)			\
	$(DOC_MAIN_SGML_FILE)		\
	$(DOC_MODULE).types		\
108 109 110
	$(DOC_MODULE)-sections.txt	\
	$(DOC_MODULE)-overrides.txt

111 112
DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
	   $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp
113 114 115 116

SCANOBJ_FILES = 		\
	$(DOC_MODULE).args 	\
	$(DOC_MODULE).hierarchy \
117 118 119 120 121 122
	$(DOC_MODULE).signals

if ENABLE_GTK_DOC
all-local: html-build.stamp

#### scan ####
123 124 125 126

scan-build.stamp: $(HFILE_GLOB)
	@echo '*** Scanning header files ***'
	cd $(srcdir) && ( \
127
	if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null ; then \
128 129 130 131 132 133 134 135 136
	    CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" gtkdoc-scangobj --module=$(DOC_MODULE) ; \
	else \
	    for i in $(SCANOBJ_FILES) ; do \
               test -f $$i || touch $$i ; \
	    done \
	fi )
	cd $(srcdir) && \
	  gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES)
	touch scan-build.stamp
137

138 139
$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES): scan-build.stamp
	@true
140

141
#### templates ####
142

143 144 145 146
tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt
	@echo '*** Rebuilding template files ***'
	cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE)
	touch tmpl-build.stamp
147

148 149
tmpl.stamp: tmpl-build.stamp
	@true
Owen Taylor's avatar
Owen Taylor committed
150

151
#### sgml ####
Owen Taylor's avatar
Owen Taylor committed
152

153
sgml-build.stamp: tmpl.stamp $(CFILE_GLOB) tmpl/*.sgml
154 155 156 157 158
	@echo '*** Building SGML ***'
	cd $(srcdir) && \
	gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) $(MKDB_OPTIONS)
	touch sgml-build.stamp

159 160
sgml.stamp: sgml-build.stamp
	@true
Owen Taylor's avatar
Owen Taylor committed
161

162
#### html ####
Owen Taylor's avatar
Owen Taylor committed
163

164
html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
165
	@echo '*** Building HTML ***'
166
	test -d $(srcdir)/html || mkdir $(srcdir)/html
167 168
	cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
	test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html )
169
	@echo '-- Fixing Crossreferences' 
170
	cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
171 172
	touch html-build.stamp
endif
Owen Taylor's avatar
Owen Taylor committed
173

174 175
##############

Owen Taylor's avatar
Owen Taylor committed
176
clean-local:
177
	rm -f *~ *.bak $(SCANOBJ_FILES) *-unused.txt $(DOC_STAMPS)
Owen Taylor's avatar
Owen Taylor committed
178 179

maintainer-clean-local: clean
180
	cd $(srcdir) && rm -rf sgml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
Owen Taylor's avatar
Owen Taylor committed
181 182

install-data-local:
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202
	$(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)
	(installfiles=`echo $(srcdir)/html/*.html`; \
	if test "$$installfiles" = '$(srcdir)/html/*.html'; \
	then echo '-- Nothing to install' ; \
	else \
	  for i in $$installfiles; do \
	    echo '-- Installing '$$i ; \
	    $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
	  done; \
	  echo '-- Installing $(srcdir)/html/index.sgml' ; \
	  $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR); \
	fi)

#
# Require gtk-doc when making dist
#
if ENABLE_GTK_DOC
dist-check-gtkdoc:
else
dist-check-gtkdoc:
203
	@echo "*** gtk-doc must be installed and enabled in order to make dist"
204 205 206
	@false
endif

207
dist-hook: dist-check-gtkdoc dist-hook-local
Owen Taylor's avatar
Owen Taylor committed
208
	mkdir $(distdir)/tmpl
209 210
	mkdir $(distdir)/sgml
	mkdir $(distdir)/html
211 212 213
	-cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
	-cp $(srcdir)/sgml/*.sgml $(distdir)/sgml
	-cp $(srcdir)/sgml/*.bottom $(srcdir)/sgml/*.top $(distdir)/sgml
214 215
	-cp $(srcdir)/html/index.sgml $(distdir)/html
	-cp $(srcdir)/html/*.html $(srcdir)/html/*.css $(distdir)/html
Tim Janik's avatar
Tim Janik committed
216 217 218 219

#	for i in $(HTML_IMAGES) ; do          \
#	  cp $(srcdir)/$$i $(distdir)/html ;  \
#	done
Owen Taylor's avatar
Owen Taylor committed
220

221
.PHONY : dist-hook-local