[U-Boot] [PATCH 0/3] Fix {c,e}tags/cscope build targets

Some "recent" changes (move to Kbuild) to the Makefile broke the tags and cscope build targets. This patch set brings those back again to working state.
Igor Grinberg (3): Makefile: fix the {c,e}tags/cscope build targets Makefile: fix ctags/etags clean targets Makefile: fix tags target documentation
Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)

Commit 9e41403 (kbuild: change out-of-tree build) changed the U-Boot build working directory to the output tree for the out-of-tree builds. This broke the {c,e}tags/cscope build targets as TAG_SUBDIRS variable collected directories based on assumption that the build working directory is the U-Boot source tree directory.
Fix the {c,e}tags/cscope build targets by adding the $(srctree) prefix. Also, remove the $(obj) prefix from the etags build target to finish the $(obj) prefix removal started by the same commit.
Cc: Masahiro Yamada yamada.m@jp.panasonic.com Signed-off-by: Igor Grinberg grinberg@compulab.co.il --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile index 5277781..26b29d1 100644 --- a/Makefile +++ b/Makefile @@ -1137,7 +1137,7 @@ spl/sunxi-spl.bin: spl/u-boot-spl tpl/u-boot-tpl.bin: tools prepare $(Q)$(MAKE) obj=tpl -f $(srctree)/scripts/Makefile.spl all CONFIG_TPL_BUILD=y
-TAG_SUBDIRS := $(u-boot-dirs) include +TAG_SUBDIRS := $(patsubst %,$(srctree)/%,$(u-boot-dirs) include)
FIND := find FINDFLAGS := -L @@ -1147,7 +1147,7 @@ tags ctags: -name '*.[chS]' -print`
etags: - etags -a -o $(obj)etags `$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) \ + etags -a -o etags `$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) \ -name '*.[chS]' -print` cscope: $(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) -name '*.[chS]' -print > \

On Tue, Jul 15, 2014 at 03:52:00PM +0300, Igor Grinberg wrote:
Commit 9e41403 (kbuild: change out-of-tree build) changed the U-Boot build working directory to the output tree for the out-of-tree builds. This broke the {c,e}tags/cscope build targets as TAG_SUBDIRS variable collected directories based on assumption that the build working directory is the U-Boot source tree directory.
Fix the {c,e}tags/cscope build targets by adding the $(srctree) prefix. Also, remove the $(obj) prefix from the etags build target to finish the $(obj) prefix removal started by the same commit.
Cc: Masahiro Yamada yamada.m@jp.panasonic.com Signed-off-by: Igor Grinberg grinberg@compulab.co.il
Applied to u-boot/master, thanks!

Commit efcf861 (kbuild: use scripts/Makefile.clean) refactored the cleaning targets and accidentially replaced the actually generated "ctags" and "etags" files in the file list by "tags" and "TAGS". "tags" and "TAGS" are not part of the Makefile build targets and therefore should not be a part of the list for clean targets.
Substitute the actually generated files instead, to fix the clean targets behavior.
Cc: Masahiro Yamada yamada.m@jp.panasonic.com Signed-off-by: Igor Grinberg grinberg@compulab.co.il --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile index 26b29d1..bfe801c 100644 --- a/Makefile +++ b/Makefile @@ -1222,7 +1222,7 @@ CLOBBER_FILES += u-boot* MLO* SPL System.map MRPROPER_DIRS += include/config include/generated \ .tmp_objdiff MRPROPER_FILES += .config .config.old \ - tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \ + ctags etags cscope* GPATH GTAGS GRTAGS GSYMS \ include/config.h include/config.mk
# clean - Delete most, but leave enough to build external modules

On Tue, Jul 15, 2014 at 03:52:01PM +0300, Igor Grinberg wrote:
Commit efcf861 (kbuild: use scripts/Makefile.clean) refactored the cleaning targets and accidentially replaced the actually generated "ctags" and "etags" files in the file list by "tags" and "TAGS". "tags" and "TAGS" are not part of the Makefile build targets and therefore should not be a part of the list for clean targets.
Substitute the actually generated files instead, to fix the clean targets behavior.
Cc: Masahiro Yamada yamada.m@jp.panasonic.com Signed-off-by: Igor Grinberg grinberg@compulab.co.il
Applied to u-boot/master, thanks!

Replace the TAGS target name by the actual ctags target name. Also, add etags target documentation.
Cc: Masahiro Yamada yamada.m@jp.panasonic.com Signed-off-by: Igor Grinberg grinberg@compulab.co.il --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile index bfe801c..ca212b5 100644 --- a/Makefile +++ b/Makefile @@ -1311,7 +1311,8 @@ help: @echo ' dir/file.[oisS] - Build specified target only' @echo ' dir/file.lst - Build specified mixed source/assembly target only' @echo ' (requires a recent binutils and recent build (System.map))' - @echo ' tags/TAGS - Generate tags file for editors' + @echo ' tags/ctags - Generate ctags file for editors' + @echo ' etags - Generate etags file for editors' @echo ' cscope - Generate cscope index' @echo ' ubootrelease - Output the release version string' @echo ' ubootversion - Output the version stored in Makefile'

On Tue, Jul 15, 2014 at 03:52:02PM +0300, Igor Grinberg wrote:
Replace the TAGS target name by the actual ctags target name. Also, add etags target documentation.
Cc: Masahiro Yamada yamada.m@jp.panasonic.com Signed-off-by: Igor Grinberg grinberg@compulab.co.il
Applied to u-boot/master, thanks!
participants (2)
-
Igor Grinberg
-
Tom Rini