hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/scripts/gdb/linux/Makefile
....@@ -1,24 +1,25 @@
11 # SPDX-License-Identifier: GPL-2.0
2
-always := gdb-scripts
32
4
-SRCTREE := $(abspath $(srctree))
3
+ifdef building_out_of_srctree
54
6
-$(obj)/gdb-scripts:
7
-ifneq ($(KBUILD_SRC),)
8
- $(Q)ln -fsn $(SRCTREE)/$(obj)/*.py $(objtree)/$(obj)
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
+
914 endif
10
- @:
1115
1216 quiet_cmd_gen_constants_py = GEN $@
1317 cmd_gen_constants_py = \
1418 $(CPP) -E -x c -P $(c_flags) $< > $@ ;\
1519 sed -i '1,/<!-- end-c-headers -->/d;' $@
1620
17
-targets += constants.py
18
-$(obj)/constants.py: $(SRCTREE)/$(obj)/constants.py.in FORCE
21
+extra-y += constants.py
22
+$(obj)/constants.py: $(src)/constants.py.in FORCE
1923 $(call if_changed_dep,gen_constants_py)
2024
21
-build_constants_py: $(obj)/constants.py
22
- @:
23
-
24
-clean-files := *.pyc *.pyo $(if $(KBUILD_SRC),*.py) $(obj)/constants.py
25
+clean-files := *.pyc *.pyo