[PATCH] libfdt: Use libfdt shared library for testcases

Josh Boyer jwboyer at linux.vnet.ibm.com
Sat Jan 3 00:21:13 EST 2009


Link the testcases against the libfdt.so that is built and use
it for the testsuite verification.

Signed-off-by: Josh Boyer <jwboyer at linux.vnet.ibm.com>
---
 tests/Makefile.tests |    9 +++++++--
 tests/tests.sh       |    1 +
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/tests/Makefile.tests b/tests/Makefile.tests
index 3a041ff..0b0ff70 100644
--- a/tests/Makefile.tests
+++ b/tests/Makefile.tests
@@ -35,9 +35,11 @@ TESTS_CLEANFILES = $(TESTS) $(TESTS_CLEANFILES_L:%=$(TESTS_PREFIX)%)
 .PHONY: tests
 tests:	$(TESTS) $(TESTS_TREES)
 
-$(LIB_TESTS): %: $(TESTS_PREFIX)testutils.o $(LIBFDT_archive)
+$(LIB_TESTS): LDFLAGS = -L$(LIBFDT_objdir) -lfdt
+$(LIB_TESTS): $(TESTS_PREFIX)testutils.o $(LIBFDT_lib)
 
-$(LIBTREE_TESTS): %: $(TESTS_PREFIX)testutils.o $(TESTS_PREFIX)trees.o $(LIBFDT_archive)
+$(LIBTREE_TESTS): LDFLAGS = -L$(LIBFDT_objdir) -lfdt
+$(LIBTREE_TESTS): %: $(TESTS_PREFIX)testutils.o $(TESTS_PREFIX)trees.o $(LIBFDT_lib)
 
 $(TESTS_PREFIX)dumptrees: $(TESTS_PREFIX)trees.o
 
@@ -45,6 +47,9 @@ $(TESTS_TREES): $(TESTS_PREFIX)dumptrees
 	@$(VECHO) DUMPTREES
 	cd $(TESTS_PREFIX); ./dumptrees >/dev/null
 
+$(TESTS_PREFIX)testutils.o: $(TESTS_PREFIX)testutils.c
+	$(CC) $(CPPFLAGS) $(CFLAGS) -L$(LIBFDT_objdir) -lfdt -o $@ -c $<
+
 tests_clean:
 	@$(VECHO) CLEAN "(tests)"
 	rm -f $(STD_CLEANFILES:%=$(TESTS_PREFIX)%)
diff --git a/tests/tests.sh b/tests/tests.sh
index 30ffead..6eb972b 100644
--- a/tests/tests.sh
+++ b/tests/tests.sh
@@ -11,6 +11,7 @@ FAIL () {
 }
 
 DTC=../dtc
+LD_LIBRARY_PATH=../libfdt
 
 verbose_run () {
     if [ -z "$QUIET_TEST" ]; then
-- 
1.6.0.6



More information about the devicetree-discuss mailing list