Add $(top_builddir)/glib to includes
[platform/upstream/glib.git] / tests / gobject / Makefile.am
1 include $(top_srcdir)/Makefile.decl
2
3 INCLUDES =                                      \
4         -I$(top_srcdir)                         \
5         -I$(top_srcdir)/glib                    \
6         -I$(top_srcdir)/gmodule                 \
7         -I$(top_builddir)/glib                  \
8         $(GLIB_DEBUG_FLAGS)
9
10 libglib = $(top_builddir)/glib/libglib-2.0.la
11 libgthread = $(top_builddir)/gthread/libgthread-2.0.la
12 libgmodule = $(top_builddir)/gmodule/libgmodule-2.0.la
13 libgobject = $(top_builddir)/gobject/libgobject-2.0.la
14
15
16 # libtool dependency tracking seems broken.  this is currently
17 # required to get the tests to dynamic link against the in-tree
18 # libglib instead of the system one
19 libgobject += $(libglib)
20
21 ########################################################################
22
23 noinst_LTLIBRARIES = libtestgobject.la
24
25 libtestgobject_la_SOURCES =     \
26         testcommon.h            \
27         testmarshal.h           \
28         testmarshal.c           \
29         testmodule.c            \
30         testmodule.h
31
32 if CROSS_COMPILING
33   glib_genmarshal=$(GLIB_GENMARSHAL)
34 else
35   glib_genmarshal=$(top_builddir)/gobject/glib-genmarshal
36 endif
37
38 testmarshal.h: stamp-testmarshal.h
39         @true
40 stamp-testmarshal.h: @REBUILD@ testmarshal.list $(glib_genmarshal)
41         $(AM_V_GEN) $(glib_genmarshal) --prefix=test_marshal $(srcdir)/testmarshal.list --header >> xgen-gmh \
42         && (cmp -s xgen-gmh testmarshal.h 2>/dev/null || cp xgen-gmh testmarshal.h) \
43         && rm -f xgen-gmh xgen-gmh~ \
44         && echo timestamp > $@
45 testmarshal.c: @REBUILD@ testmarshal.list $(glib_genmarshal)
46         $(AM_V_GEN) $(glib_genmarshal) --prefix=test_marshal $(srcdir)/testmarshal.list --body >> xgen-gmc \
47         && cp xgen-gmc testmarshal.c \
48         && rm -f xgen-gmc xgen-gmc~
49
50 BUILT_SOURCES = testmarshal.h testmarshal.c
51 CLEANFILES = stamp-testmarshal.h
52
53 ########################################################################
54
55 LDADD = libtestgobject.la $(libgobject)
56
57 test_programs =                                 \
58         deftype                                 \
59         gvalue-test                             \
60         paramspec-test                          \
61         accumulator                             \
62         defaultiface                            \
63         dynamictype                             \
64         ifacecheck                              \
65         ifaceinit                               \
66         ifaceinherit                            \
67         ifaceproperties                         \
68         override                                \
69         performance                             \
70         performance-threaded                    \
71         singleton                               \
72         references
73
74 performance_LDADD = $(libgobject) $(libgthread)
75 performance_threaded_LDADD = $(libgobject) $(libgthread)
76 check_PROGRAMS = $(test_programs)
77
78 TESTS = $(test_programs)
79 TESTS_ENVIRONMENT = srcdir=$(srcdir) \
80         LIBCHARSET_ALIAS_DIR=$(top_builddir)/glib/libcharset \
81         MALLOC_CHECK_=2 \
82         MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256))
83
84 ########################################################################
85
86 EXTRA_DIST +=             \
87         testmarshal.list
88
89 BUILT_EXTRA_DIST =                              \
90         testmarshal.h                           \
91         testmarshal.c
92
93 dist-hook: $(BUILT_EXTRA_DIST)
94         files='$(BUILT_EXTRA_DIST)';                            \
95         for f in $$files; do                                    \
96           if test -f $$f; then d=.; else d=$(srcdir); fi;       \
97           cp $$d/$$f $(distdir) || exit 1; done
98
99 distclean-local:
100         if test $(srcdir) = .; then :; else     \
101             rm -f $(BUILT_EXTRA_DIST);          \
102         fi