f1a88c806d2bf0bb72505db8934f0cd12453420c
[gnome.gobject-introspection] / tests / offsets / Makefile.am
1 include $(top_srcdir)/common.mk
2
3 BUILT_SOURCES =
4 CLEANFILES =
5 EXTRA_DIST =
6
7 check_LTLIBRARIES =
8 check_PROGRAMS =
9
10 ############################################################
11
12 check_LTLIBRARIES += liboffsets.la
13
14 liboffsets_la_SOURCES = \
15         offsets.h       \
16         offsets.c
17 liboffsets_la_CPPFLAGS = $(GIREPO_CFLAGS)
18 # dummy rpath to get built dynamically (huh?)
19 liboffsets_la_LDFLAGS = -avoid-version -rpath $(libdir)
20
21 offsets-1.0.gir: liboffsets.la offsets.h $(SCANNER_BIN) $(SCANNER_LIBS) Makefile
22         $(CHECK_DEBUG) $(SCANNER) \
23         --include=GObject-2.0 \
24         --libtool="$(LIBTOOL)" \
25         --library=liboffsets.la \
26         --namespace=offsets \
27         --nsversion=1.0 \
28         --pkg gobject-2.0 \
29         $(srcdir)/offsets.h $(srcdir)/offsets.c \
30          --output $@
31
32 %.typelib: %.gir $(top_builddir)/tools/g-ir-compiler$(EXEEXT) Makefile
33         $(top_builddir)/tools/g-ir-compiler --includedir=. --includedir=$(top_builddir)/gir $< -o $@
34
35 CLEANFILES += offsets-1.0.gir offsets-1.0.typelib
36
37 ############################################################
38
39 check_PROGRAMS += gitestoffsets
40
41 nodist_gitestoffsets_SOURCES = gitestoffsets.c
42 gitestoffsets_CPPFLAGS = $(GIREPO_CFLAGS) -I$(top_srcdir)/girepository
43 gitestoffsets_LDADD = $(top_builddir)/girepository/libgirepository-1.0.la $(GIREPO_LIBS)
44
45 gitestoffsets.c: gen-gitestoffsets offsets.h
46         $(PYTHON) $(srcdir)/gen-gitestoffsets $(srcdir)/offsets.h > $@ || ( rm -f $@ && false )
47
48 EXTRA_DIST += gen-gitestoffsets
49 BUILT_SOURCES += gitestoffsets.c
50 CLEANFILES += gitestoffsets.c
51
52 ############################################################
53
54 check-local: offsets-1.0.typelib
55         GI_TYPELIB_PATH=:$(top_builddir)/gir ./gitestoffsets$(EXEEXT) offsets.compiled offsets.introspected
56         diff -u offsets.compiled offsets.introspected
57
58 CLEANFILES += offsets.compiled offsets.introspected