~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/scripts/Makefile.asm-headers

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /scripts/Makefile.asm-headers (Architecture i386) and /scripts/Makefile.asm-headers (Architecture sparc)


  1 # SPDX-License-Identifier: GPL-2.0                  1 # SPDX-License-Identifier: GPL-2.0
  2 # include/asm-generic contains a lot of files       2 # include/asm-generic contains a lot of files that are used
  3 # verbatim by several architectures.                3 # verbatim by several architectures.
  4 #                                                   4 #
  5 # This Makefile generates arch/$(SRCARCH)/incl      5 # This Makefile generates arch/$(SRCARCH)/include/generated/(uapi/)/asm
  6 # headers from multiple sources:                    6 # headers from multiple sources:
  7 #  - a small wrapper to include the correspond      7 #  - a small wrapper to include the corresponding asm-generic/*.h
  8 #    is generated for each file listed as gene      8 #    is generated for each file listed as generic-y
  9 #  - uapi/asm/unistd_*.h files listed as sysca      9 #  - uapi/asm/unistd_*.h files listed as syscalls-y are generated from
 10 #    syscall.tbl with the __NR_* macros            10 #    syscall.tbl with the __NR_* macros
 11 #  - Corresponding asm/syscall_table_*.h are g     11 #  - Corresponding asm/syscall_table_*.h are generated from the same input
 12                                                    12 
 13 PHONY := all                                       13 PHONY := all
 14 all:                                               14 all:
 15                                                    15 
 16 src := $(srctree)/$(subst /generated,,$(obj))      16 src := $(srctree)/$(subst /generated,,$(obj))
 17                                                    17 
 18 syscall_abis_32  += common,32                      18 syscall_abis_32  += common,32
 19 syscall_abis_64  += common,64                      19 syscall_abis_64  += common,64
 20 syscalltbl := $(srctree)/scripts/syscall.tbl       20 syscalltbl := $(srctree)/scripts/syscall.tbl
 21 syshdr-args := --emit-nr                           21 syshdr-args := --emit-nr
 22                                                    22 
 23 # let architectures override $(syscall_abis_%)     23 # let architectures override $(syscall_abis_%) and $(syscalltbl)
 24 -include $(srctree)/arch/$(SRCARCH)/kernel/Mak     24 -include $(srctree)/arch/$(SRCARCH)/kernel/Makefile.syscalls
 25 include $(srctree)/scripts/Kbuild.include          25 include $(srctree)/scripts/Kbuild.include
 26 -include $(kbuild-file)                            26 -include $(kbuild-file)
 27                                                    27 
 28 syshdr := $(srctree)/scripts/syscallhdr.sh         28 syshdr := $(srctree)/scripts/syscallhdr.sh
 29 systbl := $(srctree)/scripts/syscalltbl.sh         29 systbl := $(srctree)/scripts/syscalltbl.sh
 30                                                    30 
 31 # $(generic)/Kbuild lists mandatory-y. Exclude     31 # $(generic)/Kbuild lists mandatory-y. Exclude um since it is a special case.
 32 ifneq ($(SRCARCH),um)                              32 ifneq ($(SRCARCH),um)
 33 include $(srctree)/$(generic)/Kbuild               33 include $(srctree)/$(generic)/Kbuild
 34 endif                                              34 endif
 35                                                    35 
 36 redundant := $(filter $(mandatory-y) $(generat     36 redundant := $(filter $(mandatory-y) $(generated-y), $(generic-y))
 37 redundant += $(foreach f, $(generic-y), $(if $     37 redundant += $(foreach f, $(generic-y), $(if $(wildcard $(src)/$(f)),$(f)))
 38 redundant := $(sort $(redundant))                  38 redundant := $(sort $(redundant))
 39 $(if $(redundant),\                                39 $(if $(redundant),\
 40         $(warning redundant generic-y found in     40         $(warning redundant generic-y found in $(src)/Kbuild: $(redundant)))
 41                                                    41 
 42 # If arch does not implement mandatory headers     42 # If arch does not implement mandatory headers, fallback to asm-generic ones.
 43 mandatory-y := $(filter-out $(generated-y), $(     43 mandatory-y := $(filter-out $(generated-y), $(mandatory-y))
 44 generic-y   += $(foreach f, $(mandatory-y), $(     44 generic-y   += $(foreach f, $(mandatory-y), $(if $(wildcard $(src)/$(f)),,$(f)))
 45                                                    45 
 46 generic-y   := $(addprefix $(obj)/, $(generic-     46 generic-y   := $(addprefix $(obj)/, $(generic-y))
 47 syscall-y   := $(addprefix $(obj)/, $(syscall-     47 syscall-y   := $(addprefix $(obj)/, $(syscall-y))
 48 generated-y := $(addprefix $(obj)/, $(generate     48 generated-y := $(addprefix $(obj)/, $(generated-y))
 49                                                    49 
 50 # Remove stale wrappers when the corresponding     50 # Remove stale wrappers when the corresponding files are removed from generic-y
 51 old-headers := $(wildcard $(obj)/*.h)              51 old-headers := $(wildcard $(obj)/*.h)
 52 unwanted    := $(filter-out $(generic-y) $(gen     52 unwanted    := $(filter-out $(generic-y) $(generated-y) $(syscall-y),$(old-headers))
 53                                                    53 
 54 quiet_cmd_wrap = WRAP    $@                        54 quiet_cmd_wrap = WRAP    $@
 55       cmd_wrap = echo "\#include <asm-generic/     55       cmd_wrap = echo "\#include <asm-generic/$*.h>" > $@
 56                                                    56 
 57 quiet_cmd_remove = REMOVE  $(unwanted)             57 quiet_cmd_remove = REMOVE  $(unwanted)
 58       cmd_remove = rm -f $(unwanted)               58       cmd_remove = rm -f $(unwanted)
 59                                                    59 
 60 quiet_cmd_syshdr = SYSHDR  $@                      60 quiet_cmd_syshdr = SYSHDR  $@
 61       cmd_syshdr = $(CONFIG_SHELL) $(syshdr) \     61       cmd_syshdr = $(CONFIG_SHELL) $(syshdr) \
 62                    $(if $(syshdr-args-$*),$(sy     62                    $(if $(syshdr-args-$*),$(syshdr-args-$*),$(syshdr-args)) \
 63                    $(if $(syscall_compat),--pr     63                    $(if $(syscall_compat),--prefix "compat$*_") \
 64                    --abis $(subst $(space),$(c     64                    --abis $(subst $(space),$(comma),$(strip $(syscall_abis_$*))) \
 65                    $< $@                           65                    $< $@
 66                                                    66 
 67 quiet_cmd_systbl = SYSTBL  $@                      67 quiet_cmd_systbl = SYSTBL  $@
 68       cmd_systbl = $(CONFIG_SHELL) $(systbl) \     68       cmd_systbl = $(CONFIG_SHELL) $(systbl) \
 69                    $(if $(systbl-args-$*),$(sy     69                    $(if $(systbl-args-$*),$(systbl-args-$*),$(systbl-args)) \
 70                    --abis $(subst $(space),$(c     70                    --abis $(subst $(space),$(comma),$(strip $(syscall_abis_$*))) \
 71                    $< $@                           71                    $< $@
 72                                                    72 
 73 all: $(generic-y) $(syscall-y)                     73 all: $(generic-y) $(syscall-y)
 74         $(if $(unwanted),$(call cmd,remove))       74         $(if $(unwanted),$(call cmd,remove))
 75         @:                                         75         @:
 76                                                    76 
 77 $(obj)/%.h: $(srctree)/$(generic)/%.h              77 $(obj)/%.h: $(srctree)/$(generic)/%.h
 78         $(call cmd,wrap)                           78         $(call cmd,wrap)
 79                                                    79 
 80 $(obj)/unistd_%.h: $(syscalltbl) $(syshdr) FOR     80 $(obj)/unistd_%.h: $(syscalltbl) $(syshdr) FORCE
 81         $(call if_changed,syshdr)                  81         $(call if_changed,syshdr)
 82                                                    82 
 83 $(obj)/unistd_compat_%.h: syscall_compat:=1        83 $(obj)/unistd_compat_%.h: syscall_compat:=1
 84 $(obj)/unistd_compat_%.h: $(syscalltbl) $(sysh     84 $(obj)/unistd_compat_%.h: $(syscalltbl) $(syshdr) FORCE
 85         $(call if_changed,syshdr)                  85         $(call if_changed,syshdr)
 86                                                    86 
 87 $(obj)/syscall_table_%.h: $(syscalltbl) $(syst     87 $(obj)/syscall_table_%.h: $(syscalltbl) $(systbl) FORCE
 88         $(call if_changed,systbl)                  88         $(call if_changed,systbl)
 89                                                    89 
 90 targets := $(syscall-y)                            90 targets := $(syscall-y)
 91                                                    91 
 92 # Create output directory. Skip it if at least     92 # Create output directory. Skip it if at least one old header exists
 93 # since we know the output directory already e     93 # since we know the output directory already exists.
 94 ifeq ($(old-headers),)                             94 ifeq ($(old-headers),)
 95 $(shell mkdir -p $(obj))                           95 $(shell mkdir -p $(obj))
 96 endif                                              96 endif
 97                                                    97 
 98 PHONY += FORCE                                     98 PHONY += FORCE
 99                                                    99 
100 FORCE:                                            100 FORCE:
101                                                   101 
102 existing-targets := $(wildcard $(sort $(target    102 existing-targets := $(wildcard $(sort $(targets)))
103                                                   103 
104 -include $(foreach f,$(existing-targets),$(dir    104 -include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd)
105                                                   105 
106 .PHONY: $(PHONY)                                  106 .PHONY: $(PHONY)
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php