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