[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2 10/10] xen: add cloc target
On Tue, 22 May 2018, Jan Beulich wrote: > >>> 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)? This is a target for people that know what they are doing, so it makes sense. I'll remove build as dependency. > > + $(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. The issue is that tmpfile will be different the second time around (mktemp returning a new name) so it is not quite possible to remove the old tmpfile. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |