Don't distribute glib.def. (#167496, J. Ali Harlow)
[platform/upstream/glib.git] / glib / Makefile.am
1 ## Process this file with automake to produce Makefile.in
2
3 if HAVE_GOOD_PRINTF
4 else
5 PRINTF_SUBDIR = gnulib
6 printf_la = gnulib/libgnulib.la
7 endif 
8
9 SUBDIRS = libcharset $(PRINTF_SUBDIR)
10
11 DIST_SUBDIRS = libcharset gnulib
12
13 INCLUDES = -I$(top_srcdir) -DG_LOG_DOMAIN=\"GLib\" \
14         $(GLIB_DEBUG_FLAGS) -DG_DISABLE_DEPRECATED -DGLIB_COMPILATION 
15
16 glib.def: glib.symbols
17         (echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DINCLUDE_INTERNAL_SYMBOLS -DG_OS_WIN32 - <$(srcdir)/glib.symbols | sed -e '/^$$/d' -e 's/^/    /' -e 's/G_GNUC_[^ ]*//g') > glib.def
18
19 galias.h: glib.symbols
20           $(PERL) $(srcdir)/makegalias.pl < $(srcdir)/glib.symbols > galias.h
21
22 if OS_LINUX
23 if HAVE_GNUC_VISIBILITY
24 TESTS = abicheck.sh
25 endif
26 endif
27
28 BUILT_SOURCES = galias.h
29
30 EXTRA_DIST =                    \
31         makefile.msc.in         \
32         glib.rc.in              \
33         gen-unicode-tables.pl   \
34         makegalias.pl           \
35         abicheck.sh             \
36         glib.symbols
37
38 # These may be in the builddir too
39 BUILT_EXTRA_DIST =              \
40         makefile.msc            \
41         glib.rc                 \
42         galias.h
43
44 lib_LTLIBRARIES = libglib-2.0.la
45
46 if MS_LIB_AVAILABLE
47 noinst_DATA = glib-2.0.lib
48
49 install-ms-lib:
50         $(INSTALL) glib-2.0.lib $(DESTDIR)$(libdir)
51
52 uninstall-ms-lib:
53         -rm $(DESTDIR)$(libdir)/glib-2.0.lib
54 else
55 install-ms-lib:
56 uninstall-ms-lib:
57 endif
58
59 libglib_2_0_la_SOURCES =        \
60         garray.c                \
61         gasyncqueue.c           \
62         gatomic.c               \
63         gbacktrace.c            \
64         gbsearcharray.h         \
65         gcache.c                \
66         gcompletion.c           \
67         gconvert.c              \
68         gdataset.c              \
69         gdate.c                 \
70         gdir.c                  \
71         gerror.c                \
72         gfileutils.c            \
73         ghash.c                 \
74         ghook.c                 \
75         giochannel.c            \
76         gkeyfile.c              \
77         glibintl.h              \
78         glist.c                 \
79         gmain.c                 \
80         gmarkup.c               \
81         gmem.c                  \
82         gmessages.c             \
83         gnode.c                 \
84         goption.c               \
85         gpattern.c              \
86         gprimes.c               \
87         gqsort.c                \
88         gqueue.c                \
89         grel.c                  \
90         grand.c                 \
91         gscanner.c              \
92         gshell.c                \
93         gslist.c                \
94         gstdio.c                \
95         gstrfuncs.c             \
96         gstring.c               \
97         gthread.c               \
98         gthreadinit.h           \
99         gthreadpool.c           \
100         gtimer.c                \
101         gtree.c                 \
102         guniprop.c              \
103         gutf8.c                 \
104         gunibreak.h             \
105         gunibreak.c             \
106         gunichartables.h        \
107         gunicollate.c           \
108         gunicomp.h              \
109         gunidecomp.h            \
110         gunidecomp.c            \
111         gunicodeprivate.h       \
112         gutils.c                \
113         gdebug.h                \
114         gprintf.c               \
115         gprintfint.h
116
117 EXTRA_libglib_2_0_la_SOURCES = \
118         giounix.c       \
119         giowin32.c      \
120         gspawn.c        \
121         gspawn-win32.c  \
122         gwin32.c
123
124 glibincludedir=$(includedir)/glib-2.0
125 glibinclude_HEADERS =   \
126         glib-object.h   \
127         glib.h
128
129 glibsubincludedir=$(includedir)/glib-2.0/glib
130 glibsubinclude_HEADERS =   \
131         galloca.h       \
132         garray.h        \
133         gasyncqueue.h   \
134         gatomic.h       \
135         gbacktrace.h    \
136         gcache.h        \
137         gcompletion.h   \
138         gconvert.h      \
139         gdataset.h      \
140         gdate.h         \
141         gdir.h          \
142         gerror.h        \
143         gfileutils.h    \
144         ghash.h         \
145         ghook.h         \
146         gi18n.h         \
147         gi18n-lib.h     \
148         giochannel.h    \
149         gkeyfile.h      \
150         glist.h         \
151         gmacros.h       \
152         gmain.h         \
153         gmarkup.h       \
154         gmem.h          \
155         gmessages.h     \
156         gnode.h         \
157         goption.h       \
158         gpattern.h      \
159         gprimes.h       \
160         gqsort.h        \
161         gquark.h        \
162         gqueue.h        \
163         grand.h         \
164         grel.h          \
165         gscanner.h      \
166         gshell.h        \
167         gslist.h        \
168         gspawn.h        \
169         gstdio.h        \
170         gstrfuncs.h     \
171         gstring.h       \
172         gthread.h       \
173         gthreadpool.h   \
174         gtimer.h        \
175         gtree.h         \
176         gtypes.h        \
177         gunicode.h      \
178         gutils.h        \
179         gwin32.h        \
180         gprintf.h
181
182 install-data-local: install-ms-lib install-libtool-import-lib
183         @if test -f $(glibincludedir)/glist.h ; then                                    \
184           echo "*** Old headers found in $(glibincludedir). You should remove the" ;    \
185           echo "*** contents of this directory and type 'make install' again." ;        \
186           false ;                                                                       \
187         fi
188
189 uninstall-local: uninstall-ms-lib uninstall-libtool-import-lib
190
191 if PLATFORM_WIN32
192 no_undefined = -no-undefined
193 endif
194
195 if OS_WIN32
196 # This requires a very new libtool
197 export_symbols = -export-symbols glib.def
198
199 install-libtool-import-lib:
200 #       Don't put the binary compatibility entries in the import lib!
201 #       (Unfortunately the GNU linker doesn't yet understand the PRIVATE
202 #       directive in .def files.)
203 #
204         for entry in `grep PRIVATE glib.def | sed -e 's/PRIVATE//'`; do \
205           file=`$(NM) -A .libs/libglib-2.0.dll.a | tr -d '\r' | grep -E $$entry'$$' | head -n 1 | cut -d: -f2`; \
206           ar d .libs/libglib-2.0.dll.a $$file; \
207         done
208         $(RANLIB) .libs/libglib-2.0.dll.a
209         $(INSTALL) .libs/libglib-2.0.dll.a $(DESTDIR)$(libdir)
210         $(INSTALL) glib.def $(DESTDIR)$(libdir)/glib-2.0.def
211
212 uninstall-libtool-import-lib:
213         -rm $(DESTDIR)$(libdir)/libglib-2.0.dll.a $(DESTDIR)$(libdir)/glib-2.0.def
214 else
215 install-libtool-import-lib:
216 uninstall-libtool-import-lib:
217
218 export_symbols = $(LIBTOOL_EXPORT_OPTIONS)
219 endif
220
221 libglib_2_0_la_LIBADD = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ @G_LIB_WIN32_RESOURCE@ @ICONV_LIBS@ @G_LIBS_EXTRA@ 
222 libglib_2_0_la_DEPENDENCIES = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ @G_LIB_WIN32_RESOURCE@ @GLIB_DEF@
223
224 libglib_2_0_la_LDFLAGS = \
225         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
226         -export-dynamic $(no_undefined) $(export_symbols)
227
228 if OS_WIN32
229 bin_PROGRAMS = gspawn-win32-helper
230 gspawn_win32_helper_LDADD = libglib-2.0.la
231 gspawn_win32_helper_LDFLAGS = -mwindows
232
233 $(G_LIB_WIN32_RESOURCE): glib.rc
234         $(top_srcdir)/build/win32/lt-compile-resource glib.rc $@
235 endif
236
237 glib-2.0.lib: libglib-2.0.la glib.def
238         lib -name:libglib-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:glib.def -out:$@
239
240 dist-hook: $(BUILT_EXTRA_DIST)
241         files='$(BUILT_EXTRA_DIST)'; \
242         for f in $$files; do \
243           if test -f $$f; then d=.; else d=$(srcdir); fi; \
244           cp $$d/$$f $(distdir) || exit 1; done