• Masami Hiramatsu's avatar
    tools: Let O= makes handle a relative path with -C option · be40920f
    Masami Hiramatsu authored
    When I tried to compile tools/perf from the top directory with the -C
    option, the O= option didn't work correctly if I passed a relative path:
    
      $ make O=BUILD -C tools/perf/
      make: Entering directory '/home/mhiramat/ksrc/linux/tools/perf'
        BUILD:   Doing 'make -j8' parallel build
      ../scripts/Makefile.include:4: *** O=/home/mhiramat/ksrc/linux/tools/perf/BUILD does not exist.  Stop.
      make: *** [Makefile:70: all] Error 2
      make: Leaving directory '/home/mhiramat/ksrc/linux/tools/perf'
    
    The O= directory existence check failed because the check script ran in
    the build target directory instead of the directory where I ran the make
    command.
    
    To fix that, once change directory to $(PWD) and check O= directory,
    since the PWD is set to where the make command runs.
    
    Fixes: c883122a
    
     ("perf tools: Let O= makes handle relative paths")
    Reported-by: default avatarRandy Dunlap <rdunlap@infradead.org>
    Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
    Cc: Andrew M...
    be40920f
Makefile 2.54 KB