stubdom: modify ioemu linkfarm only if necessary
authorJuergen Gross <jgross@suse.com>
Tue, 13 Dec 2016 15:38:06 +0000 (16:38 +0100)
committerWei Liu <wei.liu2@citrix.com>
Wed, 14 Dec 2016 14:42:02 +0000 (14:42 +0000)
Several stubdom libraries are being rebuilt each time a top level make
is called as they depend on stubdom/ioemu/linkfarm.stamp which is
depending on tools/qemu-xen-traditional-dir. Unfortunately this
directory is modified by each "make tools" call.

This can be avoided by writing stubdom/ioemu/linkfarm.stamp only if
a source file beneath tools/qemu-xen-traditional-dir has been added
or removed.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
stubdom/Makefile

index bc49cfe48f069136d53bb965cdadabaabff56427..f85821088d42a910b70dd7cac147c6c2f5d08755 100644 (file)
@@ -298,9 +298,13 @@ ioemu/linkfarm.stamp: $(XEN_ROOT)/tools/qemu-xen-traditional-dir
        (cd $$src && find *     ! -type l  -type f  $(addprefix ! -name ,       \
                        '*.[oda1]' 'config-*' config.mak qemu-dm qemu-img-xen   \
                        '*.html' '*.pod'                                        \
-                       )) |                                                    \
-           while read f; do rm -f "$$f"; ln -s "$$src/$$f" "$$f"; done
-       touch ioemu/linkfarm.stamp
+                       )) >linkfarm.stamp.tmp;                         \
+       cmp -s linkfarm.stamp.tmp linkfarm.stamp &&                     \
+               rm linkfarm.stamp.tmp || {                              \
+               mv linkfarm.stamp.tmp linkfarm.stamp;                   \
+               cat linkfarm.stamp | while read f;                      \
+                       do rm -f "$$f"; ln -s "$$src/$$f" "$$f"; done;  \
+       }
 else
 export QEMU_ROOT