Makefile 599 B

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