# -*- Mode: makefile -*- include ../config-host.mak include config-devices.mak include config-target.mak include $(SRC_PATH)/rules.mak ifneq ($(HWDIR),) include $(HWDIR)/config.mak endif $(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_ARCH2) else # system emulator name ifneq (,$(findstring -mwindows,$(LIBS))) # Terminate program name with a 'w' because the linker builds a windows executable. QEMU_PROGW=qemu-system-$(TARGET_ARCH2)w$(EXESUF) endif # windows executable QEMU_PROG=qemu-system-$(TARGET_ARCH2)$(EXESUF) endif PROGS=$(QEMU_PROG) ifdef QEMU_PROGW PROGS+=$(QEMU_PROGW) endif STPFILES= ifndef CONFIG_HAIKU LIBS+=-lm endif config-target.h: config-target.h-timestamp config-target.h-timestamp: config-target.mak ifdef CONFIG_TRACE_SYSTEMTAP stap: $(QEMU_PROG).stp ifdef CONFIG_USER_ONLY TARGET_TYPE=user else TARGET_TYPE=system endif $(QEMU_PROG).stp: $(SRC_PATH)/trace-events $(call quiet-command,$(TRACETOOL) \ --format=stap \ --backend=$(TRACE_BACKEND) \ --binary=$(bindir)/$(QEMU_PROG) \ --target-arch=$(TARGET_ARCH) \ --target-type=$(TARGET_TYPE) \ < $< > $@," GEN $(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-y += fpu/softfloat.o obj-y += disas.o obj-$(CONFIG_TCI_DIS) += tci-dis.o obj-y += target-$(TARGET_BASE_ARCH)/ obj-$(CONFIG_GDBSTUB_XML) += gdbstub-xml.o tci-dis.o: QEMU_CFLAGS += -I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/tci # HELPER_CFLAGS is used for all the legacy code compiled with static register # variables user-exec.o: QEMU_CFLAGS += $(HELPER_CFLAGS) # Note: this is a workaround. The real fix is to avoid compiling # cpu_signal_handler() in user-exec.c. %/signal.o: QEMU_CFLAGS += $(HELPER_CFLAGS) ######################################################### # 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 $(oslib-obj-y) 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_ARCH) obj-y += bsd-user/ obj-y += gdbstub.o user-exec.o $(oslib-obj-y) endif #CONFIG_BSD_USER ######################################################### # System emulator target ifdef CONFIG_SOFTMMU CONFIG_NO_PCI = $(if $(subst n,,$(CONFIG_PCI)),n,y) CONFIG_NO_KVM = $(if $(subst n,,$(CONFIG_KVM)),n,y) CONFIG_NO_XEN = $(if $(subst n,,$(CONFIG_XEN)),n,y) CONFIG_NO_GET_MEMORY_MAPPING = $(if $(subst n,,$(CONFIG_HAVE_GET_MEMORY_MAPPING)),n,y) CONFIG_NO_CORE_DUMP = $(if $(subst n,,$(CONFIG_HAVE_CORE_DUMP)),n,y) obj-y += arch_init.o cpus.o monitor.o gdbstub.o balloon.o ioport.o obj-y += hw/ obj-$(CONFIG_KVM) += kvm-all.o obj-$(CONFIG_NO_KVM) += kvm-stub.o obj-y += memory.o savevm.o cputlb.o obj-$(CONFIG_HAVE_GET_MEMORY_MAPPING) += memory_mapping.o obj-$(CONFIG_HAVE_CORE_DUMP) += dump.o obj-$(CONFIG_NO_GET_MEMORY_MAPPING) += memory_mapping-stub.o obj-$(CONFIG_NO_CORE_DUMP) += dump-stub.o LIBS+=-lz QEMU_CFLAGS += $(VNC_TLS_CFLAGS) QEMU_CFLAGS += $(VNC_SASL_CFLAGS) QEMU_CFLAGS += $(VNC_JPEG_CFLAGS) QEMU_CFLAGS += $(VNC_PNG_CFLAGS) # xen support obj-$(CONFIG_XEN) += xen-all.o xen-mapcache.o obj-$(CONFIG_NO_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_ARCH), 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 nested-vars += obj-y # Makefile for TIZEN-maru ifdef CONFIG_MARU include $(SRC_PATH)/tizen/src/Makefile.tizen endif ## ifdef CONFIG_BUILD_YAGL # YaGL QEMU_CFLAGS += -I$(SRC_PATH)/hw/yagl_inc $(call set-vpath, $(SRC_PATH)/hw/yagl_apis/egl: \ $(SRC_PATH)/hw/yagl_apis/gles: \ $(SRC_PATH)/hw/yagl_apis/gles1: \ $(SRC_PATH)/hw/yagl_apis/gles2: \ $(SRC_PATH)/hw/yagl_drivers/egl_glx: \ $(SRC_PATH)/hw/yagl_drivers/gles_ogl: \ $(SRC_PATH)/hw/yagl_drivers/gles1_ogl: \ $(SRC_PATH)/hw/yagl_drivers/gles2_ogl) obj-y += yagl_device.o obj-y += yagl_log.o obj-y += yagl_process.o obj-y += yagl_thread.o obj-y += yagl_server.o obj-y += yagl_ref.o obj-y += yagl_mem.o obj-y += yagl_mem_egl.o obj-y += yagl_mem_gl.o obj-y += yagl_mem_transfer.o obj-y += yagl_event.o obj-y += yagl_handle_gen.o obj-y += yagl_dyn_lib.o obj-y += yagl_api.o obj-y += yagl_vector.o obj-y += yagl_avl.o obj-y += yagl_range_list.o obj-y += yagl_egl_driver.o obj-y += yagl_gles_driver.o obj-y += yagl_gles1_driver.o obj-y += yagl_gles2_driver.o obj-y += yagl_egl_interface.o obj-y += yagl_client_interface.o obj-y += yagl_client_context.o obj-y += yagl_resource.o obj-y += yagl_resource_list.o obj-y += yagl_object.o obj-y += yagl_namespace.o obj-y += yagl_sharegroup.o obj-y += yagl_stats.o obj-y += yagl_compiled_transfer.o obj-y += yagl_egl_native_config.o obj-y += yagl_egl_surface_attribs.o # EGL api obj-y += yagl_egl_api.o obj-y += yagl_egl_api_ps.o obj-y += yagl_egl_api_ts.o obj-y += yagl_egl_calls.o obj-y += yagl_egl_display.o obj-y += yagl_egl_config.o obj-y += yagl_egl_surface.o obj-y += yagl_egl_context.o obj-y += yagl_egl_validate.o obj-y += yagl_host_egl_calls.o # GLES common api obj-y += yagl_gles_context.o obj-y += yagl_gles_array.o obj-y += yagl_gles_buffer.o obj-y += yagl_gles_texture.o obj-y += yagl_gles_framebuffer.o obj-y += yagl_gles_renderbuffer.o obj-y += yagl_gles_texture_unit.o obj-y += yagl_gles_validate.o obj-y += yagl_host_gles_calls.o # GLESv1_CM api obj-y += yagl_gles1_calls.o obj-y += yagl_host_gles1_calls.o # GLESv2 api obj-y += yagl_gles2_api.o obj-y += yagl_gles2_api_ps.o obj-y += yagl_gles2_api_ts.o obj-y += yagl_gles2_calls.o obj-y += yagl_gles2_context.o obj-y += yagl_gles2_shader.o obj-y += yagl_gles2_program.o obj-y += yagl_gles2_validate.o obj-y += yagl_host_gles2_calls.o # EGL GLX driver obj-y += yagl_egl_glx.o # GLES OpenGL common driver obj-y += yagl_gles_ogl.o # GLESv1_CM OpenGL driver obj-y += yagl_gles1_ogl.o # GLESv2 OpenGL driver obj-y += yagl_gles2_ogl.o endif ifdef CONFIG_BUILD_GLES gles2.o: gles2.c gles2.h gles2_egl.o: gles2_egl.c gles2.h gles2_es11.o: gles2_es11.c gles2.h gles2_es20.o: gles2_es20.c gles2.h gles2_kernel_calls.o: gles2_kernel_calls.c gles2.h gles2_calls.h gles2_egl_calls.o: gles2_egl_calls.c gles2.h gles2_calls.h gles2_es11_calls.o: gles2_es11_calls.c gles2.h gles2_calls.h gles2_es20_calls.o: gles2_es20_calls.c gles2.h gles2_calls.h obj-y += gles2.o gles2_egl.o gles2_es11.o gles2_es20.o obj-y += gles2_kernel_calls.o gles2_egl_calls.o gles2_es11_calls.o obj-y += gles2_es20_calls.o ifdef QEMU_PROGW GLESLIBS_LINK_LIST:=$(wildcard $(CONFIG_GLES_LIBDIR)/*.dll) else GLESLIBS_LINK_LIST:=$(wildcard $(CONFIG_GLES_LIBDIR)/lib*) endif $(GLESLIBS_LINK_LIST): GLESLIBS_RUNTIME_LIST:=$(addprefix ./,$(notdir $(GLESLIBS_LINK_LIST))) $(GLESLIBS_RUNTIME_LIST): $(GLESLIBS_LINK_LIST) @cp -dpu -t ./ $(GLESLIBS_LINK_LIST) $(QEMU_PROG): $(GLESLIBS_RUNTIME_LIST) endif # CONFIG_BUILD_GLES # This resolves all nested paths, so it must come last include $(SRC_PATH)/Makefile.objs all-obj-y = $(obj-y) all-obj-y += $(addprefix ../, $(universal-obj-y)) ifdef CONFIG_SOFTMMU all-obj-y += $(addprefix ../, $(common-obj-y)) all-obj-y += $(addprefix ../libdis/, $(libdis-y)) all-obj-y += $(addprefix $(HWDIR)/, $(hw-obj-y)) all-obj-y += $(addprefix ../, $(trace-obj-y)) else all-obj-y += $(addprefix ../libuser/, $(user-obj-y)) all-obj-y += $(addprefix ../libdis-user/, $(libdis-y)) endif #CONFIG_LINUX_USER ifdef QEMU_PROGW # The linker builds a windows executable. Make also a console executable. $(QEMU_PROGW): $(all-obj-y) $(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) $(call LINK,$^) endif CHECK_GL_OBJS = check_gl.o gloffscreen_test.o gloffscreen_common.o CHECK_GL_LDFLAGS = CHECK_GL_TARGET = ifdef CONFIG_LINUX CHECK_GL_OBJS += gloffscreen_xcomposite.o #CHECK_GL_LDFLAGS += -lGL -lXcomposite -lXext -lglib-2.0 # Fix linking error on Ubuntu 13.04 CHECK_GL_LDFLAGS += -lGL -lXcomposite -lX11 -lXext -lglib-2.0 CHECK_GL_TARGET = check-gl endif ifdef CONFIG_WIN32 CHECK_GL_OBJS += gloffscreen_wgl.o CHECK_GL_LDFLAGS += -fstack-protector `pkg-config --libs glib-2.0` -lopengl32 -lglu32 -lgdi32 CHECK_GL_TARGET = check-gl.exe endif ifdef CONFIG_DARWIN CHECK_GL_OBJS += gloffscreen_agl.o CHECK_GL_LDFLAGS += -mmacosx-version-min=10.4 `pkg-config --cflags --libs glib-2.0` -framework GLUT -framework OpenGL -framework AGL CHECK_GL_TARGET = check-gl endif check-gl: check_gl.o gcc -o $(CHECK_GL_TARGET) $(CHECK_GL_OBJS) $(CHECK_GL_LDFLAGS) check_gl.o: check_gl.c gcc -c ../tizen/src/check_gl.c 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 ifneq ($(GLESLIBS_RUNTIME_LIST),) $(INSTALL) -m 644 $(GLESLIBS_RUNTIME_LIST) "$(DESTDIR)$(bindir)" endif endif ifdef CONFIG_TRACE_SYSTEMTAP $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset" $(INSTALL_DATA) $(QEMU_PROG).stp "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset" endif GENERATED_HEADERS += config-target.h Makefile: $(GENERATED_HEADERS)