# -*- Mode: makefile -*- include ../config-host.mak include config-target.mak include config-devices.mak include $(SRC_PATH)/rules.mak $(call set-vpath, $(SRC_PATH)) ifdef CONFIG_LINUX QEMU_CFLAGS += -I../linux-headers endif QEMU_CFLAGS += -I.. -I$(SRC_PATH)/target-$(TARGET_BASE_ARCH) -DNEED_CPU_H QEMU_CFLAGS+=-I$(SRC_PATH)/include ifdef CONFIG_USER_ONLY # user emulator name QEMU_PROG=qemu-$(TARGET_NAME) else # system emulator name 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) endif PROGS=$(QEMU_PROG) ifdef QEMU_PROGW PROGS+=$(QEMU_PROGW) endif STPFILES= config-target.h: config-target.h-timestamp config-target.h-timestamp: config-target.mak ifdef CONFIG_TRACE_SYSTEMTAP stap: $(QEMU_PROG).stp-installed $(QEMU_PROG).stp ifdef CONFIG_USER_ONLY TARGET_TYPE=user else TARGET_TYPE=system endif $(QEMU_PROG).stp-installed: $(SRC_PATH)/trace-events $(call quiet-command,$(TRACETOOL) \ --format=stap \ --backend=$(TRACE_BACKEND) \ --binary=$(bindir)/$(QEMU_PROG) \ --target-name=$(TARGET_NAME) \ --target-type=$(TARGET_TYPE) \ < $< > $@," GEN $(TARGET_DIR)$(QEMU_PROG).stp-installed") $(QEMU_PROG).stp: $(SRC_PATH)/trace-events $(call quiet-command,$(TRACETOOL) \ --format=stap \ --backend=$(TRACE_BACKEND) \ --binary=$(realpath .)/$(QEMU_PROG) \ --target-name=$(TARGET_NAME) \ --target-type=$(TARGET_TYPE) \ < $< > $@," GEN $(TARGET_DIR)$(QEMU_PROG).stp") else stap: endif all: $(PROGS) stap check-gl # Dummy command so that make thinks it has done something @true ######################################################### # cpu emulator library obj-y = exec.o translate-all.o cpu-exec.o obj-y += tcg/tcg.o tcg/optimize.o obj-$(CONFIG_TCG_INTERPRETER) += tci.o obj-$(CONFIG_TCG_INTERPRETER) += disas/tci.o obj-y += fpu/softfloat.o obj-y += target-$(TARGET_BASE_ARCH)/ obj-y += disas.o obj-$(call notempty,$(TARGET_XML_FILES)) += gdbstub-xml.o obj-$(call lnot,$(CONFIG_KVM)) += kvm-stub.o ######################################################### # Linux user emulator target ifdef CONFIG_LINUX_USER QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) -I$(SRC_PATH)/linux-user obj-y += linux-user/ obj-y += gdbstub.o thunk.o user-exec.o endif #CONFIG_LINUX_USER ######################################################### # BSD user emulator target ifdef CONFIG_BSD_USER QEMU_CFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ABI_DIR) obj-y += bsd-user/ obj-y += gdbstub.o user-exec.o endif #CONFIG_BSD_USER ######################################################### # System emulator target ifdef CONFIG_SOFTMMU obj-y += arch_init.o cpus.o monitor.o gdbstub.o balloon.o ioport.o obj-y += qtest.o obj-y += hw/ obj-$(CONFIG_FDT) += device_tree.o obj-$(CONFIG_KVM) += kvm-all.o obj-y += memory.o savevm.o cputlb.o obj-y += memory_mapping.o obj-y += dump.o LIBS+=$(libs_softmmu) # xen support obj-$(CONFIG_XEN) += xen-all.o xen-mapcache.o obj-$(call lnot,$(CONFIG_XEN)) += xen-stub.o # HAX support ifdef CONFIG_WIN32 obj-$(CONFIG_HAX) += target-i386/hax-all.o target-i386/hax-windows.o obj-$(CONFIG_NO_HAX) += hax-stub.o endif ifdef CONFIG_DARWIN obj-$(CONFIG_HAX) += target-i386/hax-all.o target-i386/hax-darwin.o obj-$(CONFIG_NO_HAX) += hax-stub.o endif # Hardware support ifeq ($(TARGET_NAME), sparc64) obj-y += hw/sparc64/ else obj-y += hw/$(TARGET_BASE_ARCH)/ endif main.o: QEMU_CFLAGS+=$(GPROF_CFLAGS) GENERATED_HEADERS += hmp-commands.h qmp-commands-old.h endif # CONFIG_SOFTMMU # Workaround for http://gcc.gnu.org/PR55489, see configure. %/translate.o: QEMU_CFLAGS += $(TRANSLATE_OPT_CFLAGS) nested-vars += obj-y # Makefile for TIZEN-maru ifdef CONFIG_MARU include $(SRC_PATH)/tizen/src/Makefile.tizen endif ## # This resolves all nested paths, so it must come last include $(SRC_PATH)/Makefile.objs all-obj-y = $(obj-y) all-obj-y += $(addprefix ../, $(common-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 $(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 CHECK_GL_OBJS = check_gl.o CHECK_GL_LDFLAGS = CHECK_GL_TARGET = ifdef CONFIG_LINUX CHECK_GL_OBJS += check_gl_glx.o #CHECK_GL_LDFLAGS += -lGL -lXcomposite -lXext -lglib-2.0 # Fix linking error on Ubuntu 13.04 CHECK_GL_LDFLAGS += -lX11 -lXext -lglib-2.0 -ldl CHECK_GL_TARGET = check-gl endif ifdef CONFIG_WIN32 CHECK_GL_OBJS += check_gl_wgl.o CHECK_GL_LDFLAGS += -fstack-protector `pkg-config --libs glib-2.0` -lgdi32 CHECK_GL_TARGET = check-gl.exe endif ifdef CONFIG_DARWIN CHECK_GL_OBJS += check_gl_cgl.o CHECK_GL_LDFLAGS += -mmacosx-version-min=10.4 `pkg-config --cflags --libs glib-2.0` -framework OpenGL CHECK_GL_TARGET = check-gl endif check-gl: $(CHECK_GL_OBJS) gcc -o $(CHECK_GL_TARGET) $(CHECK_GL_OBJS) $(CHECK_GL_LDFLAGS) check_gl.o: check_gl.c gcc -c ../tizen/src/check_gl.c -I../hw/yagl/yagl_inc check_gl_glx.o: check_gl_glx.c gcc -c ../tizen/src/check_gl_glx.c -I../hw/yagl/yagl_inc check_gl_wgl.o: check_gl_wgl.c gcc -c ../tizen/src/check_gl_wgl.c -I../hw/yagl/yagl_inc check_gl_cgl.o: check_gl_cgl.c gcc -c ../tizen/src/check_gl_cgl.c -I../hw/yagl/yagl_inc 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)$@") hmp-commands.h: $(SRC_PATH)/hmp-commands.hx $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@") qmp-commands-old.h: $(SRC_PATH)/qmp-commands.hx $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@") clean: rm -f *.a *~ $(PROGS) rm -f $(shell find . -name '*.[od]') rm -f hmp-commands.h qmp-commands-old.h gdbstub-xml.c ifdef CONFIG_TRACE_SYSTEMTAP rm -f *.stp endif install: all ifneq ($(PROGS),) $(INSTALL) -m 755 $(PROGS) "$(DESTDIR)$(bindir)" ifneq ($(STRIP),) $(STRIP) $(patsubst %,"$(DESTDIR)$(bindir)/%",$(PROGS)) endif endif ifdef CONFIG_TRACE_SYSTEMTAP $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset" $(INSTALL_DATA) $(QEMU_PROG).stp-installed "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset/$(QEMU_PROG).stp" endif GENERATED_HEADERS += config-target.h Makefile: $(GENERATED_HEADERS)