xref: /openbmc/linux/arch/s390/kernel/syscalls/Makefile (revision bbc90bc1)
15c75824dSHendrik Brueckner# SPDX-License-Identifier: GPL-2.0
25c75824dSHendrik Brueckner
35c75824dSHendrik Bruecknergen	:= arch/$(ARCH)/include/generated
45c75824dSHendrik Bruecknerkapi	:= $(gen)/asm
55c75824dSHendrik Brueckneruapi	:= $(gen)/uapi/asm
65c75824dSHendrik Brueckner
75c75824dSHendrik Bruecknersyscall	:= $(srctree)/$(src)/syscall.tbl
85c75824dSHendrik Bruecknersystbl	:= $(srctree)/$(src)/syscalltbl
95c75824dSHendrik Brueckner
105c75824dSHendrik Bruecknergen-y := $(kapi)/syscall_table.h
115c75824dSHendrik Bruecknerkapi-hdrs-y := $(kapi)/unistd_nr.h
125c75824dSHendrik Brueckneruapi-hdrs-y := $(uapi)/unistd_32.h
135c75824dSHendrik Brueckneruapi-hdrs-y += $(uapi)/unistd_64.h
145c75824dSHendrik Brueckner
155c75824dSHendrik Bruecknertargets += $(addprefix ../../../,$(gen-y) $(kapi-hdrs-y) $(uapi-hdrs-y))
165c75824dSHendrik Brueckner
175c75824dSHendrik BruecknerPHONY += kapi uapi
185c75824dSHendrik Brueckner
195c75824dSHendrik Bruecknerkapi:	$(gen-y) $(kapi-hdrs-y)
205c75824dSHendrik Brueckneruapi:	$(uapi-hdrs-y)
215c75824dSHendrik Brueckner
225c75824dSHendrik Brueckner
235c75824dSHendrik Brueckner# Create output directory if not already present
24*bbc90bc1SMasahiro Yamada$(shell mkdir -p $(uapi) $(kapi))
255c75824dSHendrik Brueckner
26ba97df45SMasahiro Yamadafilechk_syshdr = $(CONFIG_SHELL) '$(systbl)' -H -a $(syshdr_abi_$(basetarget)) -f "$2" < $<
275c75824dSHendrik Brueckner
28ba97df45SMasahiro Yamadafilechk_sysnr = $(CONFIG_SHELL) '$(systbl)' -N -a $(sysnr_abi_$(basetarget)) < $<
295c75824dSHendrik Brueckner
30ba97df45SMasahiro Yamadafilechk_syscalls = $(CONFIG_SHELL) '$(systbl)' -S < $<
315c75824dSHendrik Brueckner
325c75824dSHendrik Bruecknersyshdr_abi_unistd_32 := common,32
335c75824dSHendrik Brueckner$(uapi)/unistd_32.h: $(syscall) FORCE
345c75824dSHendrik Brueckner	$(call filechk,syshdr,$@)
355c75824dSHendrik Brueckner
365c75824dSHendrik Bruecknersyshdr_abi_unistd_64 := common,64
375c75824dSHendrik Brueckner$(uapi)/unistd_64.h: $(syscall) FORCE
385c75824dSHendrik Brueckner	$(call filechk,syshdr,$@)
395c75824dSHendrik Brueckner
405c75824dSHendrik Brueckner$(kapi)/syscall_table.h: $(syscall) FORCE
415c75824dSHendrik Brueckner	$(call filechk,syscalls)
425c75824dSHendrik Brueckner
435c75824dSHendrik Bruecknersysnr_abi_unistd_nr := common,32,64
445c75824dSHendrik Brueckner$(kapi)/unistd_nr.h: $(syscall) FORCE
455c75824dSHendrik Brueckner	$(call filechk,sysnr)
46