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