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