xref: /linux/arch/powerpc/kernel/syscalls/Makefile (revision 672bff581e19d5d7bef993f910ed385c4054cbbc)
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
5aff85039SFiroz Khan_dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)')	\
6aff85039SFiroz Khan	  $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')
7aff85039SFiroz Khan
829c5c3acSMasahiro Yamadasyscall := $(src)/syscall.tbl
9*672bff58SMasahiro Yamadasyshdr := $(srctree)/scripts/syscallhdr.sh
1014b3c9d2SMasahiro Yamadasystbl := $(srctree)/scripts/syscalltbl.sh
11aff85039SFiroz Khan
12aff85039SFiroz Khanquiet_cmd_syshdr = SYSHDR  $@
13*672bff58SMasahiro Yamada      cmd_syshdr = $(CONFIG_SHELL) $(syshdr) --emit-nr --abis $(abis) $< $@
14aff85039SFiroz Khan
15aff85039SFiroz Khanquiet_cmd_systbl = SYSTBL  $@
1614b3c9d2SMasahiro Yamada      cmd_systbl = $(CONFIG_SHELL) $(systbl) --abis $(abis) $< $@
17aff85039SFiroz Khan
18*672bff58SMasahiro Yamada$(uapi)/unistd_32.h: abis := common,nospu,32
19865fa29fSMasahiro Yamada$(uapi)/unistd_32.h: $(syscall) $(syshdr) FORCE
20aff85039SFiroz Khan	$(call if_changed,syshdr)
21aff85039SFiroz Khan
22*672bff58SMasahiro Yamada$(uapi)/unistd_64.h: abis := common,nospu,64
23865fa29fSMasahiro Yamada$(uapi)/unistd_64.h: $(syscall) $(syshdr) FORCE
24aff85039SFiroz Khan	$(call if_changed,syshdr)
25aff85039SFiroz Khan
2614b3c9d2SMasahiro Yamada$(kapi)/syscall_table_32.h: abis := common,nospu,32
27865fa29fSMasahiro Yamada$(kapi)/syscall_table_32.h: $(syscall) $(systbl) FORCE
28aff85039SFiroz Khan	$(call if_changed,systbl)
29aff85039SFiroz Khan
3014b3c9d2SMasahiro Yamada$(kapi)/syscall_table_64.h: abis := common,nospu,64
31865fa29fSMasahiro Yamada$(kapi)/syscall_table_64.h: $(syscall) $(systbl) FORCE
32aff85039SFiroz Khan	$(call if_changed,systbl)
33aff85039SFiroz Khan
3414b3c9d2SMasahiro Yamada$(kapi)/syscall_table_spu.h: abis := common,spu
35865fa29fSMasahiro Yamada$(kapi)/syscall_table_spu.h: $(syscall) $(systbl) FORCE
36aff85039SFiroz Khan	$(call if_changed,systbl)
37aff85039SFiroz Khan
38aff85039SFiroz Khanuapisyshdr-y		+= unistd_32.h unistd_64.h
39aff85039SFiroz Khankapisyshdr-y		+= syscall_table_32.h		\
40aff85039SFiroz Khan			   syscall_table_64.h		\
41aff85039SFiroz Khan			   syscall_table_spu.h
42aff85039SFiroz Khan
43865fa29fSMasahiro Yamadauapisyshdr-y	:= $(addprefix $(uapi)/, $(uapisyshdr-y))
44865fa29fSMasahiro Yamadakapisyshdr-y	:= $(addprefix $(kapi)/, $(kapisyshdr-y))
45865fa29fSMasahiro Yamadatargets		+= $(addprefix ../../../../, $(uapisyshdr-y) $(kapisyshdr-y))
46aff85039SFiroz Khan
47aff85039SFiroz KhanPHONY += all
48865fa29fSMasahiro Yamadaall: $(uapisyshdr-y) $(kapisyshdr-y)
49aff85039SFiroz Khan	@:
50