Windows port: set CAIRO_LIBS in LIBADD, not LDFLAGS
[platform/upstream/gobject-introspection.git] / tests / scanner / Makefile.am
1 include $(top_srcdir)/common.mk
2 include $(top_srcdir)/Makefile.introspection
3
4 INTROSPECTION_SCANNER_ARGS += --warn-all --warn-error -I.
5
6 check_LTLIBRARIES = \
7         libannotation.la \
8         libtestinherit.la \
9         libfoo.la \
10         libutility.la \
11         libgtkfrob.la
12 if HAVE_CAIRO
13 check_LTLIBRARIES += libregress.la
14 endif
15
16 AM_CPPFLAGS = -I$(top_srcdir)/girepository
17 AM_CFLAGS = $(GIO_CFLAGS) $(GOBJECT_CFLAGS) $(GTHREAD_CFLAGS)
18 # -rpath needed to force libtool to build a shared library for a check_LTLIBRARIES
19 # target. See http://lists.gnu.org/archive/html/automake/2005-10/msg00107.html
20 AM_LDFLAGS = -rpath /unused -avoid-version
21 LIBS = $(GOBJECT_LIBS) $(GTHREAD_LIBS)
22
23 libannotation_la_SOURCES = $(srcdir)/annotation.c $(srcdir)/annotation.h
24 libtestinherit_la_SOURCES = $(srcdir)/drawable.c $(srcdir)/drawable.h
25 libfoo_la_SOURCES = $(srcdir)/foo.c $(srcdir)/foo.h
26 libfoo_la_LIBADD = $(top_builddir)/libgirepository-1.0.la
27 libutility_la_SOURCES = $(srcdir)/utility.c $(srcdir)/utility.h
28 libgtkfrob_la_SOURCES = $(srcdir)/gtkfrob.c $(srcdir)/gtkfrob.h
29 libregress_la_SOURCES = $(srcdir)/regress.c $(srcdir)/regress.h
30 libregress_la_LIBADD = $(GIO_LIBS) $(CAIRO_LIBS)
31
32 testsdir = $(datadir)/gobject-introspection-1.0/tests
33 tests_DATA = $(libregress_la_SOURCES)
34
35 libregress_la_CFLAGS = $(AM_CFLAGS) $(CAIRO_CFLAGS)
36 libregress_la_LDFLAGS = $(AM_LDFLAGS)
37
38
39 if OS_WIN32
40 AM_LDFLAGS += -no-undefined
41 endif
42
43 # .gir --[scanner]-> .typelib
44 GIRS =
45 TYPELIBS = $(GIRS:.gir=.typelib)
46 CHECKGIRS = $(GIRS:.gir=.gir.check)
47 EXPECTEDGIRS = $(GIRS:.gir=-expected.gir)
48 INTROSPECTION_GIRS = $(GIRS)
49 CLEANFILES = $(TYPELIBS) $(GIRS)
50 EXTRA_DIST = $(EXPECTEDGIRS)
51
52 Regress-1.0.gir: $(top_builddir)/Gio-2.0.gir libregress.la
53 Regress_1_0_gir_LIBS = libregress.la
54 Regress_1_0_gir_INCLUDES = cairo-1.0 Gio-2.0
55 Regress_1_0_gir_FILES = $(libregress_la_SOURCES)
56 Regress_1_0_gir_SCANNERFLAGS = --c-include="regress.h"
57 if HAVE_CAIRO
58 GIRS += Regress-1.0.gir
59 endif
60
61 Annotation-1.0.gir: Utility-1.0.gir libannotation.la
62 Annotation_1_0_gir_PACKAGES = gobject-2.0
63 Annotation_1_0_gir_LIBS = libannotation.la
64 Annotation_1_0_gir_INCLUDES = GObject-2.0 Utility-1.0
65 Annotation_1_0_gir_FILES = $(libannotation_la_SOURCES)
66 Annotation_1_0_gir_SCANNERFLAGS = --c-include="annotation.h"
67 GIRS += Annotation-1.0.gir
68
69 TestInherit-1.0.gir: Utility-1.0.gir libtestinherit.la
70 TestInherit_1_0_gir_PACKAGES = gobject-2.0
71 TestInherit_1_0_gir_LIBS = libtestinherit.la
72 TestInherit_1_0_gir_INCLUDES = GObject-2.0 Utility-1.0
73 TestInherit_1_0_gir_FILES = $(libtestinherit_la_SOURCES)
74 TestInherit_1_0_gir_SCANNERFLAGS = --c-include="drawable.h"
75 GIRS += TestInherit-1.0.gir
76
77 Foo-1.0.gir: Utility-1.0.gir libfoo.la
78 Foo_1_0_gir_PACKAGES = gobject-2.0
79 Foo_1_0_gir_LIBS = libfoo.la
80 Foo_1_0_gir_INCLUDES = GObject-2.0 Gio-2.0 Utility-1.0
81 Foo_1_0_gir_FILES = $(srcdir)/foo.h $(srcdir)/foo.c
82 Foo_1_0_gir_SCANNERFLAGS = --c-include="foo.h"
83 GIRS += Foo-1.0.gir
84
85 Utility-1.0.gir: libutility.la
86 Utility_1_0_gir_PACKAGES = gobject-2.0
87 Utility_1_0_gir_LIBS = libutility.la
88 Utility_1_0_gir_INCLUDES = GObject-2.0
89 Utility_1_0_gir_FILES = $(libutility_la_SOURCES)
90 Utility_1_0_gir_SCANNERFLAGS = --c-include="utility.h"
91 GIRS += Utility-1.0.gir
92
93 # This one tests different --namespace and --strip-prefix
94 GtkFrob-1.0.gir: libgtkfrob.la
95 GtkFrob_1_0_gir_PACKAGES = gobject-2.0
96 GtkFrob_1_0_gir_LIBS = libgtkfrob.la
97 GtkFrob_1_0_gir_INCLUDES = GObject-2.0
98 GtkFrob_1_0_gir_FILES = $(libgtkfrob_la_SOURCES)
99 GtkFrob_1_0_gir_SCANNERFLAGS = --identifier-prefix=Gtk --symbol-prefix=gtk_frob
100 GIRS += GtkFrob-1.0.gir
101
102 check_PROGRAMS = barapp
103
104 barapp_SOURCES = $(srcdir)/barapp.c $(srcdir)/barapp.h
105 barapp_LDADD = $(top_builddir)/libgirepository-1.0.la
106 barapp_LDFLAGS = -export-dynamic
107
108 Bar-1.0.gir: barapp
109 Bar_1_0_gir_PACKAGES = gobject-2.0
110 Bar_1_0_gir_PROGRAM = ./barapp
111 Bar_1_0_gir_INCLUDES = GObject-2.0
112 Bar_1_0_gir_FILES = $(barapp_SOURCES)
113 Bar_1_0_gir_SCANNERFLAGS = --accept-unprefixed
114 GIRS += Bar-1.0.gir
115
116 %.gir.check: %.gir
117         @diff -u -U 10 $(srcdir)/$*-expected.gir $*.gir && echo "  TEST  $*.gir"
118
119 check-local: $(CHECKGIRS) $(TYPELIBS)