[CRIU] [PATCH 14/20] compel/test/infect/Makefile: don't add .h to sources

Kir Kolyshkin kir at openvz.org
Thu Dec 8 01:44:27 PST 2016


The way the Makefile is written, parasite.h is added
to gcc command line, like this:

  gcc -o spy spy.c libcompel.a parasite.h

Surely this is not what we want, as parasite.h is included to spy.c

The fix is to use "order-only prerequisite", as described by
https://www.gnu.org/software/make/manual/html_node/Prerequisite-Types.html

Signed-off-by: Kir Kolyshkin <kir at openvz.org>
---
 compel/test/infect/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compel/test/infect/Makefile b/compel/test/infect/Makefile
index b9f0820..d518749 100644
--- a/compel/test/infect/Makefile
+++ b/compel/test/infect/Makefile
@@ -22,7 +22,7 @@ clean:
 victim: victim.c
 	gcc -o $@ $^
 
-spy: spy.c parasite.h $(COMPEL_LIBRARY)
+spy: spy.c $(COMPEL_LIBRARY) | parasite.h
 	gcc -Werror -I$(COMPEL_IDIR) -I$(COMMON_IDIR) -o $@ $^
 
 parasite.h: parasite.po
-- 
2.7.4



More information about the CRIU mailing list