From cefa2bbd6ad516a8cde9425a35597487d9a4becb Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Wed, 17 Feb 2016 16:59:36 +0200 Subject: [PATCH] rules: filter out irrelevant files It's often handy to make executables depend on each other, e.g. make a test depend on a helper. This doesn't work now, as linker will attempt to use the helper as an object. To fix, filter only relevant file types before linking an executable. Signed-off-by: Michael S. Tsirkin --- rules.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules.mak b/rules.mak index fc5ee41e47..d1ff311254 100644 --- a/rules.mak +++ b/rules.mak @@ -102,7 +102,7 @@ LD_REL := $(CC) -nostdlib -Wl,-r modules: %$(EXESUF): %.o - $(call LINK,$^) + $(call LINK,$(filter %.o %.a %.mo, $^)) %.a: $(call quiet-command,rm -f $@ && $(AR) rcs $@ $^," AR $(TARGET_DIR)$@")