3df395a9c2ce1ad08c209cebbd7c43bee2f8ae04
[linux-block.git] / scripts / gdb / linux / Makefile
1 # SPDX-License-Identifier: GPL-2.0
2
3 ifneq ($(KBUILD_SRC),)
4
5 symlinks := $(patsubst $(srctree)/$(src)/%,%,$(wildcard $(srctree)/$(src)/*.py))
6
7 quiet_cmd_symlink = SYMLINK $@
8       cmd_symlink = ln -fsn $(patsubst $(obj)/%,$(abspath $(srctree))/$(src)/%,$@) $@
9
10 extra-y += $(symlinks)
11 $(addprefix $(obj)/, $(symlinks)): FORCE
12         $(call if_changed,symlink)
13
14 endif
15
16 quiet_cmd_gen_constants_py = GEN     $@
17       cmd_gen_constants_py = \
18         $(CPP) -E -x c -P $(c_flags) $< > $@ ;\
19         sed -i '1,/<!-- end-c-headers -->/d;' $@
20
21 extra-y += constants.py
22 $(obj)/constants.py: $(src)/constants.py.in FORCE
23         $(call if_changed_dep,gen_constants_py)
24
25 clean-files := *.pyc *.pyo