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