Makefile 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. # SPDX-License-Identifier: GPL-2.0
  2. #
  3. # linux/arch/arm/tools/Makefile
  4. #
  5. # Copyright (C) 2001 Russell King
  6. #
  7. gen := arch/$(ARCH)/include/generated
  8. kapi := $(gen)/asm
  9. uapi := $(gen)/uapi/asm
  10. syshdr := $(srctree)/$(src)/syscallhdr.sh
  11. sysnr := $(srctree)/$(src)/syscallnr.sh
  12. systbl := $(srctree)/$(src)/syscalltbl.sh
  13. syscall := $(srctree)/$(src)/syscall.tbl
  14. gen-y := $(gen)/calls-oabi.S
  15. gen-y += $(gen)/calls-eabi.S
  16. kapi-hdrs-y := $(kapi)/unistd-nr.h
  17. kapi-hdrs-y += $(kapi)/mach-types.h
  18. uapi-hdrs-y := $(uapi)/unistd-common.h
  19. uapi-hdrs-y += $(uapi)/unistd-oabi.h
  20. uapi-hdrs-y += $(uapi)/unistd-eabi.h
  21. targets += $(addprefix ../../../,$(gen-y) $(kapi-hdrs-y) $(uapi-hdrs-y))
  22. PHONY += kapi uapi
  23. kapi: $(kapi-hdrs-y) $(gen-y)
  24. uapi: $(uapi-hdrs-y)
  25. # Create output directory if not already present
  26. _dummy := $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') \
  27. $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)')
  28. quiet_cmd_gen_mach = GEN $@
  29. cmd_gen_mach = mkdir -p $(dir $@) && \
  30. $(AWK) -f $(filter-out $(PHONY),$^) > $@ || \
  31. { rm -f $@; /bin/false; }
  32. $(kapi)/mach-types.h: $(src)/gen-mach-types $(src)/mach-types FORCE
  33. $(call if_changed,gen_mach)
  34. quiet_cmd_syshdr = SYSHDR $@
  35. cmd_syshdr = $(CONFIG_SHELL) '$(syshdr)' '$<' '$@' \
  36. '$(syshdr_abi_$(basetarget))' \
  37. '$(syshdr_pfx_$(basetarget))' \
  38. '__NR_SYSCALL_BASE'
  39. quiet_cmd_systbl = SYSTBL $@
  40. cmd_systbl = $(CONFIG_SHELL) '$(systbl)' '$<' '$@' \
  41. '$(systbl_abi_$(basetarget))'
  42. quiet_cmd_sysnr = SYSNR $@
  43. cmd_sysnr = $(CONFIG_SHELL) '$(sysnr)' '$<' '$@' \
  44. '$(syshdr_abi_$(basetarget))'
  45. syshdr_abi_unistd-common := common
  46. $(uapi)/unistd-common.h: $(syscall) $(syshdr) FORCE
  47. $(call if_changed,syshdr)
  48. syshdr_abi_unistd-oabi := oabi
  49. $(uapi)/unistd-oabi.h: $(syscall) $(syshdr) FORCE
  50. $(call if_changed,syshdr)
  51. syshdr_abi_unistd-eabi := eabi
  52. $(uapi)/unistd-eabi.h: $(syscall) $(syshdr) FORCE
  53. $(call if_changed,syshdr)
  54. sysnr_abi_unistd-nr := common,oabi,eabi,compat
  55. $(kapi)/unistd-nr.h: $(syscall) $(sysnr) FORCE
  56. $(call if_changed,sysnr)
  57. systbl_abi_calls-oabi := common,oabi
  58. $(gen)/calls-oabi.S: $(syscall) $(systbl) FORCE
  59. $(call if_changed,systbl)
  60. systbl_abi_calls-eabi := common,eabi
  61. $(gen)/calls-eabi.S: $(syscall) $(systbl) FORCE
  62. $(call if_changed,systbl)