1# SPDX-License-Identifier: GPL-2.0
2kapi := arch/$(SRCARCH)/include/generated/asm
3uapi := arch/$(SRCARCH)/include/generated/uapi/asm
4
5_dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)')	\
6	  $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')
7
8syscall := $(src)/syscall.tbl
9syshdr := $(srctree)/scripts/syscallhdr.sh
10systbl := $(srctree)/scripts/syscalltbl.sh
11
12quiet_cmd_syshdr = SYSHDR  $@
13      cmd_syshdr = $(CONFIG_SHELL) $(syshdr) --emit-nr --abis common,$* $< $@
14
15quiet_cmd_systbl = SYSTBL  $@
16      cmd_systbl = $(CONFIG_SHELL) $(systbl) --abis common,$* $< $@
17
18$(uapi)/unistd_%.h: $(syscall) $(syshdr) FORCE
19	$(call if_changed,syshdr)
20
21$(kapi)/syscall_table_%.h: $(syscall) $(systbl) FORCE
22	$(call if_changed,systbl)
23
24uapisyshdr-y		+= unistd_32.h unistd_64.h
25kapisyshdr-y		+= syscall_table_32.h		\
26			   syscall_table_64.h
27
28uapisyshdr-y	:= $(addprefix $(uapi)/, $(uapisyshdr-y))
29kapisyshdr-y	:= $(addprefix $(kapi)/, $(kapisyshdr-y))
30targets		+= $(addprefix ../../../../, $(uapisyshdr-y) $(kapisyshdr-y))
31
32PHONY += all
33all: $(uapisyshdr-y) $(kapisyshdr-y)
34	@:
35