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