Build introspection data if available and configured
[platform/upstream/atk.git] / atk / Makefile.am
1 # We set GPATH here; this gives us semantics for GNU make
2 # which are more like other make's VPATH.
3 GPATH = $(srcdir)
4
5 CLEANFILES =
6
7 if PLATFORM_WIN32
8 no_undefined = -no-undefined
9 else
10 no_undefined =
11 endif
12
13 INCLUDES = \
14         -I$(top_srcdir)         \
15         -DG_DISABLE_DEPRECATED  \
16         -DATK_DISABLE_DEPRECATED        \
17         -DATK_COMPILATION       \
18         -DATK_LOCALEDIR="\"$(datadir)/locale\"" \
19         $(DEP_CFLAGS)
20
21 lib_LTLIBRARIES = libatk-1.0.la
22
23 libatk_1_0_la_LDFLAGS =                         \
24         -version-info $(LT_VERSION_INFO)        \
25         $(no_undefined)
26 libatk_1_0_la_LIBADD = $(DEP_LIBS)
27
28 libatk_1_0_la_SOURCES =         \
29         atkaction.c             \
30         atkcomponent.c          \
31         atkdocument.c           \
32         atkeditabletext.c       \
33         atkgobjectaccessible.c  \
34         atkhyperlink.c          \
35         atkhyperlinkimpl.c      \
36         atkhypertext.c          \
37         atkimage.c              \
38         atknoopobject.c         \
39         atknoopobjectfactory.c  \
40         atkobject.c             \
41         atkobjectfactory.c      \
42         atkplug.c               \
43         atkregistry.c           \
44         atkrelation.c           \
45         atkrelationset.c        \
46         atkselection.c          \
47         atksocket.c             \
48         atkstate.c              \
49         atkstateset.c           \
50         atkstreamablecontent.c  \
51         atktable.c              \
52         atktext.c               \
53         atkutil.c               \
54         atkmisc.c               \
55         atkvalue.c              \
56         atk-enum-types.c
57
58 libatkincludedir=$(includedir)/atk-1.0/atk
59
60 atk_headers = \
61         atk.h                   \
62         atkaction.h             \
63         atkcomponent.h          \
64         atkdocument.h           \
65         atkeditabletext.h       \
66         atkgobjectaccessible.h  \
67         atkhyperlink.h          \
68         atkhyperlinkimpl.h      \
69         atkhypertext.h          \
70         atknoopobject.h         \
71         atknoopobjectfactory.h  \
72         atkobject.h             \
73         atkobjectfactory.h      \
74         atkplug.h               \
75         atkimage.h              \
76         atkregistry.h           \
77         atkrelation.h           \
78         atkrelationtype.h       \
79         atkrelationset.h        \
80         atkselection.h          \
81         atksocket.h             \
82         atkstate.h              \
83         atkstateset.h           \
84         atkstreamablecontent.h  \
85         atktable.h              \
86         atktext.h               \
87         atkutil.h               \
88         atkmisc.h               \
89         atkvalue.h
90
91 libatkinclude_HEADERS =         \
92         $(atk_headers)          \
93         atk-enum-types.h
94
95
96 # ---------- Handle built sources ----------
97
98 BUILT_SOURCES = atkmarshal.h atkmarshal.c atk-enum-types.h atk-enum-types.c
99
100 atkmarshal.h: stamp-atkmarshal.h
101         @true
102 stamp-atkmarshal.h: @REBUILD@ atkmarshal.list
103         $(GLIB_GENMARSHAL) --prefix=atk_marshal $(srcdir)/atkmarshal.list --header >> xgen-gmh \
104         && (cmp -s xgen-gmh atkmarshal.h || cp xgen-gmh atkmarshal.h) \
105         && rm -f xgen-gmh xgen-gmh~                                     \
106         && echo timestamp > $(@F)
107
108 atkmarshal.c: stamp-atkmarshal.c
109         @true
110 stamp-atkmarshal.c: @REBUILD@ atkmarshal.list
111         $(GLIB_GENMARSHAL) --prefix=atk_marshal $(srcdir)/atkmarshal.list --body >> xgen-gmc \
112         && (cmp -s xgen-gmc atkmarshal.c || cp xgen-gmc atkmarshal.c) \
113         && rm -f xgen-gmc xgen-gmc~                                     \
114         && echo timestamp > $(@F)
115
116 atk-enum-types.h: s-enum-types-h
117         @true
118 s-enum-types-h: @REBUILD@ $(atk_headers) Makefile
119         ( cd $(srcdir) && $(GLIB_MKENUMS) \
120                         --fhead "#if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)\n#error \"Only <atk/atk.h> can be included directly.\"\n#endif\n\n#ifndef __ATK_ENUM_TYPES_H__\n#define __ATK_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
121                         --fprod "/* enumerations from \"@filename@\" */\n" \
122                         --vhead "GType @enum_name@_get_type (void);\n#define ATK_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n"         \
123                         --ftail "G_END_DECLS\n\n#endif /* __ATK_ENUM_TYPES_H__ */" \
124                 $(atk_headers) ) > tmp-atk-enum-types.h \
125         && (cmp -s tmp-atk-enum-types.h atk-enum-types.h || cp tmp-atk-enum-types.h atk-enum-types.h ) \
126         && rm -f tmp-atk-enum-types.h \
127         && echo timestamp > $(@F)
128
129 atk-enum-types.c: s-enum-types-c
130         @true
131 s-enum-types-c: @REBUILD@ $(atk_headers) Makefile
132         ( cd $(srcdir) && $(GLIB_MKENUMS) \
133                         --fhead "#include <atk.h>" \
134                         --fprod "\n/* enumerations from \"@filename@\" */" \
135                         --vhead "GType\n@enum_name@_get_type (void)\n{\n  static GType etype = 0;\n  if (etype == 0) {\n    static const G@Type@Value values[] = {"     \
136                         --vprod "      { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
137                         --vtail "      { 0, NULL, NULL }\n    };\n    etype = g_@type@_register_static (\"@EnumName@\", values);\n  }\n  return etype;\n}\n" \
138                 $(atk_headers) ) > tmp-atk-enum-types.c \
139         && (cmp -s tmp-atk-enum-types.c atk-enum-types.c || cp tmp-atk-enum-types.c atk-enum-types.c ) \
140         && rm -f tmp-atk-enum-types.c \
141         && echo timestamp > $(@F)
142
143 if HAVE_INTROSPECTION
144 BUILT_GIRSOURCES =
145
146 Atk-1.0.gir: $(INTROSPECTION_SCANNER) libatk-1.0.la Makefile
147         $(INTROSPECTION_SCANNER) -v \
148                 --namespace Atk --nsversion=1.0 \
149                 $(INCLUDES) \
150                 --include=GObject-2.0 \
151                 --library=libatk-1.0.la \
152                 --libtool="$(LIBTOOL)" \
153                 --output $@ \
154                 $(libatkinclude_HEADERS) \
155                 $(libatk_1_0_la_SOURCES)
156 BUILT_GIRSOURCES += Atk-1.0.gir
157
158 girdir = $(datadir)/gir-1.0
159 gir_DATA = $(BUILT_GIRSOURCES)
160
161 typelibsdir = $(libdir)/girepository-1.0/
162
163 typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
164
165 %.typelib: %.gir $(INTROSPECTION_COMPILER)
166         $(DEBUG) $(INTROSPECTION_COMPILER) --includedir=$(srcdir) --includedir=. $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
167
168 CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
169 endif
170
171 # ---------- Win32 stuff ----------
172
173 if OS_WIN32
174 libatk_1_0_la_LDFLAGS += -export-symbols $(srcdir)/atk.def -no-undefined -Wl,atk-win32-res.o
175 libatk_1_0_la_DEPENDENCIES = atk-win32-res.o atk.def
176
177 install-def-file:
178         $(INSTALL) $(srcdir)/atk.def $(DESTDIR)$(libdir)/atk-1.0.def
179 uninstall-def-file:
180         -rm $(DESTDIR)$(libdir)/atk-1.0.def
181 else
182 install-def-file:
183 uninstall-def-file:
184 endif
185
186 atk-win32-res.o: atk.rc
187         $(WINDRES) $< $@
188
189 if MS_LIB_AVAILABLE
190 noinst_DATA = atk-$(ATK_API_VERSION).lib
191
192 install-ms-lib:
193         $(INSTALL) atk-$(ATK_API_VERSION).lib $(DESTDIR)$(libdir)
194
195 uninstall-ms-lib:
196         -rm $(DESTDIR)$(libdir)/atk-$(ATK_API_VERSION).lib
197 else
198 install-ms-lib:
199 uninstall-ms-lib:
200 endif
201
202 atk.def: atk.symbols
203         (echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DG_OS_WIN32 -DALL_FILES - <$(srcdir)/atk.symbols | sed -e '/^$$/d' -e 's/^/    /' -e 's/G_GNUC_[^ ]*//g') > atk.def
204
205 atk-$(ATK_API_VERSION).lib: libatk-$(ATK_API_VERSION).la atk.def
206         lib -machine:$(LIB_EXE_MACHINE_FLAG) -name:libatk-$(ATK_API_VERSION)-$(LT_CURRENT_MINUS_AGE).dll -def:atk.def -out:$@
207
208
209 EXTRA_DIST = atk.symbols atk.rc.in atkmarshal.list atkintl.h
210
211 DISTCLEANFILES = \
212   stamp-atkmarshal.h stamp-atkmarshal.c \
213   s-enum-types-h s-enum-types-c
214
215 distclean-local:
216         if test $(srcdir) = .; then :; else \
217           rm -f atkmarshal.h atkmarshal.c atk-enum-types.h atk-enum-types.c; \
218         fi
219
220 install-data-local: install-ms-lib install-def-file
221
222 uninstall-local: uninstall-ms-lib uninstall-def-file