summaryrefslogtreecommitdiff
path: root/tests/offsets/Makefile.am
blob: 400d32a7d4e4d7f09d1fc9ab0ac809f61c945f18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
include $(top_srcdir)/common.mk

BUILT_SOURCES =
CLEANFILES =
EXTRA_DIST =

check_LTLIBRARIES =
check_PROGRAMS =

############################################################

check_LTLIBRARIES += liboffsets.la

liboffsets_la_SOURCES = \
	offsets.h	\
	offsets.c
liboffsets_la_CPPFLAGS = $(GIREPO_CFLAGS)
# dummy rpath to get built dynamically (huh?)
liboffsets_la_LDFLAGS = -avoid-version -rpath $(libdir)

offsets-1.0.gir: liboffsets.la offsets.h $(SCANNER_BIN) $(SCANNER_LIBS) Makefile
	$(CHECK_DEBUG) $(SCANNER) \
	--include=GObject-2.0 \
        --libtool="$(LIBTOOL)" \
	--library=offsets \
	--namespace=offsets \
	--nsversion=1.0 \
	--pkg gobject-2.0 \
	$(srcdir)/offsets.h $(srcdir)/offsets.c \
	 --output $@

%.typelib: %.gir $(top_builddir)/tools/g-ir-compiler$(EXEEXT) Makefile
	$(top_builddir)/tools/g-ir-compiler --includedir=. --includedir=$(top_builddir)/gir $< -o $@

CLEANFILES += offsets-1.0.gir offsets-1.0.typelib

############################################################

check_PROGRAMS += gitestoffsets

nodist_gitestoffsets_SOURCES = gitestoffsets.c
gitestoffsets_CPPFLAGS = $(GIREPO_CFLAGS) -I$(top_srcdir)/girepository
gitestoffsets_LDADD = $(top_builddir)/girepository/libgirepository-1.0.la $(GIREPO_LIBS)

gitestoffsets.c: gen-gitestoffsets offsets.h
	$(PYTHON) $(srcdir)/gen-gitestoffsets $(srcdir)/offsets.h > $@ || ( rm -f $@ && false )

EXTRA_DIST += gen-gitestoffsets
BUILT_SOURCES += gitestoffsets.c
CLEANFILES += gitestoffsets.c

############################################################

check-local: offsets-1.0.typelib
	LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}$(builddir) GI_TYPELIB_PATH=$(builddir):$(top_builddir)/gir \
	  $(builddir)/gitestoffsets$(EXEEXT) offsets.compiled offsets.introspected
	diff -u offsets.compiled offsets.introspected

CLEANFILES += offsets.compiled offsets.introspected