distcheck: add gvariant-internal.h to SOURCES
[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 if HAVE_GOOD_PRINTF
5 else
6 PRINTF_SUBDIR = gnulib
7 printf_la = gnulib/libgnulib.la
8 endif 
9
10 if ENABLE_REGEX
11 if USE_SYSTEM_PCRE
12 else
13 MAYBE_PCRE = pcre 
14 endif
15 gregex_c = gregex.c
16 gregex_h = gregex.h
17 else
18 gregex_c =
19 gregex_h =
20 endif
21
22 if HAVE_GCC_BUILTINS_FOR_ATOMIC_OPERATIONS
23 gatomic_c = gatomic-gcc.c
24 else
25 gatomic_c = gatomic.c
26 endif
27
28 SUBDIRS = libcharset $(PRINTF_SUBDIR) $(MAYBE_PCRE) update-pcre . tests
29
30 DIST_SUBDIRS = libcharset gnulib pcre update-pcre tests
31
32 AM_CPPFLAGS =                           \
33         -I$(top_srcdir)                 \
34         $(pcre_inc)                     \
35         -DG_LOG_DOMAIN=\"GLib\"         \
36         $(GLIB_DEBUG_FLAGS)             \
37         -DG_DISABLE_DEPRECATED          \
38         -DGLIB_COMPILATION              \
39         -DPCRE_STATIC
40
41 glib.def: glib.symbols
42         (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
43
44 galias.h: $(srcdir)/makegalias.pl glib.symbols
45           $(PERL) $(srcdir)/makegalias.pl < $(srcdir)/glib.symbols > galias.h
46
47 galiasdef.c: $(srcdir)/makegalias.pl glib.symbols
48           $(PERL) $(srcdir)/makegalias.pl -def < $(srcdir)/glib.symbols > galiasdef.c
49
50 if OS_LINUX
51 if HAVE_GNUC_VISIBILITY
52 TESTS_ENVIRONMENT = GLIB_DEBUG_FLAGS="$(GLIB_DEBUG_FLAGS)"
53 TESTS = abicheck.sh pltcheck.sh
54 endif
55 endif
56
57 BUILT_SOURCES = galias.h galiasdef.c
58
59 MIRRORING_TAB_SOURCE =                          \
60         glib-mirroring-tab/Makefile             \
61         glib-mirroring-tab/gen-mirroring-tab.c  \
62         glib-mirroring-tab/packtab.h            \
63         glib-mirroring-tab/packtab.c
64
65 # The compilation of GRegex can be disabled, but the source files must
66 # be distributed.
67 EXTRA_DIST +=                   \
68         makefile.msc.in         \
69         glib.rc.in              \
70         gen-unicode-tables.pl   \
71         gen-script-table.pl     \
72         makegalias.pl           \
73         abicheck.sh             \
74         pltcheck.sh             \
75         glib.symbols            \
76         gregex.c                \
77         gregex.h                \
78         win_iconv.c             \
79         libglib-gdb.py.in       \
80         $(MIRRORING_TAB_SOURCE)
81
82 # These may be in the builddir too
83 BUILT_EXTRA_DIST =              \
84         makefile.msc            \
85         glib.rc                 \
86         galias.h                \
87         galiasdef.c
88
89 lib_LTLIBRARIES = libglib-2.0.la
90
91 if OS_WIN32_AND_DLL_COMPILATION
92 if MS_LIB_AVAILABLE
93 noinst_DATA = glib-2.0.lib
94
95 install_ms_lib_cmd = $(INSTALL) glib-2.0.lib $(DESTDIR)$(libdir)
96 uninstall_ms_lib_cmd = -rm $(DESTDIR)$(libdir)/glib-2.0.lib
97 endif
98 endif
99
100 install-ms-lib:
101         $(install_ms_lib_cmd)
102
103 uninstall-ms-lib:
104         $(uninstall_ms_lib_cmd)
105
106 libglib_2_0_la_SOURCES =        \
107         garray.c                \
108         gasyncqueue.c           \
109         $(gatomic_c)            \
110         gbacktrace.c            \
111         gbase64.c               \
112         gbitlock.c              \
113         gbookmarkfile.c         \
114         gbsearcharray.h         \
115         gbuffer.c               \
116         gbuffer.h               \
117         gcache.c                \
118         gchecksum.c             \
119         gcompletion.c           \
120         gconvert.c              \
121         gdataset.c              \
122         gdatasetprivate.h       \
123         gdate.c                 \
124         gdir.c                  \
125         gerror.c                \
126         gfileutils.c            \
127         ghash.c                 \
128         ghook.c                 \
129         ghostutils.c            \
130         giochannel.c            \
131         gkeyfile.c              \
132         glibintl.h              \
133         glist.c                 \
134         gmain.c                 \
135         gmappedfile.c           \
136         gmarkup.c               \
137         gmem.c                  \
138         gmessages.c             \
139         gmirroringtable.h       \
140         gnode.c                 \
141         goption.c               \
142         gpattern.c              \
143         gpoll.c                 \
144         gprimes.c               \
145         gqsort.c                \
146         gqueue.c                \
147         grel.c                  \
148         grand.c                 \
149         $(gregex_c)             \
150         gscanner.c              \
151         gscripttable.h          \
152         gsequence.c             \
153         gshell.c                \
154         gslice.c                \
155         gslist.c                \
156         gstdio.c                \
157         gstrfuncs.c             \
158         gstring.c               \
159         gtestutils.c            \
160         gthread.c               \
161         gthreadprivate.h        \
162         gthreadpool.c           \
163         gtimer.c                \
164         gtree.c                 \
165         guniprop.c              \
166         gutf8.c                 \
167         gunibreak.h             \
168         gunibreak.c             \
169         gunichartables.h        \
170         gunicollate.c           \
171         gunicomp.h              \
172         gunidecomp.h            \
173         gunidecomp.c            \
174         gunicodeprivate.h       \
175         gurifuncs.c             \
176         gutils.c                \
177         gvariant.h              \
178         gvariant.c              \
179         gvariant-core.h         \
180         gvariant-core.c         \
181         gvariant-internal.h     \
182         gvariant-serialiser.h   \
183         gvariant-serialiser.c   \
184         gvarianttypeinfo.h      \
185         gvarianttypeinfo.c      \
186         gvarianttype.c          \
187         gdebug.h                \
188         gprintf.c               \
189         gprintfint.h
190
191
192 EXTRA_libglib_2_0_la_SOURCES = \
193         giounix.c       \
194         giowin32.c      \
195         gspawn.c        \
196         gspawn-win32.c  \
197         gwin32.c
198
199 glibincludedir=$(includedir)/glib-2.0
200 glibinclude_HEADERS =   \
201         glib-object.h   \
202         glib.h
203
204 glibsubincludedir=$(includedir)/glib-2.0/glib
205 glibsubinclude_HEADERS =   \
206         galloca.h       \
207         garray.h        \
208         gasyncqueue.h   \
209         gatomic.h       \
210         gbacktrace.h    \
211         gbase64.h       \
212         gbitlock.h      \
213         gbookmarkfile.h \
214         gcache.h        \
215         gchecksum.h     \
216         gcompletion.h   \
217         gconvert.h      \
218         gdataset.h      \
219         gdate.h         \
220         gdir.h          \
221         gerror.h        \
222         gfileutils.h    \
223         ghash.h         \
224         ghook.h         \
225         ghostutils.h    \
226         gi18n.h         \
227         gi18n-lib.h     \
228         giochannel.h    \
229         gkeyfile.h      \
230         glist.h         \
231         gmacros.h       \
232         gmain.h         \
233         gmappedfile.h   \
234         gmarkup.h       \
235         gmem.h          \
236         gmessages.h     \
237         gnode.h         \
238         goption.h       \
239         gpattern.h      \
240         gpoll.h         \
241         gprimes.h       \
242         gqsort.h        \
243         gquark.h        \
244         gqueue.h        \
245         grand.h         \
246         $(gregex_h)     \
247         grel.h          \
248         gscanner.h      \
249         gsequence.h     \
250         gshell.h        \
251         gslice.h        \
252         gslist.h        \
253         gspawn.h        \
254         gstdio.h        \
255         gstrfuncs.h     \
256         gtestutils.h    \
257         gstring.h       \
258         gthread.h       \
259         gthreadpool.h   \
260         gtimer.h        \
261         gtree.h         \
262         gtypes.h        \
263         gunicode.h      \
264         gurifuncs.h             \
265         gutils.h        \
266         gvarianttype.h  \
267         gvariant.h      \
268         gwin32.h        \
269         gprintf.h
270
271 install-data-local: install-ms-lib install-def-file
272         @if test -f $(glibincludedir)/glist.h ; then                                    \
273           echo "*** Old headers found in $(glibincludedir). You should remove the" ;    \
274           echo "*** contents of this directory and type 'make install' again." ;        \
275           false ;                                                                       \
276         fi
277
278 uninstall-local: uninstall-ms-lib uninstall-def-file
279
280 if PLATFORM_WIN32
281 no_undefined = -no-undefined
282 endif
283
284 if OS_WIN32_AND_DLL_COMPILATION
285 export_symbols = -export-symbols glib.def
286
287 glib_win32_res = glib-win32-res.o
288 glib_win32_res_ldflag = -Wl,$(glib_win32_res)
289
290 glib_def = glib.def
291
292 install-def-file:
293         $(INSTALL) glib.def $(DESTDIR)$(libdir)/glib-2.0.def
294
295 uninstall-def-file:
296         -rm $(DESTDIR)$(libdir)/glib-2.0.def
297 else
298 install-def-file:
299 uninstall-def-file:
300
301 export_symbols = $(LIBTOOL_EXPORT_OPTIONS)
302 endif
303
304 if ENABLE_REGEX
305 if USE_SYSTEM_PCRE
306 pcre_lib = $(PCRE_LIBS)
307 pcre_inc = $(PCRE_CFLAGS)
308 else
309 pcre_lib = pcre/libpcre.la
310 pcre_inc =
311 endif
312 else
313 pcre_lib =
314 pcre_inc =
315 endif
316
317 libglib_2_0_la_LIBADD = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ @ICONV_LIBS@ @G_LIBS_EXTRA@ $(pcre_lib)
318 libglib_2_0_la_DEPENDENCIES = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ $(glib_win32_res) $(glib_def)
319
320 libglib_2_0_la_LDFLAGS = \
321          $(glib_win32_res_ldflag) \
322         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
323         -export-dynamic $(no_undefined) $(export_symbols)
324
325 INSTALL_PROGS=
326
327 gspawn-win32-helper-console.c:
328         echo '#define HELPER_CONSOLE' >$@
329         echo '#include "gspawn-win32-helper.c"' >>$@
330
331 gspawn-win64-helper.c:
332         echo '#include "gspawn-win32-helper.c"' >$@
333
334 gspawn-win64-helper-console.c:
335         echo '#define HELPER_CONSOLE' >$@
336         echo '#include "gspawn-win32-helper.c"' >>$@
337
338 if OS_WIN32
339 if OS_WIN32_X64
340 INSTALL_PROGS += gspawn-win64-helper gspawn-win64-helper-console
341 gspawn_win64_helper_LDADD = libglib-2.0.la
342 gspawn_win64_helper_LDFLAGS = -mwindows
343 gspawn_win64_helper_console_LDADD = libglib-2.0.la
344 else
345 INSTALL_PROGS += gspawn-win32-helper gspawn-win32-helper-console
346 gspawn_win32_helper_LDADD = libglib-2.0.la
347 gspawn_win32_helper_LDFLAGS = -mwindows
348 gspawn_win32_helper_console_LDADD = libglib-2.0.la
349 endif
350 endif
351
352 glib-win32-res.o: glib.rc
353         $(WINDRES) glib.rc $@
354
355 bin_PROGRAMS     = ${INSTALL_PROGS}
356
357 if OS_UNIX
358
359 INSTALL_PROGS   += gtester
360 gtester_SOURCES  = gtester.c
361 gtester_LDADD    = libglib-2.0.la 
362
363 auto_config_binscripts = gtester-report
364 bin_SCRIPTS = ${auto_config_binscripts}
365 EXTRA_DIST += ${auto_config_binscripts}
366
367 CONFIGVARS = \
368         "bindir"        : "${bindir}",          \
369         "glib-version"  : "${GLIB_VERSION}"
370
371 install-exec-hook:
372         for sf in ${auto_config_binscripts} ; do \
373           mv -f "$(DESTDIR)$(bindir)/$$sf" "$(DESTDIR)$(bindir)/$$sf".tmp \
374           && sed < "$(DESTDIR)$(bindir)/$$sf".tmp > "$(DESTDIR)$(bindir)/$$sf" \
375             -e '1,24s|^ *#@PKGINSTALL_CONFIGVARS_IN24LINES@|  ${CONFIGVARS}|' \
376             -e '1,1s|#! /usr/bin/env python\([0-9]\+\(\.[0-9]\+\)\?\)\?|#!${PYTHON}|' \
377           || exit $$? ; \
378           rm -f "$(DESTDIR)$(bindir)/$$sf".tmp ; \
379         done
380
381 endif
382
383 glib-2.0.lib: libglib-2.0.la glib.def
384         lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libglib-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:glib.def -out:$@
385
386 dist-hook: $(BUILT_EXTRA_DIST)
387         files='$(BUILT_EXTRA_DIST)'; \
388         for f in $$files; do \
389           if test -f $$f; then d=.; else d=$(srcdir); fi; \
390           cp $$d/$$f $(distdir) || exit 1; done
391
392 distclean-local:
393         if test $(srcdir) = .; then :; else \
394             rm -f libglib-gdb.py; \
395         fi
396
397 # install gdb scripts
398 gdbdir = $(datadir)/glib-2.0/gdb
399 dist_gdb_SCRIPTS = glib.py
400
401 libglib-gdb.py: libglib-gdb.py.in
402         sed -e "s|\@datadir\@|$(datadir)|" $(srcdir)/libglib-gdb.py.in > libglib-gdb.py
403
404
405 install-data-hook: libglib-gdb.py
406         mkdir -p $(DESTDIR)$(datadir)/gdb/auto-load$(ABS_GLIB_RUNTIME_LIBDIR)
407         $(INSTALL) libglib-gdb.py $(DESTDIR)$(datadir)/gdb/auto-load$(ABS_GLIB_RUNTIME_LIBDIR)/libglib-2.0.so.0.$(LT_CURRENT).$(LT_REVISION)-gdb.py
408 if HAVE_GLIB_RUNTIME_LIBDIR
409         mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
410         mv $(DESTDIR)$(libdir)/libglib-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
411         mv $(DESTDIR)$(libdir)/libglib-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
412         rm -f $(DESTDIR)$(libdir)/libglib-2.0.so
413         ln -s $(GLIB_RUNTIME_LIBDIR)/libglib-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/libglib-2.0.so
414 endif