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