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