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