Makefile.am 5.23 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=glib

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

Owen Taylor's avatar
Owen Taylor committed
9
# The directory containing the source code. Relative to $(srcdir)
Owen Taylor's avatar
Owen Taylor committed
10
DOC_SOURCE_DIR=../../..
Owen Taylor's avatar
Owen Taylor committed
11

Owen Taylor's avatar
Owen Taylor committed
12
# Extra options to supply to gtkdoc-scan
Owen Taylor's avatar
Owen Taylor committed
13
SCAN_OPTIONS=--deprecated-guards="G_DISABLE_DEPRECATED"
Owen Taylor's avatar
Owen Taylor committed
14 15

# Extra options to supply to gtkdoc-mkdb
16
MKDB_OPTIONS=--sgml-mode --output-format=xml
Owen Taylor's avatar
Owen Taylor committed
17

18 19 20
# Extra options to supply to gtkdoc-fixref
FIXXREF_OPTIONS=

Owen Taylor's avatar
Owen Taylor committed
21
# Used for dependencies
22 23
HFILE_GLOB=$(top_srcdir)/glib/*.h $(top_srcdir)/gmodule/*.h
CFILE_GLOB=$(top_srcdir)/glib/*.c $(top_srcdir)/gmodule/*.c
Owen Taylor's avatar
Owen Taylor committed
24

25 26
# Headers to ignore
IGNORE_HFILES=			\
Owen Taylor's avatar
Update.  
Owen Taylor committed
27
	build			\
28 29
	gobject 		\
	config.h 		\
Havoc Pennington's avatar
Havoc Pennington committed
30
	glibintl.h		\
31
	gbsearcharray.h		\
32
	gmoduleconf.h		\
Owen Taylor's avatar
Owen Taylor committed
33
	gunibreak.h		\
Owen Taylor's avatar
Update.  
Owen Taylor committed
34
	gunicomp.h		\
35 36
	gunidecomp.h		\
	gunichartables.h	\
37 38
	glibconfig-sysdefs.h	\
	gdebug.h
Owen Taylor's avatar
Owen Taylor committed
39

Owen Taylor's avatar
Owen Taylor committed
40 41 42 43 44 45 46 47
# Extra files to add when scanning
EXTRA_HFILES=

# Images to copy into HTML directory
HTML_IMAGES =  				\
	mainloop-states.gif

# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE)
Matthias Clasen's avatar
Matthias Clasen committed
48 49 50
content_files =				\
	running.sgml			\
	building.sgml			\
51
	changes.sgml			\
Matthias Clasen's avatar
Matthias Clasen committed
52
	compiling.sgml			\
53 54 55
	resources.sgml			\
	version.xml

Owen Taylor's avatar
Owen Taylor committed
56

Owen Taylor's avatar
Owen Taylor committed
57
# Other files to distribute
Owen Taylor's avatar
Owen Taylor committed
58 59 60
extra_files =				\
	mainloop-states.fig		\
	mainloop-states.png		\
61 62
	mainloop-states.eps		\
	version.xml.in
Owen Taylor's avatar
Owen Taylor committed
63 64 65 66 67 68 69 70 71

# CFLAGS and LDFLAGS for compiling scan program. Only needed
# if $(DOC_MODULE).types is non-empty.
GTKDOC_CFLAGS =
GTKDOC_LIBS =

# Commands for compiling and linking 
GTKDOC_CC=$(LIBTOOL) --mode=compile $(CC)
GTKDOC_LD=$(LIBTOOL) --mode=link $(CC)
Owen Taylor's avatar
Owen Taylor committed
72

73 74 75 76 77

####################################
# Everything below here is generic #
####################################

78 79 80 81 82 83 84
# We set GPATH here; this gives us semantics for GNU make
# which are more like other make's VPATH, when it comes to
# whether a source that is a target of one rule is then
# searched for in VPATH/GPATH.
#
GPATH = $(srcdir)

85
TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
Owen Taylor's avatar
Owen Taylor committed
86 87

EXTRA_DIST = 				\
Owen Taylor's avatar
Owen Taylor committed
88
	$(content_files)		\
Owen Taylor's avatar
Owen Taylor committed
89
	$(extra_files)			\
Owen Taylor's avatar
Owen Taylor committed
90
	$(HTML_IMAGES)			\
91
	$(DOC_MAIN_SGML_FILE)		\
Owen Taylor's avatar
Owen Taylor committed
92
	$(DOC_MODULE).types		\
93 94
	$(DOC_MODULE)-sections.txt	\
	$(DOC_MODULE)-overrides.txt
Owen Taylor's avatar
Owen Taylor committed
95

96 97
DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
	   $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp
Owen Taylor's avatar
Owen Taylor committed
98

99 100 101 102
SCANOBJ_FILES = 		 \
	$(DOC_MODULE).args 	 \
	$(DOC_MODULE).hierarchy  \
	$(DOC_MODULE).interfaces \
103
	$(DOC_MODULE).prerequisites \
Owen Taylor's avatar
Owen Taylor committed
104
	$(DOC_MODULE).signals
Owen Taylor's avatar
Owen Taylor committed
105

106 107 108 109 110
if ENABLE_GTK_DOC
all-local: html-build.stamp

#### scan ####

Owen Taylor's avatar
Owen Taylor committed
111 112
scan-build.stamp: $(HFILE_GLOB)
	@echo '*** Scanning header files ***'
113 114
	if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null ; then \
	    CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" gtkdoc-scangobj --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \
Owen Taylor's avatar
Owen Taylor committed
115
	else \
116
	    cd $(srcdir) ; \
Owen Taylor's avatar
Owen Taylor committed
117 118 119
	    for i in $(SCANOBJ_FILES) ; do \
               test -f $$i || touch $$i ; \
	    done \
120
	fi
Owen Taylor's avatar
Owen Taylor committed
121 122 123 124
	cd $(srcdir) && \
	  gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES)
	touch scan-build.stamp

125 126
$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES): scan-build.stamp
	@true
127

128
#### templates ####
Owen Taylor's avatar
Owen Taylor committed
129

Owen Taylor's avatar
Owen Taylor committed
130 131
tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt
	@echo '*** Rebuilding template files ***'
Owen Taylor's avatar
Owen Taylor committed
132
	cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE)
Owen Taylor's avatar
Owen Taylor committed
133
	touch tmpl-build.stamp
Owen Taylor's avatar
Owen Taylor committed
134

135 136
tmpl.stamp: tmpl-build.stamp
	@true
Owen Taylor's avatar
Owen Taylor committed
137

138
#### sgml ####
Owen Taylor's avatar
Owen Taylor committed
139

140
sgml-build.stamp: tmpl.stamp $(CFILE_GLOB) $(srcdir)/tmpl/*.sgml
Owen Taylor's avatar
Owen Taylor committed
141 142 143 144 145
	@echo '*** Building SGML ***'
	cd $(srcdir) && \
	gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) $(MKDB_OPTIONS)
	touch sgml-build.stamp

146 147
sgml.stamp: sgml-build.stamp
	@true
Owen Taylor's avatar
Owen Taylor committed
148

149
#### html ####
Owen Taylor's avatar
Owen Taylor committed
150

151
html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
Owen Taylor's avatar
Owen Taylor committed
152
	@echo '*** Building HTML ***'
153 154
	rm -rf $(srcdir)/html 
	mkdir $(srcdir)/html
Owen Taylor's avatar
Owen Taylor committed
155 156
	cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
	test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html )
157
	@echo '-- Fixing Crossreferences' 
158
	cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
Owen Taylor's avatar
Owen Taylor committed
159 160
	touch html-build.stamp
endif
Owen Taylor's avatar
Owen Taylor committed
161

162 163
##############

Owen Taylor's avatar
Owen Taylor committed
164
clean-local:
165
	rm -f *~ *.bak $(SCANOBJ_FILES) *-unused.txt $(DOC_STAMPS)
Owen Taylor's avatar
Owen Taylor committed
166 167

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

install-data-local:
Owen Taylor's avatar
Owen Taylor committed
171
	$(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)
172 173
	(installfiles=`echo $(srcdir)/html/*`; \
	if test "$$installfiles" = '$(srcdir)/html/*'; \
Owen Taylor's avatar
Owen Taylor committed
174 175 176 177 178 179 180
	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' ; \
181
	  $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR); \
Owen Taylor's avatar
Owen Taylor committed
182
	fi)
Owen Taylor's avatar
Owen Taylor committed
183

184 185 186 187 188 189 190
#
# Require gtk-doc when making dist
#
if ENABLE_GTK_DOC
dist-check-gtkdoc:
else
dist-check-gtkdoc:
191
	@echo "*** gtk-doc must be installed and enabled in order to make dist"
192 193 194
	@false
endif

Owen Taylor's avatar
Owen Taylor committed
195
dist-hook: dist-check-gtkdoc dist-hook-local
Owen Taylor's avatar
Owen Taylor committed
196
	mkdir $(distdir)/tmpl
197
	mkdir $(distdir)/xml
198
	mkdir $(distdir)/html
Owen Taylor's avatar
Owen Taylor committed
199
	-cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
200
	-cp $(srcdir)/sgml/*.xml $(distdir)/xml
201
	-cp $(srcdir)/html/* $(distdir)/html
Owen Taylor's avatar
Owen Taylor committed
202

203
.PHONY : dist-hook-local
204 205