xref: /linux/arch/arm/tools/Makefile (revision ad05f676525aefbf3d9123a525c8a58e05b2c88e)
1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
21da177e4SLinus Torvalds#
31da177e4SLinus Torvalds# linux/arch/arm/tools/Makefile
41da177e4SLinus Torvalds#
51da177e4SLinus Torvalds# Copyright (C) 2001 Russell King
61da177e4SLinus Torvalds#
71da177e4SLinus Torvalds
84e2648dbSRussell Kinggen := arch/$(ARCH)/include/generated
94e2648dbSRussell Kingkapi := $(gen)/asm
1096a8fae0SRussell Kinguapi := $(gen)/uapi/asm
1132e9a0d5SMasahiro Yamadasyshdr := $(srctree)/scripts/syscallhdr.sh
1296a8fae0SRussell Kingsysnr := $(srctree)/$(src)/syscallnr.sh
130047eb9fSMasahiro Yamadasystbl := $(srctree)/scripts/syscalltbl.sh
1429c5c3acSMasahiro Yamadasyscall := $(src)/syscall.tbl
154e2648dbSRussell King
1696a8fae0SRussell Kinggen-y := $(gen)/calls-oabi.S
1796a8fae0SRussell Kinggen-y += $(gen)/calls-eabi.S
1896a8fae0SRussell Kingkapi-hdrs-y := $(kapi)/unistd-nr.h
1996a8fae0SRussell Kingkapi-hdrs-y += $(kapi)/mach-types.h
2096a8fae0SRussell Kinguapi-hdrs-y += $(uapi)/unistd-oabi.h
2196a8fae0SRussell Kinguapi-hdrs-y += $(uapi)/unistd-eabi.h
224e2648dbSRussell King
2396a8fae0SRussell Kingtargets += $(addprefix ../../../,$(gen-y) $(kapi-hdrs-y) $(uapi-hdrs-y))
244e2648dbSRussell King
2596a8fae0SRussell KingPHONY += kapi uapi
264e2648dbSRussell King
2796a8fae0SRussell Kingkapi:	$(kapi-hdrs-y) $(gen-y)
2896a8fae0SRussell King
2996a8fae0SRussell Kinguapi:	$(uapi-hdrs-y)
304e2648dbSRussell King
314e2648dbSRussell King# Create output directory if not already present
3296a8fae0SRussell King_dummy := $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') \
3396a8fae0SRussell King          $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)')
344e2648dbSRussell King
356e8ac724SMasahiro Yamadaquiet_cmd_gen_mach = GEN     $@
366073882cSMasahiro Yamada      cmd_gen_mach = $(AWK) -f $(real-prereqs) > $@
376e8ac724SMasahiro Yamada
384e2648dbSRussell King$(kapi)/mach-types.h: $(src)/gen-mach-types $(src)/mach-types FORCE
396e8ac724SMasahiro Yamada	$(call if_changed,gen_mach)
4096a8fae0SRussell King
4196a8fae0SRussell Kingquiet_cmd_syshdr = SYSHDR  $@
42*ad05f676SMasahiro Yamada      cmd_syshdr = $(CONFIG_SHELL) $(syshdr) --abis common,$* \
4332e9a0d5SMasahiro Yamada		   --offset __NR_SYSCALL_BASE $< $@
4496a8fae0SRussell King
4596a8fae0SRussell Kingquiet_cmd_systbl = SYSTBL  $@
46*ad05f676SMasahiro Yamada      cmd_systbl = $(CONFIG_SHELL) $(systbl) --abis common,$* $< $@
4796a8fae0SRussell King
4896a8fae0SRussell Kingquiet_cmd_sysnr  = SYSNR   $@
49b34b9820SMasahiro Yamada      cmd_sysnr  = $(CONFIG_SHELL) $(sysnr) $< $@
5096a8fae0SRussell King
51*ad05f676SMasahiro Yamada$(uapi)/unistd-%.h: $(syscall) $(syshdr) FORCE
5296a8fae0SRussell King	$(call if_changed,syshdr)
5396a8fae0SRussell King
5496a8fae0SRussell King$(kapi)/unistd-nr.h: $(syscall) $(sysnr) FORCE
5596a8fae0SRussell King	$(call if_changed,sysnr)
5696a8fae0SRussell King
57*ad05f676SMasahiro Yamada$(gen)/calls-%.S: $(syscall) $(systbl) FORCE
5896a8fae0SRussell King	$(call if_changed,systbl)
59