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