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