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