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