Update.
[platform/upstream/glib.git] / gobject / Makefile.am
1 # GRuntime - GLib Type, Object, Parameter and Signal Library
2 # Copyright (C) 1997,98,99,2000 Tim Janik and Red Hat, Inc.
3 #
4 ## Process this file with automake to produce Makefile.in
5
6 INCLUDES = @STRIP_BEGIN@ \
7         -DG_LOG_DOMAIN=g_log_domain_gruntime    \
8         -I$(top_srcdir)                         \
9         -I$(top_srcdir)/glib                    \
10         -I$(top_builddir)                       \
11         @GLIB_DEBUG_FLAGS@                      \
12         -DG_DISABLE_CONST_RETURNS               \
13 @STRIP_END@
14
15 libglib = $(top_builddir)/glib/libglib-1.3.la
16
17 # libraries to compile and install
18 lib_LTLIBRARIES = libgobject-1.3.la
19
20 if MS_LIB_AVAILABLE
21 noinst_DATA = gobject-1.3.lib
22
23 install-ms-lib:
24         $(INSTALL) gobject-1.3.lib $(DESTDIR)$(libdir)
25
26 uninstall-ms-lib:
27         -rm $(DESTDIR)$(libdir)/gobject-1.3.lib
28 else
29 install-ms-lib:
30 uninstall-ms-lib:
31 endif
32
33 if PLATFORM_WIN32
34 no_undefined = -no-undefined
35 endif
36
37 if OS_WIN32
38 export_symbols = -export-symbols gobject.def
39
40 install-libtool-import-lib:
41         $(INSTALL) .libs/libgobject-1.3.dll.a $(DESTDIR)$(libdir)
42 uninstall-libtool-import-lib:
43         -rm $(DESTDIR)$(libdir)/libgobject-1.3.dll.a
44 else
45 install-libtool-import-lib:
46 uninstall-libtool-import-lib:
47 endif
48
49 # libtool stuff: set version and export symbols for resolving
50 libgobjectincludedir = $(includedir)/glib-2.0/gobject
51 libgobject_1_3_la_LDFLAGS = @STRIP_BEGIN@ \
52         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)    \
53         -export-dynamic $(no_undefined) $(export_symbols)       \
54 @STRIP_END@
55
56 libgobject_1_3_la_LIBADD = @G_OBJECT_WIN32_RESOURCE@ $(libglib)
57
58 libgobject_1_3_la_DEPENDENCIES = @G_OBJECT_WIN32_RESOURCE@ @GOBJECT_DEF@
59
60 #
61 # setup source file variables
62 #
63 # GRuntime header files for public installation (non-generated)
64 gruntime_public_h_sources = @STRIP_BEGIN@ \
65         gboxed.h                \
66         gclosure.h              \
67         genums.h                \
68         gobject.h               \
69         gparam.h                \
70         gparamspecs.h           \
71         gsignal.h               \
72         gsourceclosure.h        \
73         gtype.h                 \
74         gtypemodule.h           \
75         gtypeplugin.h           \
76         gvalue.h                \
77         gvaluearray.h           \
78         gvaluecollector.h       \
79         gvaluetypes.h           \
80         gobjectnotifyqueue.c    \
81 @STRIP_END@
82 # GRuntime header files that don't get installed
83 gruntime_private_h_sources = @STRIP_BEGIN@ \
84 @STRIP_END@
85 # GRuntime C sources to build the library from
86 gruntime_c_sources = @STRIP_BEGIN@ \
87         gboxed.c                \
88         gclosure.c              \
89         genums.c                \
90         gobject.c               \
91         gparam.c                \
92         gparamspecs.c           \
93         gsignal.c               \
94         gsourceclosure.c        \
95         gtype.c                 \
96         gtypemodule.c           \
97         gtypeplugin.c           \
98         gvalue.c                \
99         gvaluearray.c           \
100         gvaluetransform.c       \
101         gvaluetypes.c           \
102 @STRIP_END@
103
104 # we use our own built_sources variable rules to avoid automake's
105 # BUILT_SOURCES oddities
106 # we generate frequently rebuild files piggyback on a stamp file, so sources
107 # depending on them only get rebuild when the built source actually changed
108 # content
109
110 # built sources that get installed with the header files
111 gruntime_built_public_sources = @STRIP_BEGIN@ \
112         gmarshal.h      \
113 @STRIP_END@
114 # built sources that don't get installed
115 gruntime_built_sources = @STRIP_BEGIN@ \
116         stamp-gmarshal.h                 \
117         gmarshal.c                       \
118         ${gruntime_built_public_sources} \
119 @STRIP_END@
120 # non-header sources (headers should be specified in the above variables)
121 # that don't serve as direct make target sources, i.e. they don't have
122 # their own .lo rules and don't get publically installed
123 gruntime_extra_sources = @STRIP_BEGIN@ \
124         gmarshal.list           \
125         gmarshal.strings        \
126 @STRIP_END@
127
128
129 #
130 # setup GRuntime sources and their dependancies
131 #
132 gruntime_target_headers = $(gruntime_public_h_sources) $(gruntime_built_public_sources)
133 gruntime_target_sources = $(gruntime_c_sources)
134 MAINTAINERCLEANFILES += $(gruntime_built_sources)
135 EXTRA_HEADERS +=
136 EXTRA_DIST += $(gruntime_private_h_sources) $(gruntime_extra_sources)
137 EXTRA_DIST += $(gruntime_built_sources)
138
139 #
140 # rules to generate built sources
141 #
142 # setup autogeneration dependancies
143 gen_sources = xgen-gmh xgen-gmc xgen-gms
144 CLEANFILES += $(gen_sources)
145
146 $(libgobject_1_3_la_OBJECTS): $(gruntime_built_sources)  ${gruntime_built_public_sources} # this is our oldest file, used for implicit auto-generation deps
147 # initial creation of the real stamp-* files
148 gmarshal.h:     # never add deps here
149         test -f "$(srcdir)/$@" || touch $(srcdir)/$@
150 # normal autogeneration rules
151 # all autogenerated files need to be generated in the srcdir,
152 # so old versions get remade and are not confused with newer
153 # versions in the build dir. thus a development setup requires
154 # srcdir to be writable, passing --disable-rebuilds to
155 # ../configure will supress all autogeneration rules.
156 $(srcdir)/stamp-gmarshal.h: @REBUILD@ gmarshal.list gmarshal.h glib-genmarshal$(EXEEXT)
157         echo "#ifndef __G_MARSHAL_H__" > xgen-gmh \
158         && echo "#define __G_MARSHAL_H__" >> xgen-gmh \
159         && ./glib-genmarshal --nostdinc --prefix=g_cclosure_marshal $(srcdir)/gmarshal.list --header >> xgen-gmh \
160         && echo "#endif /* __G_MARSHAL_H__ */" >> xgen-gmh \
161         && (cmp -s xgen-gmh $(srcdir)/gmarshal.h || cp xgen-gmh $(srcdir)/gmarshal.h) \
162         && rm -f xgen-gmh xgen-gmh~ \
163         && echo timestamp > $@
164 $(srcdir)/gmarshal.c: @REBUILD@ $(srcdir)/stamp-gmarshal.h
165         ./glib-genmarshal --nostdinc --prefix=g_cclosure_marshal $(srcdir)/gmarshal.list --body >> xgen-gmc \
166         && cp xgen-gmc $(srcdir)/gmarshal.c \
167         && rm -f xgen-gmc xgen-gmc~
168 $(srcdir)/gmarshal.strings: @REBUILD@ $(srcdir)/gmarshal.list
169         grep '^[A-Z]' $(srcdir)/gmarshal.list \
170         | sed -e 's/^/"g_cclosure_marshal_/' -e 's/:/__/' -e 's/,/_/g' -e 's/$$/",/' > xgen-gms \
171         && cp xgen-gms $(srcdir)/gmarshal.strings \
172         && rm -f xgen-gms xgen-gms~
173 glib-genmarshal.o: gmarshal.strings
174
175
176 # target platform:
177 libgobjectinclude_HEADERS = $(gruntime_target_headers)
178 libgobject_1_3_la_SOURCES = $(gruntime_target_sources)
179
180 #
181 # programs to compile and install
182 #
183 bin_PROGRAMS = gobject-query glib-genmarshal
184 bin_SCRIPTS = glib-mkenums
185 noinst_PROGRAMS =  testgruntime
186 # source files
187 gobject_query_SOURCES = gobject-query.c
188 glib_genmarshal_SOURCES = glib-genmarshal.c
189 testgruntime_SOURCES = testgruntime.c
190 # link programs against libgobject
191 progs_LDADD = ./libgobject-1.3.la $(libglib)
192 glib_genmarshal_LDADD = $(libglib)
193 gobject_query_LDADD = $(progs_LDADD)
194 testgruntime_LDADD = $(progs_LDADD)
195
196 #
197 # manual pages to install
198 #
199 man_MANS = glib-genmarshal.1 glib-mkenums.1
200
201 #
202 # auxillary files
203 #
204 EXTRA_DIST +=                   \
205         makefile.mingw.in       \
206         makefile.msc.in         \
207         gobject.def             \
208         gobject.rc.in           \
209         glib-genmarshal.1       \
210         glib-mkenums            \
211         glib-mkenums.1
212
213 BUILT_EXTRA_DIST = \
214         makefile.mingw          \
215         makefile.msc            \
216         gobject.rc
217
218 glib-mkenums: $(srcdir)/glib-mkenums
219         if test -e glib-mkenums; then           \
220           rm glib-mkenums;                      \
221         fi;                                     \
222         cp $(srcdir)/glib-mkenums glib-mkenums
223
224 if OS_WIN32
225 @G_OBJECT_WIN32_RESOURCE@ : gobject.rc
226         $(top_srcdir)/build/win32/lt-compile-resource gobject.rc @G_OBJECT_WIN32_RESOURCE@
227 endif
228
229 gobject-1.3.lib: libgobject-1.3.la gobject.def
230         lib -name:libgobject-1.3-@LT_CURRENT_MINUS_AGE@.dll -def:gobject.def -out:$@
231
232 gobject.rc: $(top_builddir)/config.status $(top_srcdir)/gobject/gobject.rc.in
233         cd $(top_builddir) && CONFIG_FILES=gobject/$@ CONFIG_HEADERS= $(SHELL) ./config.status
234
235 makefile.mingw: $(top_builddir)/config.status $(top_srcdir)/gobject/makefile.mingw.in
236         cd $(top_builddir) && CONFIG_FILES=gobject/$@ CONFIG_HEADERS= $(SHELL) ./config.status
237
238 makefile.msc: $(top_builddir)/config.status $(top_srcdir)/gobject/makefile.msc.in
239         cd $(top_builddir) && CONFIG_FILES=gobject/$@ CONFIG_HEADERS= $(SHELL) ./config.status
240
241 dist-hook: $(BUILT_EXTRA_DIST)
242         files='$(BUILT_EXTRA_DIST)'; \
243         for f in $$files; do \
244           if test -f $$f; then d=.; else d=$(srcdir); fi; \
245           cp $$d/$$f $(distdir) || exit 1; done
246
247 install-data-local: install-ms-lib install-libtool-import-lib
248
249 uninstall-local: uninstall-ms-lib uninstall-libtool-import-lib