Merge branch 'typelib-dlopen'
[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="$(SHAVE_SAVED_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         LD_LIBRARY_PATH=$(top_builddir)/girepository/.libs:.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH} \
34          $(top_builddir)/tools/g-ir-compiler --includedir=. --includedir=$(top_builddir)/gir $< -o $@
35
36 CLEANFILES += offsets-1.0.gir offsets-1.0.typelib
37
38 ############################################################
39
40 check_PROGRAMS += gitestoffsets
41
42 nodist_gitestoffsets_SOURCES = gitestoffsets.c
43 gitestoffsets_CPPFLAGS = $(GIREPO_CFLAGS) -I$(top_srcdir)/girepository
44 gitestoffsets_LDADD = $(top_builddir)/girepository/libgirepository-1.0.la $(GIREPO_LIBS)
45
46 gitestoffsets.c: gen-gitestoffsets offsets.h
47         $(PYTHON) $(srcdir)/gen-gitestoffsets $(srcdir)/offsets.h > $@ || ( rm -f $@ && false )
48
49 EXTRA_DIST += gen-gitestoffsets
50 BUILT_SOURCES += gitestoffsets.c
51 CLEANFILES += gitestoffsets.c
52
53 ############################################################
54
55 check-local: offsets-1.0.typelib
56         LD_LIBRARY_PATH=$(top_builddir)/girepository/.libs:.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH} \
57          GI_TYPELIB_PATH=:$(top_builddir)/gir ./gitestoffsets$(EXEEXT) offsets.compiled offsets.introspected
58         diff -u offsets.compiled offsets.introspected
59
60 CLEANFILES += offsets.compiled offsets.introspected