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