blob: 57aa59fd140c0079d8b6a50add515c3df9ab7ace [file] [log] [blame]
Ingo Molnar1f57d5d2015-06-03 18:36:41 +02001out := $(obj)/../../include/generated/asm
2uapi := $(obj)/../../include/generated/uapi/asm
H. Peter Anvind1817642011-11-11 15:55:49 -08003
4# Create output directory if not already present
David Howellsec28b7f2012-10-02 18:01:56 +01005_dummy := $(shell [ -d '$(out)' ] || mkdir -p '$(out)') \
6 $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)')
H. Peter Anvind1817642011-11-11 15:55:49 -08007
8syscall32 := $(srctree)/$(src)/syscall_32.tbl
9syscall64 := $(srctree)/$(src)/syscall_64.tbl
10
11syshdr := $(srctree)/$(src)/syscallhdr.sh
12systbl := $(srctree)/$(src)/syscalltbl.sh
13
14quiet_cmd_syshdr = SYSHDR $@
H. Peter Anvin6cbb3692012-02-14 14:38:31 -080015 cmd_syshdr = $(CONFIG_SHELL) '$(syshdr)' '$<' '$@' \
16 '$(syshdr_abi_$(basetarget))' \
17 '$(syshdr_pfx_$(basetarget))' \
18 '$(syshdr_offset_$(basetarget))'
H. Peter Anvind1817642011-11-11 15:55:49 -080019quiet_cmd_systbl = SYSTBL $@
20 cmd_systbl = $(CONFIG_SHELL) '$(systbl)' $< $@
21
Juergen Gross9b4ade22015-01-21 08:49:22 +010022quiet_cmd_hypercalls = HYPERCALLS $@
23 cmd_hypercalls = $(CONFIG_SHELL) '$<' $@ $(filter-out $<,$^)
24
H. Peter Anvind1817642011-11-11 15:55:49 -080025syshdr_abi_unistd_32 := i386
David Howellsec28b7f2012-10-02 18:01:56 +010026$(uapi)/unistd_32.h: $(syscall32) $(syshdr)
H. Peter Anvind1817642011-11-11 15:55:49 -080027 $(call if_changed,syshdr)
28
29syshdr_abi_unistd_32_ia32 := i386
30syshdr_pfx_unistd_32_ia32 := ia32_
31$(out)/unistd_32_ia32.h: $(syscall32) $(syshdr)
32 $(call if_changed,syshdr)
33
H. Peter Anvin6cbb3692012-02-14 14:38:31 -080034syshdr_abi_unistd_x32 := common,x32
35syshdr_offset_unistd_x32 := __X32_SYSCALL_BIT
David Howellsec28b7f2012-10-02 18:01:56 +010036$(uapi)/unistd_x32.h: $(syscall64) $(syshdr)
H. Peter Anvin6cbb3692012-02-14 14:38:31 -080037 $(call if_changed,syshdr)
38
H. Peter Anvin6630f112012-02-14 14:18:50 -080039syshdr_abi_unistd_64 := common,64
David Howellsec28b7f2012-10-02 18:01:56 +010040$(uapi)/unistd_64.h: $(syscall64) $(syshdr)
H. Peter Anvind1817642011-11-11 15:55:49 -080041 $(call if_changed,syshdr)
42
H. Peter Anvinea499fe2012-02-14 14:46:23 -080043syshdr_abi_unistd_64_x32 := x32
44syshdr_pfx_unistd_64_x32 := x32_
45$(out)/unistd_64_x32.h: $(syscall64) $(syshdr)
46 $(call if_changed,syshdr)
47
H. Peter Anvind1817642011-11-11 15:55:49 -080048$(out)/syscalls_32.h: $(syscall32) $(systbl)
49 $(call if_changed,systbl)
50$(out)/syscalls_64.h: $(syscall64) $(systbl)
51 $(call if_changed,systbl)
52
Juergen Gross9b4ade22015-01-21 08:49:22 +010053$(out)/xen-hypercalls.h: $(srctree)/scripts/xen-hypercalls.sh
54 $(call if_changed,hypercalls)
55
56$(out)/xen-hypercalls.h: $(srctree)/include/xen/interface/xen*.h
57
David Howellsec28b7f2012-10-02 18:01:56 +010058uapisyshdr-y += unistd_32.h unistd_64.h unistd_x32.h
H. Peter Anvind1817642011-11-11 15:55:49 -080059syshdr-y += syscalls_32.h
H. Peter Anvinea499fe2012-02-14 14:46:23 -080060syshdr-$(CONFIG_X86_64) += unistd_32_ia32.h unistd_64_x32.h
H. Peter Anvind1817642011-11-11 15:55:49 -080061syshdr-$(CONFIG_X86_64) += syscalls_64.h
Juergen Gross9b4ade22015-01-21 08:49:22 +010062syshdr-$(CONFIG_XEN) += xen-hypercalls.h
H. Peter Anvind1817642011-11-11 15:55:49 -080063
David Howellsec28b7f2012-10-02 18:01:56 +010064targets += $(uapisyshdr-y) $(syshdr-y)
H. Peter Anvind1817642011-11-11 15:55:49 -080065
Masahiro Yamadae6bcd1a2014-04-10 10:35:42 +090066PHONY += all
David Howellsec28b7f2012-10-02 18:01:56 +010067all: $(addprefix $(uapi)/,$(uapisyshdr-y))
68all: $(addprefix $(out)/,$(syshdr-y))
Masahiro Yamadae6bcd1a2014-04-10 10:35:42 +090069 @: