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