diff mbox series

cpupower: Disable direct build of the 'bench' subproject

Message ID 20240626-fix_bench_compilation-v1-1-d039bd5fa551@gmail.com
State New
Headers show
Series cpupower: Disable direct build of the 'bench' subproject | expand

Commit Message

Roman Storozhenko June 26, 2024, 4:45 p.m. UTC
Execution of the 'make' command in the 'bench' subfolder causes the
following error:

$ make O=cpupower/build/ DESTDIR=cpupower/install/ -j8
"  CC      " cpupower/build//main.o
"  CC      " cpupower/build//parse.o
/bin/sh: 1: "  CC      "cpupower/build//system.o
  CC      : not found
  make: *** [Makefile:21: cpupower/build//main.o] Error 127
  make: *** Waiting for unfinished jobs....
  /bin/sh: 1:   CC      : not found
  /bin/sh: 1:   CC      : not found
  make: *** [Makefile:21: cpupower/build//parse.o] Error 127
  make: *** [Makefile:21: cpupower/build//system.o] Error 127

The makefile uses variables defined in the main project makefile and it
is not intended to run standalone. The reason is that 'bench' subproject
depends on the 'libcpupower' library, see the 'compile-bench' target in
the main makefile.
Add a check that prevents standalone execution of the 'bench' makefile.

Signed-off-by: Roman Storozhenko <romeusmeister@gmail.com>
---
 tools/power/cpupower/bench/Makefile | 5 +++++
 1 file changed, 5 insertions(+)


---
base-commit: 0fc4bfab2cd45f9acb86c4f04b5191e114e901ed
change-id: 20240626-fix_bench_compilation-a2e892938c34

Best regards,

Comments

Shuah Khan June 28, 2024, 10:05 p.m. UTC | #1
On 6/26/24 10:45, Roman Storozhenko wrote:
> Execution of the 'make' command in the 'bench' subfolder causes the
> following error:
> 
> $ make O=cpupower/build/ DESTDIR=cpupower/install/ -j8
> "  CC      " cpupower/build//main.o
> "  CC      " cpupower/build//parse.o
> /bin/sh: 1: "  CC      "cpupower/build//system.o
>    CC      : not found
>    make: *** [Makefile:21: cpupower/build//main.o] Error 127
>    make: *** Waiting for unfinished jobs....
>    /bin/sh: 1:   CC      : not found
>    /bin/sh: 1:   CC      : not found
>    make: *** [Makefile:21: cpupower/build//parse.o] Error 127
>    make: *** [Makefile:21: cpupower/build//system.o] Error 127
> 
> The makefile uses variables defined in the main project makefile and it
> is not intended to run standalone. The reason is that 'bench' subproject
> depends on the 'libcpupower' library, see the 'compile-bench' target in
> the main makefile.
> Add a check that prevents standalone execution of the 'bench' makefile.
> 
> Signed-off-by: Roman Storozhenko <romeusmeister@gmail.com>
> ---

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux.git/log/?h=cpupower
for Linux 6.11-rc1

thanks,
-- Shuah
diff mbox series

Patch

diff --git a/tools/power/cpupower/bench/Makefile b/tools/power/cpupower/bench/Makefile
index a4b902f9e1c4..34e5894476eb 100644
--- a/tools/power/cpupower/bench/Makefile
+++ b/tools/power/cpupower/bench/Makefile
@@ -1,4 +1,9 @@ 
 # SPDX-License-Identifier: GPL-2.0
+ifeq ($(MAKELEVEL),0)
+$(error This Makefile is not intended to be run standalone, but only as a part \
+of the  main one in the parent dir)
+endif
+
 OUTPUT := ./
 ifeq ("$(origin O)", "command line")
 ifneq ($(O),)