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