Add standalone test case.
[external/binutils.git] / gold / testsuite / Makefile.am
1 # Process this file with automake to generate Makefile.in
2
3 # As far as I can tell automake testing support assumes that the build
4 # system and the host system are the same.  So these tests will not
5 # work when building with a cross-compiler.
6
7 AUTOMAKE_OPTIONS =
8
9 AM_CXXFLAGS = $(WARN_CXXFLAGS) $(LFS_CXXFLAGS)
10
11 INCLUDES = -D_GNU_SOURCE \
12         -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../../include \
13         -I$(srcdir)/../../elfcpp \
14         -DLOCALEDIR="\"$(datadir)/locale\"" \
15         @INCINTL@
16
17 if GCC
18 if NATIVE_LINKER
19 NATIVE_TESTING = t1 t1_pic
20 endif
21 endif
22
23 TESTS = object_unittest $(NATIVE_TESTING)
24
25 check_LIBRARIES = libgoldtest.a
26 libgoldtest_a_SOURCES = test.cc testmain.cc testfile.cc
27
28 LDADD = libgoldtest.a ../libgold.a
29
30 check_PROGRAMS = object_unittest
31
32 object_unittest_SOURCES = object_unittest.cc
33
34 if GCC
35 if NATIVE_LINKER
36
37 gcctestdir/ld: ../ld-new
38         test -d gcctestdir || mkdir -p gcctestdir
39         rm -f gcctestdir/ld
40         (cd gcctestdir && $(LN_S) ../../ld-new ld)
41
42 # Override the default CXXFLAGS--we don't want any optimization
43 t1.o: t1.cc
44         $(CXXCOMPILE) -O0 -c -o $@ $<
45 t1: t1.o gcctestdir/ld
46         $(CXXLINK) -Bgcctestdir/ t1.o
47
48 t1_pic.o: t1.cc
49         $(CXXCOMPILE) -O0 -c -fpic -o $@ $<
50 t1_pic: t1_pic.o gcctestdir/ld
51         $(CXXLINK) -Bgcctestdir/ t1_pic.o
52
53 endif
54 endif