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