H. Peter Anvin | d181764 | 2011-11-11 15:55:49 -0800 | [diff] [blame] | 1 | out := $(obj)/../include/generated/asm |
| 2 | |
| 3 | # Create output directory if not already present |
| 4 | _dummy := $(shell [ -d '$(out)' ] || mkdir -p '$(out)') |
| 5 | |
| 6 | syscall32 := $(srctree)/$(src)/syscall_32.tbl |
| 7 | syscall64 := $(srctree)/$(src)/syscall_64.tbl |
| 8 | |
| 9 | syshdr := $(srctree)/$(src)/syscallhdr.sh |
| 10 | systbl := $(srctree)/$(src)/syscalltbl.sh |
| 11 | |
| 12 | quiet_cmd_syshdr = SYSHDR $@ |
H. Peter Anvin | 6cbb369 | 2012-02-14 14:38:31 -0800 | [diff] [blame] | 13 | cmd_syshdr = $(CONFIG_SHELL) '$(syshdr)' '$<' '$@' \ |
| 14 | '$(syshdr_abi_$(basetarget))' \ |
| 15 | '$(syshdr_pfx_$(basetarget))' \ |
| 16 | '$(syshdr_offset_$(basetarget))' |
H. Peter Anvin | d181764 | 2011-11-11 15:55:49 -0800 | [diff] [blame] | 17 | quiet_cmd_systbl = SYSTBL $@ |
| 18 | cmd_systbl = $(CONFIG_SHELL) '$(systbl)' $< $@ |
| 19 | |
| 20 | syshdr_abi_unistd_32 := i386 |
| 21 | $(out)/unistd_32.h: $(syscall32) $(syshdr) |
| 22 | $(call if_changed,syshdr) |
| 23 | |
| 24 | syshdr_abi_unistd_32_ia32 := i386 |
| 25 | syshdr_pfx_unistd_32_ia32 := ia32_ |
| 26 | $(out)/unistd_32_ia32.h: $(syscall32) $(syshdr) |
| 27 | $(call if_changed,syshdr) |
| 28 | |
H. Peter Anvin | 6cbb369 | 2012-02-14 14:38:31 -0800 | [diff] [blame] | 29 | syshdr_abi_unistd_x32 := common,x32 |
| 30 | syshdr_offset_unistd_x32 := __X32_SYSCALL_BIT |
| 31 | $(out)/unistd_x32.h: $(syscall64) $(syshdr) |
| 32 | $(call if_changed,syshdr) |
| 33 | |
H. Peter Anvin | 6630f11 | 2012-02-14 14:18:50 -0800 | [diff] [blame] | 34 | syshdr_abi_unistd_64 := common,64 |
H. Peter Anvin | d181764 | 2011-11-11 15:55:49 -0800 | [diff] [blame] | 35 | $(out)/unistd_64.h: $(syscall64) $(syshdr) |
| 36 | $(call if_changed,syshdr) |
| 37 | |
H. Peter Anvin | ea499fe | 2012-02-14 14:46:23 -0800 | [diff] [blame] | 38 | syshdr_abi_unistd_64_x32 := x32 |
| 39 | syshdr_pfx_unistd_64_x32 := x32_ |
| 40 | $(out)/unistd_64_x32.h: $(syscall64) $(syshdr) |
| 41 | $(call if_changed,syshdr) |
| 42 | |
H. Peter Anvin | d181764 | 2011-11-11 15:55:49 -0800 | [diff] [blame] | 43 | $(out)/syscalls_32.h: $(syscall32) $(systbl) |
| 44 | $(call if_changed,systbl) |
| 45 | $(out)/syscalls_64.h: $(syscall64) $(systbl) |
| 46 | $(call if_changed,systbl) |
| 47 | |
H. Peter Anvin | 6cbb369 | 2012-02-14 14:38:31 -0800 | [diff] [blame] | 48 | syshdr-y += unistd_32.h unistd_64.h unistd_x32.h |
H. Peter Anvin | d181764 | 2011-11-11 15:55:49 -0800 | [diff] [blame] | 49 | syshdr-y += syscalls_32.h |
H. Peter Anvin | ea499fe | 2012-02-14 14:46:23 -0800 | [diff] [blame] | 50 | syshdr-$(CONFIG_X86_64) += unistd_32_ia32.h unistd_64_x32.h |
H. Peter Anvin | d181764 | 2011-11-11 15:55:49 -0800 | [diff] [blame] | 51 | syshdr-$(CONFIG_X86_64) += syscalls_64.h |
| 52 | |
| 53 | targets += $(syshdr-y) |
| 54 | |
| 55 | all: $(addprefix $(out)/,$(targets)) |