gmodule/Makefile.am (gmodule-2.0.lib) Use $(srcdir) for builds outside
[platform/upstream/glib.git] / gmodule / Makefile.am
1 ## Process this file with automake to produce Makefile.in
2
3 INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/glib -I$(top_srcdir)/gmodule \
4         -DG_LOG_DOMAIN=\"GModule\" @GLIB_DEBUG_FLAGS@ -DG_DISABLE_DEPRECATED
5
6 EXTRA_DIST =    \
7                 makefile.msc.in \
8                 gmoduleconf.h.in \
9                 gmodule.def     \
10                 gmodule-dl.c    \
11                 gmodule-dld.c   \
12                 gmodule-dyld.c  \
13                 gmodule-os2.c   \
14                 gmodule-win32.c \
15                 gmodule-beos.c  \
16                 gmodule-ar.c    \
17                 gmoduleconf.h.win32 \
18                 gmodule.rc.in
19
20 BUILT_EXTRA_DIST = \
21                 makefile.msc    \
22                 gmodule.rc
23
24 BUILT_SOURCES = gmoduleconf.h
25 gmoduleconf.h:  gmoduleconf.h.in
26
27 glibincludedir=$(includedir)/glib-2.0
28 glibinclude_HEADERS = \
29                 gmodule.h
30
31 libglib = $(top_builddir)/glib/libglib-2.0.la
32
33 top_builddir_full=`cd \$(top_builddir); pwd`
34
35 lib_LTLIBRARIES = libgmodule-2.0.la
36
37 if MS_LIB_AVAILABLE
38 noinst_DATA = gmodule-2.0.lib
39
40 install-ms-lib:
41         $(INSTALL) gmodule-2.0.lib $(DESTDIR)$(libdir)
42
43 uninstall-ms-lib:
44         -rm $(DESTDIR)$(libdir)/gmodule-2.0.lib
45 else
46 install-ms-lib:
47 uninstall-ms-lib:
48 endif
49
50 if PLATFORM_WIN32
51 no_undefined = -no-undefined
52 endif
53
54 if OS_WIN32
55 export_symbols = -export-symbols $(srcdir)/gmodule.def
56
57 install-def-file:
58         $(INSTALL) $(srcdir)/gmodule.def $(DESTDIR)$(libdir)/gmodule-2.0.def
59
60 uninstall-def-file:
61         -rm $(DESTDIR)$(libdir)/gmodule-2.0.def
62 else
63 install-def-file:
64 uninstall-def-file:
65 endif
66
67 if OS_WIN32
68 gmodule_win32_res = gmodule-win32-res.o
69 gmodule_win32_res_ldflag = -Wl,$(gmodule_win32_res)
70 endif
71
72 libgmodule_2_0_la_SOURCES = gmodule.c
73 libgmodule_2_0_la_LDFLAGS = \
74         $(gmodule_win32_res_ldflag) \
75         $(G_MODULE_LDFLAGS) \
76         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
77         -export-dynamic $(no_undefined) $(export_symbols)
78
79 libgmodule_2_0_la_LIBADD = $(G_MODULE_LIBS_EXTRA) $(G_MODULE_LIBS) $(libglib)
80
81 libgmodule_2_0_la_DEPENDENCIES = $(gmodule_win32_res) $(GMODULE_DEF)
82
83 if OS_WIN32
84 gmodule-win32-res.o: gmodule.rc
85         $(WINDRES) gmodule.rc $@
86 endif
87
88 gmodule-2.0.lib: libgmodule-2.0.la gmodule.def
89         lib -name:libgmodule-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:$(srcdir)/gmodule.def -out:$@
90
91 .PHONY: files release
92
93 files:
94         @files=`ls $(DISTFILES) 2> /dev/null `; for p in $$files; do \
95           echo $$p; \
96         done
97
98 release:
99         $(MAKE) dist distdir=$(PACKAGE)`date +"%y%m%d"`
100
101 dist-hook: $(BUILT_EXTRA_DIST)
102         @files='$(BUILT_EXTRA_DIST)'; \
103         for f in $$files; do \
104           if test -f $$f; then d=.; else d=$(srcdir); fi; \
105           cp $$d/$$f $(distdir) || exit 1; done
106
107
108 install-data-local: install-ms-lib install-def-file
109
110 uninstall-local: uninstall-ms-lib uninstall-def-file