diff options
author | Tero Tervala <tero.tervala@unikie.com> | 2022-06-29 19:35:31 +0300 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2022-07-27 16:35:29 +1000 |
commit | fd9b8c96c780c90dd0f1af46963bf2c52de1f0a6 (patch) | |
tree | 0e644312cf76bb6264d8ae99d0093b82abf4b7cd /Makefile | |
parent | fda71da26e7fa00966a58afeb2114269b5512e59 (diff) | |
download | device-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 'Makefile')
-rw-r--r-- | Makefile | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -198,6 +198,13 @@ LIBFDT_lib = $(LIBFDT_dir)/$(LIBFDT_LIB) LIBFDT_include = $(addprefix $(LIBFDT_dir)/,$(LIBFDT_INCLUDES)) LIBFDT_version = $(addprefix $(LIBFDT_dir)/,$(LIBFDT_VERSION)) +ifeq ($(STATIC_BUILD),1) + CFLAGS += -static + LIBFDT_dep = $(LIBFDT_archive) +else + LIBFDT_dep = $(LIBFDT_lib) +endif + include $(LIBFDT_dir)/Makefile.libfdt .PHONY: libfdt @@ -261,11 +268,11 @@ convert-dtsv0: $(CONVERT_OBJS) fdtdump: $(FDTDUMP_OBJS) -fdtget: $(FDTGET_OBJS) $(LIBFDT_lib) +fdtget: $(FDTGET_OBJS) $(LIBFDT_dep) -fdtput: $(FDTPUT_OBJS) $(LIBFDT_lib) +fdtput: $(FDTPUT_OBJS) $(LIBFDT_dep) -fdtoverlay: $(FDTOVERLAY_OBJS) $(LIBFDT_lib) +fdtoverlay: $(FDTOVERLAY_OBJS) $(LIBFDT_dep) dist: git archive --format=tar --prefix=dtc-$(dtc_version)/ HEAD \ |