summaryrefslogtreecommitdiff
path: root/tests/Makefile.tests
diff options
context:
space:
mode:
authorTero Tervala <tero.tervala@unikie.com>2022-06-29 19:35:31 +0300
committerDavid Gibson <david@gibson.dropbear.id.au>2022-07-27 16:35:29 +1000
commitfd9b8c96c780c90dd0f1af46963bf2c52de1f0a6 (patch)
tree0e644312cf76bb6264d8ae99d0093b82abf4b7cd /tests/Makefile.tests
parentfda71da26e7fa00966a58afeb2114269b5512e59 (diff)
downloaddevice-tree-compiler-fd9b8c96c780c90dd0f1af46963bf2c52de1f0a6.tar.gz
Allow static building with make
Set STATIC_BUILD=1 environment variable to enable static building when using makefiles. Signed-off-by: Tero Tervala <tero.tervala@unikie.com> Message-Id: <20220629163531.932281-1-tero.tervala@unikie.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'tests/Makefile.tests')
-rw-r--r--tests/Makefile.tests12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/Makefile.tests b/tests/Makefile.tests
index 2f78952..2d36c5d 100644
--- a/tests/Makefile.tests
+++ b/tests/Makefile.tests
@@ -37,8 +37,10 @@ LIBTREE_TESTS_L = truncated_property truncated_string truncated_memrsv \
LIBTREE_TESTS = $(LIBTREE_TESTS_L:%=$(TESTS_PREFIX)%)
-DL_LIB_TESTS_L = asm_tree_dump value-labels
-DL_LIB_TESTS = $(DL_LIB_TESTS_L:%=$(TESTS_PREFIX)%)
+ifneq ($(STATIC_BUILD),1)
+ DL_LIB_TESTS_L = asm_tree_dump value-labels
+ DL_LIB_TESTS = $(DL_LIB_TESTS_L:%=$(TESTS_PREFIX)%)
+endif
TESTS = $(LIB_TESTS) $(LIBTREE_TESTS) $(DL_LIB_TESTS)
@@ -60,17 +62,17 @@ TESTS_CLEANDIRS = $(TESTS_CLEANDIRS_L:%=$(TESTS_PREFIX)%)
.PHONY: tests
tests: $(TESTS) $(TESTS_TREES)
-$(LIB_TESTS): %: $(TESTS_PREFIX)testutils.o util.o $(LIBFDT_lib)
+$(LIB_TESTS): %: $(TESTS_PREFIX)testutils.o util.o $(LIBFDT_dep)
# Not necessary on all platforms; allow -ldl to be excluded instead of forcing
# other platforms to patch it out.
LIBDL = -ldl
-$(DL_LIB_TESTS): %: %.o $(TESTS_PREFIX)testutils.o util.o $(LIBFDT_lib)
+$(DL_LIB_TESTS): %: %.o $(TESTS_PREFIX)testutils.o util.o $(LIBFDT_dep)
@$(VECHO) LD [libdl] $@
$(LINK.c) -o $@ $^ $(LIBDL)
$(LIBTREE_TESTS): %: $(TESTS_PREFIX)testutils.o $(TESTS_PREFIX)trees.o \
- util.o $(LIBFDT_lib)
+ util.o $(LIBFDT_dep)
$(TESTS_PREFIX)dumptrees: $(TESTS_PREFIX)trees.o