[CRIU] [PATCH] buld: generate tag with etags only if ctags failed

Dmitry Safonov dsafonov at virtuozzo.com
Thu Feb 25 02:13:57 PST 2016


On 02/25/2016 01:09 PM, Dmitry Safonov wrote:
> As I didn't set swap area on my computer - I do not use emacs.
> So, lets generate tags with etags only if ctags did not do that.
>
> Fixes the following error:
> [criu]$ make tags
>    GEN      tags
> xargs: etags: No such file or directory
> Makefile:176: recipe for target 'tags' failed
> make: [tags] Error 127 (ignored)
Or drop it: I guess, someone with etags may have ctags,
and may not have.
In the first case he will get only ctags-generated tags,
in the second case he will get error 'ctags: no such file'.
So, maybe we need to check for {c,e}tags and use them
only if check successed.
>
> Signed-off-by: Dmitry Safonov <dsafonov at virtuozzo.com>
> ---
>   Makefile | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index 99d40ee..704ff7d 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -175,7 +175,7 @@ dist tar: criu-$(tar-name).tar.bz2
>   tags:
>   	$(call msg-gen, $@)
>   	$(Q) $(RM) tags
> -	$(Q) $(FIND) . -name '*.[hcS]' ! -path './.*' ! -path './test/*' -print | xargs $(CTAGS) -a
> +	$(Q) $(FIND) . -name '*.[hcS]' ! -path './.*' ! -path './test/*' -print | xargs $(CTAGS) -a || \
>   	$(Q) $(FIND) . -name '*.[hcS]' ! -path './.*' ! -path './test/*' -print | xargs $(ETAGS) -a
>   PHONY += tags
>   


-- 
Regards,
Dmitry Safonov



More information about the CRIU mailing list