Skip to content

Commit

Permalink
rules: filter out irrelevant files
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mstsirkin committed Feb 17, 2016
1 parent 9cfaa00 commit cefa2bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rules.mak
Expand Up @@ -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)$@")
Expand Down

0 comments on commit cefa2bb

Please sign in to comment.