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