Drop binary checks when cross-compiling
[glib.git] / gobject / Makefile.am
blob72ad2cd7155459ac9d44acfc95cfa5aca9c5dc37
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
7 SUBDIRS = . tests
9 AM_CPPFLAGS =                                   \
10         -DG_LOG_DOMAIN=\"GLib-GObject\"         \
11         $(glib_INCLUDES)                        \
12         $(GLIB_DEBUG_FLAGS)                     \
13         -DGOBJECT_COMPILATION
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
23 if MS_LIB_AVAILABLE
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
28 endif
29 endif
31 install-ms-lib:
32         $(install_ms_lib_cmd)
34 uninstall-ms-lib:
35         $(uninstall_ms_lib_cmd)
37 if PLATFORM_WIN32
38 no_undefined = -no-undefined
39 endif
41 if OS_WIN32_AND_DLL_COMPILATION
42 gobject_win32_res = gobject-win32-res.o
43 gobject_win32_res_ldflag = -Wl,$(gobject_win32_res)
44 endif
46 libgobjectincludedir = $(includedir)/glib-2.0/gobject
47 libgobject_2_0_la_LDFLAGS = $(GLIB_LINK_FLAGS) \
48   $(GOBJECT_LINK_FLAGS) \
49   $(gobject_win32_res_ldflag) \
50   -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
51   -export-dynamic $(no_undefined)
53 libgobject_2_0_la_CFLAGS = $(AM_CFLAGS) $(LIBFFI_CFLAGS) $(GLIB_HIDDEN_VISIBILITY_CFLAGS)
55 libgobject_2_0_la_LIBADD = $(libglib) $(LIBFFI_LIBS)
57 libgobject_2_0_la_DEPENDENCIES = $(gobject_win32_res)
60 # setup source file variables
62 # GObject library header files for public installation
63 gobject_public_h_sources = \
64         gobject-autocleanups.h  \
65         glib-types.h            \
66         gbinding.h              \
67         gboxed.h                \
68         gclosure.h              \
69         genums.h                \
70         gmarshal.h              \
71         gobject.h               \
72         gparam.h                \
73         gparamspecs.h           \
74         gsignal.h               \
75         gsourceclosure.h        \
76         gtype.h                 \
77         gtypemodule.h           \
78         gtypeplugin.h           \
79         gvalue.h                \
80         gvaluearray.h           \
81         gvaluecollector.h       \
82         gvaluetypes.h           \
83         gobjectnotifyqueue.c
85 # GObject library header files that don't get installed
86 gobject_private_h_sources =     \
87         gatomicarray.h          \
88         gtype-private.h
90 # GObject library C sources to build the library from
91 gobject_c_sources = \
92         gobject_probes.d        \
93         gatomicarray.c          \
94         gbinding.c              \
95         gboxed.c                \
96         gclosure.c              \
97         genums.c                \
98         gmarshal.c              \
99         gobject.c               \
100         gobject_trace.h         \
101         gparam.c                \
102         gparamspecs.c           \
103         gsignal.c               \
104         gsourceclosure.c        \
105         gtype.c                 \
106         gtypemodule.c           \
107         gtypeplugin.c           \
108         gvalue.c                \
109         gvaluearray.c           \
110         gvaluetransform.c       \
111         gvaluetypes.c
113 if ENABLE_DTRACE
114 DTCOMPILE = $(patsubst -W%,,$(LTCOMPILE))
115 DTCFLAGS = $(patsubst -W%,,$(CFLAGS))
117 gobject_probes.h: gobject_probes.d
118         $(AM_V_GEN) $(DTRACE) -C -h -s $< -o $@.tmp
119         @$(SED) -e "s,define STAP_HAS_SEMAPHORES 1,undef STAP_HAS_SEMAPHORES," < $@.tmp > $@ && rm -f $@.tmp
121 gobject_probes.lo: gobject_probes.d
122         $(AM_V_GEN) env CC="$(DTCOMPILE)" CFLAGS="$(DTCFLAGS)" $(DTRACE) -G -s $< -o $@
124 BUILT_SOURCES += gobject_probes.h gobject_probes.lo
125 CLEANFILES += gobject_probes.h
126 libgobject_2_0_la_LIBADD += gobject_probes.lo
127 endif
129 if ENABLE_SYSTEMTAP
130 tapset_in_files = gobject.stp.in
131 tapsetdir   = @ABS_TAPSET_DIR@
132 tapset_DATA = $(tapset_in_files:.stp.in=.stp)
133 EXTRA_DIST += $(tapset_in_files)
134 endif
136 # non-header sources (headers should be specified in the above variables)
137 # that don't serve as direct make target sources, i.e. they don't have
138 # their own .lo rules and don't get publically installed
139 gobject_extra_sources = \
140         gmarshal.list           \
141         gmarshal.strings
145 # setup GObject library sources and their dependancies
147 gobject_target_headers = $(gobject_public_h_sources)
148 gobject_target_sources = $(gobject_c_sources)
149 EXTRA_HEADERS =
150 EXTRA_DIST += \
151         $(gobject_private_h_sources)    \
152         $(gobject_extra_sources)        \
153         marshal-genstrings.pl
155 # This is read by gobject-introspection/misc/ and gtk-doc
156 gobject-public-headers.txt: Makefile
157         $(AM_V_GEN) echo $(gobject_public_h_sources) > $@.tmp && mv $@.tmp $@
159 CLEANFILES += gobject-public-headers.txt
161 all-local: gobject-public-headers.txt
164 # rules to generate built sources
166 # setup autogeneration dependancies
167 gen_sources = xgen-gmh xgen-gmc xgen-gms
168 CLEANFILES += $(gen_sources)
170 # normal autogeneration rules
171 # all autogenerated files need to be generated in the srcdir,
172 # so old versions get remade and are not confused with newer
173 # versions in the build dir. thus a development setup requires
174 # srcdir to be writable, passing --disable-rebuilds to
175 # ../configure will supress all autogeneration rules.
178 gmarshal.strings: @REBUILD@ $(srcdir)/gmarshal.list
179         $(AM_V_GEN) grep '^[A-Z]' $(srcdir)/gmarshal.list \
180         | $(SED) -e 's/^/"g_cclosure_marshal_/' -e 's/:/__/' -e 's/,/_/g' -e 's/$$/",/' > xgen-gms \
181         && cp xgen-gms gmarshal.strings \
182         && rm -f xgen-gms xgen-gms~
184 glib-genmarshal.o: gmarshal.strings
186 # target platform:
187 libgobjectinclude_HEADERS = $(gobject_target_headers)
188 libgobject_2_0_la_SOURCES = $(gobject_target_sources)
191 # programs to compile and install
193 bin_PROGRAMS = gobject-query glib-genmarshal
194 bin_SCRIPTS = glib-mkenums
195 # source files
196 gobject_query_SOURCES = gobject-query.c
197 glib_genmarshal_SOURCES = glib-genmarshal.c
198 # link programs against libgobject
199 progs_LDADD = ./libgobject-2.0.la $(libglib)
200 glib_genmarshal_LDADD = $(libglib)
201 gobject_query_LDADD = $(progs_LDADD)
204 # auxillary files
206 EXTRA_DIST +=                   \
207         makefile.msc.in         \
208         gobject.rc.in           \
209         libgobject-gdb.py.in    \
210         glib-mkenums.in
212 CLEANFILES += libgobject-gdb.py
214 BUILT_EXTRA_DIST += \
215         makefile.msc            \
216         gobject.rc
218 gobject-win32-res.o: gobject.rc
219         $(AM_V_GEN) $(WINDRES) gobject.rc $@
221 gobject.def: libgobject-2.0.la
222         $(AM_V_GEN) dumpbin.exe -exports .libs/libgobject-2.0-0.dll | awk 'BEGIN { print "EXPORTS" } / +[[:digit:]]+ +[[:xdigit:]]+ +[[:xdigit:]]+/{ print $$4 }' > gobject.def.tmp && mv gobject.def.tmp gobject.def
224 gobject-2.0.lib: libgobject-2.0.la gobject.def
225         $(AM_V_GEN) lib.exe -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgobject-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:$(builddir)/gobject.def -out:$@
227 dist-hook: $(BUILT_EXTRA_DIST) ../build/win32/vs9/gobject.vcproj ../build/win32/vs10/gobject.vcxproj ../build/win32/vs10/gobject.vcxproj.filters
228         files='$(BUILT_EXTRA_DIST)'; \
229         for f in $$files; do \
230           if test -f $$f; then d=.; else d=$(srcdir); fi; \
231           cp $$d/$$f $(distdir) || exit 1; done
233 ../build/win32/vs9/gobject.vcproj: $(top_srcdir)/build/win32/vs9/gobject.vcprojin
234         for F in $(libgobject_2_0_la_SOURCES); do \
235                 case $$F in \
236                 *.c) echo '   <File RelativePath="..\..\..\gobject\'$$F'" />' \
237                      ;; \
238                 esac; \
239         done >libgobject.sourcefiles
240         $(CPP) -P - <$(top_srcdir)/build/win32/vs9/gobject.vcprojin >$@
241         rm libgobject.sourcefiles
243 ../build/win32/vs10/gobject.vcxproj: $(top_srcdir)/build/win32/vs10/gobject.vcxprojin
244         for F in $(libgobject_2_0_la_SOURCES); do \
245                 case $$F in \
246                 *.c) echo '    <ClCompile Include="..\..\..\gobject\'$$F'" />' \
247                      ;; \
248                 esac; \
249         done >libgobject.vs10.sourcefiles
250         $(CPP) -P - <$(top_srcdir)/build/win32/vs10/gobject.vcxprojin >$@
251         rm libgobject.vs10.sourcefiles
253 ../build/win32/vs10/gobject.vcxproj.filters: $(top_srcdir)/build/win32/vs10/gobject.vcxproj.filtersin
254         for F in $(libgobject_2_0_la_SOURCES); do \
255                 case $$F in \
256                 *.c) echo '    <ClCompile Include="..\..\..\gobject\'$$F'"><Filter>Source Files</Filter></ClCompile>' \
257                      ;; \
258                 esac; \
259         done >libgobject.vs10.sourcefiles.filters
260         $(CPP) -P - <$(top_srcdir)/build/win32/vs10/gobject.vcxproj.filtersin >$@
261         rm libgobject.vs10.sourcefiles.filters
263 install-data-local: install-ms-lib
265 uninstall-local: uninstall-ms-lib uninstall-gdb
267 distclean-local:
268         if test $(srcdir) = .; then :; else \
269             rm -f $(BUILT_EXTRA_DIST); \
270         fi
272 # install gdb scripts
273 gdbdir = $(datadir)/glib-2.0/gdb
274 dist_gdb_SCRIPTS = gobject.py
276 libgobject-gdb.py: libgobject-gdb.py.in
277         $(AM_V_GEN) $(SED) -e "s|\@datadir\@|$(datadir)|" $(srcdir)/libgobject-gdb.py.in > $(builddir)/libgobject-gdb.py
279 uninstall-gdb:
280         -rm -r $(DESTDIR)$(datadir)/gdb
282 install-data-hook: libgobject-gdb.py
283         mkdir -p $(DESTDIR)$(datadir)/gdb/auto-load/$(ABS_GLIB_RUNTIME_LIBDIR)
284         $(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
285 if HAVE_GLIB_RUNTIME_LIBDIR
286         mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
287         mv $(DESTDIR)$(libdir)/libgobject-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
288         mv $(DESTDIR)$(libdir)/libgobject-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
289         rm -f $(DESTDIR)$(libdir)/libgobject-2.0.so
290         ln -s $(GLIB_RUNTIME_LIBDIR)/libgobject-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/libgobject-2.0.so
291 endif