fix parallel build
Based on a ideas of Daniel Jacobowitz + Stefan Weil Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
593831de5d
commit
f527c57935
8
Makefile
8
Makefile
|
@ -1,5 +1,8 @@
|
||||||
# Makefile for QEMU.
|
# Makefile for QEMU.
|
||||||
|
|
||||||
|
# This needs to be defined before rules.mak
|
||||||
|
GENERATED_HEADERS = config-host.h config-all-devices.h
|
||||||
|
|
||||||
ifneq ($(wildcard config-host.mak),)
|
ifneq ($(wildcard config-host.mak),)
|
||||||
# Put the all: rule here so that config-host.mak can contain dependencies.
|
# Put the all: rule here so that config-host.mak can contain dependencies.
|
||||||
all: build-all
|
all: build-all
|
||||||
|
@ -40,8 +43,7 @@ config-all-devices.mak: $(SUBDIR_DEVICES_MAK)
|
||||||
|
|
||||||
-include config-all-devices.mak
|
-include config-all-devices.mak
|
||||||
|
|
||||||
build-all: config-host.h config-all-devices.h $(DOCS) $(TOOLS)
|
build-all: $(DOCS) $(TOOLS) recurse-all
|
||||||
$(call quiet-command, $(MAKE) $(SUBDIR_MAKEFLAGS) recurse-all,)
|
|
||||||
|
|
||||||
config-host.h: config-host.h-timestamp
|
config-host.h: config-host.h-timestamp
|
||||||
config-host.h-timestamp: config-host.mak
|
config-host.h-timestamp: config-host.mak
|
||||||
|
@ -51,7 +53,7 @@ config-all-devices.h-timestamp: config-all-devices.mak
|
||||||
|
|
||||||
SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
|
SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
|
||||||
|
|
||||||
subdir-%: config-host.h config-all-devices.h
|
subdir-%: $(GENERATED_HEADERS)
|
||||||
$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,)
|
$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,)
|
||||||
|
|
||||||
$(filter %-softmmu,$(SUBDIR_RULES)): libqemu_common.a
|
$(filter %-softmmu,$(SUBDIR_RULES)): libqemu_common.a
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
# -*- Mode: makefile -*-
|
# -*- Mode: makefile -*-
|
||||||
|
|
||||||
|
# This needs to be defined before rules.mak
|
||||||
|
GENERATED_HEADERS = config-target.h config-devices.h
|
||||||
|
|
||||||
include ../config-host.mak
|
include ../config-host.mak
|
||||||
include config-devices.mak
|
include config-devices.mak
|
||||||
include config-target.mak
|
include config-target.mak
|
||||||
|
@ -33,8 +36,7 @@ config-target.h-timestamp: config-target.mak
|
||||||
config-devices.h: config-devices.h-timestamp
|
config-devices.h: config-devices.h-timestamp
|
||||||
config-devices.h-timestamp: config-devices.mak
|
config-devices.h-timestamp: config-devices.mak
|
||||||
|
|
||||||
all: config-target.h config-devices.h
|
all: $(PROGS)
|
||||||
$(call quiet-command, $(MAKE) $(PROGS),)
|
|
||||||
|
|
||||||
# Dummy command so that make thinks it has done something
|
# Dummy command so that make thinks it has done something
|
||||||
@true
|
@true
|
||||||
|
|
|
@ -13,7 +13,7 @@ MAKEFLAGS += -rR
|
||||||
|
|
||||||
QEMU_CFLAGS += -MMD -MP -MT $@
|
QEMU_CFLAGS += -MMD -MP -MT $@
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c $(GENERATED_HEADERS)
|
||||||
$(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) -c -o $@ $<," CC $(TARGET_DIR)$@")
|
$(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) -c -o $@ $<," CC $(TARGET_DIR)$@")
|
||||||
|
|
||||||
%.o: %.S
|
%.o: %.S
|
||||||
|
|
Loading…
Reference in a new issue