1aff85039SFiroz Khan# SPDX-License-Identifier: GPL-2.0
2aff85039SFiroz Khankapi := arch/$(SRCARCH)/include/generated/asm
3aff85039SFiroz Khanuapi := arch/$(SRCARCH)/include/generated/uapi/asm
4aff85039SFiroz Khan
5*bbc90bc1SMasahiro Yamada$(shell mkdir -p $(uapi) $(kapi))
6aff85039SFiroz Khan
729c5c3acSMasahiro Yamadasyscall := $(src)/syscall.tbl
8672bff58SMasahiro Yamadasyshdr := $(srctree)/scripts/syscallhdr.sh
914b3c9d2SMasahiro Yamadasystbl := $(srctree)/scripts/syscalltbl.sh
10aff85039SFiroz Khan
11aff85039SFiroz Khanquiet_cmd_syshdr = SYSHDR  $@
12672bff58SMasahiro Yamada      cmd_syshdr = $(CONFIG_SHELL) $(syshdr) --emit-nr --abis $(abis) $< $@
13aff85039SFiroz Khan
14aff85039SFiroz Khanquiet_cmd_systbl = SYSTBL  $@
1514b3c9d2SMasahiro Yamada      cmd_systbl = $(CONFIG_SHELL) $(systbl) --abis $(abis) $< $@
16aff85039SFiroz Khan
17672bff58SMasahiro Yamada$(uapi)/unistd_32.h: abis := common,nospu,32
18865fa29fSMasahiro Yamada$(uapi)/unistd_32.h: $(syscall) $(syshdr) FORCE
19aff85039SFiroz Khan	$(call if_changed,syshdr)
20aff85039SFiroz Khan
21672bff58SMasahiro Yamada$(uapi)/unistd_64.h: abis := common,nospu,64
22865fa29fSMasahiro Yamada$(uapi)/unistd_64.h: $(syscall) $(syshdr) FORCE
23aff85039SFiroz Khan	$(call if_changed,syshdr)
24aff85039SFiroz Khan
2514b3c9d2SMasahiro Yamada$(kapi)/syscall_table_32.h: abis := common,nospu,32
26865fa29fSMasahiro Yamada$(kapi)/syscall_table_32.h: $(syscall) $(systbl) FORCE
27aff85039SFiroz Khan	$(call if_changed,systbl)
28aff85039SFiroz Khan
2914b3c9d2SMasahiro Yamada$(kapi)/syscall_table_64.h: abis := common,nospu,64
30865fa29fSMasahiro Yamada$(kapi)/syscall_table_64.h: $(syscall) $(systbl) FORCE
31aff85039SFiroz Khan	$(call if_changed,systbl)
32aff85039SFiroz Khan
3314b3c9d2SMasahiro Yamada$(kapi)/syscall_table_spu.h: abis := common,spu
34865fa29fSMasahiro Yamada$(kapi)/syscall_table_spu.h: $(syscall) $(systbl) FORCE
35aff85039SFiroz Khan	$(call if_changed,systbl)
36aff85039SFiroz Khan
37aff85039SFiroz Khanuapisyshdr-y		+= unistd_32.h unistd_64.h
38aff85039SFiroz Khankapisyshdr-y		+= syscall_table_32.h		\
39aff85039SFiroz Khan			   syscall_table_64.h		\
40aff85039SFiroz Khan			   syscall_table_spu.h
41aff85039SFiroz Khan
42865fa29fSMasahiro Yamadauapisyshdr-y	:= $(addprefix $(uapi)/, $(uapisyshdr-y))
43865fa29fSMasahiro Yamadakapisyshdr-y	:= $(addprefix $(kapi)/, $(kapisyshdr-y))
44865fa29fSMasahiro Yamadatargets		+= $(addprefix ../../../../, $(uapisyshdr-y) $(kapisyshdr-y))
45aff85039SFiroz Khan
46aff85039SFiroz KhanPHONY += all
47865fa29fSMasahiro Yamadaall: $(uapisyshdr-y) $(kapisyshdr-y)
48aff85039SFiroz Khan	@:
49