linux-yocto/scripts/gdb/linux/Makefile
Masahiro Yamada b513adf45c scripts/gdb: refactor rules for symlink creation
gdb-scripts is not a real object, but (ab)used like a phony target.

Rewrite the code in a more Kbuild-ish way. Add symlinks to extra-y
and use if_changed.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-02-27 21:41:04 +09:00

658 B

SPDX-License-Identifier: GPL-2.0

ifneq ($(KBUILD_SRC),)

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