Makefile.am 2.62 KB
Newer Older
1
## Process this file with automake to produce Makefile.in
2
include $(top_srcdir)/Makefile.decl
3

4
AM_CPPFLAGS = 				\
5
	$(glib_INCLUDES) 		\
6 7
	-DG_LOG_DOMAIN=\"GThread\" 	\
	@GTHREAD_COMPILE_IMPL_DEFINES@ 	\
8
	@GLIB_DEBUG_FLAGS@
9

10
EXTRA_DIST +=				\
11
		makefile.msc.in		\
12
		gthread.def		\
13
		gthread.rc.in
14

15
BUILT_EXTRA_DIST = 			\
16 17 18
		makefile.msc		\
		gthread.rc

19
libglib = $(top_builddir)/glib/libglib-2.0.la
20

21 22
top_builddir_full=`cd \$(top_builddir); pwd`

23
lib_LTLIBRARIES = libgthread-2.0.la
24

25
if OS_WIN32_AND_DLL_COMPILATION
26
if MS_LIB_AVAILABLE
27
noinst_DATA = gthread-2.0.lib
28

29 30 31 32
install_ms_lib_cmd = $(INSTALL) gthread-2.0.lib $(DESTDIR)$(libdir)
uninstall_ms_lib_cmd = -rm $(DESTDIR)$(libdir)/gthread-2.0.lib
endif
endif
33 34

install-ms-lib:
35 36
	$(install_ms_lib_cmd)

37
uninstall-ms-lib:
38
	$(uninstall_ms_lib_cmd)
39

40 41 42
if PLATFORM_WIN32
no_undefined = -no-undefined
endif
43

44
if OS_WIN32_AND_DLL_COMPILATION
45
export_symbols = -export-symbols $(srcdir)/gthread.def
46
gthread_def = gthread.def
47

48
install-def-file:
49
	$(INSTALL) $(srcdir)/gthread.def $(DESTDIR)$(libdir)/gthread-2.0.def
50

51 52
uninstall-def-file:
	-rm $(DESTDIR)$(libdir)/gthread-2.0.def
53
else
54 55
install-def-file:
uninstall-def-file:
56 57
endif

58
if OS_WIN32_AND_DLL_COMPILATION
59 60 61 62
gthread_win32_res = gthread-win32-res.o
gthread_win32_res_ldflag = -Wl,$(gthread_win32_res)
endif

63
libgthread_2_0_la_SOURCES = gthread-impl.c
64
libgthread_2_0_la_LDFLAGS = $(GLIB_LINK_FLAGS) \
65
	$(gthread_win32_res_ldflag) \
66
	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
67
	-export-dynamic $(no_undefined) $(export_symbols)
68

69
libgthread_2_0_la_LIBADD = $(G_THREAD_LIBS_EXTRA) $(G_THREAD_LIBS_FOR_GTHREAD) $(libglib)
70

71
libgthread_2_0_la_DEPENDENCIES = $(gthread_win32_res) $(gthread_def)
72

73
gthread-win32-res.o: gthread.rc
74
	$(AM_V_GEN) $(WINDRES) gthread.rc $@
75

76
gthread-2.0.lib: libgthread-2.0.la gthread.def
77
	lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgthread-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:$(srcdir)/gthread.def -out:$@
78 79 80 81 82 83 84

dist-hook: $(BUILT_EXTRA_DIST)
	files='$(BUILT_EXTRA_DIST)'; \
	for f in $$files; do \
	  if test -f $$f; then d=.; else d=$(srcdir); fi; \
	  cp $$d/$$f $(distdir) || exit 1; done

85
install-data-local: install-ms-lib install-def-file
86

87
uninstall-local: uninstall-ms-lib uninstall-def-file
88

89 90 91 92
if HAVE_GLIB_RUNTIME_LIBDIR
install-data-hook:
	mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
	mv $(DESTDIR)$(libdir)/libgthread-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
93
	mv $(DESTDIR)$(libdir)/libgthread-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
94
	rm -f $(DESTDIR)$(libdir)/libgthread-2.0.so
95
	ln -s $(GLIB_RUNTIME_LIBDIR)/libgthread-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/libgthread-2.0.so
96
endif