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