From: Claudio Fontana <cfontana@suse.de>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, Laurent Vivier <laurent@vivier.eu>,
Alex Bennee <alex.bennee@linaro.org>,
Claudio Fontana <cfontana@suse.de>,
David Gibson <david@gibson.dropbear.id.au>
Subject: [PATCH] Makefile: libfdt: build only the strict necessary
Date: Wed, 8 Apr 2020 09:02:31 +0200 [thread overview]
Message-ID: <20200408070231.20265-1-cfontana@suse.de> (raw)
when building dtc/libfdt, we were previously using dtc/Makefile,
which tries to build some artifacts that are not needed,
and can complain on stderr about the absence of tools that
are not required to build just libfdt.
Instead, build only the strict necessary to get libfdt.a .
Remove the subdir-dtc "compatibility gunk" for recursion,
since we are not recursing anymore.
Signed-off-by: Claudio Fontana <cfontana@suse.de>
---
Makefile | 21 ++++++++++-----------
configure | 6 +-----
2 files changed, 11 insertions(+), 16 deletions(-)
diff --git a/Makefile b/Makefile
index 84ef881600..8a461534d9 100644
--- a/Makefile
+++ b/Makefile
@@ -526,15 +526,16 @@ $(SOFTMMU_FUZZ_RULES): $(edk2-decompressed)
$(TARGET_DIRS_RULES):
$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" TARGET_DIR="$(dir $@)" $(notdir $@),)
-DTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V="$(V)" LIBFDT_srcdir=$(SRC_PATH)/dtc/libfdt
-DTC_CFLAGS=$(CFLAGS) $(QEMU_CFLAGS)
-DTC_CPPFLAGS=-I$(BUILD_DIR)/dtc -I$(SRC_PATH)/dtc -I$(SRC_PATH)/dtc/libfdt
-
-.PHONY: dtc/all
-dtc/all: .git-submodule-status dtc/libfdt dtc/tests
- $(call quiet-command,$(MAKE) $(DTC_MAKE_ARGS) CPPFLAGS="$(DTC_CPPFLAGS)" CFLAGS="$(DTC_CFLAGS)" LDFLAGS="$(QEMU_LDFLAGS)" ARFLAGS="$(ARFLAGS)" CC="$(CC)" AR="$(AR)" LD="$(LD)" $(SUBDIR_MAKEFLAGS) libfdt/libfdt.a,)
-
-dtc/%: .git-submodule-status
+LIBFDT_srcdir = $(SRC_PATH)/dtc/libfdt
+LIBFDT_objdir = dtc/libfdt
+LIBFDT_archive = $(LIBFDT_objdir)/libfdt.a
+include $(LIBFDT_srcdir)/Makefile.libfdt
+LIBFDT_objects = $(addprefix $(LIBFDT_objdir)/, $(LIBFDT_OBJS))
+.PHONY: libfdt
+libfdt: .git-submodule-status $(LIBFDT_archive)
+$(LIBFDT_archive): $(LIBFDT_objects)
+$(LIBFDT_objects): | $(LIBFDT_objdir)
+$(LIBFDT_objdir): .git-submodule-status
@mkdir -p $@
# Overriding CFLAGS causes us to lose defines added in the sub-makefile.
@@ -563,7 +564,6 @@ slirp/all: .git-submodule-status
# Compatibility gunk to keep make working across the rename of targets
# for recursion, to be removed some time after 4.1.
-subdir-dtc: dtc/all
subdir-capstone: capstone/all
subdir-slirp: slirp/all
@@ -821,7 +821,6 @@ distclean: clean
rm -rf $$d || exit 1 ; \
done
rm -Rf .sdk
- if test -f dtc/version_gen.h; then $(MAKE) $(DTC_MAKE_ARGS) clean; fi
KEYMAPS=da en-gb et fr fr-ch is lt no pt-br sv \
ar de en-us fi fr-be hr it lv nl pl ru th \
diff --git a/configure b/configure
index 22870f3867..eb50d50b0a 100755
--- a/configure
+++ b/configure
@@ -4278,10 +4278,6 @@ EOF
if test -d "${source_path}/dtc/libfdt" || test -e "${source_path}/.git" ; then
fdt=git
mkdir -p dtc
- if [ "$pwd_is_source_path" != "y" ] ; then
- symlink "$source_path/dtc/Makefile" "dtc/Makefile"
- symlink "$source_path/dtc/scripts" "dtc/scripts"
- fi
fdt_cflags="-I\$(SRC_PATH)/dtc/libfdt"
fdt_ldflags="-L\$(BUILD_DIR)/dtc/libfdt"
fdt_libs="$fdt_libs"
@@ -8151,7 +8147,7 @@ echo "PIXMAN_CFLAGS=$pixman_cflags" >> $config_host_mak
echo "PIXMAN_LIBS=$pixman_libs" >> $config_host_mak
if [ "$fdt" = "git" ]; then
- echo "config-host.h: dtc/all" >> $config_host_mak
+ echo "config-host.h: libfdt" >> $config_host_mak
fi
if [ "$capstone" = "git" -o "$capstone" = "internal" ]; then
echo "config-host.h: capstone/all" >> $config_host_mak
--
2.16.4
next reply other threads:[~2020-04-08 7:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-08 7:02 Claudio Fontana [this message]
2020-04-08 7:06 ` [PATCH] Makefile: libfdt: build only the strict necessary no-reply
2020-04-08 7:49 ` Claudio Fontana
2020-04-08 9:08 ` Daniel P. Berrangé
2020-04-08 10:09 ` Claudio Fontana
2020-04-08 7:07 ` no-reply
2020-04-08 7:08 ` no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200408070231.20265-1-cfontana@suse.de \
--to=cfontana@suse.de \
--cc=alex.bennee@linaro.org \
--cc=david@gibson.dropbear.id.au \
--cc=laurent@vivier.eu \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).