xref: /linux-6.15/scripts/gdb/linux/Makefile (revision 1e5ff84f)
1# SPDX-License-Identifier: GPL-2.0
2always := gdb-scripts
3
4SRCTREE := $(abspath $(srctree))
5
6$(obj)/gdb-scripts:
7ifneq ($(KBUILD_SRC),)
8	$(Q)ln -fsn $(SRCTREE)/$(obj)/*.py $(objtree)/$(obj)
9endif
10	@:
11
12quiet_cmd_gen_constants_py = GEN     $@
13      cmd_gen_constants_py = \
14	$(CPP) -E -x c -P $(c_flags) $< > $@ ;\
15	sed -i '1,/<!-- end-c-headers -->/d;' $@
16
17extra-y += constants.py
18$(obj)/constants.py: $(src)/constants.py.in FORCE
19	$(call if_changed_dep,gen_constants_py)
20
21clean-files := *.pyc *.pyo $(if $(KBUILD_SRC),*.py)
22