Bug 654195 - Add g_unichar_compose() and g_unichar_decompose()
[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 BUILT_SOURCES=
10 CLEANFILES=
11
12 if HAVE_THREADS
13 THREAD_FLAGS=-DG_THREADS_MANDATORY
14 endif
15
16 AM_CPPFLAGS =                                   \
17         -DG_LOG_DOMAIN=\"GLib-GObject\"         \
18         $(gthread_INCLUDES)                     \
19         $(GLIB_DEBUG_FLAGS)                     \
20         $(THREAD_FLAGS)                         \
21         -DG_DISABLE_DEPRECATED                  \
22         -DGOBJECT_COMPILATION
23
24 gobject.def: gobject.symbols
25         $(AM_V_GEN) (echo 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 if OS_LINUX
28 if HAVE_GNUC_VISIBILITY
29 TESTS = abicheck.sh
30 endif
31 endif
32
33 libglib = $(top_builddir)/glib/libglib-2.0.la $(top_builddir)/gthread/libgthread-2.0.la
34
35 # libraries to compile and install
36 lib_LTLIBRARIES = libgobject-2.0.la
37
38 if OS_WIN32_AND_DLL_COMPILATION
39 if MS_LIB_AVAILABLE
40 noinst_DATA = gobject-2.0.lib
41
42 install_ms_lib_cmd = $(INSTALL) gobject-2.0.lib $(DESTDIR)$(libdir)
43 uninstall_ms_lib_cmd = -rm $(DESTDIR)$(libdir)/gobject-2.0.lib
44 endif
45 endif
46
47 install-ms-lib:
48         $(install_ms_lib_cmd)
49
50 uninstall-ms-lib:
51         $(uninstall_ms_lib_cmd)
52
53 if PLATFORM_WIN32
54 no_undefined = -no-undefined
55 endif
56
57 if OS_WIN32_AND_DLL_COMPILATION
58 export_symbols = -export-symbols gobject.def
59 gobject_def = gobject.def
60
61 gobject_win32_res = gobject-win32-res.o
62 gobject_win32_res_ldflag = -Wl,$(gobject_win32_res)
63
64 install-def-file:
65         $(INSTALL) gobject.def $(DESTDIR)$(libdir)/gobject-2.0.def
66
67 uninstall-def-file:
68         -rm $(DESTDIR)$(libdir)/gobject-2.0.def
69 else
70 install-def-file:
71 uninstall-def-file:
72
73 export_symbols = $(LIBTOOL_EXPORT_OPTIONS)
74 endif
75
76 # libtool stuff: set version and export symbols for resolving
77 libgobjectincludedir = $(includedir)/glib-2.0/gobject
78 libgobject_2_0_la_LDFLAGS = $(GLIB_LINK_FLAGS) \
79   $(gobject_win32_res_ldflag) \
80   -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
81   -export-dynamic $(no_undefined) $(export_symbols)
82
83 libgobject_2_0_la_CFLAGS = $(LIBFFI_CFLAGS)
84
85 libgobject_2_0_la_LIBADD = $(libglib) $(LIBFFI_LIBS)
86
87 libgobject_2_0_la_DEPENDENCIES = $(gobject_win32_res) $(gobject_def)
88
89 #
90 # setup source file variables
91 #
92 # GObject library header files for public installation
93 gobject_public_h_sources = \
94         glib-types.h            \
95         gbinding.h              \
96         gboxed.h                \
97         gclosure.h              \
98         genums.h                \
99         gmarshal.h              \
100         gobject.h               \
101         gparam.h                \
102         gparamspecs.h           \
103         gsignal.h               \
104         gsourceclosure.h        \
105         gtype.h                 \
106         gtypemodule.h           \
107         gtypeplugin.h           \
108         gvalue.h                \
109         gvaluearray.h           \
110         gvaluecollector.h       \
111         gvaluetypes.h           \
112         gobjectnotifyqueue.c
113
114 # GObject library header files that don't get installed
115 gobject_private_h_sources =     \
116         gatomicarray.h          \
117         gtype-private.h
118
119 # GObject library C sources to build the library from
120 gobject_c_sources = \
121         gobject_probes.d        \
122         gatomicarray.c          \
123         gbinding.c              \
124         gboxed.c                \
125         gclosure.c              \
126         genums.c                \
127         gmarshal.c              \
128         gobject.c               \
129         gobject_trace.h         \
130         gparam.c                \
131         gparamspecs.c           \
132         gsignal.c               \
133         gsourceclosure.c        \
134         gtype.c                 \
135         gtypemodule.c           \
136         gtypeplugin.c           \
137         gvalue.c                \
138         gvaluearray.c           \
139         gvaluetransform.c       \
140         gvaluetypes.c
141
142 if ENABLE_DTRACE
143 gobject_probes.h: gobject_probes.d Makefile
144         $(AM_V_GEN) $(DTRACE) -C -h -s $< -o $@.tmp
145         @$(SED) -e "s,define STAP_HAS_SEMAPHORES 1,undef STAP_HAS_SEMAPHORES," < $@.tmp > $@ && rm -f $@.tmp
146 gobject_probes.o: gobject_probes.d Makefile
147         $(AM_V_GEN) $(DTRACE) -G -s $< -o $@
148 BUILT_SOURCES += gobject_probes.h gobject_probes.o
149 CLEANFILES += gobject_probes.h
150 libgobject_2_0_la_LIBADD += gobject_probes.o
151 endif
152
153 if ENABLE_SYSTEMTAP
154 tapset_in_files = gobject.stp.in
155 tapsetdir   = @ABS_TAPSET_DIR@
156 tapset_DATA = $(tapset_in_files:.stp.in=.stp)
157 EXTRA_DIST += $(tapset_in_files)
158 endif
159
160 # non-header sources (headers should be specified in the above variables)
161 # that don't serve as direct make target sources, i.e. they don't have
162 # their own .lo rules and don't get publically installed
163 gobject_extra_sources = \
164         gmarshal.list           \
165         gmarshal.strings        \
166         gobject.symbols
167
168
169 #
170 # setup GObject library sources and their dependancies
171 #
172 gobject_target_headers = $(gobject_public_h_sources)
173 gobject_target_sources = $(gobject_c_sources)
174 EXTRA_HEADERS =
175 EXTRA_DIST += \
176         $(gobject_private_h_sources)    \
177         $(gobject_extra_sources)        \
178         marshal-genstrings.pl
179
180 # This is read by gobject-introspection/misc/ and gtk-doc
181 gobject-public-headers.txt: Makefile
182         echo $(gobject_public_h_sources) > $@.tmp && mv $@.tmp $@
183
184 CLEANFILES += gobject-public-headers.txt
185
186 all-local: gobject-public-headers.txt
187
188 #
189 # rules to generate built sources
190 #
191 # setup autogeneration dependancies
192 gen_sources = xgen-gmh xgen-gmc xgen-gms
193 CLEANFILES += $(gen_sources)
194
195 # normal autogeneration rules
196 # all autogenerated files need to be generated in the srcdir,
197 # so old versions get remade and are not confused with newer
198 # versions in the build dir. thus a development setup requires
199 # srcdir to be writable, passing --disable-rebuilds to
200 # ../configure will supress all autogeneration rules.
201
202
203 gmarshal.strings: @REBUILD@ $(srcdir)/gmarshal.list
204         $(AM_V_GEN) grep '^[A-Z]' $(srcdir)/gmarshal.list \
205         | $(SED) -e 's/^/"g_cclosure_marshal_/' -e 's/:/__/' -e 's/,/_/g' -e 's/$$/",/' > xgen-gms \
206         && cp xgen-gms gmarshal.strings \
207         && rm -f xgen-gms xgen-gms~
208
209 glib-genmarshal.o: gmarshal.strings
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-mkenums.in         \
239         abicheck.sh
240
241 BUILT_EXTRA_DIST = \
242         makefile.msc            \
243         gobject.rc
244
245 gobject-win32-res.o: gobject.rc
246         $(AM_V_GEN) $(WINDRES) gobject.rc $@
247
248 gobject-2.0.lib: libgobject-2.0.la gobject.def
249         lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgobject-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:gobject.def -out:$@
250
251 dist-hook: $(BUILT_EXTRA_DIST) ../build/win32/vs9/gobject.vcproj ../build/win32/vs10/gobject.vcxproj ../build/win32/vs10/gobject.vcxproj.filters
252         files='$(BUILT_EXTRA_DIST)'; \
253         for f in $$files; do \
254           if test -f $$f; then d=.; else d=$(srcdir); fi; \
255           cp $$d/$$f $(distdir) || exit 1; done
256
257 ../build/win32/vs9/gobject.vcproj: $(top_srcdir)/build/win32/vs9/gobject.vcprojin
258         for F in $(libgobject_2_0_la_SOURCES); do \
259                 case $$F in \
260                 *.c) echo '   <File RelativePath="..\..\..\gobject\'$$F'" />' \
261                      ;; \
262                 esac; \
263         done >libgobject.sourcefiles
264         $(CPP) -P - <$(top_srcdir)/build/win32/vs9/gobject.vcprojin >$@
265         rm libgobject.sourcefiles
266
267 ../build/win32/vs10/gobject.vcxproj: $(top_srcdir)/build/win32/vs10/gobject.vcxprojin
268         for F in $(libgobject_2_0_la_SOURCES); do \
269                 case $$F in \
270                 *.c) echo '    <ClCompile Include="..\..\..\gobject\'$$F'" />' \
271                      ;; \
272                 esac; \
273         done >libgobject.vs10.sourcefiles
274         $(CPP) -P - <$(top_srcdir)/build/win32/vs10/gobject.vcxprojin >$@
275         rm libgobject.vs10.sourcefiles
276
277 ../build/win32/vs10/gobject.vcxproj.filters: $(top_srcdir)/build/win32/vs10/gobject.vcxproj.filtersin
278         for F in $(libgobject_2_0_la_SOURCES); do \
279                 case $$F in \
280                 *.c) echo '    <ClCompile Include="..\..\..\gobject\'$$F'"><Filter>Source Files</Filter></ClCompile>' \
281                      ;; \
282                 esac; \
283         done >libgobject.vs10.sourcefiles.filters
284         $(CPP) -P - <$(top_srcdir)/build/win32/vs10/gobject.vcxproj.filtersin >$@
285         rm libgobject.vs10.sourcefiles.filters
286
287 install-data-local: install-ms-lib install-def-file
288
289 uninstall-local: uninstall-ms-lib uninstall-def-file uninstall-gdb
290
291 distclean-local:
292         if test $(srcdir) = .; then :; else \
293             rm -f $(BUILT_EXTRA_DIST); \
294             rm -f libgobject-gdb.py; \
295         fi
296
297 # install gdb scripts
298 gdbdir = $(datadir)/glib-2.0/gdb
299 dist_gdb_SCRIPTS = gobject.py
300
301 libgobject-gdb.py: libgobject-gdb.py.in
302         $(AM_V_GEN) $(SED) -e "s|\@datadir\@|$(datadir)|" $(srcdir)/libgobject-gdb.py.in > libgobject-gdb.py
303
304 uninstall-gdb:
305         -rm -r $(DESTDIR)$(datadir)/gdb
306
307 install-data-hook: libgobject-gdb.py
308         mkdir -p $(DESTDIR)$(datadir)/gdb/auto-load/$(ABS_GLIB_RUNTIME_LIBDIR)
309         $(INSTALL) libgobject-gdb.py $(DESTDIR)$(datadir)/gdb/auto-load/$(ABS_GLIB_RUNTIME_LIBDIR)/libgobject-2.0.so.0.$(LT_CURRENT).$(LT_REVISION)-gdb.py
310 if HAVE_GLIB_RUNTIME_LIBDIR
311         mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
312         mv $(DESTDIR)$(libdir)/libgobject-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
313         mv $(DESTDIR)$(libdir)/libgobject-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
314         rm -f $(DESTDIR)$(libdir)/libgobject-2.0.so
315         ln -s $(GLIB_RUNTIME_LIBDIR)/libgobject-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/libgobject-2.0.so
316 endif