Commit 41a3f3c1 authored by Peter Maydell's avatar Peter Maydell
Browse files

Merge remote-tracking branch 'remotes/bonzini/configure' into staging



* remotes/bonzini/configure:
  libcacard: remove libcacard-specific CFLAGS and LIBS from global vars
  build: simplify and fix fix-obj-vars
  build: convert some obj-specific CFLAGS to use new foo.o-cflags syntax
  build: add support for per-object -cflags and -libs to all rules
  Makefile: use $(INSTALL_LIB) for modules not $(INSTALL_PROG)
  Makefile.target: use $(INSTALL_PROG) for installing, not $(INSTALL)
  Makefile: strip tools and modules too
  build: simplify Makefile.target around unnest-vars invocations
  build: simplify Makefile.target a bit, use just one rule for softmmu
  build: Fix per-object variables for Makefile.target

Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parents 1b5498f6 9d171bd9
Loading
Loading
Loading
Loading
+12 −10
Original line number Diff line number Diff line
@@ -148,10 +148,6 @@ endif

all: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all modules

vl.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)

vl.o: QEMU_CFLAGS+=$(SDL_CFLAGS)

config-host.h: config-host.h-timestamp
config-host.h-timestamp: config-host.mak
qemu-options.def: $(SRC_PATH)/qemu-options.hx
@@ -195,8 +191,6 @@ ALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS))

recurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES)

bt-host.o: QEMU_CFLAGS += $(BLUEZ_CFLAGS)

$(BUILD_DIR)/version.o: $(SRC_PATH)/version.rc $(BUILD_DIR)/config-host.h | $(BUILD_DIR)/version.lo
	$(call quiet-command,$(WINDRES) -I$(BUILD_DIR) -o $@ $<,"  RC    version.o")
$(BUILD_DIR)/version.lo: $(SRC_PATH)/version.rc $(BUILD_DIR)/config-host.h
@@ -384,17 +378,25 @@ install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig \
install-datadir install-localstatedir
	$(INSTALL_DIR) "$(DESTDIR)$(bindir)"
ifneq ($(TOOLS),)
	$(INSTALL_PROG) $(STRIP_OPT) $(TOOLS) "$(DESTDIR)$(bindir)"
	$(INSTALL_PROG) $(TOOLS) "$(DESTDIR)$(bindir)"
ifneq ($(STRIP),)
	$(STRIP) $(TOOLS:%="$(DESTDIR)$(bindir)/%")
endif
endif
ifneq ($(CONFIG_MODULES),)
	$(INSTALL_DIR) "$(DESTDIR)$(qemu_moddir)"
	for s in $(patsubst %.mo,%$(DSOSUF),$(modules-m)); do \
		$(INSTALL_PROG) $(STRIP_OPT) $$s "$(DESTDIR)$(qemu_moddir)/$$(echo $$s | tr / -)"; \
	for s in $(modules-m:.mo=$(DSOSUF)); do \
		t="$(DESTDIR)$(qemu_moddir)/$$(echo $$s | tr / -)"; \
		$(INSTALL_LIB) $$s "$$t"; \
		test -z "$(STRIP)" || $(STRIP) "$$t"; \
	done
endif
ifneq ($(HELPERS-y),)
	$(INSTALL_DIR) "$(DESTDIR)$(libexecdir)"
	$(INSTALL_PROG) $(STRIP_OPT) $(HELPERS-y) "$(DESTDIR)$(libexecdir)"
	$(INSTALL_PROG) $(HELPERS-y) "$(DESTDIR)$(libexecdir)"
ifneq ($(STRIP),)
	$(STRIP) $(HELPERS-y:%="$(DESTDIR)$(libexecdir)/%")
endif
endif
ifneq ($(BLOBS),)
	set -e; for x in $(BLOBS); do \
+4 −0
Original line number Diff line number Diff line
@@ -31,6 +31,8 @@ libcacard-y += libcacard/vcard_emul_nss.o
libcacard-y += libcacard/vcard_emul_type.o
libcacard-y += libcacard/card_7816.o
libcacard-y += libcacard/vcardt.o
libcacard/vcard_emul_nss.o-cflags := $(NSS_CFLAGS)
libcacard/vcard_emul_nss.o-libs := $(NSS_LIBS)

######################################################################
# Target independent part of system emulation. The long term path is to
@@ -64,9 +66,11 @@ common-obj-y += hw/

common-obj-y += ui/
common-obj-y += bt-host.o bt-vhci.o
bt-host.o-cflags := $(BLUEZ_CFLAGS)

common-obj-y += dma-helpers.o
common-obj-y += vl.o
vl.o-cflags := $(GPROF_CFLAGS) $(SDL_CFLAGS)
common-obj-y += tpm.o

