[dpdk-dev] mk: allow renaming of build directories

Message ID 20180228171156.91077-1-bruce.richardson@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Bruce Richardson Feb. 28, 2018, 5:11 p.m. UTC
  When building using make, the Makefile in the build directory contained
the name of the build directory to be passed as an "O=" parameter to
the DPDK SDK makefiles. Unfortunately, this meant that the compilation
would always fail if the build directory was renamed. To remove this
limitation, we can use $(CURDIR) instead of the directory name.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 buildtools/gen-build-mk.sh | 4 ++--
 mk/rte.sdkconfig.mk        | 3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)
  

Comments

Thomas Monjalon April 22, 2018, 11:16 p.m. UTC | #1
28/02/2018 18:11, Bruce Richardson:
> When building using make, the Makefile in the build directory contained
> the name of the build directory to be passed as an "O=" parameter to
> the DPDK SDK makefiles. Unfortunately, this meant that the compilation
> would always fail if the build directory was renamed. To remove this
> limitation, we can use $(CURDIR) instead of the directory name.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
> --- a/buildtools/gen-build-mk.sh
> +++ b/buildtools/gen-build-mk.sh
> -echo "	@\$(MAKE) -C $1 O=$2"
> +echo "	@\$(MAKE) -C $1 O=\$(CURDIR)"
>  echo
>  echo "%::"
> -echo "	@\$(MAKE) -C $1 O=$2 \$@"
> +echo "	@\$(MAKE) -C $1 O=\$(CURDIR) \$@"
> --- a/mk/rte.sdkconfig.mk
> +++ b/mk/rte.sdkconfig.mk
> -	$(Q)$(RTE_SDK)/buildtools/gen-build-mk.sh $(SDK_RELPATH) $(OUTPUT_RELPATH) \
> -		> $(RTE_OUTPUT)/Makefile
> +	$(Q)$(RTE_SDK)/buildtools/gen-build-mk.sh $(SDK_RELPATH) > $@

You need to remove the comment about the 2nd argument of the script:
#   $2: path of build dir (can be relative to $1)
  

Patch

diff --git a/buildtools/gen-build-mk.sh b/buildtools/gen-build-mk.sh
index c18b205e3..a61c4d6cf 100755
--- a/buildtools/gen-build-mk.sh
+++ b/buildtools/gen-build-mk.sh
@@ -18,7 +18,7 @@  echo
 echo "MAKEFLAGS += --no-print-directory"
 echo
 echo "all:"
-echo "	@\$(MAKE) -C $1 O=$2"
+echo "	@\$(MAKE) -C $1 O=\$(CURDIR)"
 echo
 echo "%::"
-echo "	@\$(MAKE) -C $1 O=$2 \$@"
+echo "	@\$(MAKE) -C $1 O=\$(CURDIR) \$@"
diff --git a/mk/rte.sdkconfig.mk b/mk/rte.sdkconfig.mk
index 0664725ee..ade681ffd 100644
--- a/mk/rte.sdkconfig.mk
+++ b/mk/rte.sdkconfig.mk
@@ -105,8 +105,7 @@  SDK_RELPATH=$(shell $(RTE_SDK)/buildtools/relpath.sh $(abspath $(RTE_SRCDIR)) \
 OUTPUT_RELPATH=$(shell $(RTE_SDK)/buildtools/relpath.sh $(abspath $(RTE_OUTPUT)) \
 				$(abspath $(RTE_SRCDIR)))
 $(RTE_OUTPUT)/Makefile: | $(RTE_OUTPUT)
-	$(Q)$(RTE_SDK)/buildtools/gen-build-mk.sh $(SDK_RELPATH) $(OUTPUT_RELPATH) \
-		> $(RTE_OUTPUT)/Makefile
+	$(Q)$(RTE_SDK)/buildtools/gen-build-mk.sh $(SDK_RELPATH) > $@
 
 # clean installed files, and generate a new config header file
 # if NODOTCONF variable is defined, don't try to rebuild .config