docs: Ditch more markup
[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 DTCOMPILE = $(patsubst -W%,,$(LTCOMPILE))
113 DTCFLAGS = $(patsubst -W%,,$(CFLAGS))
114
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
118
119 gobject_probes.lo: gobject_probes.d
120         $(AM_V_GEN) env CC="$(DTCOMPILE)" CFLAGS="$(DTCFLAGS)" $(DTRACE) -G -s $< -o $@
121
122 BUILT_SOURCES += gobject_probes.h gobject_probes.lo
123 CLEANFILES += gobject_probes.h
124 libgobject_2_0_la_LIBADD += gobject_probes.lo
125 endif
126
127 if ENABLE_SYSTEMTAP
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)
132 endif
133
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 = \
138         gmarshal.list           \
139         gmarshal.strings
140
141
142 #
143 # setup GObject library sources and their dependancies
144 #
145 gobject_target_headers = $(gobject_public_h_sources)
146 gobject_target_sources = $(gobject_c_sources)
147 EXTRA_HEADERS =
148 EXTRA_DIST += \
149         $(gobject_private_h_sources)    \
150         $(gobject_extra_sources)        \
151         marshal-genstrings.pl
152
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 $@
156
157 CLEANFILES += gobject-public-headers.txt
158
159 all-local: gobject-public-headers.txt
160
161 #
162 # rules to generate built sources
163 #
164 # setup autogeneration dependancies
165 gen_sources = xgen-gmh xgen-gmc xgen-gms
166 CLEANFILES += $(gen_sources)
167
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.
174
175
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~
181
182 glib-genmarshal.o: gmarshal.strings
183
184 # target platform:
185 libgobjectinclude_HEADERS = $(gobject_target_headers)
186 libgobject_2_0_la_SOURCES = $(gobject_target_sources)
187
188 #
189 # programs to compile and install
190 #
191 bin_PROGRAMS = gobject-query glib-genmarshal
192 bin_SCRIPTS = glib-mkenums
193 # source files
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)
200
201 #
202 # auxillary files
203 #
204 EXTRA_DIST +=                   \
205         makefile.msc.in         \
206         gobject.rc.in           \
207         libgobject-gdb.py.in    \
208         glib-mkenums.in
209
210 CLEANFILES += libgobject-gdb.py
211
212 BUILT_EXTRA_DIST += \
213         makefile.msc            \
214         gobject.rc
215
216 gobject-win32-res.o: gobject.rc
217         $(AM_V_GEN) $(WINDRES) gobject.rc $@
218
219 gobject.def: libgobject-2.0.la
220         $(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
221
222 gobject-2.0.lib: libgobject-2.0.la gobject.def
223         $(AM_V_GEN) lib.exe -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgobject-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:$(builddir)/gobject.def -out:$@
224
225 dist-hook: $(BUILT_EXTRA_DIST) ../build/win32/vs9/gobject.vcproj ../build/win32/vs10/gobject.vcxproj ../build/win32/vs10/gobject.vcxproj.filters
226         files='$(BUILT_EXTRA_DIST)'; \
227         for f in $$files; do \
228           if test -f $$f; then d=.; else d=$(srcdir); fi; \
229           cp $$d/$$f $(distdir) || exit 1; done
230
231 ../build/win32/vs9/gobject.vcproj: $(top_srcdir)/build/win32/vs9/gobject.vcprojin
232         for F in $(libgobject_2_0_la_SOURCES); do \
233                 case $$F in \
234                 *.c) echo '   <File RelativePath="..\..\..\gobject\'$$F'" />' \
235                      ;; \
236                 esac; \
237         done >libgobject.sourcefiles
238         $(CPP) -P - <$(top_srcdir)/build/win32/vs9/gobject.vcprojin >$@
239         rm libgobject.sourcefiles
240
241 ../build/win32/vs10/gobject.vcxproj: $(top_srcdir)/build/win32/vs10/gobject.vcxprojin
242         for F in $(libgobject_2_0_la_SOURCES); do \
243                 case $$F in \
244                 *.c) echo '    <ClCompile Include="..\..\..\gobject\'$$F'" />' \
245                      ;; \
246                 esac; \
247         done >libgobject.vs10.sourcefiles
248         $(CPP) -P - <$(top_srcdir)/build/win32/vs10/gobject.vcxprojin >$@
249         rm libgobject.vs10.sourcefiles
250
251 ../build/win32/vs10/gobject.vcxproj.filters: $(top_srcdir)/build/win32/vs10/gobject.vcxproj.filtersin
252         for F in $(libgobject_2_0_la_SOURCES); do \
253                 case $$F in \
254                 *.c) echo '    <ClCompile Include="..\..\..\gobject\'$$F'"><Filter>Source Files</Filter></ClCompile>' \
255                      ;; \
256                 esac; \
257         done >libgobject.vs10.sourcefiles.filters
258         $(CPP) -P - <$(top_srcdir)/build/win32/vs10/gobject.vcxproj.filtersin >$@
259         rm libgobject.vs10.sourcefiles.filters
260
261 install-data-local: install-ms-lib
262
263 uninstall-local: uninstall-ms-lib uninstall-gdb
264
265 distclean-local:
266         if test $(srcdir) = .; then :; else \
267             rm -f $(BUILT_EXTRA_DIST); \
268         fi
269
270 # install gdb scripts
271 gdbdir = $(datadir)/glib-2.0/gdb
272 dist_gdb_SCRIPTS = gobject.py
273
274 libgobject-gdb.py: libgobject-gdb.py.in
275         $(AM_V_GEN) $(SED) -e "s|\@datadir\@|$(datadir)|" $(srcdir)/libgobject-gdb.py.in > $(builddir)/libgobject-gdb.py
276
277 uninstall-gdb:
278         -rm -r $(DESTDIR)$(datadir)/gdb
279
280 install-data-hook: libgobject-gdb.py
281         mkdir -p $(DESTDIR)$(datadir)/gdb/auto-load/$(ABS_GLIB_RUNTIME_LIBDIR)
282         $(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
283 if HAVE_GLIB_RUNTIME_LIBDIR
284         mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
285         mv $(DESTDIR)$(libdir)/libgobject-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
286         mv $(DESTDIR)$(libdir)/libgobject-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
287         rm -f $(DESTDIR)$(libdir)/libgobject-2.0.so
288         ln -s $(GLIB_RUNTIME_LIBDIR)/libgobject-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/libgobject-2.0.so
289 endif