Makefile 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. out := $(obj)/../../include/generated/asm
  2. uapi := $(obj)/../../include/generated/uapi/asm
  3. # Create output directory if not already present
  4. _dummy := $(shell [ -d '$(out)' ] || mkdir -p '$(out)') \
  5. $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)')
  6. syscall32 := $(srctree)/$(src)/syscall_32.tbl
  7. syscall64 := $(srctree)/$(src)/syscall_64.tbl
  8. syshdr := $(srctree)/$(src)/syscallhdr.sh
  9. systbl := $(srctree)/$(src)/syscalltbl.sh
  10. quiet_cmd_syshdr = SYSHDR $@
  11. cmd_syshdr = $(CONFIG_SHELL) '$(syshdr)' '$<' '$@' \
  12. '$(syshdr_abi_$(basetarget))' \
  13. '$(syshdr_pfx_$(basetarget))' \
  14. '$(syshdr_offset_$(basetarget))'
  15. quiet_cmd_systbl = SYSTBL $@
  16. cmd_systbl = $(CONFIG_SHELL) '$(systbl)' $< $@
  17. quiet_cmd_hypercalls = HYPERCALLS $@
  18. cmd_hypercalls = $(CONFIG_SHELL) '$<' $@ $(filter-out $<,$^)
  19. syshdr_abi_unistd_32 := i386
  20. $(uapi)/unistd_32.h: $(syscall32) $(syshdr)
  21. $(call if_changed,syshdr)
  22. syshdr_abi_unistd_32_ia32 := i386
  23. syshdr_pfx_unistd_32_ia32 := ia32_
  24. $(out)/unistd_32_ia32.h: $(syscall32) $(syshdr)
  25. $(call if_changed,syshdr)
  26. syshdr_abi_unistd_x32 := common,x32
  27. syshdr_offset_unistd_x32 := __X32_SYSCALL_BIT
  28. $(uapi)/unistd_x32.h: $(syscall64) $(syshdr)
  29. $(call if_changed,syshdr)
  30. syshdr_abi_unistd_64 := common,64
  31. $(uapi)/unistd_64.h: $(syscall64) $(syshdr)
  32. $(call if_changed,syshdr)
  33. syshdr_abi_unistd_64_x32 := x32
  34. syshdr_pfx_unistd_64_x32 := x32_
  35. $(out)/unistd_64_x32.h: $(syscall64) $(syshdr)
  36. $(call if_changed,syshdr)
  37. $(out)/syscalls_32.h: $(syscall32) $(systbl)
  38. $(call if_changed,systbl)
  39. $(out)/syscalls_64.h: $(syscall64) $(systbl)
  40. $(call if_changed,systbl)
  41. $(out)/xen-hypercalls.h: $(srctree)/scripts/xen-hypercalls.sh
  42. $(call if_changed,hypercalls)
  43. $(out)/xen-hypercalls.h: $(srctree)/include/xen/interface/xen*.h
  44. uapisyshdr-y += unistd_32.h unistd_64.h unistd_x32.h
  45. syshdr-y += syscalls_32.h
  46. syshdr-$(CONFIG_X86_64) += unistd_32_ia32.h unistd_64_x32.h
  47. syshdr-$(CONFIG_X86_64) += syscalls_64.h
  48. syshdr-$(CONFIG_XEN) += xen-hypercalls.h
  49. targets += $(uapisyshdr-y) $(syshdr-y)
  50. PHONY += all
  51. all: $(addprefix $(uapi)/,$(uapisyshdr-y))
  52. all: $(addprefix $(out)/,$(syshdr-y))
  53. @: