Add refcounted data
[glib.git] / glib / Makefile.am
blob8ec5f445453da5d8a6ab8baf2fba1e4c06d52d1a
1 ## Process this file with automake to produce Makefile.in
2 include $(top_srcdir)/glib.mk
5 # Generate glibconfig.h
7 # The timestamp of the stamp file is used to indicate if glibconfig.h is
8 # up to date with respect to config.status.  In the usual case, changes
9 # to config.status will not result in changes to glibconfig.h so we
10 # avoid touching its timestamp (in order not to rebuild the whole tree).
12 DISTCLEANFILES += glibconfig-stamp glibconfig.h
13 BUILT_SOURCES += glibconfig-stamp
14 configexecincludedir = $(libdir)/glib-2.0/include
15 nodist_configexecinclude_HEADERS = glibconfig.h
16 glibconfig-stamp: ../config.status
17         $(AM_V_GEN) cd $(top_builddir) && \
18           $(SHELL) ./config.status glib/glibconfig.h
19         @touch glibconfig-stamp
23 if HAVE_GOOD_PRINTF
24 else
25 PRINTF_SUBDIR = gnulib
26 printf_la = gnulib/libgnulib.la
27 endif 
29 if USE_SYSTEM_PCRE
30 else
31 MAYBE_PCRE = pcre 
32 endif
34 SUBDIRS = libcharset $(PRINTF_SUBDIR) $(MAYBE_PCRE) update-pcre . tests
35 DIST_SUBDIRS = libcharset gnulib pcre update-pcre tests
37 AM_CPPFLAGS =                           \
38         $(glib_INCLUDES)                \
39         $(pcre_inc)                     \
40         -DG_LOG_DOMAIN=\"GLib\"         \
41         $(GLIB_DEBUG_FLAGS)             \
42         -DGLIB_COMPILATION              \
43         -DPCRE_STATIC
45 AM_CFLAGS = $(GLIB_WARN_CFLAGS)
47 MIRRORING_TAB_SOURCE =                          \
48         glib-mirroring-tab/Makefile             \
49         glib-mirroring-tab/gen-mirroring-tab.c  \
50         glib-mirroring-tab/packtab.h            \
51         glib-mirroring-tab/packtab.c
53 # The compilation of GRegex can be disabled, but the source files must
54 # be distributed.
55 EXTRA_DIST +=                   \
56         glib.rc.in              \
57         gen-unicode-tables.pl   \
58         gregex.c                \
59         gregex.h                \
60         win_iconv.c             \
61         libglib-gdb.py.in       \
62         docs.c                  \
63         gconstructor.h          \
64         $(MIRRORING_TAB_SOURCE)
66 CLEANFILES += libglib-gdb.py
68 # These may be in the builddir too
69 BUILT_EXTRA_DIST +=             \
70         glib.rc
72 lib_LTLIBRARIES = libglib-2.0.la
74 if OS_WIN32_AND_DLL_COMPILATION
75 if MS_LIB_AVAILABLE
76 noinst_DATA += glib-2.0.lib
78 install_ms_lib_cmd = $(INSTALL) glib-2.0.lib $(DESTDIR)$(libdir)
79 uninstall_ms_lib_cmd = -rm $(DESTDIR)$(libdir)/glib-2.0.lib
80 endif
81 endif
83 install-ms-lib:
84         $(install_ms_lib_cmd)
86 uninstall-ms-lib:
87         $(uninstall_ms_lib_cmd)
89 deprecated_sources = \
90         deprecated/gallocator.c         \
91         deprecated/gcache.c             \
92         deprecated/gcompletion.c        \
93         deprecated/grel.c               \
94         deprecated/gthread-deprecated.c
96 libglib_2_0_la_SOURCES =        \
97         $(deprecated_sources)   \
98         glib_probes.d           \
99         garray.c                \
100         gasyncqueue.c           \
101         gasyncqueueprivate.h    \
102         gatomic.c               \
103         gbacktrace.c            \
104         gbase64.c               \
105         gbitlock.c              \
106         gbookmarkfile.c         \
107         gbsearcharray.h         \
108         gbytes.c                \
109         gbytes.h                \
110         gcharset.c              \
111         gcharsetprivate.h       \
112         gchecksum.c             \
113         gconvert.c              \
114         gdataset.c              \
115         gdatasetprivate.h       \
116         gdate.c                 \
117         gdatetime.c             \
118         gdir.c                  \
119         genviron.c              \
120         gerror.c                \
121         gfileutils.c            \
122         ggettext.c              \
123         ghash.c                 \
124         ghmac.c                 \
125         ghook.c                 \
126         ghostutils.c            \
127         giochannel.c            \
128         gkeyfile.c              \
129         glibintl.h              \
130         glib_trace.h            \
131         glib-init.h             \
132         glib-init.c             \
133         glib-private.h          \
134         glib-private.c          \
135         glist.c                 \
136         gmain-internal.h        \
137         gmain.c                 \
138         gmappedfile.c           \
139         gmarkup.c               \
140         gmem.c                  \
141         gmessages.c             \
142         gmirroringtable.h       \
143         gnode.c                 \
144         goption.c               \
145         gpattern.c              \
146         gpoll.c                 \
147         gprimes.c               \
148         gqsort.c                \
149         gquark.c                \
150         gqueue.c                \
151         grand.c                 \
152         grcbox.c                \
153         grefcount.c             \
154         gregex.c                \
155         gscanner.c              \
156         gscripttable.h          \
157         gsequence.c             \
158         gshell.c                \
159         gslice.c                \
160         gslist.c                \
161         gstdio.c                \
162         gstdioprivate.h         \
163         gstrfuncs.c             \
164         gstring.c               \
165         gstringchunk.c          \
166         gtestutils.c            \
167         gthread.c               \
168         gthreadprivate.h        \
169         gthreadpool.c           \
170         gtimer.c                \
171         gtimezone.c             \
172         gtranslit.c             \
173         gtranslit-data.h        \
174         gtrashstack.c           \
175         gtree.c                 \
176         guniprop.c              \
177         gutf8.c                 \
178         gunibreak.h             \
179         gunibreak.c             \
180         gunichartables.h        \
181         gunicollate.c           \
182         gunicomp.h              \
183         gunidecomp.h            \
184         gunidecomp.c            \
185         gunicodeprivate.h       \
186         gurifuncs.c             \
187         gutils.c                \
188         guuid.c                 \
189         gvalgrind.h             \
190         gvariant.h              \
191         gvariant.c              \
192         gvariant-core.h         \
193         gvariant-core.c         \
194         gvariant-internal.h     \
195         gvariant-parser.c       \
196         gvariant-serialiser.h   \
197         gvariant-serialiser.c   \
198         gvarianttypeinfo.h      \
199         gvarianttypeinfo.c      \
200         gvarianttype.c          \
201         gversion.c              \
202         gwakeup.h               \
203         gwakeup.c               \
204         gprintf.c               \
205         gprintfint.h            \
206         valgrind.h
208 if OS_UNIX
209 libglib_2_0_la_SOURCES += glib-unix.c
210 endif
212 if THREADS_WIN32
213 libglib_2_0_la_SOURCES += gthread-win32.c
214 else
215 if THREADS_POSIX
216 libglib_2_0_la_SOURCES += gthread-posix.c
217 endif
218 endif
220 EXTRA_libglib_2_0_la_SOURCES = \
221         giounix.c       \
222         giowin32.c      \
223         gspawn.c        \
224         gspawn-private.h \
225         gspawn-win32.c  \
226         gwin32.c
228 glibincludedir=$(includedir)/glib-2.0
229 glibinclude_HEADERS =   \
230         glib-unix.h     \
231         glib-object.h   \
232         glib.h
234 deprecatedincludedir=$(includedir)/glib-2.0/glib/deprecated
235 deprecatedinclude_HEADERS = \
236         deprecated/gallocator.h         \
237         deprecated/gcache.h             \
238         deprecated/gcompletion.h        \
239         deprecated/gmain.h              \
240         deprecated/grel.h               \
241         deprecated/gthread.h
243 glibsubincludedir=$(includedir)/glib-2.0/glib
244 glibsubinclude_HEADERS = \
245         glib-autocleanups.h     \
246         galloca.h       \
247         garray.h        \
248         gasyncqueue.h   \
249         gatomic.h       \
250         gbacktrace.h    \
251         gbase64.h       \
252         gbitlock.h      \
253         gbookmarkfile.h \
254         gbytes.h        \
255         gcharset.h      \
256         gchecksum.h     \
257         gconvert.h      \
258         gdataset.h      \
259         gdate.h         \
260         gdatetime.h     \
261         gdir.h          \
262         genviron.h      \
263         gerror.h        \
264         gfileutils.h    \
265         ggettext.h      \
266         ghash.h         \
267         ghmac.h         \
268         ghook.h         \
269         ghostutils.h    \
270         gi18n.h         \
271         gi18n-lib.h     \
272         giochannel.h    \
273         gkeyfile.h      \
274         glist.h         \
275         gmacros.h       \
276         gmain.h         \
277         gmappedfile.h   \
278         gmarkup.h       \
279         gmem.h          \
280         gmessages.h     \
281         gnode.h         \
282         goption.h       \
283         gpattern.h      \
284         gpoll.h         \
285         gprimes.h       \
286         gqsort.h        \
287         gquark.h        \
288         gqueue.h        \
289         grand.h         \
290         grcbox.h        \
291         grefcount.h     \
292         gregex.h        \
293         gscanner.h      \
294         gsequence.h     \
295         gshell.h        \
296         gslice.h        \
297         gslist.h        \
298         gspawn.h        \
299         gstdio.h        \
300         gstrfuncs.h     \
301         gtestutils.h    \
302         gstring.h       \
303         gstringchunk.h  \
304         gthread.h       \
305         gthreadpool.h   \
306         gtimer.h        \
307         gtimezone.h     \
308         gtrashstack.h   \
309         gtree.h         \
310         gtypes.h        \
311         gunicode.h      \
312         gurifuncs.h     \
313         gutils.h        \
314         guuid.h         \
315         gvarianttype.h  \
316         gvariant.h      \
317         gversion.h      \
318         gversionmacros.h \
319         gwin32.h        \
320         gprintf.h
322 # This is read by gobject-introspection/misc/ and gtk-doc
323 glib-public-headers.txt: Makefile
324         $(AM_V_GEN) echo $(glibinclude_HEADERS) $(glibsubinclude_HEADERS) > $@.tmp && mv $@.tmp $@
326 CLEANFILES += glib-public-headers.txt
328 all-local: glib-public-headers.txt
330 install-data-local: install-ms-lib
331         @if test -f $(glibincludedir)/glist.h ; then                                    \
332           echo "*** Old headers found in $(glibincludedir). You should remove the" ;    \
333           echo "*** contents of this directory and type 'make install' again." ;        \
334           false ;                                                                       \
335         fi
337 uninstall-local: uninstall-ms-lib uninstall-gdb
339 if PLATFORM_WIN32
340 no_undefined = -no-undefined
341 endif
343 if OS_WIN32_AND_DLL_COMPILATION
344 glib_win32_res = glib-win32-res.o
345 glib_win32_res_ldflag = -Wl,$(glib_win32_res)
346 endif
348 if USE_SYSTEM_PCRE
349 pcre_lib = $(PCRE_LIBS)
350 pcre_inc = $(PCRE_CFLAGS)
351 else
352 pcre_lib = pcre/libpcre.la
353 pcre_inc =
354 endif
356 libglib_2_0_la_CFLAGS = $(AM_CFLAGS) $(GLIB_HIDDEN_VISIBILITY_CFLAGS) $(LIBSYSTEMD_CFLAGS)
357 libglib_2_0_la_LIBADD = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ @ICONV_LIBS@ @G_LIBS_EXTRA@ $(pcre_lib) $(G_THREAD_LIBS_EXTRA) $(G_THREAD_LIBS_FOR_GTHREAD) $(LIBSYSTEMD_LIBS)
358 libglib_2_0_la_DEPENDENCIES = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ $(glib_win32_res) $(glib_def)
360 libglib_2_0_la_LDFLAGS = $(GLIB_LINK_FLAGS) \
361          $(glib_win32_res_ldflag) \
362         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
363         -export-dynamic $(no_undefined)
365 INSTALL_PROGS=
367 if ENABLE_DTRACE
368 glib_probes.h: glib_probes.d
369         $(AM_V_GEN) $(DTRACE) -C -h -s $< -o $@.tmp
370         @$(SED) \
371                 -e "s,define STAP_HAS_SEMAPHORES 1,undef STAP_HAS_SEMAPHORES," \
372                 -e "s,define _SDT_HAS_SEMAPHORES 1,undef _SDT_HAS_SEMAPHORES," \
373                 < $@.tmp > $@ && rm -f $@.tmp
375 glib_probes.lo: glib_probes.d
376         $(AM_V_GEN) $(LIBTOOL) --mode=compile $(AM_V_lt) --tag=CC $(DTRACE) -G -s $< -o $@
378 BUILT_SOURCES += glib_probes.h glib_probes.lo
379 CLEANFILES += glib_probes.h glib_probes.h.tmp
380 libglib_2_0_la_LIBADD += glib_probes.lo
381 endif
383 tapsetdir   = @ABS_TAPSET_DIR@
384 EXTRA_DIST += glib.stp.in
386 if ENABLE_SYSTEMTAP
387 tapset_DATA = libglib-2.0.so.0.@LT_CURRENT@.@LT_REVISION@.stp
388 CLEANFILES += $(tapset_DATA)
390 $(tapset_DATA): glib.stp.in Makefile
391         $(AM_V_GEN)$(SED) \
392                 -e 's|[@]ABS_GLIB_RUNTIME_LIBDIR[@]|$(ABS_GLIB_RUNTIME_LIBDIR)|g' \
393                 -e 's|[@]LT_CURRENT[@]|$(LT_CURRENT)|g' \
394                 -e 's|[@]LT_REVISION[@]|$(LT_REVISION)|g' \
395                 $< > $@
396 endif
398 gspawn-win32-helper-console.c:
399         echo '#define HELPER_CONSOLE' >$@
400         echo '#include "gspawn-win32-helper.c"' >>$@
402 gspawn-win64-helper.c:
403         echo '#include "gspawn-win32-helper.c"' >$@
405 gspawn-win64-helper-console.c:
406         echo '#define HELPER_CONSOLE' >$@
407         echo '#include "gspawn-win32-helper.c"' >>$@
410 if OS_WIN32
411 if OS_WIN32_X64
412 INSTALL_PROGS += gspawn-win64-helper gspawn-win64-helper-console
413 gspawn_win64_helper_LDADD = libglib-2.0.la
414 gspawn_win64_helper_LDFLAGS = -mwindows
415 gspawn_win64_helper_console_LDADD = libglib-2.0.la
416 else
417 INSTALL_PROGS += gspawn-win32-helper gspawn-win32-helper-console
418 gspawn_win32_helper_LDADD = libglib-2.0.la
419 gspawn_win32_helper_LDFLAGS = -mwindows
420 gspawn_win32_helper_console_LDADD = libglib-2.0.la
421 endif
422 endif
424 glib-win32-res.o: glib.rc
425         $(WINDRES) glib.rc $@
427 bin_PROGRAMS     = ${INSTALL_PROGS}
429 if OS_UNIX
431 INSTALL_PROGS   += gtester
432 gtester_SOURCES  = gtester.c
433 gtester_LDADD    = libglib-2.0.la 
435 auto_config_binscripts = gtester-report
436 bin_SCRIPTS = ${auto_config_binscripts}
437 EXTRA_DIST += ${auto_config_binscripts}
439 CONFIGVARS = \
440         "bindir"        : "${bindir}",          \
441         "glib-version"  : "${GLIB_VERSION}"
443 install-exec-hook:
444         for sf in ${auto_config_binscripts} ; do \
445           mv -f "$(DESTDIR)$(bindir)/$$sf" "$(DESTDIR)$(bindir)/$$sf".tmp \
446           && sed < "$(DESTDIR)$(bindir)/$$sf".tmp > "$(DESTDIR)$(bindir)/$$sf" \
447             -e '1,24s|^ *#@PKGINSTALL_CONFIGVARS_IN24LINES@|  ${CONFIGVARS}|' \
448             -e '1,1s|#! /usr/bin/env python.*|#!${PYTHON}|' \
449           || exit $$? ; \
450           chmod a+x $(DESTDIR)$(bindir)/$$sf ; \
451           rm -f "$(DESTDIR)$(bindir)/$$sf".tmp ; \
452         done
454 endif
456 glib.def: libglib-2.0.la
457         $(AM_V_GEN) dumpbin.exe -exports .libs/libglib-2.0-0.dll | awk 'BEGIN { print "EXPORTS" } / +[[:digit:]]+ +[[:xdigit:]]+ +[[:xdigit:]]+/{ print $$4 }' > glib.def.tmp && mv glib.def.tmp glib.def
459 glib-2.0.lib: libglib-2.0.la glib.def
460         $(AM_V_GEN) lib.exe -machine:@LIB_EXE_MACHINE_FLAG@ -name:libglib-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:$(builddir)/glib.def -out:$@
462 dist-hook: $(BUILT_EXTRA_DIST)
463         files='$(BUILT_EXTRA_DIST)'; \
464         for f in $$files; do \
465           if test -f $$f; then d=.; else d=$(srcdir); fi; \
466           cp $$d/$$f $(distdir) || exit 1; done
468 # install gdb scripts
469 gdbdir = $(datadir)/glib-2.0/gdb
470 dist_gdb_DATA = glib_gdb.py
472 all-local: libglib-gdb.py
473 libglib-gdb.py: libglib-gdb.py.in
474         $(AM_V_GEN) $(SED) -e "s|\@datadir\@|$(datadir)|" $(srcdir)/libglib-gdb.py.in > $(builddir)/libglib-gdb.py
476 if HAVE_GLIB_RUNTIME_LIBDIR
477 ABS_GLIB_RUNTIME_LIBDIR = $(realpath $(libdir)/$(GLIB_RUNTIME_LIBDIR))
478 else
479 ABS_GLIB_RUNTIME_LIBDIR = $(libdir)
480 endif
482 install-data-hook: libglib-gdb.py
483         mkdir -p $(DESTDIR)$(datadir)/gdb/auto-load$(ABS_GLIB_RUNTIME_LIBDIR)
484         $(INSTALL) $(builddir)/libglib-gdb.py $(DESTDIR)$(datadir)/gdb/auto-load$(ABS_GLIB_RUNTIME_LIBDIR)/libglib-2.0.so.0.$(LT_CURRENT).$(LT_REVISION)-gdb.py
485 if HAVE_GLIB_RUNTIME_LIBDIR
486         mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
487         mv $(DESTDIR)$(libdir)/libglib-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
488         mv $(DESTDIR)$(libdir)/libglib-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
489         rm -f $(DESTDIR)$(libdir)/libglib-2.0.so
490         ln -s $(GLIB_RUNTIME_LIBDIR)/libglib-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/libglib-2.0.so
491 endif
493 uninstall-gdb:
494         -rm -r $(DESTDIR)$(datadir)/gdb