kbuild: replace KBUILD_SRCTREE with boolean building_out_of_srctree
[linux-2.6-block.git] / scripts / gdb / linux / Makefile
CommitLineData
b2441318 1# SPDX-License-Identifier: GPL-2.0
3ee7b3fa 2
051f278e 3ifdef building_out_of_srctree
b513adf4
MY
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
3ee7b3fa 14endif
3ee7b3fa 15
f197d75f
KB
16quiet_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
1e5ff84f
MY
21extra-y += constants.py
22$(obj)/constants.py: $(src)/constants.py.in FORCE
834a3529 23 $(call if_changed_dep,gen_constants_py)
f197d75f 24
b513adf4 25clean-files := *.pyc *.pyo