summaryrefslogtreecommitdiff
path: root/rules.mak
diff options
context:
space:
mode:
Diffstat (limited to 'rules.mak')
-rw-r--r--rules.mak10
1 files changed, 8 insertions, 2 deletions
diff --git a/rules.mak b/rules.mak
index 927301251e..4673aada07 100644
--- a/rules.mak
+++ b/rules.mak
@@ -23,10 +23,18 @@ QEMU_CFLAGS += -I$(<D) -I$(@D)
ifeq ($(LIBTOOL),)
%.lo: %.c
@echo "missing libtool. please install and rerun configure"; exit 1
+LINK = $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ \
+ $(sort $(filter %.o, $1)) $(filter-out %.o, $1) \
+ $(LIBS)," LINK $(TARGET_DIR)$@")
else
LIBTOOL += $(if $(V),,--quiet)
%.lo: %.c
$(call quiet-command,$(LIBTOOL) --mode=compile --tag=CC $(CC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," lt CC $@")
+LINK = $(call quiet-command,\
+ $(if $(filter %.lo %.la,$^),$(LIBTOOL) --mode=link --tag=CC \
+ )$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ \
+ $(sort $(filter %.o, $1)) $(filter-out %.o, $1) \
+ $(LIBS),$(if $(filter %.lo %.la,$^),"lt LINK ", " LINK ")"$(TARGET_DIR)$@")
endif
%.asm: %.S
@@ -38,8 +46,6 @@ endif
%.o: %.m
$(call quiet-command,$(OBJCC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," OBJC $(TARGET_DIR)$@")
-LINK = $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(sort $(filter %.o, $1)) $(filter-out %.o, $1) $(LIBS)," LINK $(TARGET_DIR)$@")
-
%$(EXESUF): %.o
$(call LINK,$^)