e33cc89a0cd404de12668be1b3fcf6c0558b0be8
[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 include $(INTROSPECTION_MAKEFILE)
6 INTROSPECTION_GIRS =
7
8 CLEANFILES =
9
10 if PLATFORM_WIN32
11 no_undefined = -no-undefined
12 else
13 no_undefined =
14 endif
15
16 INCLUDES = \
17         -I$(top_srcdir)         \
18         -DG_DISABLE_DEPRECATED  \
19         -DATK_DISABLE_DEPRECATED        \
20         -DATK_COMPILATION       \
21         -DATK_LOCALEDIR="\"$(datadir)/locale\"" \
22         $(DEP_CFLAGS)
23
24 lib_LTLIBRARIES = libatk-1.0.la
25
26 libatk_1_0_la_LDFLAGS =                         \
27         -version-info $(LT_VERSION_INFO)        \
28         $(no_undefined)
29 libatk_1_0_la_LIBADD = \
30        $(DEP_LIBS)     \
31        $(INTLLIBS)
32
33 atk_sources =   \
34         atkaction.c             \
35         atkcomponent.c          \
36         atkdocument.c           \
37         atkeditabletext.c       \
38         atkgobjectaccessible.c  \
39         atkhyperlink.c          \
40         atkhyperlinkimpl.c      \
41         atkhypertext.c          \
42         atkimage.c              \
43         atknoopobject.c         \
44         atknoopobjectfactory.c  \
45         atkobject.c             \
46         atkobjectfactory.c      \
47         atkplug.c               \
48         atkregistry.c           \
49         atkrelation.c           \
50         atkrelationset.c        \
51         atkselection.c          \
52         atksocket.c             \
53         atkstate.c              \
54         atkstateset.c           \
55         atkstreamablecontent.c  \
56         atktable.c              \
57         atktext.c               \
58         atkutil.c               \
59         atkmisc.c               \
60         atkvalue.c
61
62 libatk_1_0_la_SOURCES =         \
63         $(atk_sources)          \
64         atk-enum-types.c
65
66 libatkincludedir=$(includedir)/atk-1.0/atk
67
68 atk_headers = \
69         atk.h                   \
70         atkaction.h             \
71         atkcomponent.h          \
72         atkdocument.h           \
73         atkeditabletext.h       \
74         atkgobjectaccessible.h  \
75         atkhyperlink.h          \
76         atkhyperlinkimpl.h      \
77         atkhypertext.h          \
78         atknoopobject.h         \
79         atknoopobjectfactory.h  \
80         atkobject.h             \
81         atkobjectfactory.h      \
82         atkplug.h               \
83         atkimage.h              \
84         atkregistry.h           \
85         atkrelation.h           \
86         atkrelationtype.h       \
87         atkrelationset.h        \
88         atkselection.h          \
89         atksocket.h             \
90         atkstate.h              \
91         atkstateset.h           \
92         atkstreamablecontent.h  \
93         atktable.h              \
94         atktext.h               \
95         atkutil.h               \
96         atkmisc.h               \
97         atkvalue.h
98
99 libatkinclude_HEADERS =         \
100         $(atk_headers)          \
101         atk-enum-types.h
102
103
104 # ---------- Handle built sources ----------
105
106 BUILT_SOURCES = atkmarshal.h atkmarshal.c atk-enum-types.h atk-enum-types.c
107
108 atkmarshal.h: stamp-atkmarshal.h
109         @true
110 stamp-atkmarshal.h: @REBUILD@ atkmarshal.list
111         $(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=atk_marshal $(srcdir)/atkmarshal.list --header >> xgen-gmh \
112         && (cmp -s xgen-gmh atkmarshal.h || cp xgen-gmh atkmarshal.h) \
113         && rm -f xgen-gmh xgen-gmh~                                     \
114         && echo timestamp > $(@F)
115
116 atkmarshal.c: stamp-atkmarshal.c
117         @true
118 stamp-atkmarshal.c: @REBUILD@ atkmarshal.list
119         $(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=atk_marshal $(srcdir)/atkmarshal.list --body >> xgen-gmc \
120         && (cmp -s xgen-gmc atkmarshal.c || cp xgen-gmc atkmarshal.c) \
121         && rm -f xgen-gmc xgen-gmc~                                     \
122         && echo timestamp > $(@F)
123
124 atk-enum-types.h: s-enum-types-h
125         @true
126 s-enum-types-h: @REBUILD@ $(atk_headers) Makefile
127         $(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) \
128                         --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" \
129                         --fprod "/* enumerations from \"@filename@\" */\n" \
130                         --vhead "GType @enum_name@_get_type (void);\n#define ATK_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n"         \
131                         --ftail "G_END_DECLS\n\n#endif /* __ATK_ENUM_TYPES_H__ */" \
132                 $(atk_headers) ) > tmp-atk-enum-types.h \
133         && (cmp -s tmp-atk-enum-types.h atk-enum-types.h || cp tmp-atk-enum-types.h atk-enum-types.h ) \
134         && rm -f tmp-atk-enum-types.h \
135         && echo timestamp > $(@F)
136
137 atk-enum-types.c: s-enum-types-c
138         @true
139 s-enum-types-c: @REBUILD@ $(atk_headers) Makefile
140         $(AM_V_GEN) ( cd $(srcdir) && $(GLIB_MKENUMS) \
141                         --fhead "#include <atk.h>" \
142                         --fprod "\n/* enumerations from \"@filename@\" */" \
143                         --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[] = {"     \
144                         --vprod "      { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
145                         --vtail "      { 0, NULL, NULL }\n    };\n    etype = g_@type@_register_static (\"@EnumName@\", values);\n  }\n  return etype;\n}\n" \
146                 $(atk_headers) ) > tmp-atk-enum-types.c \
147         && (cmp -s tmp-atk-enum-types.c atk-enum-types.c || cp tmp-atk-enum-types.c atk-enum-types.c ) \
148         && rm -f tmp-atk-enum-types.c \
149         && echo timestamp > $(@F)
150
151
152 if HAVE_INTROSPECTION
153 introspection_sources = \
154     $(atk_headers)      \
155     $(atk_sources)
156 introspection_generated_sources = \
157     atk-enum-types.c    \
158     atk-enum-types.h
159
160 Atk-1.0.gir: libatk-1.0.la Makefile
161 Atk_1_0_gir_INCLUDES = GObject-2.0
162 Atk_1_0_gir_CFLAGS = $(INCLUDES)
163 Atk_1_0_gir_LIBS = libatk-1.0.la
164 Atk_1_0_gir_SCANNERFLAGS = --pkg-export atk --warn-all
165 Atk_1_0_gir_FILES = \
166     $(addprefix $(srcdir)/, $(introspection_sources))   \
167     $(introspection_generated_sources)
168 INTROSPECTION_GIRS += Atk-1.0.gir
169
170 girdir = $(datadir)/gir-1.0
171 gir_DATA = $(INTROSPECTION_GIRS)
172
173 typelibsdir = $(libdir)/girepository-1.0
174 typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
175
176 CLEANFILES += $(gir_DATA) $(typelibs_DATA)
177 endif
178
179 # ---------- Win32 stuff ----------
180
181 if OS_WIN32
182 libatk_1_0_la_LDFLAGS += -export-symbols $(srcdir)/atk.def -no-undefined -Wl,atk-win32-res.o
183 libatk_1_0_la_DEPENDENCIES = atk-win32-res.o atk.def
184
185 install-def-file:
186         $(INSTALL) $(srcdir)/atk.def $(DESTDIR)$(libdir)/atk-1.0.def
187 uninstall-def-file:
188         -rm $(DESTDIR)$(libdir)/atk-1.0.def
189 else
190 install-def-file:
191 uninstall-def-file:
192 endif
193
194 atk-win32-res.o: atk.rc
195         $(WINDRES) $< $@
196
197 if MS_LIB_AVAILABLE
198 noinst_DATA = atk-$(ATK_API_VERSION).lib
199
200 install-ms-lib:
201         $(INSTALL) atk-$(ATK_API_VERSION).lib $(DESTDIR)$(libdir)
202
203 uninstall-ms-lib:
204         -rm $(DESTDIR)$(libdir)/atk-$(ATK_API_VERSION).lib
205 else
206 install-ms-lib:
207 uninstall-ms-lib:
208 endif
209
210 atk.def: atk.symbols
211         (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
212
213 atk-$(ATK_API_VERSION).lib: libatk-$(ATK_API_VERSION).la atk.def
214         lib -machine:$(LIB_EXE_MACHINE_FLAG) -name:libatk-$(ATK_API_VERSION)-$(LT_CURRENT_MINUS_AGE).dll -def:atk.def -out:$@
215
216
217 EXTRA_DIST = atk.symbols atk.rc.in atkmarshal.list atkintl.h atk.rc
218
219 dist-hook: ../build/win32/vs9/atk.vcproj ../build/win32/vs10/atk.vcxproj ../build/win32/vs10/atk.vcxproj.filters
220
221 ../build/win32/vs9/atk.vcproj: ../build/win32/vs9/atk.vcprojin
222         for F in $(libatk_1_0_la_SOURCES); do \
223                 case $$F in \
224                 *.c) echo '   <File RelativePath="..\..\..\atk\'$$F'" />' \
225                      ;; \
226                 esac; \
227         done >libatk.sourcefiles
228         $(CPP) -P - <$(top_srcdir)/build/win32/vs9/atk.vcprojin >$@
229         rm libatk.sourcefiles
230         
231 ../build/win32/vs10/atk.vcxproj: ../build/win32/vs10/atk.vcxprojin
232         for F in $(libatk_1_0_la_SOURCES); do \
233                 case $$F in \
234                 *.c) echo '    <ClCompile Include="..\..\..\atk\'$$F'" />' \
235                      ;; \
236                 esac; \
237         done >libatk.vs10.sourcefiles
238         $(CPP) -P - <$(top_srcdir)/build/win32/vs10/atk.vcxprojin >$@
239         rm libatk.vs10.sourcefiles
240         
241 ../build/win32/vs10/atk.vcxproj.filters: ../build/win32/vs10/atk.vcxproj.filtersin
242         for F in $(libatk_1_0_la_SOURCES); do \
243                 case $$F in \
244                 *.c) echo '    <ClCompile Include="..\..\..\atk\'$$F'"><Filter>Source Files</Filter></ClCompile>' \
245                      ;; \
246                 esac; \
247         done >libatk.vs10.sourcefiles.filters
248         $(CPP) -P - <$(top_srcdir)/build/win32/vs10/atk.vcxproj.filtersin >$@
249         rm libatk.vs10.sourcefiles.filters
250
251 DISTCLEANFILES = \
252   stamp-atkmarshal.h stamp-atkmarshal.c \
253   s-enum-types-h s-enum-types-c
254
255 distclean-local:
256         if test $(srcdir) = .; then :; else \
257           rm -f atkmarshal.h atkmarshal.c atk-enum-types.h atk-enum-types.c; \
258         fi
259
260 install-data-local: install-ms-lib install-def-file
261
262 uninstall-local: uninstall-ms-lib uninstall-def-file