aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2019-03-29 17:20:16 +1100
committerDavid Gibson <david@gibson.dropbear.id.au>2019-03-29 17:20:16 +1100
commit5c3513f68921cc15231af7ae6806c1f61c517c7c (patch)
treea187cb60d7ad5bfbb2ddb13f65d0cb6b7efd24d7 /Makefile
parent00f9febf9c16d932380243a3135ee5aed1adc410 (diff)
downloaddtc-5c3513f68921cc15231af7ae6806c1f61c517c7c.zip
dtc-5c3513f68921cc15231af7ae6806c1f61c517c7c.tar.gz
dtc-5c3513f68921cc15231af7ae6806c1f61c517c7c.tar.bz2
Link tools and tests against libfdt shared library
Currently the libfdt based tools (fdtput, fdtget, etc.) and all the test binaries using libfdt are linked against the static version of libfdt. That's made it very easy in the past to forget to properly update the version.lds file which is needed to make functions publicaly accessible from the shared library. To avoid problems like that in future, alter the build so that we link and run the tests against the shared library version of libfdt. That immediately points out several important symbols that are still missing from the version.lds, so fix those as well. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile9
1 files changed, 5 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index ff2b4d1..95c2662 100644
--- a/Makefile
+++ b/Makefile
@@ -184,7 +184,7 @@ endif
#
LIBFDT_dir = libfdt
LIBFDT_archive = $(LIBFDT_dir)/libfdt.a
-LIBFDT_lib = $(LIBFDT_dir)/libfdt-$(DTC_VERSION).$(SHAREDLIB_EXT)
+LIBFDT_lib = $(LIBFDT_dir)/$(LIBFDT_LIB)
LIBFDT_include = $(addprefix $(LIBFDT_dir)/,$(LIBFDT_INCLUDES))
LIBFDT_version = $(addprefix $(LIBFDT_dir)/,$(LIBFDT_VERSION))
@@ -199,6 +199,7 @@ $(LIBFDT_lib): $(addprefix $(LIBFDT_dir)/,$(LIBFDT_OBJS)) $(LIBFDT_version)
@$(VECHO) LD $@
$(CC) $(LDFLAGS) $(SHAREDLIB_LDFLAGS)$(LIBFDT_soname) -o $(LIBFDT_lib) \
$(addprefix $(LIBFDT_dir)/,$(LIBFDT_OBJS))
+ ln -s $(LIBFDT_LIB) $(LIBFDT_dir)/$(LIBFDT_soname)
ifneq ($(DEPTARGETS),)
-include $(LIBFDT_OBJS:%.o=$(LIBFDT_dir)/%.d)
@@ -250,11 +251,11 @@ convert-dtsv0: $(CONVERT_OBJS)
fdtdump: $(FDTDUMP_OBJS)
-fdtget: $(FDTGET_OBJS) $(LIBFDT_archive)
+fdtget: $(FDTGET_OBJS) $(LIBFDT_lib)
-fdtput: $(FDTPUT_OBJS) $(LIBFDT_archive)
+fdtput: $(FDTPUT_OBJS) $(LIBFDT_lib)
-fdtoverlay: $(FDTOVERLAY_OBJS) $(LIBFDT_archive)
+fdtoverlay: $(FDTOVERLAY_OBJS) $(LIBFDT_lib)
dist:
git archive --format=tar --prefix=dtc-$(dtc_version)/ HEAD \