xref: /openbmc/linux/arch/mips/kernel/syscalls/Makefile (revision 865fa29f)
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
8syscalln32 := $(srctree)/$(src)/syscall_n32.tbl
9syscalln64 := $(srctree)/$(src)/syscall_n64.tbl
10syscallo32 := $(srctree)/$(src)/syscall_o32.tbl
11syshdr := $(srctree)/$(src)/syscallhdr.sh
12sysnr := $(srctree)/$(src)/syscallnr.sh
13systbl := $(srctree)/$(src)/syscalltbl.sh
14
15quiet_cmd_syshdr = SYSHDR  $@
16      cmd_syshdr = $(CONFIG_SHELL) '$(syshdr)' '$<' '$@'	\
17		   '$(syshdr_abis_$(basetarget))'		\
18		   '$(syshdr_pfx_$(basetarget))'		\
19		   '$(syshdr_offset_$(basetarget))'
20
21quiet_cmd_sysnr = SYSNR   $@
22      cmd_sysnr = $(CONFIG_SHELL) '$(sysnr)' '$<' '$@'		\
23		  '$(sysnr_abis_$(basetarget))'			\
24		  '$(sysnr_pfx_$(basetarget))'			\
25		  '$(sysnr_offset_$(basetarget))'
26
27quiet_cmd_systbl = SYSTBL  $@
28      cmd_systbl = $(CONFIG_SHELL) '$(systbl)' '$<' '$@'	\
29		   '$(systbl_abis_$(basetarget))'		\
30		   '$(systbl_abi_$(basetarget))'		\
31		   '$(systbl_offset_$(basetarget))'
32
33syshdr_offset_unistd_n32 := __NR_Linux
34$(uapi)/unistd_n32.h: $(syscalln32) $(syshdr) FORCE
35	$(call if_changed,syshdr)
36
37syshdr_offset_unistd_n64 := __NR_Linux
38$(uapi)/unistd_n64.h: $(syscalln64) $(syshdr) FORCE
39	$(call if_changed,syshdr)
40
41syshdr_offset_unistd_o32 := __NR_Linux
42$(uapi)/unistd_o32.h: $(syscallo32) $(syshdr) FORCE
43	$(call if_changed,syshdr)
44
45sysnr_pfx_unistd_nr_n32 := N32
46sysnr_offset_unistd_nr_n32 := 6000
47$(uapi)/unistd_nr_n32.h: $(syscalln32) $(sysnr) FORCE
48	$(call if_changed,sysnr)
49
50sysnr_pfx_unistd_nr_n64 := 64
51sysnr_offset_unistd_nr_n64 := 5000
52$(uapi)/unistd_nr_n64.h: $(syscalln64) $(sysnr) FORCE
53	$(call if_changed,sysnr)
54
55sysnr_pfx_unistd_nr_o32 := O32
56sysnr_offset_unistd_nr_o32 := 4000
57$(uapi)/unistd_nr_o32.h: $(syscallo32) $(sysnr) FORCE
58	$(call if_changed,sysnr)
59
60systbl_abi_syscall_table_32_o32 := 32_o32
61systbl_offset_syscall_table_32_o32 := 4000
62$(kapi)/syscall_table_32_o32.h: $(syscallo32) $(systbl) FORCE
63	$(call if_changed,systbl)
64
65systbl_abi_syscall_table_64_n32 := 64_n32
66systbl_offset_syscall_table_64_n32 := 6000
67$(kapi)/syscall_table_64_n32.h: $(syscalln32) $(systbl) FORCE
68	$(call if_changed,systbl)
69
70systbl_abi_syscall_table_64_n64 := 64_n64
71systbl_offset_syscall_table_64_n64 := 5000
72$(kapi)/syscall_table_64_n64.h: $(syscalln64) $(systbl) FORCE
73	$(call if_changed,systbl)
74
75systbl_abi_syscall_table_64_o32 := 64_o32
76systbl_offset_syscall_table_64_o32 := 4000
77$(kapi)/syscall_table_64_o32.h: $(syscallo32) $(systbl) FORCE
78	$(call if_changed,systbl)
79
80uapisyshdr-y		+= unistd_n32.h			\
81			   unistd_n64.h			\
82			   unistd_o32.h			\
83			   unistd_nr_n32.h		\
84			   unistd_nr_n64.h		\
85			   unistd_nr_o32.h
86kapisyshdr-y		+= syscall_table_32_o32.h	\
87			   syscall_table_64_n32.h	\
88			   syscall_table_64_n64.h	\
89			   syscall_table_64_o32.h
90
91uapisyshdr-y	:= $(addprefix $(uapi)/, $(uapisyshdr-y))
92kapisyshdr-y	:= $(addprefix $(kapi)/, $(kapisyshdr-y))
93targets		+= $(addprefix ../../../../, $(uapisyshdr-y) $(kapisyshdr-y))
94
95PHONY += all
96all: $(uapisyshdr-y) $(kapisyshdr-y)
97	@:
98