Re-wrap
[gnome.gobject-introspection] / tests / scanner / Makefile.am
1 # We need to build a shared library, which can be dlopened
2 # it does not work with noinst_LTLIBRARIES
3 testlib_LTLIBRARIES =           \
4         libannotation.la        \
5         libdrawable.la          \
6         libfoo.la               \
7         libutility.la
8 testlibdir = $(prefix)/unused
9 install-testlibLTLIBRARIES: # prevent it from being installed
10
11 libannotation_la_SOURCES = $(srcdir)/annotation.c $(srcdir)/annotation.h
12 libannotation_la_CFLAGS = $(GOBJECT_CFLAGS)
13 libannotation_la_LDFLAGS = -module -avoid-version
14 libannotation_la_LIBADD = $(GOBJECT_LIBS)
15
16 libdrawable_la_SOURCES = $(srcdir)/drawable.c $(srcdir)/drawable.h
17 libdrawable_la_CFLAGS = $(GOBJECT_CFLAGS)
18 libdrawable_la_LDFLAGS = -module -avoid-version
19 libdrawable_la_LIBADD = $(GOBJECT_LIBS)
20
21 libfoo_la_SOURCES = $(srcdir)/foo.c $(srcdir)/foo.h
22 libfoo_la_CFLAGS = $(GOBJECT_CFLAGS)
23 libfoo_la_LDFLAGS = -module -avoid-version
24 libfoo_la_LIBADD = $(GOBJECT_LIBS)
25
26 libutility_la_SOURCES = $(srcdir)/utility.c $(srcdir)/utility.h
27 libutility_la_CFLAGS = $(GOBJECT_CFLAGS)
28 libutility_la_LDFLAGS = -module -avoid-version
29 libutility_la_LIBADD = $(GOBJECT_LIBS)
30
31 CLEANFILES = utility.gir foo.gir
32 EXTRA_DIST = utility-expected.gir foo-expected.gir
33
34 SCANNER = $(top_srcdir)/tools/g-ir-scanner
35 SCANNER_LIBS = \
36         $(top_srcdir)/giscanner/*.py \
37         $(top_builddir)/giscanner/libgiscanner.la
38
39 annotation.gir: libannotation.la annotation.h $(SCANNER) $(SCANNER_LIBS)
40         $(CHECK_DEBUG) $(SCANNER) -v \
41         --include=$(top_srcdir)/gir/glib-2.0.gir \
42         --include=$(top_srcdir)/gir/gobject-2.0.gir \
43         --library=libannotation.la \
44         --namespace=test \
45         --pkg gobject-2.0 \
46         $(libannotation_la_SOURCES) \
47          --output $@
48
49 drawable.gir: libdrawable.la drawable.h $(SCANNER) $(SCANNER_LIBS)
50         $(CHECK_DEBUG) $(SCANNER) -v \
51         --include=$(top_srcdir)/gir/glib-2.0.gir \
52         --include=$(top_srcdir)/gir/gobject-2.0.gir \
53         --library=libdrawable.la \
54         --namespace=test \
55         --pkg gobject-2.0 \
56         $(libdrawable_la_SOURCES) \
57          --output $@
58
59 foo.gir: libfoo.la foo.h $(SCANNER) $(SCANNER_LIBS)
60         $(CHECK_DEBUG) $(SCANNER) -v \
61         --include=$(top_srcdir)/gir/glib-2.0.gir \
62         --include=$(top_srcdir)/gir/gobject-2.0.gir \
63         --include=$(top_builddir)/tests/scanner/utility.gir \
64         --library=libfoo.la \
65         --namespace=foo \
66         --pkg gobject-2.0 \
67         $(libfoo_la_SOURCES) \
68          --output $@
69
70 utility.gir: libutility.la utility.h $(SCANNER) $(SCANNER_LIBS)
71         $(CHECK_DEBUG) $(SCANNER) -v \
72         --include=$(top_srcdir)/gir/glib-2.0.gir \
73         --include=$(top_srcdir)/gir/gobject-2.0.gir \
74         --library=libutility.la \
75         --namespace=utility \
76         --pkg gobject-2.0 \
77         $(libutility_la_SOURCES) \
78         --output $@
79
80 check-%.gir: %.gir
81         @diff -u -U 10 $(srcdir)/$*-expected.gir $*.gir && echo "* $*.gir"
82
83 pre-check:
84         @if test "$(top_builddir)" != "$(top_srcdir)"; then \
85            cp $(top_srcdir)/giscanner/*.py $(top_builddir)/giscanner; \
86         fi
87         @echo "Running scanner checks..."
88
89 post-check:
90         @echo "========================"
91         @echo "All scanner tests passed"
92         @echo "========================"
93         @if test "$(top_builddir)" != "$(top_srcdir)"; then \
94            rm -f $(top_builddir)/giscanner/*.py*; \
95         fi
96
97 check-local: pre-check
98 check-local: check-utility.gir check-annotation.gir check-drawable.gir 
99 check-local: check-foo.gir
100 check-local: post-check
101
102 .PHONY: annotation.gir drawable.gir foo.gir utility.gir