1c7914ef6SFiroz Khan# SPDX-License-Identifier: GPL-2.0
2c7914ef6SFiroz Khankapi := arch/$(SRCARCH)/include/generated/asm
3c7914ef6SFiroz Khanuapi := arch/$(SRCARCH)/include/generated/uapi/asm
4c7914ef6SFiroz Khan
5c7914ef6SFiroz Khan_dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)')	\
6c7914ef6SFiroz Khan	  $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')
7c7914ef6SFiroz Khan
8c7914ef6SFiroz Khansyscall := $(srctree)/$(src)/syscall.tbl
9c7914ef6SFiroz Khansyshdr := $(srctree)/$(src)/syscallhdr.sh
10c7914ef6SFiroz Khansystbl := $(srctree)/$(src)/syscalltbl.sh
11c7914ef6SFiroz Khan
12c7914ef6SFiroz Khanquiet_cmd_syshdr = SYSHDR  $@
13c7914ef6SFiroz Khan      cmd_syshdr = $(CONFIG_SHELL) '$(syshdr)' '$<' '$@'	\
14c7914ef6SFiroz Khan		   '$(syshdr_abis_$(basetarget))'		\
15c7914ef6SFiroz Khan		   '$(syshdr_pfx_$(basetarget))'		\
16c7914ef6SFiroz Khan		   '$(syshdr_offset_$(basetarget))'
17c7914ef6SFiroz Khan
18c7914ef6SFiroz Khanquiet_cmd_systbl = SYSTBL  $@
19c7914ef6SFiroz Khan      cmd_systbl = $(CONFIG_SHELL) '$(systbl)' '$<' '$@'	\
20c7914ef6SFiroz Khan		   '$(systbl_abis_$(basetarget))'		\
21c7914ef6SFiroz Khan		   '$(systbl_abi_$(basetarget))'		\
22c7914ef6SFiroz Khan		   '$(systbl_offset_$(basetarget))'
23c7914ef6SFiroz Khan
24c7914ef6SFiroz Khan$(uapi)/unistd_32.h: $(syscall) $(syshdr)
25c7914ef6SFiroz Khan	$(call if_changed,syshdr)
26c7914ef6SFiroz Khan
27c7914ef6SFiroz Khan$(kapi)/syscall_table.h: $(syscall) $(systbl)
28c7914ef6SFiroz Khan	$(call if_changed,systbl)
29c7914ef6SFiroz Khan
30c7914ef6SFiroz Khanuapisyshdr-y		+= unistd_32.h
31c7914ef6SFiroz Khankapisyshdr-y		+= syscall_table.h
32c7914ef6SFiroz Khan
33c7914ef6SFiroz Khantargets	+= $(uapisyshdr-y) $(kapisyshdr-y)
34c7914ef6SFiroz Khan
35c7914ef6SFiroz KhanPHONY += all
36c7914ef6SFiroz Khanall: $(addprefix $(uapi)/,$(uapisyshdr-y))
37c7914ef6SFiroz Khanall: $(addprefix $(kapi)/,$(kapisyshdr-y))
38c7914ef6SFiroz Khan	@:
39