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