Look for windres on Win32.
[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 if PLATFORM_WIN32
6 no_undefined = -no-undefined
7 else
8 no_undefined =
9 endif
10
11 INCLUDES = \
12         -I$(top_srcdir)         \
13         -DG_DISABLE_DEPRECATED  \
14         $(DEP_CFLAGS)
15
16 lib_LTLIBRARIES = libatk-1.0.la
17
18 libatk_1_0_la_LDFLAGS =                         \
19         -version-info $(LT_VERSION_INFO)        \
20         $(no_undefined)
21 libatk_1_0_la_LIBADD = $(DEP_LIBS)
22
23 libatk_1_0_la_SOURCES =         \
24         atkaction.c             \
25         atkcomponent.c          \
26         atkdocument.c           \
27         atkeditabletext.c       \
28         atkgobjectaccessible.c  \
29         atkhyperlink.c          \
30         atkhypertext.c          \
31         atkimage.c              \
32         atknoopobject.c         \
33         atknoopobjectfactory.c  \
34         atkobject.c             \
35         atkobjectfactory.c      \
36         atkregistry.c           \
37         atkrelation.c           \
38         atkrelationset.c        \
39         atkselection.c          \
40         atkstate.c              \
41         atkstateset.c           \
42         atkstreamablecontent.c  \
43         atktable.c              \
44         atktext.c               \
45         atkutil.c               \
46         atkvalue.c              \
47         atk-enum-types.c
48
49 libatkincludedir=$(includedir)/atk-1.0/atk
50
51 atk_headers = \
52         atk.h                   \
53         atkaction.h             \
54         atkcomponent.h          \
55         atkdocument.h           \
56         atkeditabletext.h       \
57         atkgobjectaccessible.h  \
58         atkhyperlink.h          \
59         atkhypertext.h          \
60         atknoopobject.h         \
61         atknoopobjectfactory.h  \
62         atkobject.h             \
63         atkobjectfactory.h      \
64         atkimage.h              \
65         atkregistry.h           \
66         atkrelation.h           \
67         atkrelationtype.h       \
68         atkrelationset.h        \
69         atkselection.h          \
70         atkstate.h              \
71         atkstateset.h           \
72         atkstreamablecontent.h  \
73         atktable.h              \
74         atktext.h               \
75         atkutil.h               \
76         atkvalue.h
77
78 libatkinclude_HEADERS =         \
79         $(atk_headers)          \
80         atk-enum-types.h
81
82
83 # ---------- Handle built sources ----------
84
85 BUILT_SOURCES = atkmarshal.h atkmarshal.c atk-enum-types.h atk-enum-types.c
86
87 atkmarshal.h: stamp-atkmarshal.h
88         @true
89 stamp-atkmarshal.h: @REBUILD@ atkmarshal.list
90         $(GLIB_GENMARSHAL) --prefix=atk_marshal $(srcdir)/atkmarshal.list --header >> xgen-gmh \
91         && (cmp -s xgen-gmh atkmarshal.h || cp xgen-gmh atkmarshal.h) \
92         && rm -f xgen-gmh xgen-gmh~                                     \
93         && echo timestamp > $(@F)
94
95 atkmarshal.c: stamp-atkmarshal.c
96         @true
97 stamp-atkmarshal.c: @REBUILD@ atkmarshal.list
98         $(GLIB_GENMARSHAL) --prefix=atk_marshal $(srcdir)/atkmarshal.list --body >> xgen-gmc \
99         && (cmp -s xgen-gmc atkmarshal.c || cp xgen-gmc atkmarshal.c) \
100         && rm -f xgen-gmc xgen-gmc~                                     \
101         && echo timestamp > $(@F)
102
103 atk-enum-types.h: s-enum-types-h
104         @true
105 s-enum-types-h: @REBUILD@ $(atk_headers) Makefile
106         ( cd $(srcdir) && glib-mkenums \
107                         --fhead "#ifndef __ATK_ENUM_TYPES_H__\n#define __ATK_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
108                         --fprod "/* enumerations from \"@filename@\" */\n" \
109                         --vhead "GType @enum_name@_get_type (void);\n#define ATK_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n"         \
110                         --ftail "G_END_DECLS\n\n#endif /* __ATK_ENUM_TYPES_H__ */" \
111                 $(atk_headers) ) > tmp-atk-enum-types.h \
112         && (cmp -s tmp-atk-enum-types.h atk-enum-types.h || cp tmp-atk-enum-types.h atk-enum-types.h ) \
113         && rm -f tmp-atk-enum-types.h \
114         && echo timestamp > $(@F)
115
116 atk-enum-types.c: s-enum-types-c
117         @true
118 s-enum-types-c: @REBUILD@ $(atk_headers) Makefile
119         ( cd $(srcdir) && glib-mkenums \
120                         --fhead "#include <atk.h>" \
121                         --fprod "\n/* enumerations from \"@filename@\" */" \
122                         --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[] = {"     \
123                         --vprod "      { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
124                         --vtail "      { 0, NULL, NULL }\n    };\n    etype = g_@type@_register_static (\"@EnumName@\", values);\n  }\n  return etype;\n}\n" \
125                 $(atk_headers) ) > tmp-atk-enum-types.c \
126         && (cmp -s tmp-atk-enum-types.c atk-enum-types.c || cp tmp-atk-enum-types.c atk-enum-types.c ) \
127         && rm -f tmp-atk-enum-types.c \
128         && echo timestamp > $(@F)
129
130 # ---------- Win32 stuff ----------
131
132 if OS_WIN32
133 libatk_1_0_la_LDFLAGS += -export-symbols atk.def -no-undefined -Wl,atk-win32-res.o
134 libatk_1_0_la_DEPENDENCIES = atk-win32-res.o
135
136 install-def-file:
137         $(INSTALL) $(srcdir)atk.def $(DESTDIR)$(libdir)/atk-1.0.def
138 uninstall-def-file:
139         -rm $(DESTDIR)$(libdir)/atk-1.0.def
140 else
141 install-def-file:
142 uninstall-def-file:
143 endif
144
145 atk-win32-res.o: atk.rc
146         $(WINDRES) $< $@
147
148 if MS_LIB_AVAILABLE
149 noinst_DATA = atk-$(ATK_API_VERSION).lib
150
151 install-ms-lib:
152         $(INSTALL) atk-$(ATK_API_VERSION).lib $(DESTDIR)$(libdir)
153
154 uninstall-ms-lib:
155         -rm $(DESTDIR)$(libdir)/atk-$(ATK_API_VERSION).lib
156 else
157 install-ms-lib:
158 uninstall-ms-lib:
159 endif
160
161 atk-$(ATK_API_VERSION).lib: libatk-$(ATK_API_VERSION).la atk.def
162         lib -name:libatk-$(ATK_API_VERSION)-$(LT_CURRENT_MINUS_AGE).dll -def:atk.def -out:$@
163
164
165 EXTRA_DIST = atk.def atk.rc.in atkmarshal.list atkintl.h
166
167 DISTCLEANFILES = \
168   stamp-atkmarshal.h stamp-atkmarshal.c \
169   s-enum-types-h s-enum-types-c
170
171 distclean-local:
172         if test $(srcdir) = .; then :; else \
173           rm -f atkmarshal.h atkmarshal.c atk-enum-types.h atk-enum-types.c; \
174         fi
175
176 install-data-local: install-ms-lib install-def-file
177
178 uninstall-local: uninstall-ms-lib uninstall-def-file