summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2020-05-11 10:40:15 +0900
committerSascha Hauer <s.hauer@pengutronix.de>2020-05-12 07:45:04 +0200
commit992116ba3aeda6635c103ea2d04682bdd081fb4b (patch)
treeedc1da4637a49a0fbaa4ad07a0b4c91594437f1d /scripts
parent6619b70e2935afc4b41dfe4a0c4ca7cfa76cfbdb (diff)
downloadbarebox-992116ba3aeda6635c103ea2d04682bdd081fb4b.tar.gz
barebox-992116ba3aeda6635c103ea2d04682bdd081fb4b.tar.xz
kbuild: resync top Makefile, mkmakefile, tags.sh with Linux 5.7-rc4
The prologue of the build system is not specific to Linux or Barebox. Paritially resync with Linux 5.7-rc4 - In Linux, $(objtree) is always '.', and $(srctree) might be relative. I am keeping both absolute for now to avoid unexpected breakage. - I did not resync single target for now. We need to touch Makefile.build a lot if we want to resync it. - 'export CDPATH=' is Barebox-only code, which was added by commit 6cc8d0544658 ("Makefile: disable CDPATH"). Keep it. - KBUILD_SRC no longer exists in the upstream Linux. I replaced it with building_out_of_srctree. - scripts/mkmakefile does not contain anything specific to Linux or Barebox. Resync it with Linux 5.7-rc4 - scripts/tags was imported from Linux 3.6 with some cherry-picks on top of that. Resync it with Linux 5.7-rc4 Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.build2
-rw-r--r--scripts/Makefile.host2
-rw-r--r--scripts/Makefile.lib2
-rwxr-xr-xscripts/mkmakefile43
-rwxr-xr-xscripts/tags.sh282
5 files changed, 192 insertions, 139 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 32b8165434..5b36cfd152 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -49,7 +49,7 @@ ifneq ($(hostprogs)$(hostprogs-y)$(hostprogs-m),)
include scripts/Makefile.host
endif
-ifneq ($(KBUILD_SRC),)
+ifdef building_out_of_srctree
# Create output directory if not already present
_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
diff --git a/scripts/Makefile.host b/scripts/Makefile.host
index 9740f3106b..55b565ce3f 100644
--- a/scripts/Makefile.host
+++ b/scripts/Makefile.host
@@ -86,7 +86,7 @@ _hostc_flags = $(KBUILD_HOSTCFLAGS) $(HOST_EXTRACFLAGS) \
_hostcxx_flags = $(KBUILD_HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) \
$(HOSTCXXFLAGS_$(target-stem).o)
-ifeq ($(KBUILD_SRC),)
+ifndef building_out_of_srctree
__hostc_flags = $(_hostc_flags)
__hostcxx_flags = $(_hostcxx_flags)
else
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 985fc13035..39cc24b196 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -147,7 +147,7 @@ endif
# If building barebox in a separate objtree expand all occurrences
# of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/').
-ifeq ($(KBUILD_SRC),)
+ifndef building_out_of_srctree
__c_flags = $(_c_flags)
__a_flags = $(_a_flags)
__cpp_flags = $(_cpp_flags)
diff --git a/scripts/mkmakefile b/scripts/mkmakefile
index 84af27bf0f..1cb1747514 100755
--- a/scripts/mkmakefile
+++ b/scripts/mkmakefile
@@ -1,52 +1,17 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# Generates a small Makefile used in the root of the output
# directory, to allow make to be started from there.
# The Makefile also allow for more convinient build of external modules
# Usage
# $1 - Kernel src directory
-# $2 - Output directory
-# $3 - version
-# $4 - patchlevel
-
-test ! -r $2/Makefile -o -O $2/Makefile || exit 0
-# Only overwrite automatically generated Makefiles
-# (so we do not overwrite kernel Makefile)
-if test -e $2/Makefile && ! grep -q Automatically $2/Makefile
-then
- exit 0
-fi
if [ "${quiet}" != "silent_" ]; then
- echo " GEN $2/Makefile"
+ echo " GEN Makefile"
fi
-cat << EOF > $2/Makefile
+cat << EOF > Makefile
# Automatically generated by $0: don't edit
-
-VERSION = $3
-PATCHLEVEL = $4
-
-lastword = \$(word \$(words \$(1)),\$(1))
-makedir := \$(dir \$(call lastword,\$(MAKEFILE_LIST)))
-
-ifeq ("\$(origin V)", "command line")
-VERBOSE := \$(V)
-endif
-ifneq (\$(VERBOSE),1)
-Q := @
-endif
-
-MAKEARGS := -C $1
-MAKEARGS += O=\$(if \$(patsubst /%,,\$(makedir)),\$(CURDIR)/)\$(patsubst %/,%,\$(makedir))
-
-MAKEFLAGS += --no-print-directory
-
-.PHONY: __sub-make \$(MAKECMDGOALS)
-
-__sub-make:
- \$(Q)\$(MAKE) \$(MAKEARGS) \$(MAKECMDGOALS)
-
-\$(filter-out __sub-make, \$(MAKECMDGOALS)): __sub-make
- @:
+include $1/Makefile
EOF
diff --git a/scripts/tags.sh b/scripts/tags.sh
index 8ae44642a2..4e18ae5282 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -1,70 +1,64 @@
-#!/bin/sh
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0-only
# Generate tags or cscope files
# Usage tags.sh <mode>
#
# mode may be any of: tags, TAGS, cscope
#
# Uses the following environment variables:
-# ARCH, SUBARCH, SRCARCH, srctree, src, obj
+# SUBARCH, SRCARCH, srctree
if [ "$KBUILD_VERBOSE" = "1" ]; then
set -x
fi
-# This is a duplicate of RCS_FIND_IGNORE without escaped '()'
-ignore="( -name SCCS -o -name BitKeeper -o -name .svn -o \
- -name CVS -o -name .pc -o -name .hg -o \
- -name .git ) \
- -prune -o"
+# RCS_FIND_IGNORE has escaped ()s -- remove them.
+ignore="$(echo "$RCS_FIND_IGNORE" | sed 's|\\||g' )"
+# tags and cscope files should also ignore MODVERSION *.mod.c files
+ignore="$ignore ( -name *.mod.c ) -prune -o"
-# Do not use full path if we do not use O=.. builds
-# Use make O=. {tags|cscope}
+# Use make KBUILD_ABS_SRCTREE=1 {tags|cscope}
# to force full paths for a non-O= build
-if [ "${KBUILD_SRC}" = "" ]; then
+if [ "${srctree}" = "." -o -z "${srctree}" ]; then
tree=
else
tree=${srctree}/
fi
-# Find all available archs
-find_all_archs()
-{
- ALLSOURCE_ARCHS=""
- for arch in `ls ${tree}arch`; do
- ALLSOURCE_ARCHS="${ALLSOURCE_ARCHS} "${arch##\/}
- done
-}
+# ignore userspace tools
+ignore="$ignore ( -path ${tree}tools ) -prune -o"
# Detect if ALLSOURCE_ARCHS is set. If not, we assume SRCARCH
if [ "${ALLSOURCE_ARCHS}" = "" ]; then
ALLSOURCE_ARCHS=${SRCARCH}
elif [ "${ALLSOURCE_ARCHS}" = "all" ]; then
- find_all_archs
+ ALLSOURCE_ARCHS=$(find ${tree}arch/ -mindepth 1 -maxdepth 1 -type d -printf '%f ')
fi
-# find sources in arch/$ARCH
+# find sources in arch/$1
find_arch_sources()
{
for i in $archincludedir; do
prune="$prune -wholename $i -prune -o"
done
- find ${tree}arch/$1 $ignore $prune -name "$2" -print;
+ find ${tree}arch/$1 $ignore $prune -name "$2" -not -type l -print;
}
# find sources in arch/$1/include
find_arch_include_sources()
{
- include=$(find ${tree}arch/$1/ -name include -type d);
+ include=$(find ${tree}arch/$1/ -name include -type d -print);
if [ -n "$include" ]; then
archincludedir="$archincludedir $include"
- find $include $ignore -name "$2" -print;
+ find $include $ignore -name "$2" -not -type l -print;
fi
}
# find sources in include/
find_include_sources()
{
- find ${tree}include $ignore -name config -prune -o -name "$1" -print;
+ find ${tree}include $ignore -name config -prune -o -name "$1" \
+ -not -type l -print;
}
# find sources in rest of tree
@@ -72,8 +66,8 @@ find_include_sources()
find_other_sources()
{
find ${tree}* $ignore \
- \( -name include -o -name arch -o -name '.tmp_*' \) -prune -o \
- -name "$1" -print;
+ \( -path ${tree}include -o -path ${tree}arch -o -name '.tmp_*' \) -prune -o \
+ -name "$1" -not -type l -print;
}
find_sources()
@@ -95,8 +89,37 @@ all_sources()
find_other_sources '*.[chS]'
}
+all_compiled_sources()
+{
+ for i in $(all_sources); do
+ case "$i" in
+ *.[cS])
+ j=${i/\.[cS]/\.o}
+ j="${j#$tree}"
+ if [ -e $j ]; then
+ echo $i
+ fi
+ ;;
+ *)
+ echo $i
+ ;;
+ esac
+ done
+}
+
+all_target_sources()
+{
+ if [ -n "$COMPILED_SOURCE" ]; then
+ all_compiled_sources
+ else
+ all_sources
+ fi
+}
+
all_kconfigs()
{
+ find ${tree}arch/ -maxdepth 1 $ignore \
+ -name "Kconfig*" -not -type l -print;
for arch in $ALLSOURCE_ARCHS; do
find_sources $arch 'Kconfig*'
done
@@ -105,93 +128,159 @@ all_kconfigs()
docscope()
{
- (echo \-k; echo \-q; all_sources) > cscope.files
+ (echo \-k; echo \-q; all_target_sources) > cscope.files
cscope -b -f cscope.out
}
dogtags()
{
- all_sources | gtags -i -f -
+ all_target_sources | gtags -i -f -
+}
+
+# Basic regular expressions with an optional /kind-spec/ for ctags and
+# the following limitations:
+# - No regex modifiers
+# - Use \{0,1\} instead of \?, because etags expects an unescaped ?
+# - \s is not working with etags, use a space or [ \t]
+# - \w works, but does not match underscores in etags
+# - etags regular expressions have to match at the start of a line;
+# a ^[^#] is prepended by setup_regex unless an anchor is already present
+regex_asm=(
+ '/^\(ENTRY\|_GLOBAL\)(\([[:alnum:]_\\]*\)).*/\2/'
+)
+regex_c=(
+ '/^SYSCALL_DEFINE[0-9](\([[:alnum:]_]*\).*/sys_\1/'
+ '/^BPF_CALL_[0-9](\([[:alnum:]_]*\).*/\1/'
+ '/^COMPAT_SYSCALL_DEFINE[0-9](\([[:alnum:]_]*\).*/compat_sys_\1/'
+ '/^TRACE_EVENT(\([[:alnum:]_]*\).*/trace_\1/'
+ '/^TRACE_EVENT(\([[:alnum:]_]*\).*/trace_\1_rcuidle/'
+ '/^DEFINE_EVENT([^,)]*, *\([[:alnum:]_]*\).*/trace_\1/'
+ '/^DEFINE_EVENT([^,)]*, *\([[:alnum:]_]*\).*/trace_\1_rcuidle/'
+ '/^DEFINE_INSN_CACHE_OPS(\([[:alnum:]_]*\).*/get_\1_slot/'
+ '/^DEFINE_INSN_CACHE_OPS(\([[:alnum:]_]*\).*/free_\1_slot/'
+ '/^PAGEFLAG(\([[:alnum:]_]*\).*/Page\1/'
+ '/^PAGEFLAG(\([[:alnum:]_]*\).*/SetPage\1/'
+ '/^PAGEFLAG(\([[:alnum:]_]*\).*/ClearPage\1/'
+ '/^TESTSETFLAG(\([[:alnum:]_]*\).*/TestSetPage\1/'
+ '/^TESTPAGEFLAG(\([[:alnum:]_]*\).*/Page\1/'
+ '/^SETPAGEFLAG(\([[:alnum:]_]*\).*/SetPage\1/'
+ '/\<__SETPAGEFLAG(\([[:alnum:]_]*\).*/__SetPage\1/'
+ '/\<TESTCLEARFLAG(\([[:alnum:]_]*\).*/TestClearPage\1/'
+ '/\<__TESTCLEARFLAG(\([[:alnum:]_]*\).*/TestClearPage\1/'
+ '/\<CLEARPAGEFLAG(\([[:alnum:]_]*\).*/ClearPage\1/'
+ '/\<__CLEARPAGEFLAG(\([[:alnum:]_]*\).*/__ClearPage\1/'
+ '/^__PAGEFLAG(\([[:alnum:]_]*\).*/__SetPage\1/'
+ '/^__PAGEFLAG(\([[:alnum:]_]*\).*/__ClearPage\1/'
+ '/^PAGEFLAG_FALSE(\([[:alnum:]_]*\).*/Page\1/'
+ '/\<TESTSCFLAG(\([[:alnum:]_]*\).*/TestSetPage\1/'
+ '/\<TESTSCFLAG(\([[:alnum:]_]*\).*/TestClearPage\1/'
+ '/\<SETPAGEFLAG_NOOP(\([[:alnum:]_]*\).*/SetPage\1/'
+ '/\<CLEARPAGEFLAG_NOOP(\([[:alnum:]_]*\).*/ClearPage\1/'
+ '/\<__CLEARPAGEFLAG_NOOP(\([[:alnum:]_]*\).*/__ClearPage\1/'
+ '/\<TESTCLEARFLAG_FALSE(\([[:alnum:]_]*\).*/TestClearPage\1/'
+ '/^PAGE_TYPE_OPS(\([[:alnum:]_]*\).*/Page\1/'
+ '/^PAGE_TYPE_OPS(\([[:alnum:]_]*\).*/__SetPage\1/'
+ '/^PAGE_TYPE_OPS(\([[:alnum:]_]*\).*/__ClearPage\1/'
+ '/^TASK_PFA_TEST([^,]*, *\([[:alnum:]_]*\))/task_\1/'
+ '/^TASK_PFA_SET([^,]*, *\([[:alnum:]_]*\))/task_set_\1/'
+ '/^TASK_PFA_CLEAR([^,]*, *\([[:alnum:]_]*\))/task_clear_\1/'
+ '/^DEF_MMIO_\(IN\|OUT\)_[XD](\([[:alnum:]_]*\),[^)]*)/\2/'
+ '/^DEBUGGER_BOILERPLATE(\([[:alnum:]_]*\))/\1/'
+ '/^DEF_PCI_AC_\(\|NO\)RET(\([[:alnum:]_]*\).*/\2/'
+ '/^PCI_OP_READ(\(\w*\).*[1-4])/pci_bus_read_config_\1/'
+ '/^PCI_OP_WRITE(\(\w*\).*[1-4])/pci_bus_write_config_\1/'
+ '/\<DEFINE_\(RT_MUTEX\|MUTEX\|SEMAPHORE\|SPINLOCK\)(\([[:alnum:]_]*\)/\2/v/'
+ '/\<DEFINE_\(RAW_SPINLOCK\|RWLOCK\|SEQLOCK\)(\([[:alnum:]_]*\)/\2/v/'
+ '/\<DECLARE_\(RWSEM\|COMPLETION\)(\([[:alnum:]_]\+\)/\2/v/'
+ '/\<DECLARE_BITMAP(\([[:alnum:]_]*\)/\1/v/'
+ '/\(^\|\s\)\(\|L\|H\)LIST_HEAD(\([[:alnum:]_]*\)/\3/v/'
+ '/\(^\|\s\)RADIX_TREE(\([[:alnum:]_]*\)/\2/v/'
+ '/\<DEFINE_PER_CPU([^,]*, *\([[:alnum:]_]*\)/\1/v/'
+ '/\<DEFINE_PER_CPU_SHARED_ALIGNED([^,]*, *\([[:alnum:]_]*\)/\1/v/'
+ '/\<DECLARE_WAIT_QUEUE_HEAD(\([[:alnum:]_]*\)/\1/v/'
+ '/\<DECLARE_\(TASKLET\|WORK\|DELAYED_WORK\)(\([[:alnum:]_]*\)/\2/v/'
+ '/\(^\s\)OFFSET(\([[:alnum:]_]*\)/\2/v/'
+ '/\(^\s\)DEFINE(\([[:alnum:]_]*\)/\2/v/'
+ '/\<\(DEFINE\|DECLARE\)_HASHTABLE(\([[:alnum:]_]*\)/\2/v/'
+ '/\<DEFINE_ID\(R\|A\)(\([[:alnum:]_]\+\)/\2/'
+ '/\<DEFINE_WD_CLASS(\([[:alnum:]_]\+\)/\1/'
+ '/\<ATOMIC_NOTIFIER_HEAD(\([[:alnum:]_]\+\)/\1/'
+ '/\<RAW_NOTIFIER_HEAD(\([[:alnum:]_]\+\)/\1/'
+ '/\<DECLARE_FAULT_ATTR(\([[:alnum:]_]\+\)/\1/'
+ '/\<BLOCKING_NOTIFIER_HEAD(\([[:alnum:]_]\+\)/\1/'
+ '/\<DEVICE_ATTR_\(RW\|RO\|WO\)(\([[:alnum:]_]\+\)/dev_attr_\2/'
+ '/\<DRIVER_ATTR_\(RW\|RO\|WO\)(\([[:alnum:]_]\+\)/driver_attr_\2/'
+ '/\<\(DEFINE\|DECLARE\)_STATIC_KEY_\(TRUE\|FALSE\)\(\|_RO\)(\([[:alnum:]_]\+\)/\4/'
+)
+regex_kconfig=(
+ '/^[[:blank:]]*\(menu\|\)config[[:blank:]]\+\([[:alnum:]_]\+\)/\2/'
+ '/^[[:blank:]]*\(menu\|\)config[[:blank:]]\+\([[:alnum:]_]\+\)/CONFIG_\2/'
+)
+setup_regex()
+{
+ local mode=$1 lang tmp=() r
+ shift
+
+ regex=()
+ for lang; do
+ case "$lang" in
+ asm) tmp=("${regex_asm[@]}") ;;
+ c) tmp=("${regex_c[@]}") ;;
+ kconfig) tmp=("${regex_kconfig[@]}") ;;
+ esac
+ for r in "${tmp[@]}"; do
+ if test "$mode" = "exuberant"; then
+ regex[${#regex[@]}]="--regex-$lang=${r}b"
+ else
+ # Remove ctags /kind-spec/
+ case "$r" in
+ /*/*/?/)
+ r=${r%?/}
+ esac
+ # Prepend ^[^#] unless already anchored
+ case "$r" in
+ /^*) ;;
+ *)
+ r="/^[^#]*${r#/}"
+ esac
+ regex[${#regex[@]}]="--regex=$r"
+ fi
+ done
+ done
}
exuberant()
{
- all_sources | xargs $1 -a \
- -I __initdata,__exitdata,__acquires,__releases \
- -I __read_mostly,____cacheline_aligned \
+ setup_regex exuberant asm c
+ all_target_sources | xargs $1 -a \
+ -I __initdata,__exitdata,__initconst,__ro_after_init \
+ -I __initdata_memblock \
+ -I __refdata,__attribute,__maybe_unused,__always_unused \
+ -I __acquires,__releases,__deprecated,__always_inline \
+ -I __read_mostly,__aligned,____cacheline_aligned \
-I ____cacheline_aligned_in_smp \
+ -I __cacheline_aligned,__cacheline_aligned_in_smp \
-I ____cacheline_internodealigned_in_smp \
- -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
+ -I __used,__packed,__packed2__,__must_check,__must_hold \
+ -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL,ACPI_EXPORT_SYMBOL \
-I DEFINE_TRACE,EXPORT_TRACEPOINT_SYMBOL,EXPORT_TRACEPOINT_SYMBOL_GPL \
- --extra=+f --c-kinds=+px \
- --regex-asm='/^(ENTRY|_GLOBAL)\(([^)]*)\).*/\2/' \
- --regex-c='/^SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/sys_\1/' \
- --regex-c++='/^TRACE_EVENT\(([^,)]*).*/trace_\1/' \
- --regex-c++='/^DEFINE_EVENT\([^,)]*, *([^,)]*).*/trace_\1/' \
- --regex-c++='/PAGEFLAG\(([^,)]*).*/Page\1/' \
- --regex-c++='/PAGEFLAG\(([^,)]*).*/SetPage\1/' \
- --regex-c++='/PAGEFLAG\(([^,)]*).*/ClearPage\1/' \
- --regex-c++='/TESTSETFLAG\(([^,)]*).*/TestSetPage\1/' \
- --regex-c++='/TESTPAGEFLAG\(([^,)]*).*/Page\1/' \
- --regex-c++='/SETPAGEFLAG\(([^,)]*).*/SetPage\1/' \
- --regex-c++='/__SETPAGEFLAG\(([^,)]*).*/__SetPage\1/' \
- --regex-c++='/TESTCLEARFLAG\(([^,)]*).*/TestClearPage\1/' \
- --regex-c++='/__TESTCLEARFLAG\(([^,)]*).*/TestClearPage\1/' \
- --regex-c++='/CLEARPAGEFLAG\(([^,)]*).*/ClearPage\1/' \
- --regex-c++='/__CLEARPAGEFLAG\(([^,)]*).*/__ClearPage\1/' \
- --regex-c++='/__PAGEFLAG\(([^,)]*).*/__SetPage\1/' \
- --regex-c++='/__PAGEFLAG\(([^,)]*).*/__ClearPage\1/' \
- --regex-c++='/PAGEFLAG_FALSE\(([^,)]*).*/Page\1/' \
- --regex-c++='/TESTSCFLAG\(([^,)]*).*/TestSetPage\1/' \
- --regex-c++='/TESTSCFLAG\(([^,)]*).*/TestClearPage\1/' \
- --regex-c++='/SETPAGEFLAG_NOOP\(([^,)]*).*/SetPage\1/' \
- --regex-c++='/CLEARPAGEFLAG_NOOP\(([^,)]*).*/ClearPage\1/' \
- --regex-c++='/__CLEARPAGEFLAG_NOOP\(([^,)]*).*/__ClearPage\1/' \
- --regex-c++='/TESTCLEARFLAG_FALSE\(([^,)]*).*/TestClearPage\1/' \
- --regex-c++='/_PE\(([^,)]*).*/PEVENT_ERRNO__\1/' \
- --regex-c='/PCI_OP_READ\(([a-z]*[a-z]).*[1-4]\)/pci_bus_read_config_\1/' \
- --regex-c='/PCI_OP_WRITE\(([a-z]*[a-z]).*[1-4]\)/pci_bus_write_config_\1/'
+ -I static,const \
+ --extra=+fq --c-kinds=+px --fields=+iaS --langmap=c:+.h \
+ "${regex[@]}"
+ setup_regex exuberant kconfig
all_kconfigs | xargs $1 -a \
- --langdef=kconfig --language-force=kconfig \
- --regex-kconfig='/^[[:blank:]]*(menu|)config[[:blank:]]+([[:alnum:]_]+)/\2/' \
- --regex-kconfig='/^[[:blank:]]*(menu|)config[[:blank:]]+([[:alnum:]_]+)/CONFIG_\2/'
+ --langdef=kconfig --language-force=kconfig "${regex[@]}"
+
}
emacs()
{
- all_sources | xargs $1 -a \
- --regex='/^(ENTRY|_GLOBAL)(\([^)]*\)).*/\2/' \
- --regex='/^SYSCALL_DEFINE[0-9]?(\([^,)]*\).*/sys_\1/' \
- --regex='/^TRACE_EVENT(\([^,)]*\).*/trace_\1/' \
- --regex='/^DEFINE_EVENT([^,)]*, *\([^,)]*\).*/trace_\1/' \
- --regex='/PAGEFLAG\(([^,)]*).*/Page\1/' \
- --regex='/PAGEFLAG\(([^,)]*).*/SetPage\1/' \
- --regex='/PAGEFLAG\(([^,)]*).*/ClearPage\1/' \
- --regex='/TESTSETFLAG\(([^,)]*).*/TestSetPage\1/' \
- --regex='/TESTPAGEFLAG\(([^,)]*).*/Page\1/' \
- --regex='/SETPAGEFLAG\(([^,)]*).*/SetPage\1/' \
- --regex='/__SETPAGEFLAG\(([^,)]*).*/__SetPage\1/' \
- --regex='/TESTCLEARFLAG\(([^,)]*).*/TestClearPage\1/' \
- --regex='/__TESTCLEARFLAG\(([^,)]*).*/TestClearPage\1/' \
- --regex='/CLEARPAGEFLAG\(([^,)]*).*/ClearPage\1/' \
- --regex='/__CLEARPAGEFLAG\(([^,)]*).*/__ClearPage\1/' \
- --regex='/__PAGEFLAG\(([^,)]*).*/__SetPage\1/' \
- --regex='/__PAGEFLAG\(([^,)]*).*/__ClearPage\1/' \
- --regex='/PAGEFLAG_FALSE\(([^,)]*).*/Page\1/' \
- --regex='/TESTSCFLAG\(([^,)]*).*/TestSetPage\1/' \
- --regex='/TESTSCFLAG\(([^,)]*).*/TestClearPage\1/' \
- --regex='/SETPAGEFLAG_NOOP\(([^,)]*).*/SetPage\1/' \
- --regex='/CLEARPAGEFLAG_NOOP\(([^,)]*).*/ClearPage\1/' \
- --regex='/__CLEARPAGEFLAG_NOOP\(([^,)]*).*/__ClearPage\1/' \
- --regex='/TESTCLEARFLAG_FALSE\(([^,)]*).*/TestClearPage\1/' \
- --regex='/_PE\(([^,)]*).*/PEVENT_ERRNO__\1/' \
- --regex='/PCI_OP_READ\(([a-z]*[a-z]).*[1-4]\)/pci_bus_read_config_\1/' \
- --regex='/PCI_OP_WRITE\(([a-z]*[a-z]).*[1-4]\)/pci_bus_write_config_\1/'
+ setup_regex emacs asm c
+ all_target_sources | xargs $1 -a "${regex[@]}"
- all_kconfigs | xargs $1 -a \
- --regex='/^[ \t]*\(\(menu\)*config\)[ \t]+\([a-zA-Z0-9_]+\)/\3/' \
- --regex='/^[ \t]*\(\(menu\)*config\)[ \t]+\([a-zA-Z0-9_]+\)/CONFIG_\3/'
+ setup_regex emacs kconfig
+ all_kconfigs | xargs $1 -a "${regex[@]}"
}
xtags()
@@ -201,11 +290,10 @@ xtags()
elif $1 --version 2>&1 | grep -iq emacs; then
emacs $1
else
- all_sources | xargs $1 -a
- fi
+ all_target_sources | xargs $1 -a
+ fi
}
-
# Support um (which uses SUBARCH)
if [ "${ARCH}" = "um" ]; then
if [ "$SUBARCH" = "i386" ]; then