[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 10/10] xen: add cloc target



>>> On 22.05.18 at 02:53, <sstabellini@xxxxxxxxxx> wrote:
> --- a/xen/Makefile
> +++ b/xen/Makefile
> @@ -267,3 +267,14 @@ $(KCONFIG_CONFIG):
>  include/config/auto.conf.cmd: ;
>  
>  -include $(BASEDIR)/include/config/auto.conf.cmd
> +
> +.PHONY: cloc
> +cloc: build

Not sure here - wouldn't it be reasonable to have no dependency here at
all, and just have the rule act on whatever is in the tree at present (from
whatever prior invocation of make)?

> +     $(eval tmpfile := $(shell mktemp))
> +     $(foreach f, $(shell find $(BASEDIR) -name *.o.d), \
> +             $(eval path := $(dir $(f))) \
> +             $(eval name := $(shell cat $(f) | head -1 | cut -d " " -f 2)) \
> +             $(shell if test -f $(path)/$(name) ; then echo $(path)/$(name) 
> >> $(tmpfile); fi;))
> +     cloc --list-file=$(tmpfile)
> +     rm $(tmpfile)

I think you also want to "rm -f $(tmpfile)" first thing in case a prior "make 
cloc"
was interrupted.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.