xref: /openbmc/linux/arch/arm/tools/Makefile (revision 6b5fc336)
1#
2# linux/arch/arm/tools/Makefile
3#
4# Copyright (C) 2001 Russell King
5#
6
7gen := arch/$(ARCH)/include/generated
8kapi := $(gen)/asm
9uapi := $(gen)/uapi/asm
10syshdr := $(srctree)/$(src)/syscallhdr.sh
11sysnr := $(srctree)/$(src)/syscallnr.sh
12systbl := $(srctree)/$(src)/syscalltbl.sh
13syscall := $(srctree)/$(src)/syscall.tbl
14
15gen-y := $(gen)/calls-oabi.S
16gen-y += $(gen)/calls-eabi.S
17kapi-hdrs-y := $(kapi)/unistd-nr.h
18kapi-hdrs-y += $(kapi)/mach-types.h
19uapi-hdrs-y := $(uapi)/unistd-common.h
20uapi-hdrs-y += $(uapi)/unistd-oabi.h
21uapi-hdrs-y += $(uapi)/unistd-eabi.h
22
23targets += $(addprefix ../../../,$(gen-y) $(kapi-hdrs-y) $(uapi-hdrs-y))
24
25PHONY += kapi uapi
26
27kapi:	$(kapi-hdrs-y) $(gen-y)
28
29uapi:	$(uapi-hdrs-y)
30
31# Create output directory if not already present
32_dummy := $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') \
33          $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)')
34
35quiet_cmd_gen_mach = GEN     $@
36      cmd_gen_mach = mkdir -p $(dir $@) && \
37		     $(AWK) -f $(filter-out $(PHONY),$^) > $@ || \
38		     { rm -f $@; /bin/false; }
39
40$(kapi)/mach-types.h: $(src)/gen-mach-types $(src)/mach-types FORCE
41	$(call if_changed,gen_mach)
42
43quiet_cmd_syshdr = SYSHDR  $@
44      cmd_syshdr = $(CONFIG_SHELL) '$(syshdr)' '$<' '$@' \
45		   '$(syshdr_abi_$(basetarget))' \
46		   '$(syshdr_pfx_$(basetarget))' \
47		   '__NR_SYSCALL_BASE'
48
49quiet_cmd_systbl = SYSTBL  $@
50      cmd_systbl = $(CONFIG_SHELL) '$(systbl)' '$<' '$@' \
51		   '$(systbl_abi_$(basetarget))'
52
53quiet_cmd_sysnr  = SYSNR   $@
54      cmd_sysnr  = $(CONFIG_SHELL) '$(sysnr)' '$<' '$@' \
55		   '$(syshdr_abi_$(basetarget))'
56
57syshdr_abi_unistd-common := common
58$(uapi)/unistd-common.h: $(syscall) $(syshdr) FORCE
59	$(call if_changed,syshdr)
60
61syshdr_abi_unistd-oabi := oabi
62$(uapi)/unistd-oabi.h: $(syscall) $(syshdr) FORCE
63	$(call if_changed,syshdr)
64
65syshdr_abi_unistd-eabi := eabi
66$(uapi)/unistd-eabi.h: $(syscall) $(syshdr) FORCE
67	$(call if_changed,syshdr)
68
69sysnr_abi_unistd-nr := common,oabi,eabi,compat
70$(kapi)/unistd-nr.h: $(syscall) $(sysnr) FORCE
71	$(call if_changed,sysnr)
72
73systbl_abi_calls-oabi := common,oabi
74$(gen)/calls-oabi.S: $(syscall) $(systbl) FORCE
75	$(call if_changed,systbl)
76
77systbl_abi_calls-eabi := common,eabi
78$(gen)/calls-eabi.S: $(syscall) $(systbl) FORCE
79	$(call if_changed,systbl)
80