diff mbox

[PULL,11/13] rules: filter out irrelevant files

Message ID 1455868726-26350-12-git-send-email-mst@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michael S. Tsirkin Feb. 19, 2016, 8 a.m. UTC
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 <mst@redhat.com>
---
 rules.mak | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/rules.mak b/rules.mak
index fc5ee41..d1ff311 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)$@")