xref: /linux/arch/x86/entry/syscalls/Makefile (revision af8e947079a7dab0480b5d6db6b093fd04b86fc9)
1*af8e9470SMasahiro Yamadaout := arch/$(SRCARCH)/include/generated/asm
2*af8e9470SMasahiro Yamadauapi := arch/$(SRCARCH)/include/generated/uapi/asm
31f57d5d8SIngo Molnar
41f57d5d8SIngo Molnar# Create output directory if not already present
51f57d5d8SIngo Molnar_dummy := $(shell [ -d '$(out)' ] || mkdir -p '$(out)') \
61f57d5d8SIngo Molnar	  $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)')
71f57d5d8SIngo Molnar
81f57d5d8SIngo Molnarsyscall32 := $(srctree)/$(src)/syscall_32.tbl
91f57d5d8SIngo Molnarsyscall64 := $(srctree)/$(src)/syscall_64.tbl
101f57d5d8SIngo Molnar
111f57d5d8SIngo Molnarsyshdr := $(srctree)/$(src)/syscallhdr.sh
121f57d5d8SIngo Molnarsystbl := $(srctree)/$(src)/syscalltbl.sh
131f57d5d8SIngo Molnar
141f57d5d8SIngo Molnarquiet_cmd_syshdr = SYSHDR  $@
151f57d5d8SIngo Molnar      cmd_syshdr = $(CONFIG_SHELL) '$(syshdr)' '$<' '$@' \
161f57d5d8SIngo Molnar		   '$(syshdr_abi_$(basetarget))' \
171f57d5d8SIngo Molnar		   '$(syshdr_pfx_$(basetarget))' \
181f57d5d8SIngo Molnar		   '$(syshdr_offset_$(basetarget))'
191f57d5d8SIngo Molnarquiet_cmd_systbl = SYSTBL  $@
201f57d5d8SIngo Molnar      cmd_systbl = $(CONFIG_SHELL) '$(systbl)' $< $@
211f57d5d8SIngo Molnar
221f57d5d8SIngo Molnarquiet_cmd_hypercalls = HYPERCALLS $@
231f57d5d8SIngo Molnar      cmd_hypercalls = $(CONFIG_SHELL) '$<' $@ $(filter-out $<,$^)
241f57d5d8SIngo Molnar
251f57d5d8SIngo Molnarsyshdr_abi_unistd_32 := i386
261f57d5d8SIngo Molnar$(uapi)/unistd_32.h: $(syscall32) $(syshdr)
271f57d5d8SIngo Molnar	$(call if_changed,syshdr)
281f57d5d8SIngo Molnar
291f57d5d8SIngo Molnarsyshdr_abi_unistd_32_ia32 := i386
301f57d5d8SIngo Molnarsyshdr_pfx_unistd_32_ia32 := ia32_
311f57d5d8SIngo Molnar$(out)/unistd_32_ia32.h: $(syscall32) $(syshdr)
321f57d5d8SIngo Molnar	$(call if_changed,syshdr)
331f57d5d8SIngo Molnar
341f57d5d8SIngo Molnarsyshdr_abi_unistd_x32 := common,x32
351f57d5d8SIngo Molnarsyshdr_offset_unistd_x32 := __X32_SYSCALL_BIT
361f57d5d8SIngo Molnar$(uapi)/unistd_x32.h: $(syscall64) $(syshdr)
371f57d5d8SIngo Molnar	$(call if_changed,syshdr)
381f57d5d8SIngo Molnar
391f57d5d8SIngo Molnarsyshdr_abi_unistd_64 := common,64
401f57d5d8SIngo Molnar$(uapi)/unistd_64.h: $(syscall64) $(syshdr)
411f57d5d8SIngo Molnar	$(call if_changed,syshdr)
421f57d5d8SIngo Molnar
431f57d5d8SIngo Molnarsyshdr_abi_unistd_64_x32 := x32
441f57d5d8SIngo Molnarsyshdr_pfx_unistd_64_x32 := x32_
451f57d5d8SIngo Molnar$(out)/unistd_64_x32.h: $(syscall64) $(syshdr)
461f57d5d8SIngo Molnar	$(call if_changed,syshdr)
471f57d5d8SIngo Molnar
481f57d5d8SIngo Molnar$(out)/syscalls_32.h: $(syscall32) $(systbl)
491f57d5d8SIngo Molnar	$(call if_changed,systbl)
501f57d5d8SIngo Molnar$(out)/syscalls_64.h: $(syscall64) $(systbl)
511f57d5d8SIngo Molnar	$(call if_changed,systbl)
521f57d5d8SIngo Molnar
531f57d5d8SIngo Molnar$(out)/xen-hypercalls.h: $(srctree)/scripts/xen-hypercalls.sh
541f57d5d8SIngo Molnar	$(call if_changed,hypercalls)
551f57d5d8SIngo Molnar
561f57d5d8SIngo Molnar$(out)/xen-hypercalls.h: $(srctree)/include/xen/interface/xen*.h
571f57d5d8SIngo Molnar
581f57d5d8SIngo Molnaruapisyshdr-y			+= unistd_32.h unistd_64.h unistd_x32.h
591f57d5d8SIngo Molnarsyshdr-y			+= syscalls_32.h
601f57d5d8SIngo Molnarsyshdr-$(CONFIG_X86_64)		+= unistd_32_ia32.h unistd_64_x32.h
611f57d5d8SIngo Molnarsyshdr-$(CONFIG_X86_64)		+= syscalls_64.h
621f57d5d8SIngo Molnarsyshdr-$(CONFIG_XEN)		+= xen-hypercalls.h
631f57d5d8SIngo Molnar
641f57d5d8SIngo Molnartargets	+= $(uapisyshdr-y) $(syshdr-y)
651f57d5d8SIngo Molnar
661f57d5d8SIngo MolnarPHONY += all
671f57d5d8SIngo Molnarall: $(addprefix $(uapi)/,$(uapisyshdr-y))
681f57d5d8SIngo Molnarall: $(addprefix $(out)/,$(syshdr-y))
691f57d5d8SIngo Molnar	@:
70