aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/gdb/linux/Makefile
blob: 9fd3d8ed731a8507a87b5257f14bd90d2048c2eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# SPDX-License-Identifier: GPL-2.0

ifneq ($(srctree),.)

symlinks := $(patsubst $(srctree)/$(src)/%,%,$(wildcard $(srctree)/$(src)/*.py))

quiet_cmd_symlink = SYMLINK $@
      cmd_symlink = ln -fsn $(patsubst $(obj)/%,$(abspath $(srctree))/$(src)/%,$@) $@

extra-y += $(symlinks)
$(addprefix $(obj)/, $(symlinks)): FORCE
	$(call if_changed,symlink)

endif

quiet_cmd_gen_constants_py = GEN     $@
      cmd_gen_constants_py = \
	$(CPP) -E -x c -P $(c_flags) $< > $@ ;\
	sed -i '1,/<!-- end-c-headers -->/d;' $@

extra-y += constants.py
$(obj)/constants.py: $(src)/constants.py.in FORCE
	$(call if_changed_dep,gen_constants_py)

clean-files := *.pyc *.pyo