Makefile 667 B

12345678910111213141516171819202122232425
  1. # SPDX-License-Identifier: GPL-2.0
  2. ifdef building_out_of_srctree
  3. symlinks := $(patsubst $(srctree)/$(src)/%,%,$(wildcard $(srctree)/$(src)/*.py))
  4. quiet_cmd_symlink = SYMLINK $@
  5. cmd_symlink = ln -fsn $(patsubst $(obj)/%,$(abspath $(srctree))/$(src)/%,$@) $@
  6. always-y += $(symlinks)
  7. $(addprefix $(obj)/, $(symlinks)): FORCE
  8. $(call if_changed,symlink)
  9. endif
  10. quiet_cmd_gen_constants_py = GEN $@
  11. cmd_gen_constants_py = \
  12. $(CPP) -E -x c -P $(c_flags) $< > $@ ;\
  13. sed -i '1,/<!-- end-c-headers -->/d;' $@
  14. always-y += constants.py
  15. $(obj)/constants.py: $(src)/constants.py.in FORCE
  16. $(call if_changed_dep,gen_constants_py)
  17. clean-files := *.pyc *.pyo