11da177e4SLinus Torvalds# 21da177e4SLinus Torvalds# linux/arch/arm/tools/Makefile 31da177e4SLinus Torvalds# 41da177e4SLinus Torvalds# Copyright (C) 2001 Russell King 51da177e4SLinus Torvalds# 61da177e4SLinus Torvalds 74e2648dbSRussell Kinggen := arch/$(ARCH)/include/generated 84e2648dbSRussell Kingkapi := $(gen)/asm 9*96a8fae0SRussell Kinguapi := $(gen)/uapi/asm 10*96a8fae0SRussell Kingsyshdr := $(srctree)/$(src)/syscallhdr.sh 11*96a8fae0SRussell Kingsysnr := $(srctree)/$(src)/syscallnr.sh 12*96a8fae0SRussell Kingsystbl := $(srctree)/$(src)/syscalltbl.sh 13*96a8fae0SRussell Kingsyscall := $(srctree)/$(src)/syscall.tbl 144e2648dbSRussell King 15*96a8fae0SRussell Kinggen-y := $(gen)/calls-oabi.S 16*96a8fae0SRussell Kinggen-y += $(gen)/calls-eabi.S 17*96a8fae0SRussell Kingkapi-hdrs-y := $(kapi)/unistd-nr.h 18*96a8fae0SRussell Kingkapi-hdrs-y += $(kapi)/mach-types.h 19*96a8fae0SRussell Kinguapi-hdrs-y := $(uapi)/unistd-common.h 20*96a8fae0SRussell Kinguapi-hdrs-y += $(uapi)/unistd-oabi.h 21*96a8fae0SRussell Kinguapi-hdrs-y += $(uapi)/unistd-eabi.h 224e2648dbSRussell King 23*96a8fae0SRussell Kingtargets += $(addprefix ../../../,$(gen-y) $(kapi-hdrs-y) $(uapi-hdrs-y)) 244e2648dbSRussell King 25*96a8fae0SRussell KingPHONY += kapi uapi 264e2648dbSRussell King 27*96a8fae0SRussell Kingkapi: $(kapi-hdrs-y) $(gen-y) 28*96a8fae0SRussell King 29*96a8fae0SRussell Kinguapi: $(uapi-hdrs-y) 304e2648dbSRussell King 314e2648dbSRussell King# Create output directory if not already present 32*96a8fae0SRussell King_dummy := $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') \ 33*96a8fae0SRussell King $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') 344e2648dbSRussell King 356e8ac724SMasahiro Yamadaquiet_cmd_gen_mach = GEN $@ 366e8ac724SMasahiro Yamada cmd_gen_mach = mkdir -p $(dir $@) && \ 376e8ac724SMasahiro Yamada $(AWK) -f $(filter-out $(PHONY),$^) > $@ || \ 386e8ac724SMasahiro Yamada { rm -f $@; /bin/false; } 396e8ac724SMasahiro Yamada 404e2648dbSRussell King$(kapi)/mach-types.h: $(src)/gen-mach-types $(src)/mach-types FORCE 416e8ac724SMasahiro Yamada $(call if_changed,gen_mach) 42*96a8fae0SRussell King 43*96a8fae0SRussell Kingquiet_cmd_syshdr = SYSHDR $@ 44*96a8fae0SRussell King cmd_syshdr = $(CONFIG_SHELL) '$(syshdr)' '$<' '$@' \ 45*96a8fae0SRussell King '$(syshdr_abi_$(basetarget))' \ 46*96a8fae0SRussell King '$(syshdr_pfx_$(basetarget))' \ 47*96a8fae0SRussell King '__NR_SYSCALL_BASE' 48*96a8fae0SRussell King 49*96a8fae0SRussell Kingquiet_cmd_systbl = SYSTBL $@ 50*96a8fae0SRussell King cmd_systbl = $(CONFIG_SHELL) '$(systbl)' '$<' '$@' \ 51*96a8fae0SRussell King '$(systbl_abi_$(basetarget))' 52*96a8fae0SRussell King 53*96a8fae0SRussell Kingquiet_cmd_sysnr = SYSNR $@ 54*96a8fae0SRussell King cmd_sysnr = $(CONFIG_SHELL) '$(sysnr)' '$<' '$@' \ 55*96a8fae0SRussell King '$(syshdr_abi_$(basetarget))' 56*96a8fae0SRussell King 57*96a8fae0SRussell Kingsyshdr_abi_unistd-common := common 58*96a8fae0SRussell King$(uapi)/unistd-common.h: $(syscall) $(syshdr) FORCE 59*96a8fae0SRussell King $(call if_changed,syshdr) 60*96a8fae0SRussell King 61*96a8fae0SRussell Kingsyshdr_abi_unistd-oabi := oabi 62*96a8fae0SRussell King$(uapi)/unistd-oabi.h: $(syscall) $(syshdr) FORCE 63*96a8fae0SRussell King $(call if_changed,syshdr) 64*96a8fae0SRussell King 65*96a8fae0SRussell Kingsyshdr_abi_unistd-eabi := eabi 66*96a8fae0SRussell King$(uapi)/unistd-eabi.h: $(syscall) $(syshdr) FORCE 67*96a8fae0SRussell King $(call if_changed,syshdr) 68*96a8fae0SRussell King 69*96a8fae0SRussell Kingsysnr_abi_unistd-nr := common,oabi,eabi,compat 70*96a8fae0SRussell King$(kapi)/unistd-nr.h: $(syscall) $(sysnr) FORCE 71*96a8fae0SRussell King $(call if_changed,sysnr) 72*96a8fae0SRussell King 73*96a8fae0SRussell Kingsystbl_abi_calls-oabi := common,oabi 74*96a8fae0SRussell King$(gen)/calls-oabi.S: $(syscall) $(systbl) FORCE 75*96a8fae0SRussell King $(call if_changed,systbl) 76*96a8fae0SRussell King 77*96a8fae0SRussell Kingsystbl_abi_calls-eabi := common,eabi 78*96a8fae0SRussell King$(gen)/calls-eabi.S: $(syscall) $(systbl) FORCE 79*96a8fae0SRussell King $(call if_changed,systbl) 80