G_DEFINE_INTERFACE_* documentation is not generated
[platform/upstream/glib.git] / gobject / Makefile.am
1 # GObject - GLib Type, Object, Parameter and Signal Library
2 # Copyright (C) 1997,98,99,2000 Tim Janik and Red Hat, Inc.
3 #
4 ## Process this file with automake to produce Makefile.in
5 include $(top_srcdir)/Makefile.decl
6
7 SUBDIRS = . tests
8
9 AM_CPPFLAGS =                                   \
10         -DG_LOG_DOMAIN=\"GLib-GObject\"         \
11         -I$(top_srcdir)                         \
12         -I$(top_srcdir)/glib                    \
13         -I$(top_builddir)                       \
14         $(GLIB_DEBUG_FLAGS)                     \
15         -DG_DISABLE_DEPRECATED                  \
16         -DGOBJECT_COMPILATION                   \
17         -DG_DISABLE_CONST_RETURNS
18
19 gobject.def: gobject.symbols
20         (echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DINCLUDE_INTERNAL_SYMBOLS -DG_OS_WIN32 -DALL_FILES - <$(srcdir)/gobject.symbols | sed -e '/^$$/d' -e 's/^/     /' -e 's/G_GNUC_[^ ]*//g' | sort) > gobject.def
21
22 gobjectalias.h: gobject.symbols
23         $(PERL) $(srcdir)/makegobjectalias.pl < $(srcdir)/gobject.symbols > gobjectalias.h
24
25 gobjectaliasdef.c: gobject.symbols
26         $(PERL) $(srcdir)/makegobjectalias.pl -def < $(srcdir)/gobject.symbols > gobjectaliasdef.c
27
28 if OS_LINUX
29 if HAVE_GNUC_VISIBILITY
30 TESTS = abicheck.sh pltcheck.sh
31 endif
32 endif
33
34 libglib = $(top_builddir)/glib/libglib-2.0.la
35
36 # libraries to compile and install
37 lib_LTLIBRARIES = libgobject-2.0.la
38
39 if OS_WIN32_AND_DLL_COMPILATION
40 if MS_LIB_AVAILABLE
41 noinst_DATA = gobject-2.0.lib
42
43 install_ms_lib_cmd = $(INSTALL) gobject-2.0.lib $(DESTDIR)$(libdir)
44 uninstall_ms_lib_cmd = -rm $(DESTDIR)$(libdir)/gobject-2.0.lib
45 endif
46 endif
47
48 install-ms-lib:
49         $(install_ms_lib_cmd)
50
51 uninstall-ms-lib:
52         $(uninstall_ms_lib_cmd)
53
54 if PLATFORM_WIN32
55 no_undefined = -no-undefined
56 endif
57
58 if OS_WIN32_AND_DLL_COMPILATION
59 export_symbols = -export-symbols gobject.def
60 gobject_def = gobject.def
61
62 gobject_win32_res = gobject-win32-res.o
63 gobject_win32_res_ldflag = -Wl,$(gobject_win32_res)
64
65 install-def-file:
66         $(INSTALL) gobject.def $(DESTDIR)$(libdir)/gobject-2.0.def
67
68 uninstall-def-file:
69         -rm $(DESTDIR)$(libdir)/gobject-2.0.def
70 else
71 install-def-file:
72 uninstall-def-file:
73
74 export_symbols = $(LIBTOOL_EXPORT_OPTIONS)
75 endif
76
77 # libtool stuff: set version and export symbols for resolving
78 libgobjectincludedir = $(includedir)/glib-2.0/gobject
79 libgobject_2_0_la_LDFLAGS = \
80   $(gobject_win32_res_ldflag) \
81   -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
82   -export-dynamic $(no_undefined) $(export_symbols)
83
84 libgobject_2_0_la_LIBADD = $(libglib)
85
86 libgobject_2_0_la_DEPENDENCIES = $(gobject_win32_res) $(gobject_def)
87
88 #
89 # setup source file variables
90 #
91 # GObject library header files for public installation
92 gobject_public_h_sources = \
93         gboxed.h                \
94         gclosure.h              \
95         genums.h                \
96         gobject.h               \
97         gparam.h                \
98         gparamspecs.h           \
99         gsignal.h               \
100         gsourceclosure.h        \
101         gtype.h                 \
102         gtypemodule.h           \
103         gtypeplugin.h           \
104         gvalue.h                \
105         gvaluearray.h           \
106         gvaluecollector.h       \
107         gvaluetypes.h           \
108         gobjectnotifyqueue.c    \
109         gmarshal.h
110
111 # GObject library header files that don't get installed
112 gobject_private_h_sources = gatomicarray.h
113 # GObject library C sources to build the library from
114 gobject_c_sources = \
115         gatomicarray.c          \
116         gboxed.c                \
117         gclosure.c              \
118         genums.c                \
119         gobject.c               \
120         gparam.c                \
121         gparamspecs.c           \
122         gsignal.c               \
123         gsourceclosure.c        \
124         gtype.c                 \
125         gtypemodule.c           \
126         gtypeplugin.c           \
127         gvalue.c                \
128         gvaluearray.c           \
129         gvaluetransform.c       \
130         gvaluetypes.c
131
132 # these sources (also mentioned above) are generated.
133 BUILT_SOURCES = gmarshal.h gmarshal.c gobjectalias.h gobjectaliasdef.c
134
135 # non-header sources (headers should be specified in the above variables)
136 # that don't serve as direct make target sources, i.e. they don't have
137 # their own .lo rules and don't get publically installed
138 gobject_extra_sources = \
139         gmarshal.list           \
140         gmarshal.strings        \
141         gobject.symbols
142
143
144 #
145 # setup GObject library sources and their dependancies
146 #
147 gobject_target_headers = $(gobject_public_h_sources)
148 gobject_target_sources = $(gobject_c_sources)
149 EXTRA_HEADERS =
150 EXTRA_DIST += \
151         $(gobject_private_h_sources)    \
152         $(gobject_extra_sources)        \
153         makegobjectalias.pl             \
154         marshal-genstrings.pl
155
156 #
157 # rules to generate built sources
158 #
159 # setup autogeneration dependancies
160 gen_sources = xgen-gmh xgen-gmc xgen-gms
161 CLEANFILES = $(gen_sources)
162
163 # normal autogeneration rules
164 # all autogenerated files need to be generated in the srcdir,
165 # so old versions get remade and are not confused with newer
166 # versions in the build dir. thus a development setup requires
167 # srcdir to be writable, passing --disable-rebuilds to
168 # ../configure will supress all autogeneration rules.
169
170 if CROSS_COMPILING
171   glib_genmarshal=$(GLIB_GENMARSHAL)
172 else
173   glib_genmarshal=./glib-genmarshal
174 endif
175
176 gmarshal.h: stamp-gmarshal.h
177         @true
178 stamp-gmarshal.h: @REBUILD@ gmarshal.list glib-genmarshal$(EXEEXT)
179         $(MAKE) glib-genmarshal$(EXEEXT)
180         echo "#ifndef __G_MARSHAL_H__" > xgen-gmh \
181         && echo "#define __G_MARSHAL_H__" >> xgen-gmh \
182         && $(glib_genmarshal) --nostdinc --prefix=g_cclosure_marshal $(srcdir)/gmarshal.list --header >> xgen-gmh \
183         && echo "#endif /* __G_MARSHAL_H__ */" >> xgen-gmh \
184         && (cmp -s xgen-gmh gmarshal.h 2>/dev/null || cp xgen-gmh gmarshal.h) \
185         && rm -f xgen-gmh xgen-gmh~ \
186         && echo timestamp > $@
187
188 gmarshal.c: @REBUILD@ stamp-gmarshal.h
189         $(glib_genmarshal) --nostdinc --prefix=g_cclosure_marshal $(srcdir)/gmarshal.list --body >> xgen-gmc \
190         && cp xgen-gmc gmarshal.c \
191         && rm -f xgen-gmc xgen-gmc~
192
193 gmarshal.strings: @REBUILD@ $(srcdir)/gmarshal.list
194         grep '^[A-Z]' $(srcdir)/gmarshal.list \
195         | sed -e 's/^/"g_cclosure_marshal_/' -e 's/:/__/' -e 's/,/_/g' -e 's/$$/",/' > xgen-gms \
196         && cp xgen-gms gmarshal.strings \
197         && rm -f xgen-gms xgen-gms~
198
199 glib-genmarshal.o: gmarshal.strings
200 gsignal.lo: gmarshal.c
201
202
203 # target platform:
204 libgobjectinclude_HEADERS = $(gobject_target_headers)
205 libgobject_2_0_la_SOURCES = $(gobject_target_sources)
206
207 #
208 # programs to compile and install
209 #
210 bin_PROGRAMS = gobject-query glib-genmarshal
211 bin_SCRIPTS = glib-mkenums
212 noinst_PROGRAMS = testgobject
213 # source files
214 gobject_query_SOURCES = gobject-query.c
215 glib_genmarshal_SOURCES = glib-genmarshal.c
216 testgobject_SOURCES = testgobject.c
217 # link programs against libgobject
218 progs_LDADD = ./libgobject-2.0.la $(libglib)
219 glib_genmarshal_LDADD = $(libglib)
220 gobject_query_LDADD = $(progs_LDADD)
221 testgobject_LDADD = $(progs_LDADD)
222
223 #
224 # auxillary files
225 #
226 EXTRA_DIST +=                   \
227         makefile.msc.in         \
228         gobject.rc.in           \
229         libgobject-gdb.py.in    \
230         glib-genmarshal.1       \
231         glib-mkenums.in         \
232         glib-mkenums.1          \
233         abicheck.sh             \
234         pltcheck.sh
235
236 BUILT_EXTRA_DIST = \
237         makefile.msc            \
238         gobject.rc              \
239         gmarshal.h              \
240         gmarshal.c              \
241         stamp-gmarshal.h        \
242         gobjectalias.h          \
243         gobjectaliasdef.c
244
245 gobject-win32-res.o: gobject.rc
246         $(WINDRES) gobject.rc $@
247
248 gobject-2.0.lib: libgobject-2.0.la gobject.def
249         lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgobject-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:gobject.def -out:$@
250
251 dist-hook: $(BUILT_EXTRA_DIST)
252         files='$(BUILT_EXTRA_DIST)'; \
253         for f in $$files; do \
254           if test -f $$f; then d=.; else d=$(srcdir); fi; \
255           cp $$d/$$f $(distdir) || exit 1; done
256
257 install-data-local: install-ms-lib install-def-file
258
259 uninstall-local: uninstall-ms-lib uninstall-def-file uninstall-gdb
260
261 distclean-local:
262         if test $(srcdir) = .; then :; else \
263             rm -f $(BUILT_EXTRA_DIST); \
264             rm -f libgobject-gdb.py; \
265         fi
266
267 # install gdb scripts
268 gdbdir = $(datadir)/glib-2.0/gdb
269 dist_gdb_SCRIPTS = gobject.py
270
271 libgobject-gdb.py: libgobject-gdb.py.in
272         sed -e "s|\@datadir\@|$(datadir)|" $(srcdir)/libgobject-gdb.py.in > libgobject-gdb.py
273
274 uninstall-gdb:
275         -rm -r $(DESTDIR)$(datadir)/gdb
276
277 install-data-hook: libgobject-gdb.py
278         mkdir -p $(DESTDIR)$(datadir)/gdb/auto-load/$(ABS_GLIB_RUNTIME_LIBDIR)
279         $(INSTALL) libgobject-gdb.py $(DESTDIR)$(datadir)/gdb/auto-load/$(ABS_GLIB_RUNTIME_LIBDIR)/libgobject-2.0.so.0.$(LT_CURRENT).$(LT_REVISION)-gdb.py
280 if HAVE_GLIB_RUNTIME_LIBDIR
281         mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
282         mv $(DESTDIR)$(libdir)/libgobject-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
283         mv $(DESTDIR)$(libdir)/libgobject-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
284         rm -f $(DESTDIR)$(libdir)/libgobject-2.0.so
285         ln -s $(GLIB_RUNTIME_LIBDIR)/libgobject-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/libgobject-2.0.so
286 endif