Merge remote branch 'gvdb/master'
[platform/upstream/glib.git] / gthread / Makefile.am
1 ## Process this file with automake to produce Makefile.in
2 include $(top_srcdir)/Makefile.decl
3
4 SUBDIRS = . tests
5 DIST_SUBDIRS = tests
6
7 AM_CPPFLAGS =                           \
8         -I$(top_srcdir)                 \
9         -I$(top_srcdir)/glib            \
10         -I$(top_srcdir)/gthread         \
11         -DG_LOG_DOMAIN=\"GThread\"      \
12         @GTHREAD_COMPILE_IMPL_DEFINES@  \
13         @GLIB_DEBUG_FLAGS@              \
14         -DG_DISABLE_DEPRECATED
15
16 EXTRA_DIST +=                           \
17                 makefile.msc.in         \
18                 gthread-posix.c         \
19                 gthread-win32.c         \
20                 gthread-none.c          \
21                 gthread.def             \
22                 gthread.rc.in
23
24 BUILT_EXTRA_DIST =                      \
25                 makefile.msc            \
26                 gthread.rc
27
28 libglib = $(top_builddir)/glib/libglib-2.0.la
29
30 top_builddir_full=`cd \$(top_builddir); pwd`
31
32 lib_LTLIBRARIES = libgthread-2.0.la
33
34 if OS_WIN32_AND_DLL_COMPILATION
35 if MS_LIB_AVAILABLE
36 noinst_DATA = gthread-2.0.lib
37
38 install_ms_lib_cmd = $(INSTALL) gthread-2.0.lib $(DESTDIR)$(libdir)
39 uninstall_ms_lib_cmd = -rm $(DESTDIR)$(libdir)/gthread-2.0.lib
40 endif
41 endif
42
43 install-ms-lib:
44         $(install_ms_lib_cmd)
45
46 uninstall-ms-lib:
47         $(uninstall_ms_lib_cmd)
48
49 if PLATFORM_WIN32
50 no_undefined = -no-undefined
51 endif
52
53 if OS_WIN32_AND_DLL_COMPILATION
54 export_symbols = -export-symbols $(srcdir)/gthread.def
55 gthread_def = gthread.def
56
57 install-def-file:
58         $(INSTALL) $(srcdir)/gthread.def $(DESTDIR)$(libdir)/gthread-2.0.def
59
60 uninstall-def-file:
61         -rm $(DESTDIR)$(libdir)/gthread-2.0.def
62 else
63 install-def-file:
64 uninstall-def-file:
65 endif
66
67 if OS_WIN32_AND_DLL_COMPILATION
68 gthread_win32_res = gthread-win32-res.o
69 gthread_win32_res_ldflag = -Wl,$(gthread_win32_res)
70 endif
71
72 libgthread_2_0_la_SOURCES = gthread-impl.c
73 libgthread_2_0_la_LDFLAGS = \
74         $(gthread_win32_res_ldflag) \
75         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
76         -export-dynamic $(no_undefined) $(export_symbols)
77
78 libgthread_2_0_la_LIBADD = $(G_THREAD_LIBS_EXTRA) $(G_THREAD_LIBS_FOR_GTHREAD) $(libglib)
79
80 libgthread_2_0_la_DEPENDENCIES = $(gthread_win32_res) $(gthread_def)
81
82 gthread-win32-res.o: gthread.rc
83         $(WINDRES) gthread.rc $@
84
85 gthread-2.0.lib: libgthread-2.0.la gthread.def
86         lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgthread-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:$(srcdir)/gthread.def -out:$@
87
88 dist-hook: $(BUILT_EXTRA_DIST)
89         files='$(BUILT_EXTRA_DIST)'; \
90         for f in $$files; do \
91           if test -f $$f; then d=.; else d=$(srcdir); fi; \
92           cp $$d/$$f $(distdir) || exit 1; done
93
94 install-data-local: install-ms-lib install-def-file
95
96 uninstall-local: uninstall-ms-lib uninstall-def-file
97
98 if HAVE_GLIB_RUNTIME_LIBDIR
99 install-data-hook:
100         mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
101         mv $(DESTDIR)$(libdir)/libgthread-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
102         mv $(DESTDIR)$(libdir)/libgthread-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
103         rm -f $(DESTDIR)$(libdir)/libgthread-2.0.so
104         ln -s $(GLIB_RUNTIME_LIBDIR)/libgthread-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/libgthread-2.0.so
105 endif