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 245c75824dSHendrik Brueckner_dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \ 255c75824dSHendrik Brueckner $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') 265c75824dSHendrik Brueckner 27ba97df45SMasahiro Yamadafilechk_syshdr = $(CONFIG_SHELL) '$(systbl)' -H -a $(syshdr_abi_$(basetarget)) -f "$2" < $< 285c75824dSHendrik Brueckner 29ba97df45SMasahiro Yamadafilechk_sysnr = $(CONFIG_SHELL) '$(systbl)' -N -a $(sysnr_abi_$(basetarget)) < $< 305c75824dSHendrik Brueckner 31ba97df45SMasahiro Yamadafilechk_syscalls = $(CONFIG_SHELL) '$(systbl)' -S < $< 325c75824dSHendrik Brueckner 335c75824dSHendrik Bruecknersyshdr_abi_unistd_32 := common,32 345c75824dSHendrik Brueckner$(uapi)/unistd_32.h: $(syscall) FORCE 355c75824dSHendrik Brueckner $(call filechk,syshdr,$@) 365c75824dSHendrik Brueckner 375c75824dSHendrik Bruecknersyshdr_abi_unistd_64 := common,64 385c75824dSHendrik Brueckner$(uapi)/unistd_64.h: $(syscall) FORCE 395c75824dSHendrik Brueckner $(call filechk,syshdr,$@) 405c75824dSHendrik Brueckner 415c75824dSHendrik Brueckner$(kapi)/syscall_table.h: $(syscall) FORCE 425c75824dSHendrik Brueckner $(call filechk,syscalls) 435c75824dSHendrik Brueckner 445c75824dSHendrik Bruecknersysnr_abi_unistd_nr := common,32,64 455c75824dSHendrik Brueckner$(kapi)/unistd_nr.h: $(syscall) FORCE 465c75824dSHendrik Brueckner $(call filechk,sysnr) 47