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