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