linux-yocto/scripts/gdb/linux/Makefile
Joel Granados a11aaf6d0b kbuild: scripts/gdb: bring the "abspath" back
Use the "abspath" call when symlinking the gdb python scripts in
scripts/gdb/linux. This call is needed to avoid broken links when
running the scripts_gdb target on a build directory located directly
under the source tree (e.g., O=builddir).

Fixes: 659bbf7e1b ("kbuild: scripts/gdb: Replace missed $(srctree)/$(src) w/ $(src)")
Signed-off-by: Joel Granados <j.granados@samsung.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Tested-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2024-06-27 04:20:32 +09:00

634 B

SPDX-License-Identifier: GPL-2.0

ifdef building_out_of_srctree

symlinks := $(patsubst $(src)/%,%,$(wildcard $(src)/*.py))

quiet_cmd_symlink = SYMLINK $@ cmd_symlink = ln -fsn $(patsubst $(obj)/%,$(abspath $(src))/%,$@) $@

always-y += $(symlinks) $(addprefix $(obj)/, $(symlinks)): FORCE $(call if_changed,symlink)

endif

quiet_cmd_gen_constants_py = GEN $@ cmd_gen_constants_py =
$(CPP) -E -x c -P $(c_flags) $< > $@ ;
sed -i '1,//d;' $@

always-y += constants.py $(obj)/constants.py: $(src)/constants.py.in FORCE $(call if_changed_dep,gen_constants_py)

clean-files := *.pyc *.pyo