1 # GObject - GLib Type, Object, Parameter and Signal Library
2 # Copyright (C) 1997,98,99,2000 Tim Janik and Red Hat, Inc.
4 ## Process this file with automake to produce Makefile.in
5 include $(top_srcdir)/glib.mk
10 -DG_LOG_DOMAIN=\"GLib-GObject\" \
15 AM_CFLAGS = $(GLIB_WARN_CFLAGS)
17 libglib = $(top_builddir)/glib/libglib-2.0.la
19 # libraries to compile and install
20 lib_LTLIBRARIES = libgobject-2.0.la
22 if OS_WIN32_AND_DLL_COMPILATION
24 noinst_DATA += gobject-2.0.lib
26 install_ms_lib_cmd = $(INSTALL) gobject-2.0.lib $(DESTDIR)$(libdir)
27 uninstall_ms_lib_cmd = -rm $(DESTDIR)$(libdir)/gobject-2.0.lib
35 $(uninstall_ms_lib_cmd)
38 no_undefined = -no-undefined
41 if OS_WIN32_AND_DLL_COMPILATION
42 gobject_win32_res = gobject-win32-res.o
43 gobject_win32_res_ldflag = -Wl,$(gobject_win32_res)
46 libgobjectincludedir = $(includedir)/glib-2.0/gobject
47 libgobject_2_0_la_LDFLAGS = $(GLIB_LINK_FLAGS) \
48 $(gobject_win32_res_ldflag) \
49 -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
50 -export-dynamic $(no_undefined)
52 libgobject_2_0_la_CFLAGS = $(AM_CFLAGS) $(LIBFFI_CFLAGS) $(GLIB_HIDDEN_VISIBILITY_CFLAGS)
54 libgobject_2_0_la_LIBADD = $(libglib) $(LIBFFI_LIBS)
56 libgobject_2_0_la_DEPENDENCIES = $(gobject_win32_res)
59 # setup source file variables
61 # GObject library header files for public installation
62 gobject_public_h_sources = \
83 # GObject library header files that don't get installed
84 gobject_private_h_sources = \
88 # GObject library C sources to build the library from
112 DTCOMPILE = $(patsubst -W%,,$(LTCOMPILE))
113 DTCFLAGS = $(patsubst -W%,,$(CFLAGS))
115 gobject_probes.h: gobject_probes.d
116 $(AM_V_GEN) $(DTRACE) -C -h -s $< -o $@.tmp
117 @$(SED) -e "s,define STAP_HAS_SEMAPHORES 1,undef STAP_HAS_SEMAPHORES," < $@.tmp > $@ && rm -f $@.tmp
119 gobject_probes.lo: gobject_probes.d
120 $(AM_V_GEN) env CC="$(DTCOMPILE)" CFLAGS="$(DTCFLAGS)" $(DTRACE) -G -s $< -o $@
122 BUILT_SOURCES += gobject_probes.h gobject_probes.lo
123 CLEANFILES += gobject_probes.h
124 libgobject_2_0_la_LIBADD += gobject_probes.lo
128 tapset_in_files = gobject.stp.in
129 tapsetdir = @ABS_TAPSET_DIR@
130 tapset_DATA = $(tapset_in_files:.stp.in=.stp)
131 EXTRA_DIST += $(tapset_in_files)
134 # non-header sources (headers should be specified in the above variables)
135 # that don't serve as direct make target sources, i.e. they don't have
136 # their own .lo rules and don't get publically installed
137 gobject_extra_sources = \
143 # setup GObject library sources and their dependancies
145 gobject_target_headers = $(gobject_public_h_sources)
146 gobject_target_sources = $(gobject_c_sources)
149 $(gobject_private_h_sources) \
150 $(gobject_extra_sources) \
151 marshal-genstrings.pl
153 # This is read by gobject-introspection/misc/ and gtk-doc
154 gobject-public-headers.txt: Makefile
155 $(AM_V_GEN) echo $(gobject_public_h_sources) > $@.tmp && mv $@.tmp $@
157 CLEANFILES += gobject-public-headers.txt
159 all-local: gobject-public-headers.txt
162 # rules to generate built sources
164 # setup autogeneration dependancies
165 gen_sources = xgen-gmh xgen-gmc xgen-gms
166 CLEANFILES += $(gen_sources)
168 # normal autogeneration rules
169 # all autogenerated files need to be generated in the srcdir,
170 # so old versions get remade and are not confused with newer
171 # versions in the build dir. thus a development setup requires
172 # srcdir to be writable, passing --disable-rebuilds to
173 # ../configure will supress all autogeneration rules.
176 gmarshal.strings: @REBUILD@ $(srcdir)/gmarshal.list
177 $(AM_V_GEN) grep '^[A-Z]' $(srcdir)/gmarshal.list \
178 | $(SED) -e 's/^/"g_cclosure_marshal_/' -e 's/:/__/' -e 's/,/_/g' -e 's/$$/",/' > xgen-gms \
179 && cp xgen-gms gmarshal.strings \
180 && rm -f xgen-gms xgen-gms~
182 glib-genmarshal.o: gmarshal.strings
185 libgobjectinclude_HEADERS = $(gobject_target_headers)
186 libgobject_2_0_la_SOURCES = $(gobject_target_sources)
189 # programs to compile and install
191 bin_PROGRAMS = gobject-query glib-genmarshal
192 bin_SCRIPTS = glib-mkenums
194 gobject_query_SOURCES = gobject-query.c
195 glib_genmarshal_SOURCES = glib-genmarshal.c
196 # link programs against libgobject
197 progs_LDADD = ./libgobject-2.0.la $(libglib)
198 glib_genmarshal_LDADD = $(libglib)
199 gobject_query_LDADD = $(progs_LDADD)
207 libgobject-gdb.py.in \
210 CLEANFILES += libgobject-gdb.py
212 BUILT_EXTRA_DIST += \
216 gobject-win32-res.o: gobject.rc
217 $(AM_V_GEN) $(WINDRES) gobject.rc $@
219 gobject-2.0.lib: libgobject-2.0.la gobject.def
220 lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgobject-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:$(builddir)/gobject.def -out:$@
222 dist-hook: $(BUILT_EXTRA_DIST) ../build/win32/vs9/gobject.vcproj ../build/win32/vs10/gobject.vcxproj ../build/win32/vs10/gobject.vcxproj.filters
223 files='$(BUILT_EXTRA_DIST)'; \
224 for f in $$files; do \
225 if test -f $$f; then d=.; else d=$(srcdir); fi; \
226 cp $$d/$$f $(distdir) || exit 1; done
228 ../build/win32/vs9/gobject.vcproj: $(top_srcdir)/build/win32/vs9/gobject.vcprojin
229 for F in $(libgobject_2_0_la_SOURCES); do \
231 *.c) echo ' <File RelativePath="..\..\..\gobject\'$$F'" />' \
234 done >libgobject.sourcefiles
235 $(CPP) -P - <$(top_srcdir)/build/win32/vs9/gobject.vcprojin >$@
236 rm libgobject.sourcefiles
238 ../build/win32/vs10/gobject.vcxproj: $(top_srcdir)/build/win32/vs10/gobject.vcxprojin
239 for F in $(libgobject_2_0_la_SOURCES); do \
241 *.c) echo ' <ClCompile Include="..\..\..\gobject\'$$F'" />' \
244 done >libgobject.vs10.sourcefiles
245 $(CPP) -P - <$(top_srcdir)/build/win32/vs10/gobject.vcxprojin >$@
246 rm libgobject.vs10.sourcefiles
248 ../build/win32/vs10/gobject.vcxproj.filters: $(top_srcdir)/build/win32/vs10/gobject.vcxproj.filtersin
249 for F in $(libgobject_2_0_la_SOURCES); do \
251 *.c) echo ' <ClCompile Include="..\..\..\gobject\'$$F'"><Filter>Source Files</Filter></ClCompile>' \
254 done >libgobject.vs10.sourcefiles.filters
255 $(CPP) -P - <$(top_srcdir)/build/win32/vs10/gobject.vcxproj.filtersin >$@
256 rm libgobject.vs10.sourcefiles.filters
258 install-data-local: install-ms-lib
260 uninstall-local: uninstall-ms-lib uninstall-gdb
263 if test $(srcdir) = .; then :; else \
264 rm -f $(BUILT_EXTRA_DIST); \
267 # install gdb scripts
268 gdbdir = $(datadir)/glib-2.0/gdb
269 dist_gdb_SCRIPTS = gobject.py
271 libgobject-gdb.py: libgobject-gdb.py.in
272 $(AM_V_GEN) $(SED) -e "s|\@datadir\@|$(datadir)|" $(srcdir)/libgobject-gdb.py.in > $(builddir)/libgobject-gdb.py
275 -rm -r $(DESTDIR)$(datadir)/gdb
277 install-data-hook: libgobject-gdb.py
278 mkdir -p $(DESTDIR)$(datadir)/gdb/auto-load/$(ABS_GLIB_RUNTIME_LIBDIR)
279 $(INSTALL) $(builddir)/libgobject-gdb.py $(DESTDIR)$(datadir)/gdb/auto-load/$(ABS_GLIB_RUNTIME_LIBDIR)/libgobject-2.0.so.0.$(LT_CURRENT).$(LT_REVISION)-gdb.py
280 if HAVE_GLIB_RUNTIME_LIBDIR
281 mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
282 mv $(DESTDIR)$(libdir)/libgobject-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
283 mv $(DESTDIR)$(libdir)/libgobject-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
284 rm -f $(DESTDIR)$(libdir)/libgobject-2.0.so
285 ln -s $(GLIB_RUNTIME_LIBDIR)/libgobject-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/libgobject-2.0.so