Merge branch 'doc-types' into 'master'
[glib.git] / glib / Makefile.am
blob7252a67d07b6e088589d3c5a10369ec2170c46a6
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         grefcount.c             \
153         gregex.c                \
154         gscanner.c              \
155         gscripttable.h          \
156         gsequence.c             \
157         gshell.c                \
158         gslice.c                \
159         gslist.c                \
160         gstdio.c                \
161         gstdioprivate.h         \
162         gstrfuncs.c             \
163         gstring.c               \
164         gstringchunk.c          \
165         gtestutils.c            \
166         gthread.c               \
167         gthreadprivate.h        \
168         gthreadpool.c           \
169         gtimer.c                \
170         gtimezone.c             \
171         gtranslit.c             \
172         gtranslit-data.h        \
173         gtrashstack.c           \
174         gtree.c                 \
175         guniprop.c              \
176         gutf8.c                 \
177         gunibreak.h             \
178         gunibreak.c             \
179         gunichartables.h        \
180         gunicollate.c           \
181         gunicomp.h              \
182         gunidecomp.h            \
183         gunidecomp.c            \
184         gunicodeprivate.h       \
185         gurifuncs.c             \
186         gutils.c                \
187         guuid.c                 \
188         gvalgrind.h             \
189         gvariant.h              \
190         gvariant.c              \
191         gvariant-core.h         \
192         gvariant-core.c         \
193         gvariant-internal.h     \
194         gvariant-parser.c       \
195         gvariant-serialiser.h   \
196         gvariant-serialiser.c   \
197         gvarianttypeinfo.h      \
198         gvarianttypeinfo.c      \
199         gvarianttype.c          \
200         gversion.c              \
201         gwakeup.h               \
202         gwakeup.c               \
203         gprintf.c               \
204         gprintfint.h            \
205         valgrind.h
207 if OS_UNIX
208 libglib_2_0_la_SOURCES += glib-unix.c
209 endif
211 if THREADS_WIN32
212 libglib_2_0_la_SOURCES += gthread-win32.c
213 else
214 if THREADS_POSIX
215 libglib_2_0_la_SOURCES += gthread-posix.c
216 endif
217 endif
219 EXTRA_libglib_2_0_la_SOURCES = \
220         giounix.c       \
221         giowin32.c      \
222         gspawn.c        \
223         gspawn-private.h \
224         gspawn-win32.c  \
225         gwin32.c
227 glibincludedir=$(includedir)/glib-2.0
228 glibinclude_HEADERS =   \
229         glib-unix.h     \
230         glib-object.h   \
231         glib.h
233 deprecatedincludedir=$(includedir)/glib-2.0/glib/deprecated
234 deprecatedinclude_HEADERS = \
235         deprecated/gallocator.h         \
236         deprecated/gcache.h             \
237         deprecated/gcompletion.h        \
238         deprecated/gmain.h              \
239         deprecated/grel.h               \
240         deprecated/gthread.h
242 glibsubincludedir=$(includedir)/glib-2.0/glib
243 glibsubinclude_HEADERS = \
244         glib-autocleanups.h     \
245         galloca.h       \
246         garray.h        \
247         gasyncqueue.h   \
248         gatomic.h       \
249         gbacktrace.h    \
250         gbase64.h       \
251         gbitlock.h      \
252         gbookmarkfile.h \
253         gbytes.h        \
254         gcharset.h      \
255         gchecksum.h     \
256         gconvert.h      \
257         gdataset.h      \
258         gdate.h         \
259         gdatetime.h     \
260         gdir.h          \
261         genviron.h      \
262         gerror.h        \
263         gfileutils.h    \
264         ggettext.h      \
265         ghash.h         \
266         ghmac.h         \
267         ghook.h         \
268         ghostutils.h    \
269         gi18n.h         \
270         gi18n-lib.h     \
271         giochannel.h    \
272         gkeyfile.h      \
273         glist.h         \
274         gmacros.h       \
275         gmain.h         \
276         gmappedfile.h   \
277         gmarkup.h       \
278         gmem.h          \
279         gmessages.h     \
280         gnode.h         \
281         goption.h       \
282         gpattern.h      \
283         gpoll.h         \
284         gprimes.h       \
285         gqsort.h        \
286         gquark.h        \
287         gqueue.h        \
288         grand.h         \
289         grefcount.h     \
290         gregex.h        \
291         gscanner.h      \
292         gsequence.h     \
293         gshell.h        \
294         gslice.h        \
295         gslist.h        \
296         gspawn.h        \
297         gstdio.h        \
298         gstrfuncs.h     \
299         gtestutils.h    \
300         gstring.h       \
301         gstringchunk.h  \
302         gthread.h       \
303         gthreadpool.h   \
304         gtimer.h        \
305         gtimezone.h     \
306         gtrashstack.h   \
307         gtree.h         \
308         gtypes.h        \
309         gunicode.h      \
310         gurifuncs.h     \
311         gutils.h        \
312         guuid.h         \
313         gvarianttype.h  \
314         gvariant.h      \
315         gversion.h      \
316         gversionmacros.h \
317         gwin32.h        \
318         gprintf.h
320 # This is read by gobject-introspection/misc/ and gtk-doc
321 glib-public-headers.txt: Makefile
322         $(AM_V_GEN) echo $(glibinclude_HEADERS) $(glibsubinclude_HEADERS) > $@.tmp && mv $@.tmp $@
324 CLEANFILES += glib-public-headers.txt
326 all-local: glib-public-headers.txt
328 install-data-local: install-ms-lib
329         @if test -f $(glibincludedir)/glist.h ; then                                    \
330           echo "*** Old headers found in $(glibincludedir). You should remove the" ;    \
331           echo "*** contents of this directory and type 'make install' again." ;        \
332           false ;                                                                       \
333         fi
335 uninstall-local: uninstall-ms-lib uninstall-gdb
337 if PLATFORM_WIN32
338 no_undefined = -no-undefined
339 endif
341 if OS_WIN32_AND_DLL_COMPILATION
342 glib_win32_res = glib-win32-res.o
343 glib_win32_res_ldflag = -Wl,$(glib_win32_res)
344 endif
346 if USE_SYSTEM_PCRE
347 pcre_lib = $(PCRE_LIBS)
348 pcre_inc = $(PCRE_CFLAGS)
349 else
350 pcre_lib = pcre/libpcre.la
351 pcre_inc =
352 endif
354 libglib_2_0_la_CFLAGS = $(AM_CFLAGS) $(GLIB_HIDDEN_VISIBILITY_CFLAGS) $(LIBSYSTEMD_CFLAGS)
355 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)
356 libglib_2_0_la_DEPENDENCIES = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ $(glib_win32_res) $(glib_def)
358 libglib_2_0_la_LDFLAGS = $(GLIB_LINK_FLAGS) \
359          $(glib_win32_res_ldflag) \
360         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
361         -export-dynamic $(no_undefined)
363 INSTALL_PROGS=
365 if ENABLE_DTRACE
366 glib_probes.h: glib_probes.d
367         $(AM_V_GEN) $(DTRACE) -C -h -s $< -o $@.tmp
368         @$(SED) \
369                 -e "s,define STAP_HAS_SEMAPHORES 1,undef STAP_HAS_SEMAPHORES," \
370                 -e "s,define _SDT_HAS_SEMAPHORES 1,undef _SDT_HAS_SEMAPHORES," \
371                 < $@.tmp > $@ && rm -f $@.tmp
373 glib_probes.lo: glib_probes.d
374         $(AM_V_GEN) $(LIBTOOL) --mode=compile $(AM_V_lt) --tag=CC $(DTRACE) -G -s $< -o $@
376 BUILT_SOURCES += glib_probes.h glib_probes.lo
377 CLEANFILES += glib_probes.h glib_probes.h.tmp
378 libglib_2_0_la_LIBADD += glib_probes.lo
379 endif
381 tapsetdir   = @ABS_TAPSET_DIR@
382 EXTRA_DIST += glib.stp.in
384 if ENABLE_SYSTEMTAP
385 tapset_DATA = libglib-2.0.so.0.@LT_CURRENT@.@LT_REVISION@.stp
386 CLEANFILES += $(tapset_DATA)
388 $(tapset_DATA): glib.stp.in Makefile
389         $(AM_V_GEN)$(SED) \
390                 -e 's|[@]ABS_GLIB_RUNTIME_LIBDIR[@]|$(ABS_GLIB_RUNTIME_LIBDIR)|g' \
391                 -e 's|[@]LT_CURRENT[@]|$(LT_CURRENT)|g' \
392                 -e 's|[@]LT_REVISION[@]|$(LT_REVISION)|g' \
393                 $< > $@
394 endif
396 gspawn-win32-helper-console.c:
397         echo '#define HELPER_CONSOLE' >$@
398         echo '#include "gspawn-win32-helper.c"' >>$@
400 gspawn-win64-helper.c:
401         echo '#include "gspawn-win32-helper.c"' >$@
403 gspawn-win64-helper-console.c:
404         echo '#define HELPER_CONSOLE' >$@
405         echo '#include "gspawn-win32-helper.c"' >>$@
408 if OS_WIN32
409 if OS_WIN32_X64
410 INSTALL_PROGS += gspawn-win64-helper gspawn-win64-helper-console
411 gspawn_win64_helper_LDADD = libglib-2.0.la
412 gspawn_win64_helper_LDFLAGS = -mwindows
413 gspawn_win64_helper_console_LDADD = libglib-2.0.la
414 else
415 INSTALL_PROGS += gspawn-win32-helper gspawn-win32-helper-console
416 gspawn_win32_helper_LDADD = libglib-2.0.la
417 gspawn_win32_helper_LDFLAGS = -mwindows
418 gspawn_win32_helper_console_LDADD = libglib-2.0.la
419 endif
420 endif
422 glib-win32-res.o: glib.rc
423         $(WINDRES) glib.rc $@
425 bin_PROGRAMS     = ${INSTALL_PROGS}
427 if OS_UNIX
429 INSTALL_PROGS   += gtester
430 gtester_SOURCES  = gtester.c
431 gtester_LDADD    = libglib-2.0.la 
433 auto_config_binscripts = gtester-report
434 bin_SCRIPTS = ${auto_config_binscripts}
435 EXTRA_DIST += ${auto_config_binscripts}
437 CONFIGVARS = \
438         "bindir"        : "${bindir}",          \
439         "glib-version"  : "${GLIB_VERSION}"
441 install-exec-hook:
442         for sf in ${auto_config_binscripts} ; do \
443           mv -f "$(DESTDIR)$(bindir)/$$sf" "$(DESTDIR)$(bindir)/$$sf".tmp \
444           && sed < "$(DESTDIR)$(bindir)/$$sf".tmp > "$(DESTDIR)$(bindir)/$$sf" \
445             -e '1,24s|^ *#@PKGINSTALL_CONFIGVARS_IN24LINES@|  ${CONFIGVARS}|' \
446             -e '1,1s|#! /usr/bin/env python.*|#!${PYTHON}|' \
447           || exit $$? ; \
448           chmod a+x $(DESTDIR)$(bindir)/$$sf ; \
449           rm -f "$(DESTDIR)$(bindir)/$$sf".tmp ; \
450         done
452 endif
454 glib.def: libglib-2.0.la
455         $(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
457 glib-2.0.lib: libglib-2.0.la glib.def
458         $(AM_V_GEN) lib.exe -machine:@LIB_EXE_MACHINE_FLAG@ -name:libglib-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:$(builddir)/glib.def -out:$@
460 dist-hook: $(BUILT_EXTRA_DIST)
461         files='$(BUILT_EXTRA_DIST)'; \
462         for f in $$files; do \
463           if test -f $$f; then d=.; else d=$(srcdir); fi; \
464           cp $$d/$$f $(distdir) || exit 1; done
466 # install gdb scripts
467 gdbdir = $(datadir)/glib-2.0/gdb
468 dist_gdb_DATA = glib_gdb.py
470 all-local: libglib-gdb.py
471 libglib-gdb.py: libglib-gdb.py.in
472         $(AM_V_GEN) $(SED) -e "s|\@datadir\@|$(datadir)|" $(srcdir)/libglib-gdb.py.in > $(builddir)/libglib-gdb.py
474 if HAVE_GLIB_RUNTIME_LIBDIR
475 ABS_GLIB_RUNTIME_LIBDIR = $(realpath $(libdir)/$(GLIB_RUNTIME_LIBDIR))
476 else
477 ABS_GLIB_RUNTIME_LIBDIR = $(libdir)
478 endif
480 install-data-hook: libglib-gdb.py
481         mkdir -p $(DESTDIR)$(datadir)/gdb/auto-load$(ABS_GLIB_RUNTIME_LIBDIR)
482         $(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
483 if HAVE_GLIB_RUNTIME_LIBDIR
484         mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
485         mv $(DESTDIR)$(libdir)/libglib-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
486         mv $(DESTDIR)$(libdir)/libglib-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
487         rm -f $(DESTDIR)$(libdir)/libglib-2.0.so
488         ln -s $(GLIB_RUNTIME_LIBDIR)/libglib-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/libglib-2.0.so
489 endif
491 uninstall-gdb:
492         -rm -r $(DESTDIR)$(datadir)/gdb