Bug 567813 – Everything should be versioned
[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         --libtool="$(LIBTOOL)" \
24         --library=offsets \
25         --namespace=offsets \
26         --nsversion=1.0 \
27         --pkg gobject-2.0 \
28         $(srcdir)/offsets.h $(srcdir)/offsets.c \
29          --output $@
30
31 %.typelib: %.gir $(top_builddir)/tools/g-ir-compiler$(EXEEXT) Makefile
32         $(top_builddir)/tools/g-ir-compiler --includedir=. --includedir=$(top_builddir)/gir $< -o $@
33
34 CLEANFILES += offsets-1.0.gir offsets-1.0.typelib
35
36 ############################################################
37
38 check_PROGRAMS += gitestoffsets
39
40 nodist_gitestoffsets_SOURCES = gitestoffsets.c
41 gitestoffsets_CPPFLAGS = $(GIREPO_CFLAGS) -I$(top_srcdir)/girepository
42 gitestoffsets_LDADD = $(top_builddir)/girepository/libgirepository-1.0.la $(GIREPO_LIBS)
43
44 gitestoffsets.c: gen-gitestoffsets offsets.h
45         $(PYTHON) $(srcdir)/gen-gitestoffsets $(srcdir)/offsets.h > $@ || ( rm -f $@ && false )
46
47 EXTRA_DIST += gen-gitestoffsets
48 BUILT_SOURCES += gitestoffsets.c
49 CLEANFILES += gitestoffsets.c
50
51 ############################################################
52
53 check-local: offsets-1.0.typelib
54         LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}$(builddir) GI_TYPELIB_PATH=$(builddir) \
55           $(builddir)/gitestoffsets$(EXEEXT) offsets.compiled offsets.introspected
56         diff -u offsets.compiled offsets.introspected
57
58 CLEANFILES += offsets.compiled offsets.introspected