[build] Added basic GObject introspection to libadg
[adg.git] / src / adg / Makefile.am
blobd1838ebddaa9ba73f1592ae5164a003a956252aa
1 include $(top_srcdir)/build/Makefile.am.common
4 SUBDIRS=                        tests
5 AM_CPPFLAGS=                    -I$(top_srcdir)/src \
6                                 -I$(top_builddir)/src
7 AM_CFLAGS=                      $(CAIRO_CFLAGS) \
8                                 $(GOBJECT2_CFLAGS)
9 AM_LDFLAGS=                     $(CAIRO_LIBS) \
10                                 $(GOBJECT2_LIBS)
11 LDADD=                          $(top_builddir)/src/cpml/libcpml-1.la
14 # file groups
15 h_sources=                      adg-adim.h \
16                                 adg-alignment.h \
17                                 adg-arrow.h \
18                                 adg-canvas.h \
19                                 adg-color-style.h \
20                                 adg-container.h \
21                                 adg-dim.h \
22                                 adg-dim-style.h \
23                                 adg-dress.h \
24                                 adg-dress-builtins.h \
25                                 adg-edges.h \
26                                 adg-entity.h \
27                                 adg-enums.h \
28                                 adg-fill-style.h \
29                                 adg-font-style.h \
30                                 adg-hatch.h \
31                                 adg-ldim.h \
32                                 adg-line-style.h \
33                                 adg-logo.h \
34                                 adg-marker.h \
35                                 adg-matrix.h \
36                                 adg-model.h \
37                                 adg-pair.h \
38                                 adg-path.h \
39                                 adg-pattern.h \
40                                 adg-point.h \
41                                 adg-primitive.h \
42                                 adg-projection.h \
43                                 adg-rdim.h \
44                                 adg-ruled-fill.h \
45                                 adg-segment.h \
46                                 adg-stroke.h \
47                                 adg-style.h \
48                                 adg-table.h \
49                                 adg-table-style.h \
50                                 adg-textual.h \
51                                 adg-title-block.h \
52                                 adg-toy-text.h \
53                                 adg-trail.h \
54                                 adg-utils.h
55 built_h_sources=                adg-type-builtins.h
56 private_h_sources=              adg-adim-private.h \
57                                 adg-alignment-private.h \
58                                 adg-arrow-private.h \
59                                 adg-canvas-private.h \
60                                 adg-color-style-private.h \
61                                 adg-container-private.h \
62                                 adg-dim-private.h \
63                                 adg-dim-style-private.h \
64                                 adg-dress-private.h \
65                                 adg-edges-private.h \
66                                 adg-entity-private.h \
67                                 adg-fill-style-private.h \
68                                 adg-font-style-private.h \
69                                 adg-hatch-private.h \
70                                 adg-internal.h \
71                                 adg-ldim-private.h \
72                                 adg-line-style-private.h \
73                                 adg-logo-private.h \
74                                 adg-marker-private.h \
75                                 adg-model-private.h \
76                                 adg-path-private.h \
77                                 adg-projection-private.h \
78                                 adg-rdim-private.h \
79                                 adg-ruled-fill-private.h \
80                                 adg-stroke-private.h \
81                                 adg-table-private.h \
82                                 adg-table-style-private.h \
83                                 adg-text-internal.h \
84                                 adg-title-block-private.h \
85                                 adg-toy-text-private.h \
86                                 adg-trail-private.h
87 built_private_h_sources=        adg-marshal.h
88 c_sources=                      adg-adim.c \
89                                 adg-alignment.c \
90                                 adg-arrow.c \
91                                 adg-canvas.c \
92                                 adg-color-style.c \
93                                 adg-container.c \
94                                 adg-dim.c \
95                                 adg-dim-style.c \
96                                 adg-dress.c \
97                                 adg-dress-builtins.c \
98                                 adg-edges.c \
99                                 adg-entity.c \
100                                 adg-enums.c \
101                                 adg-fill-style.c \
102                                 adg-font-style.c \
103                                 adg-hatch.c \
104                                 adg-ldim.c \
105                                 adg-line-style.c \
106                                 adg-logo.c \
107                                 adg-marker.c \
108                                 adg-matrix.c \
109                                 adg-model.c \
110                                 adg-pair.c \
111                                 adg-path.c \
112                                 adg-pattern.c \
113                                 adg-point.c \
114                                 adg-primitive.c \
115                                 adg-projection.c \
116                                 adg-rdim.c \
117                                 adg-ruled-fill.c \
118                                 adg-segment.c \
119                                 adg-stroke.c \
120                                 adg-style.c \
121                                 adg-table.c \
122                                 adg-table-style.c \
123                                 adg-textual.c \
124                                 adg-title-block.c \
125                                 adg-trail.c \
126                                 adg-toy-text.c \
127                                 adg-utils.c
128 built_c_sources=                adg-type-builtins.c \
129                                 adg-marshal.c
130 template_sources=               adg-type-builtins.c.mkenums \
131                                 adg-type-builtins.h.mkenums \
132                                 adg-marshal.genmarshal
135 # targets
136 EXTRA_DIST=                     $(template_sources)
137 BUILT_SOURCES=                  $(built_h_sources) \
138                                 $(built_private_h_sources)
139 #                               built_c_sources are properly tracked
140 #                               by nodist_libadg_1_la_SOURCES
141 CLEANFILES=                     $(built_h_sources) \
142                                 $(built_private_h_sources) \
143                                 $(built_c_sources)
145 adg_includedir=                 $(includedir)/adg-1/adg
146 adg_include_DATA=               $(h_sources) \
147                                 $(built_h_sources)
149 lib_LTLIBRARIES=                libadg-1.la
150 libadg_1_la_SOURCES=            $(h_sources) \
151                                 $(private_h_sources) \
152                                 $(c_sources)
153 nodist_libadg_1_la_SOURCES=     $(built_h_sources) \
154                                 $(built_private_h_sources) \
155                                 $(built_c_sources)
156 libadg_1_la_LDFLAGS=            -no-undefined
159 ## Optional pangocairo related stuff
160 if HAVE_PANGO
162 h_sources+=                     adg-pango-style.h \
163                                 adg-text.h
164 private_h_sources+=             adg-pango-style-private.h \
165                                 adg-text-private.h
166 c_sources+=                     adg-pango-style.c \
167                                 adg-text.c
168 AM_CFLAGS+=                     $(PANGO_CFLAGS)
169 AM_LDFLAGS+=                    $(PANGO_LIBS)
171 endif
174 ## GObject introspection
175 -include $(INTROSPECTION_MAKEFILE)
176 INTROSPECTION_GIRS=
177 INTROSPECTION_SCANNER_ARGS=     --add-include-path=$(srcdir)
178 INTROSPECTION_COMPILER_ARGS=    --includedir=$(srcdir)
180 if HAVE_INTROSPECTION
182 introspection_sources=          $(h_sources) \
183                                 $(c_sources) \
184                                 $(built_h_sources) \
185                                 $(built_c_sources)
187 Adg-1.gir: libadg-1.la
188 Adg_1_gir_INCLUDES=             GLib-2.0 \
189                                 GObject-2.0
190 if HAVE_PANGO
191 Adg_1_gir_INCLUDES+=            PangoCairo-1.0
192 endif
193 Adg_1_gir_CFLAGS=               $(AM_CPPFLAGS) \
194                                 $(AM_CFLAGS) \
195                                 -D__ADG_H__
196 Adg_1_gir_LDFLAGS=              $(AM_LDFLAGS) \
197                                 -L$(top_builddir)/src/cpml/.libs \
198                                 -lcpml-1
199 Adg_1_gir_LIBS=                 libadg-1.la
200 Adg_1_gir_FILES=                $(introspection_sources)
201 INTROSPECTION_GIRS+=            Adg-1.gir
202 girdir=                         $(datadir)/gir-1.0
203 gir_DATA=                       $(INTROSPECTION_GIRS)
204 typelibdir=                     $(libdir)/girepository-1.0
205 typelib_DATA=                   $(INTROSPECTION_GIRS:.gir=.typelib)
206 CLEANFILES+=                    $(gir_DATA) $(typelib_DATA)
208 endif
211 mkenums_command=                $(AM_V_GEN)$(GLIB_MKENUMS) \
212                                 --template
213 genmarshal_command=             $(AM_V_GEN)$(GLIB_GENMARSHAL) \
214                                 --nostdinc --internal --prefix=adg_marshal
217 adg-type-builtins.c: $(srcdir)/adg-type-builtins.c.mkenums $(srcdir)/adg-enums.h
218         $(mkenums_command) $(srcdir)/adg-type-builtins.c.mkenums $(srcdir)/adg-enums.h > $@
220 adg-type-builtins.h: $(srcdir)/adg-type-builtins.h.mkenums $(srcdir)/adg-enums.h
221         $(mkenums_command) $(srcdir)/adg-type-builtins.h.mkenums $(srcdir)/adg-enums.h > $@
223 adg-marshal.c: $(srcdir)/adg-marshal.genmarshal
224         @echo '#include <glib-object.h>' > $@ ;
225         $(genmarshal_command) --body $(srcdir)/adg-marshal.genmarshal >> $@
227 adg-marshal.h: $(srcdir)/adg-marshal.genmarshal
228         $(genmarshal_command) --header $(srcdir)/adg-marshal.genmarshal > $@