aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/gdb/linux
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/gdb/linux')
-rw-r--r--scripts/gdb/linux/Makefile25
1 files changed, 13 insertions, 12 deletions
diff --git a/scripts/gdb/linux/Makefile b/scripts/gdb/linux/Makefile
index aba23be985e4..3df395a9c2ce 100644
--- a/scripts/gdb/linux/Makefile
+++ b/scripts/gdb/linux/Makefile
@@ -1,24 +1,25 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: GPL-2.0
2always := gdb-scripts
3 2
4SRCTREE := $(abspath $(srctree))
5
6$(obj)/gdb-scripts:
7ifneq ($(KBUILD_SRC),) 3ifneq ($(KBUILD_SRC),)
8 $(Q)ln -fsn $(SRCTREE)/$(obj)/*.py $(objtree)/$(obj) 4
5symlinks := $(patsubst $(srctree)/$(src)/%,%,$(wildcard $(srctree)/$(src)/*.py))
6
7quiet_cmd_symlink = SYMLINK $@
8 cmd_symlink = ln -fsn $(patsubst $(obj)/%,$(abspath $(srctree))/$(src)/%,$@) $@
9
10extra-y += $(symlinks)
11$(addprefix $(obj)/, $(symlinks)): FORCE
12 $(call if_changed,symlink)
13
9endif 14endif
10 @:
11 15
12quiet_cmd_gen_constants_py = GEN $@ 16quiet_cmd_gen_constants_py = GEN $@
13 cmd_gen_constants_py = \ 17 cmd_gen_constants_py = \
14 $(CPP) -E -x c -P $(c_flags) $< > $@ ;\ 18 $(CPP) -E -x c -P $(c_flags) $< > $@ ;\
15 sed -i '1,/<!-- end-c-headers -->/d;' $@ 19 sed -i '1,/<!-- end-c-headers -->/d;' $@
16 20
17targets += constants.py 21extra-y += constants.py
18$(obj)/constants.py: $(SRCTREE)/$(obj)/constants.py.in FORCE 22$(obj)/constants.py: $(src)/constants.py.in FORCE
19 $(call if_changed_dep,gen_constants_py) 23 $(call if_changed_dep,gen_constants_py)
20 24
21build_constants_py: $(obj)/constants.py 25clean-files := *.pyc *.pyo
22 @:
23
24clean-files := *.pyc *.pyo $(if $(KBUILD_SRC),*.py) $(obj)/constants.py