linux-yocto/scripts/gdb/linux/Makefile
Masahiro Yamada 051f278e9d kbuild: replace KBUILD_SRCTREE with boolean building_out_of_srctree
Commit 25b146c5b8 ("kbuild: allow Kbuild to start from any directory")
deprecated KBUILD_SRCTREE.

It is only used in tools/testing/selftest/ to distinguish out-of-tree
build. Replace it with a new boolean flag, building_out_of_srctree.

I also replaced the conditional ($(srctree),.) because the next commit
will allow an absolute path to be used for $(srctree) even when building
in the source tree.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-11 00:05:09 +09:00

665 B

SPDX-License-Identifier: GPL-2.0

ifdef building_out_of_srctree

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

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

extra-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;' $@

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

clean-files := *.pyc *.pyo