Add ABI control using the same technique that is used in GTK+.
[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
6 INCLUDES = \
7         -DG_LOG_DOMAIN=\"GLib-GObject\"         \
8         -I$(top_srcdir)                         \
9         -I$(top_srcdir)/glib                    \
10         -I$(top_builddir)                       \
11         $(GLIB_DEBUG_FLAGS)                     \
12         -DG_DISABLE_DEPRECATED                  \
13         -DGOBJECT_COMPILATION                   \
14         -DG_DISABLE_CONST_RETURNS
15
16 gobject.def: gobject.symbols
17         (echo -e EXPORTS; cpp -P -DINCLUDE_VARIABLES -DINCLUDE_INTERNAL_SYMBOLS -DG_OS_WIN32 $(srcdir)/gobject.symbols | sed -e '/^$$/d' -e 's/^/\t/' | sort) > gobject.def
18
19 if OS_UNIX
20 TESTS = abicheck.sh
21 endif
22
23 libglib = $(top_builddir)/glib/libglib-2.0.la
24
25 # libraries to compile and install
26 lib_LTLIBRARIES = libgobject-2.0.la
27
28 if MS_LIB_AVAILABLE
29 noinst_DATA = gobject-2.0.lib
30
31 install-ms-lib:
32         $(INSTALL) gobject-2.0.lib $(DESTDIR)$(libdir)
33
34 uninstall-ms-lib:
35         -rm $(DESTDIR)$(libdir)/gobject-2.0.lib
36 else
37 install-ms-lib:
38 uninstall-ms-lib:
39 endif
40
41 if PLATFORM_WIN32
42 no_undefined = -no-undefined
43 endif
44
45 if OS_WIN32
46 export_symbols = -export-symbols $(srcdir)/gobject.def
47
48 install-libtool-import-lib:
49         $(INSTALL) .libs/libgobject-2.0.dll.a $(DESTDIR)$(libdir)
50         $(INSTALL) $(srcdir)/gobject.def $(DESTDIR)$(libdir)/gobject-2.0.def
51
52 uninstall-libtool-import-lib:
53         -rm $(DESTDIR)$(libdir)/libgobject-2.0.dll.a $(DESTDIR)$(libdir)/gobject-2.0.def
54 else
55 install-libtool-import-lib:
56 uninstall-libtool-import-lib:
57
58 export_symbols = $(LIBTOOL_EXPORT_OPTIONS)
59 endif
60
61 # libtool stuff: set version and export symbols for resolving
62 libgobjectincludedir = $(includedir)/glib-2.0/gobject
63 libgobject_2_0_la_LDFLAGS = \
64   -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)  \
65   -export-dynamic $(no_undefined) $(export_symbols)
66
67 libgobject_2_0_la_LIBADD = $(G_OBJECT_WIN32_RESOURCE) $(libglib)
68
69 libgobject_2_0_la_DEPENDENCIES = $(G_OBJECT_WIN32_RESOURCE) $(GOBJECT_DEF)
70
71 #
72 # setup source file variables
73 #
74 # GObject library header files for public installation
75 gobject_public_h_sources = \
76         gboxed.h                \
77         gclosure.h              \
78         genums.h                \
79         gobject.h               \
80         gparam.h                \
81         gparamspecs.h           \
82         gsignal.h               \
83         gsourceclosure.h        \
84         gtype.h                 \
85         gtypemodule.h           \
86         gtypeplugin.h           \
87         gvalue.h                \
88         gvaluearray.h           \
89         gvaluecollector.h       \
90         gvaluetypes.h           \
91         gobjectnotifyqueue.c    \
92         gmarshal.h
93
94 # GObject library header files that don't get installed
95 gobject_private_h_sources = 
96 # GObject library C sources to build the library from
97 gobject_c_sources = \
98         gboxed.c                \
99         gclosure.c              \
100         genums.c                \
101         gobject.c               \
102         gparam.c                \
103         gparamspecs.c           \
104         gsignal.c               \
105         gsourceclosure.c        \
106         gtype.c                 \
107         gtypemodule.c           \
108         gtypeplugin.c           \
109         gvalue.c                \
110         gvaluearray.c           \
111         gvaluetransform.c       \
112         gvaluetypes.c
113
114 # these sources (also mentioned above) are generated.
115 BUILT_SOURCES = gmarshal.h gmarshal.c 
116
117 # non-header sources (headers should be specified in the above variables)
118 # that don't serve as direct make target sources, i.e. they don't have
119 # their own .lo rules and don't get publically installed
120 gobject_extra_sources = \
121         gmarshal.list           \
122         gmarshal.strings        \
123         gobject.symbols
124
125
126 #
127 # setup GObject library sources and their dependancies
128 #
129 gobject_target_headers = $(gobject_public_h_sources)
130 gobject_target_sources = $(gobject_c_sources)
131 EXTRA_HEADERS =
132 EXTRA_DIST = $(gobject_private_h_sources) $(gobject_extra_sources)
133
134 #
135 # rules to generate built sources
136 #
137 # setup autogeneration dependancies
138 gen_sources = xgen-gmh xgen-gmc xgen-gms
139 CLEANFILES = $(gen_sources)
140
141 # normal autogeneration rules
142 # all autogenerated files need to be generated in the srcdir,
143 # so old versions get remade and are not confused with newer
144 # versions in the build dir. thus a development setup requires
145 # srcdir to be writable, passing --disable-rebuilds to
146 # ../configure will supress all autogeneration rules.
147
148 if CROSS_COMPILING
149   glib_genmarshal=$(GLIB_GENMARSHAL)
150 else
151   glib_genmarshal=./glib-genmarshal
152 endif
153
154 gmarshal.h: stamp-gmarshal.h
155         @true
156 stamp-gmarshal.h: @REBUILD@ gmarshal.list glib-genmarshal$(EXEEXT)
157         $(MAKE) glib-genmarshal$(EXEEXT)
158         echo "#ifndef __G_MARSHAL_H__" > xgen-gmh \
159         && echo "#define __G_MARSHAL_H__" >> xgen-gmh \
160         && $(glib_genmarshal) --nostdinc --prefix=g_cclosure_marshal $(srcdir)/gmarshal.list --header >> xgen-gmh \
161         && echo "#endif /* __G_MARSHAL_H__ */" >> xgen-gmh \
162         && (cmp -s xgen-gmh gmarshal.h 2>/dev/null || cp xgen-gmh gmarshal.h) \
163         && rm -f xgen-gmh xgen-gmh~ \
164         && echo timestamp > $@
165
166 gmarshal.c: @REBUILD@ stamp-gmarshal.h
167         $(glib_genmarshal) --nostdinc --prefix=g_cclosure_marshal $(srcdir)/gmarshal.list --body >> xgen-gmc \
168         && cp xgen-gmc gmarshal.c \
169         && rm -f xgen-gmc xgen-gmc~
170
171 gmarshal.strings: @REBUILD@ $(srcdir)/gmarshal.list
172         grep '^[A-Z]' $(srcdir)/gmarshal.list \
173         | sed -e 's/^/"g_cclosure_marshal_/' -e 's/:/__/' -e 's/,/_/g' -e 's/$$/",/' > xgen-gms \
174         && cp xgen-gms gmarshal.strings \
175         && rm -f xgen-gms xgen-gms~
176
177 glib-genmarshal.o: gmarshal.strings
178 gsignal.lo: gmarshal.c
179
180
181 # target platform:
182 libgobjectinclude_HEADERS = $(gobject_target_headers)
183 libgobject_2_0_la_SOURCES = $(gobject_target_sources)
184
185 #
186 # programs to compile and install
187 #
188 bin_PROGRAMS = gobject-query glib-genmarshal
189 bin_SCRIPTS = glib-mkenums
190 noinst_PROGRAMS = testgobject
191 # source files
192 gobject_query_SOURCES = gobject-query.c
193 glib_genmarshal_SOURCES = glib-genmarshal.c
194 testgobject_SOURCES = testgobject.c
195 # link programs against libgobject
196 progs_LDADD = ./libgobject-2.0.la $(libglib)
197 glib_genmarshal_LDADD = $(libglib)
198 gobject_query_LDADD = $(progs_LDADD)
199 testgobject_LDADD = $(progs_LDADD)
200
201 #
202 # auxillary files
203 #
204 EXTRA_DIST +=                   \
205         makefile.msc.in         \
206         gobject.def             \
207         gobject.rc.in           \
208         glib-genmarshal.1       \
209         glib-mkenums.in         \
210         glib-mkenums.1          \
211         abicheck.sh
212
213 BUILT_EXTRA_DIST = \
214         makefile.msc            \
215         gobject.rc              \
216         gmarshal.h              \
217         gmarshal.c              \
218         stamp-gmarshal.h
219
220 if OS_WIN32
221 $(G_OBJECT_WIN32_RESOURCE): gobject.rc
222         $(top_srcdir)/build/win32/lt-compile-resource gobject.rc $@
223 endif
224
225 gobject-2.0.lib: libgobject-2.0.la gobject.def
226         lib -name:libgobject-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:gobject.def -out:$@
227
228 dist-hook: $(BUILT_EXTRA_DIST)
229         files='$(BUILT_EXTRA_DIST)'; \
230         for f in $$files; do \
231           if test -f $$f; then d=.; else d=$(srcdir); fi; \
232           cp $$d/$$f $(distdir) || exit 1; done
233
234 install-data-local: install-ms-lib install-libtool-import-lib
235
236 uninstall-local: uninstall-ms-lib uninstall-libtool-import-lib
237
238 distclean-local:
239         if test $(srcdir) = .; then :; else \
240             rm -f $(BUILT_EXTRA_DIST); \
241         fi