common-obj-$(CONFIG_SLIRP) += slirp/
+15 −26
Original line number Diff line number Diff line
@@ -16,19 +16,22 @@ QEMU_CFLAGS+=-I$(SRC_PATH)/include
ifdef CONFIG_USER_ONLY
# user emulator name
QEMU_PROG=qemu-$(TARGET_NAME)
QEMU_PROG_BUILD = $(QEMU_PROG)
else
# system emulator name
QEMU_PROG=qemu-system-$(TARGET_NAME)$(EXESUF)
ifneq (,$(findstring -mwindows,$(libs_softmmu)))
# Terminate program name with a 'w' because the linker builds a windows executable.
QEMU_PROGW=qemu-system-$(TARGET_NAME)w$(EXESUF)
endif # windows executable
QEMU_PROG=qemu-system-$(TARGET_NAME)$(EXESUF)
$(QEMU_PROG): $(QEMU_PROGW)
	$(call quiet-command,$(OBJCOPY) --subsystem console $(QEMU_PROGW) $(QEMU_PROG),"  GEN   $(TARGET_DIR)$(QEMU_PROG)")
QEMU_PROG_BUILD = $(QEMU_PROGW)
else
QEMU_PROG_BUILD = $(QEMU_PROG)
endif

PROGS=$(QEMU_PROG)
ifdef QEMU_PROGW
PROGS+=$(QEMU_PROGW)
endif

PROGS=$(QEMU_PROG) $(QEMU_PROGW)
STPFILES=

config-target.h: config-target.h-timestamp
@@ -140,10 +143,7 @@ endif # CONFIG_SOFTMMU
%/translate.o: QEMU_CFLAGS += $(TRANSLATE_OPT_CFLAGS)

dummy := $(call unnest-vars,,obj-y)

# we are making another call to unnest-vars with different vars, protect obj-y,
# it can be overriden in subdir Makefile.objs
obj-y-save := $(obj-y)
all-obj-y := $(obj-y)

block-obj-y :=
common-obj-y :=
@@ -153,27 +153,16 @@ dummy := $(call unnest-vars,.., \
               block-obj-m \
               common-obj-y \
               common-obj-m)

# Now restore obj-y
obj-y := $(obj-y-save)

all-obj-y = $(obj-y) $(common-obj-y)
all-obj-y += $(common-obj-y)
all-obj-$(CONFIG_SOFTMMU) += $(block-obj-y)

ifndef CONFIG_HAIKU
LIBS+=-lm
endif

ifdef QEMU_PROGW
# The linker builds a windows executable. Make also a console executable.
$(QEMU_PROGW): $(all-obj-y) ../libqemuutil.a ../libqemustub.a
# build either PROG or PROGW
$(QEMU_PROG_BUILD): $(all-obj-y) ../libqemuutil.a ../libqemustub.a
	$(call LINK,$^)
$(QEMU_PROG): $(QEMU_PROGW)
	$(call quiet-command,$(OBJCOPY) --subsystem console $(QEMU_PROGW) $(QEMU_PROG),"  GEN   $(TARGET_DIR)$(QEMU_PROG)")
else
$(QEMU_PROG): $(all-obj-y) ../libqemuutil.a ../libqemustub.a
	$(call LINK,$^)
endif

gdbstub-xml.c: $(TARGET_XML_FILES) $(SRC_PATH)/scripts/feature_to_c.sh
	$(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/scripts/feature_to_c.sh $@ $(TARGET_XML_FILES),"  GEN   $(TARGET_DIR)$@")
@@ -194,9 +183,9 @@ endif

install: all
ifneq ($(PROGS),)
	$(INSTALL) -m 755 $(PROGS) "$(DESTDIR)$(bindir)"
	$(INSTALL_PROG) $(PROGS) "$(DESTDIR)$(bindir)"
ifneq ($(STRIP),)
	$(STRIP) $(patsubst %,"$(DESTDIR)$(bindir)/%",$(PROGS))
	$(STRIP) $(PROGS:%="$(DESTDIR)$(bindir)/%")
endif
endif
ifdef CONFIG_TRACE_SYSTEMTAP
+1 −1
Original line number Diff line number Diff line
@@ -14,4 +14,4 @@ common-obj-$(CONFIG_AUDIO_WIN_INT) += audio_win_int.o
common-obj-y += wavcapture.o

$(obj)/audio.o $(obj)/fmodaudio.o: QEMU_CFLAGS += $(FMOD_CFLAGS)
$(obj)/sdlaudio.o: QEMU_CFLAGS += $(SDL_CFLAGS)
sdlaudio.o-cflags := $(SDL_CFLAGS)
+1 −1
Original line number Diff line number Diff line
@@ -3,6 +3,6 @@ common-obj-$(CONFIG_POSIX) += rng-random.o

common-obj-y += msmouse.o
common-obj-$(CONFIG_BRLAPI) += baum.o
$(obj)/baum.o: QEMU_CFLAGS += $(SDL_CFLAGS) 
baum.o-cflags := $(SDL_CFLAGS)

common-obj-$(CONFIG_TPM) += tpm.o
Loading