2006-12-01 07:52:50 +08:00
|
|
|
# Process this file with automake to generate Makefile.in
|
|
|
|
|
2007-09-23 04:11:12 +08:00
|
|
|
# As far as I can tell automake testing support assumes that the build
|
|
|
|
# system and the host system are the same. So these tests will not
|
|
|
|
# work when building with a cross-compiler.
|
|
|
|
|
2006-12-01 07:52:50 +08:00
|
|
|
AUTOMAKE_OPTIONS =
|
|
|
|
|
|
|
|
AM_CXXFLAGS = $(WARN_CXXFLAGS) $(LFS_CXXFLAGS)
|
|
|
|
|
|
|
|
INCLUDES = -D_GNU_SOURCE \
|
|
|
|
-I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../../include \
|
|
|
|
-I$(srcdir)/../../elfcpp \
|
|
|
|
-DLOCALEDIR="\"$(datadir)/locale\"" \
|
|
|
|
@INCINTL@
|
|
|
|
|
2007-09-23 06:44:33 +08:00
|
|
|
if GCC
|
|
|
|
if NATIVE_LINKER
|
2007-09-23 07:36:01 +08:00
|
|
|
NATIVE_TESTING = \
|
|
|
|
basic_test \
|
|
|
|
basic_pic_test \
|
|
|
|
basic_static_test \
|
|
|
|
basic_static_pic_test
|
2007-09-23 06:44:33 +08:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
TESTS = object_unittest $(NATIVE_TESTING)
|
2006-12-01 07:52:50 +08:00
|
|
|
|
|
|
|
check_LIBRARIES = libgoldtest.a
|
|
|
|
libgoldtest_a_SOURCES = test.cc testmain.cc testfile.cc
|
|
|
|
|
|
|
|
LDADD = libgoldtest.a ../libgold.a
|
|
|
|
|
|
|
|
check_PROGRAMS = object_unittest
|
|
|
|
|
|
|
|
object_unittest_SOURCES = object_unittest.cc
|
2007-09-23 06:44:33 +08:00
|
|
|
|
|
|
|
if GCC
|
|
|
|
if NATIVE_LINKER
|
|
|
|
|
|
|
|
gcctestdir/ld: ../ld-new
|
|
|
|
test -d gcctestdir || mkdir -p gcctestdir
|
|
|
|
rm -f gcctestdir/ld
|
|
|
|
(cd gcctestdir && $(LN_S) ../../ld-new ld)
|
|
|
|
|
|
|
|
# Override the default CXXFLAGS--we don't want any optimization
|
2007-09-23 07:36:01 +08:00
|
|
|
basic_test.o: basic_test.cc
|
2007-09-23 06:44:33 +08:00
|
|
|
$(CXXCOMPILE) -O0 -c -o $@ $<
|
2007-09-23 07:36:01 +08:00
|
|
|
basic_test: basic_test.o gcctestdir/ld
|
|
|
|
$(CXXLINK) -Bgcctestdir/ basic_test.o
|
|
|
|
basic_static_test: basic_test.o gcctestdir/ld
|
|
|
|
$(CXXLINK) -Bgcctestdir/ -static basic_test.o
|
2007-09-23 06:44:33 +08:00
|
|
|
|
2007-09-23 07:36:01 +08:00
|
|
|
basic_pic_test.o: basic_test.cc
|
2007-09-23 06:44:33 +08:00
|
|
|
$(CXXCOMPILE) -O0 -c -fpic -o $@ $<
|
2007-09-23 07:36:01 +08:00
|
|
|
basic_pic_test: basic_pic_test.o gcctestdir/ld
|
|
|
|
$(CXXLINK) -Bgcctestdir/ basic_pic_test.o
|
|
|
|
basic_static_pic_test: basic_pic_test.o gcctestdir/ld
|
|
|
|
$(CXXLINK) -Bgcctestdir/ -static basic_pic_test.o
|
2007-09-23 06:44:33 +08:00
|
|
|
|
|
|
|
endif
|
|
|
|
endif
|