[CRIU] Re: [PATCH] make: Fix dependency generation

Cyrill Gorcunov gorcunov at openvz.org
Thu Apr 5 10:19:12 EDT 2012


On Thu, Apr 05, 2012 at 05:48:22PM +0400, Kinsbursky Stanislav wrote:
> >Another problem which is not handled by anything we have before in Makefile
> >is deps generation for %.o goals. Example
> >
> >[cyrill at moon crtools]$ make
> >   CC       parasite.o
> >	...
> >   LINK     crtools
> >[cyrill at moon crtools]$ touch include/parasite.h
> >[cyrill at moon crtools]$ make parasite.o
> >make: `parasite.o' is up to date.
> 
> This sound really strange. It work after my commit I mentioned.
> But there were some more on top of it. So, who knows.
> Anyway, my patch has a flaw in case of building two or more targets,
> when one or more requires deps, and others - not.
> 
> >After my last patch applied
> >
> >[cyrill at moon crtools]$ touch include/parasite.h
> >[cyrill at moon crtools]$ make parasite.o
> >   CC       parasite.o
> >   GEN      parasite.bin
> >   GEN      parasite-blob.h
> >make: `parasite.o' is up to date.
> >[cyrill at moon crtools]$
> 
> Does parasite.o requires deps?

Yes, it requires deps and actually deps are generated

[cyrill at moon crtools]$ touch include/parasite.h 
[cyrill at moon crtools]$ make V=1 parasite.o
gcc -c -I./include -O0 -ggdb3 -Werror -Wall -Wno-unused -DCONFIG_X86_64 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -fpic parasite.c -o parasite.o
ld -T parasite.lds.S parasite.o parasite-util-net.o -o parasite.bin
sh gen-offsets.sh parasite > parasite-blob.h || rm -f parasite-blob.h
sync
gcc -M -MT cr-restore.o -I./include -O0 -ggdb3 -Werror -Wall -Wno-unused -DCONFIG_X86_64 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE cr-restore.c -o cr-restore.d
gcc -M -MT parasite-syscall.o -I./include -O0 -ggdb3 -Werror -Wall -Wno-unused -DCONFIG_X86_64 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE parasite-syscall.c -o parasite-syscall.d
make: `parasite.o' is up to date.

so as you see parasite.o is recompiled. It seems for cleaner scheme the parasite
and restored should be built via separate Makefile. I'll think about it.
Meanwhile I think the patch is worth to have to eliminate problem with
deps generation on clean target. What do you think?

> If yes, why it wasn't rebuilt?
> I no, why does parasite-blob.h was rebuilt?

	Cyrill


More information about the CRIU mailing list