1# SPDX-License-Identifier: GPL-2.0 2 3gen := arch/$(ARCH)/include/generated 4kapi := $(gen)/asm 5uapi := $(gen)/uapi/asm 6 7syscall := $(src)/syscall.tbl 8systbl := $(src)/syscalltbl 9 10gen-y := $(kapi)/syscall_table.h 11kapi-hdrs-y := $(kapi)/unistd_nr.h 12uapi-hdrs-y := $(uapi)/unistd_32.h 13uapi-hdrs-y += $(uapi)/unistd_64.h 14 15targets += $(addprefix ../../../../,$(gen-y) $(kapi-hdrs-y) $(uapi-hdrs-y)) 16 17PHONY += kapi uapi 18 19kapi: $(gen-y) $(kapi-hdrs-y) 20uapi: $(uapi-hdrs-y) 21 22 23# Create output directory if not already present 24$(shell mkdir -p $(uapi) $(kapi)) 25 26quiet_cmd_syshdr = SYSHDR $@ 27 cmd_syshdr = $(CONFIG_SHELL) '$(systbl)' -H -a $(syshdr_abi_$(basetarget)) -f "$@" < $< > $@ 28 29quiet_cmd_sysnr = SYSNR $@ 30 cmd_sysnr = $(CONFIG_SHELL) '$(systbl)' -N -a $(sysnr_abi_$(basetarget)) < $< > $@ 31 32quiet_cmd_syscalls = SYSTBL $@ 33 cmd_syscalls = $(CONFIG_SHELL) '$(systbl)' -S < $< > $@ 34 35syshdr_abi_unistd_32 := common,32 36$(uapi)/unistd_32.h: $(syscall) $(systbl) FORCE 37 $(call if_changed,syshdr) 38 39syshdr_abi_unistd_64 := common,64 40$(uapi)/unistd_64.h: $(syscall) $(systbl) FORCE 41 $(call if_changed,syshdr) 42 43$(kapi)/syscall_table.h: $(syscall) $(systbl) FORCE 44 $(call if_changed,syscalls) 45 46sysnr_abi_unistd_nr := common,32,64 47$(kapi)/unistd_nr.h: $(syscall) $(systbl) FORCE 48 $(call if_changed,sysnr) 49