2.7.0
[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 -DALL_FILES - <$(srcdir)/gobject.symbols | sed -e '/^$$/d' -e 's/^/     /' -e 's/G_GNUC_[^ ]*//g' | sort) > gobject.def
18
19 gobjectalias.h: gobject.symbols
20         $(PERL) $(srcdir)/makegobjectalias.pl < $(srcdir)/gobject.symbols > gobjectalias.h
21
22 gobjectaliasdef.c: gobject.symbols
23         $(PERL) $(srcdir)/makegobjectalias.pl -def < $(srcdir)/gobject.symbols > gobjectaliasdef.c
24
25 if OS_LINUX
26 if HAVE_GNUC_VISIBILITY
27 TESTS = abicheck.sh
28 endif
29 endif
30
31 libglib = $(top_builddir)/glib/libglib-2.0.la
32
33 # libraries to compile and install
34 lib_LTLIBRARIES = libgobject-2.0.la
35
36 if MS_LIB_AVAILABLE
37 noinst_DATA = gobject-2.0.lib
38
39 install-ms-lib:
40         $(INSTALL) gobject-2.0.lib $(DESTDIR)$(libdir)
41
42 uninstall-ms-lib:
43         -rm $(DESTDIR)$(libdir)/gobject-2.0.lib
44 else
45 install-ms-lib:
46 uninstall-ms-lib:
47 endif
48
49 if PLATFORM_WIN32
50 no_undefined = -no-undefined
51 endif
52
53 if OS_WIN32
54 export_symbols = -export-symbols gobject.def
55
56 install-libtool-import-lib:
57 #       Don't put the bug compatibility entries in the import lib!
58 #       (Unfortunately the GNU linker doesn't yet understand the PRIVATE
59 #       directive in .def files.)
60 #
61         for entry in `grep PRIVATE gobject.def | sed -e 's/PRIVATE//'`; do \
62           file=`$(NM) -A .libs/libgobject-2.0.dll.a | grep $$entry | head -n 1 | cut -d: -f2`; \
63           ar d .libs/libgobject-2.0.dll.a $$file; \
64         done
65         $(RANLIB) .libs/libgobject-2.0.dll.a
66         $(INSTALL) .libs/libgobject-2.0.dll.a $(DESTDIR)$(libdir)
67         $(INSTALL) gobject.def $(DESTDIR)$(libdir)/gobject-2.0.def
68
69 uninstall-libtool-import-lib:
70         -rm $(DESTDIR)$(libdir)/libgobject-2.0.dll.a $(DESTDIR)$(libdir)/gobject-2.0.def
71 else
72 install-libtool-import-lib:
73 uninstall-libtool-import-lib:
74
75 export_symbols = $(LIBTOOL_EXPORT_OPTIONS)
76 endif
77
78 # libtool stuff: set version and export symbols for resolving
79 libgobjectincludedir = $(includedir)/glib-2.0/gobject
80 libgobject_2_0_la_LDFLAGS = \
81   -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)  \
82   -export-dynamic $(no_undefined) $(export_symbols)
83
84 libgobject_2_0_la_LIBADD = $(G_OBJECT_WIN32_RESOURCE) $(libglib)
85
86 libgobject_2_0_la_DEPENDENCIES = $(G_OBJECT_WIN32_RESOURCE) $(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 = 
113 # GObject library C sources to build the library from
114 gobject_c_sources = \
115         gboxed.c                \
116         gclosure.c              \
117         genums.c                \
118         gobject.c               \
119         gparam.c                \
120         gparamspecs.c           \
121         gsignal.c               \
122         gsourceclosure.c        \
123         gtype.c                 \
124         gtypemodule.c           \
125         gtypeplugin.c           \
126         gvalue.c                \
127         gvaluearray.c           \
128         gvaluetransform.c       \
129         gvaluetypes.c
130
131 # these sources (also mentioned above) are generated.
132 BUILT_SOURCES = gmarshal.h gmarshal.c gobjectalias.h gobjectaliasdef.c
133
134 # non-header sources (headers should be specified in the above variables)
135 # that don't serve as direct make target sources, i.e. they don't have
136 # their own .lo rules and don't get publically installed
137 gobject_extra_sources = \
138         gmarshal.list           \
139         gmarshal.strings        \
140         gobject.symbols
141
142
143 #
144 # setup GObject library sources and their dependancies
145 #
146 gobject_target_headers = $(gobject_public_h_sources)
147 gobject_target_sources = $(gobject_c_sources)
148 EXTRA_HEADERS =
149 EXTRA_DIST = \
150         $(gobject_private_h_sources)    \
151         $(gobject_extra_sources)        \
152         makegobjectalias.pl
153
154 #
155 # rules to generate built sources
156 #
157 # setup autogeneration dependancies
158 gen_sources = xgen-gmh xgen-gmc xgen-gms
159 CLEANFILES = $(gen_sources)
160
161 # normal autogeneration rules
162 # all autogenerated files need to be generated in the srcdir,
163 # so old versions get remade and are not confused with newer
164 # versions in the build dir. thus a development setup requires
165 # srcdir to be writable, passing --disable-rebuilds to
166 # ../configure will supress all autogeneration rules.
167
168 if CROSS_COMPILING
169   glib_genmarshal=$(GLIB_GENMARSHAL)
170 else
171   glib_genmarshal=./glib-genmarshal
172 endif
173
174 gmarshal.h: stamp-gmarshal.h
175         @true
176 stamp-gmarshal.h: @REBUILD@ gmarshal.list glib-genmarshal$(EXEEXT)
177         $(MAKE) glib-genmarshal$(EXEEXT)
178         echo "#ifndef __G_MARSHAL_H__" > xgen-gmh \
179         && echo "#define __G_MARSHAL_H__" >> xgen-gmh \
180         && $(glib_genmarshal) --nostdinc --prefix=g_cclosure_marshal $(srcdir)/gmarshal.list --header >> xgen-gmh \
181         && echo "#endif /* __G_MARSHAL_H__ */" >> xgen-gmh \
182         && (cmp -s xgen-gmh gmarshal.h 2>/dev/null || cp xgen-gmh gmarshal.h) \
183         && rm -f xgen-gmh xgen-gmh~ \
184         && echo timestamp > $@
185
186 gmarshal.c: @REBUILD@ stamp-gmarshal.h
187         $(glib_genmarshal) --nostdinc --prefix=g_cclosure_marshal $(srcdir)/gmarshal.list --body >> xgen-gmc \
188         && cp xgen-gmc gmarshal.c \
189         && rm -f xgen-gmc xgen-gmc~
190
191 gmarshal.strings: @REBUILD@ $(srcdir)/gmarshal.list
192         grep '^[A-Z]' $(srcdir)/gmarshal.list \
193         | sed -e 's/^/"g_cclosure_marshal_/' -e 's/:/__/' -e 's/,/_/g' -e 's/$$/",/' > xgen-gms \
194         && cp xgen-gms gmarshal.strings \
195         && rm -f xgen-gms xgen-gms~
196
197 glib-genmarshal.o: gmarshal.strings
198 gsignal.lo: gmarshal.c
199
200
201 # target platform:
202 libgobjectinclude_HEADERS = $(gobject_target_headers)
203 libgobject_2_0_la_SOURCES = $(gobject_target_sources)
204
205 #
206 # programs to compile and install
207 #
208 bin_PROGRAMS = gobject-query glib-genmarshal
209 bin_SCRIPTS = glib-mkenums
210 noinst_PROGRAMS = testgobject
211 # source files
212 gobject_query_SOURCES = gobject-query.c
213 glib_genmarshal_SOURCES = glib-genmarshal.c
214 testgobject_SOURCES = testgobject.c
215 # link programs against libgobject
216 progs_LDADD = ./libgobject-2.0.la $(libglib)
217 glib_genmarshal_LDADD = $(libglib)
218 gobject_query_LDADD = $(progs_LDADD)
219 testgobject_LDADD = $(progs_LDADD)
220
221 #
222 # auxillary files
223 #
224 EXTRA_DIST +=                   \
225         makefile.msc.in         \
226         gobject.rc.in           \
227         glib-genmarshal.1       \
228         glib-mkenums.in         \
229         glib-mkenums.1          \
230         abicheck.sh
231
232 BUILT_EXTRA_DIST = \
233         makefile.msc            \
234         gobject.rc              \
235         gmarshal.h              \
236         gmarshal.c              \
237         stamp-gmarshal.h        \
238         gobjectalias.h          \
239         gobjectaliasdef.c
240
241
242 if OS_WIN32
243 $(G_OBJECT_WIN32_RESOURCE): gobject.rc
244         $(top_srcdir)/build/win32/lt-compile-resource gobject.rc $@
245 endif
246
247 gobject-2.0.lib: libgobject-2.0.la gobject.def
248         lib -name:libgobject-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:gobject.def -out:$@
249
250 dist-hook: $(BUILT_EXTRA_DIST)
251         files='$(BUILT_EXTRA_DIST)'; \
252         for f in $$files; do \
253           if test -f $$f; then d=.; else d=$(srcdir); fi; \
254           cp $$d/$$f $(distdir) || exit 1; done
255
256 install-data-local: install-ms-lib install-libtool-import-lib
257
258 uninstall-local: uninstall-ms-lib uninstall-libtool-import-lib
259
260 distclean-local:
261         if test $(srcdir) = .; then :; else \
262             rm -f $(BUILT_EXTRA_DIST); \
263         fi