EMUL_DIR=../emulator DIBS_X86_DIR=../x86 DIBS_ARM_DIR=../arm DIBS_COMMON_DIR=../common DIBS_SWT_DIR=-Dclasspath.dibs=$(ROOTDIR)/tools/emulator/bin ifeq ($(CC),"") @echo "cc does not exist" @exit 1 endif ifndef TIZEN_SDK_DEV_PATH TIZEN_SDK_DEV_PATH=${HOME}/tizen-sdk-dev endif ifneq ($(wildcard ../../config-host.mak),) include ../../config-host.mak TARGET_EXE += util/check-cam$(EXESUF) TARGET_EXE += util/check-net$(EXESUF) ifdef CONFIG_YAGL TARGET_EXE += util/check-gl$(EXESUF) endif ifndef CONFIG_LINUX TARGET_EXE += util/check-hax$(EXESUF) endif TARGET_DSO += all: qemu skin_client $(TARGET_EXE) $(TARGET_DSO) qemu: $(TARGET_EXE) $(TARGET_DSO) build_info cd ../../ && $(MAKE) qemu_clean: cd ../../ && $(MAKE) clean qemu_distclean: cd ../../ && $(MAKE) distclean # Building check-net CHECK_NET_OBJS = util/check_net.o CHECK_NET_CFLAGS = -c $(GLIB_CFLAGS) $(CURL_CFLAGS) CHECK_NET_LDFLAGS = CHECK_NET_TARGET = util/check-net$(EXESUF) ifdef CONFIG_LINUX CHECK_NET_OBJS += util/check_net_linux.o CHECK_NET_LDFLAGS += ${CURL_LIBS} `pkg-config --libs glib-2.0` endif ifdef CONFIG_WIN32 CHECK_NET_OBJS += util/check_net_win32.o CHECK_NET_LDFLAGS += -liphlpapi -lws2_32 ${CURL_LIBS} `pkg-config --libs glib-2.0` endif ifdef CONFIG_DARWIN CHECK_NET_OBJS += util/check_net_darwin.o CHECK_NET_LDFLAGS += -mmacosx-version-min=10.4 ${CURL_LIBS} -framework CoreFoundation -framework SystemConfiguration `pkg-config --libs glib-2.0` endif util/check-net$(EXESUF): $(CHECK_NET_OBJS) $(CC) $(CHECK_NET_OBJS) $(CHECK_NET_LDFLAGS) -o $@ $(CHECK_NET_OBJS): %.o: %.c $(CC) $< $(CHECK_NET_CFLAGS) -o $@ # Building check-gl CHECK_GL_OBJS = util/check_gl.o util/check_gl_core.o CHECK_GL_CFLAGS = -c -I$(SRC_PATH)/hw/yagl/yagl_inc CHECK_GL_LDFLAGS = CHECK_GL_TARGET = util/check-gl$(EXESUF) ifdef CONFIG_LINUX CHECK_GL_OBJS += util/check_gl_glx.o CHECK_GL_LDFLAGS += -lX11 -lXext -lglib-2.0 -ldl endif ifdef CONFIG_WIN32 CHECK_GL_OBJS += util/check_gl_wgl.o CHECK_GL_LDFLAGS += -fstack-protector `pkg-config --libs glib-2.0` -lgdi32 endif ifdef CONFIG_DARWIN CHECK_GL_OBJS += util/check_gl_cgl.o CHECK_GL_LDFLAGS += -mmacosx-version-min=10.4 `pkg-config --cflags --libs glib-2.0` -framework OpenGL endif util/check-gl$(EXESUF): $(CHECK_GL_OBJS) $(CC) $(CHECK_GL_OBJS) $(CHECK_GL_LDFLAGS) -o $@ $(CHECK_GL_OBJS): %.o: %.c $(CC) $< $(CHECK_GL_CFLAGS) -o $@ # Building check-cam CHECK_CAM_CFLAGS = -c ifdef CONFIG_LINUX CHECK_CAM_LDFLAGS = -lv4l2 -lv4lconvert endif ifdef CONFIG_WIN32 CHECK_CAM_CFLAGS += -I. CHECK_CAM_LDFLAGS = -lole32 -loleaut32 -luuid -lstrmiids endif ifdef CONFIG_DARWIN endif util/check-cam$(EXESUF): util/check_cam.o $(CC) $< -o $@ $(CHECK_CAM_LDFLAGS) util/check_cam.o: %.o: %.c $(CC) $< -o $@ $(CHECK_CAM_CFLAGS) # Building check-hax CHECK_HAX_CFLAGS = -c ifdef CONFIG_LINUX endif ifdef CONFIG_WIN32 endif ifdef CONFIG_DARWIN CHECK_HAX_CFLAGS += -mmacosx-version-min=10.4 endif util/check-hax$(EXESUF): util/check_hax.o $(CC) $< -o $@ util/check_hax.o: %.o: %.c $(CC) $< $(CHECK_HAX_CFLAGS) -o $@ # Building java skin skin_client: ifdef CONFIG_USE_SHM TIZEN_SDK_DEV_PATH=${TIZEN_SDK_DEV_PATH} ant -DdoNotUseSHM=false -buildfile skin/client/build.xml make-jar else ifdef CONFIG_SDL TIZEN_SDK_DEV_PATH=${TIZEN_SDK_DEV_PATH} ant -DdoNotUseSHM=true -buildfile skin/client/build.xml make-jar endif endif build_info: @echo "Generate a build information file" @echo "/* Automatically generated by Makefile - do not modify! */" > build_info.h @echo "static const char build_version[] = \"`cat VERSION`\";" >> build_info.h @echo "static const char build_date[] = \"`date +"%F %T %Z"`\";" >> build_info.h @echo "static const char pkginfo_version[] = \"`sed -n '1p' ./../../package/pkginfo.manifest | sed 's/\"//g'`\";" >> build_info.h @echo "static const char pkginfo_maintainer[] = \"`sed -n '2p' ./../../package/pkginfo.manifest | sed 's/\"//g'`\";" >> build_info.h @echo "static const char pkginfo_githead[] = \"`git rev-parse HEAD`\";" >> build_info.h @echo "static const char latest_gittag[] = \"`git for-each-ref --count=1 --sort=-taggerdate refs/tags/ --format='Latest Git Tag : %(refname:short) (%(subject))' | sed 's/\"//g'`\";" >> build_info.h clean: qemu_clean rm -f util/check-hax$(EXESUF) util/check-cam$(EXESUF) util/check-gl$(EXESUF) util/check-net$(EXESUF) distclean: clean qemu_distclean install: all mkdir -p $(EMUL_DIR)/bin mkdir -p $(EMUL_DIR)/etc mkdir -p $(EMUL_DIR)/data mkdir -p $(EMUL_DIR)/images @for target in $(TARGET_DIRS); do \ case "$$target" in \ i386-softmmu) \ mkdir -p $(EMUL_DIR)/data/bios ;\ echo "Copying i386-softmmu/qemu-system-i386$(EXESUF) to $(EMUL_DIR)/bin/emulator-x86$(EXESUF)" ;\ cp -pP ../../i386-softmmu/qemu-system-i386$(EXESUF) $(EMUL_DIR)/bin/emulator-x86$(EXESUF) ;\ echo "Copying bioses to $(EMUL_DIR)/data/bios" ;\ cp -pP ../../pc-bios/bios-256k.bin $(EMUL_DIR)/data/bios ;\ cp -pP ../../pc-bios/linuxboot.bin $(EMUL_DIR)/data/bios ;\ cp -pP ../../pc-bios/efi-virtio.rom $(EMUL_DIR)/data/bios ;\ cp -pP ../../pc-bios/acpi-dsdt.aml $(EMUL_DIR)/data/bios ;\ ;; \ arm-softmmu) \ echo "Copying arm-softmmu/qemu-system-arm$(EXESUF) to $(EMUL_DIR)/bin/emulator-arm$(EXESUF)" ;\ cp -pP ../../arm-softmmu/qemu-system-arm$(EXESUF) $(EMUL_DIR)/bin/emulator-arm$(EXESUF) ;\ ;; \ esac; \ done cp -pP ../../qemu-img$(EXESUF) $(EMUL_DIR)/bin ifndef CONFIG_WIN32 cp -pP scripts/emulator.sh $(EMUL_DIR)/bin else cp -pP scripts/emulator.bat $(EMUL_DIR)/bin endif # resources and jar for skin ifdef CONFIG_SDL cp -pP skin/client/emulator-skin.jar $(EMUL_DIR)/bin cp -pPR skin/client/skins $(EMUL_DIR) cp -pP skin/client/resource/images/blank-guide.png $(EMUL_DIR)/images else ifdef CONFIG_USE_SHM cp -pP skin/client/emulator-skin.jar $(EMUL_DIR)/bin cp -pPR skin/client/skins $(EMUL_DIR) endif endif # check capabilities of OpenGL, Webcam and net cp -pP util/check-gl$(EXESUF) $(EMUL_DIR)/bin cp -pP util/check-cam$(EXESUF) $(EMUL_DIR)/bin cp -pP util/check-net$(EXESUF) $(EMUL_DIR)/bin # Enable HW Virtualization on Linux ifdef CONFIG_LINUX cp -pP ../supplements/SDK/tizen-kvm $(EMUL_DIR)/etc cp -pP ../supplements/SDK/45-tizen-kvm.rules $(EMUL_DIR)/etc endif # check HW Virtualization on Windows and MAC OS X. ifndef CONFIG_LINUX cp -pP util/check-hax$(EXESUF) $(EMUL_DIR)/bin endif # give a title name for sdb terminal. ifdef CONFIG_DARWIN cp -pP scripts/sdbscript $(EMUL_DIR)/bin endif # use shared memory for display framebuffer ifdef CONFIG_USE_SHM ifdef CONFIG_LINUX cp -pP skin/client/native_src/libshared.so $(EMUL_DIR)/bin endif ifdef CONFIG_DARWIN cp -pP skin/client/native_src/libshared.dylib $(EMUL_DIR)/bin endif endif # use GTK for CopyToClipboard on Ubuntu 12.04 64bit ifdef CONFIG_LINUX cp -pP skin/client/native_src/clipboard.py $(EMUL_DIR)/bin endif # for dibs system... all_dibs: qemu skin_client_dibs skin_client_dibs: ifdef CONFIG_USE_SHM TIZEN_SDK_DEV_PATH=${TIZEN_SDK_DEV_PATH} ant -DdoNotUseSHM=false ${DIBS_SWT_DIR} -buildfile skin/client/build.xml make-jar else ifdef CONFIG_SDL TIZEN_SDK_DEV_PATH=${TIZEN_SDK_DEV_PATH} ant -DdoNotNotUseSHM=true ${DIBS_SWT_DIR} -buildfile skin/client/build.xml make-jar endif endif install_dibs: all_dibs mkdir -p $(DIBS_COMMON_DIR)/bin mkdir -p $(DIBS_COMMON_DIR)/etc mkdir -p $(DIBS_COMMON_DIR)/images mkdir -p $(DIBS_X86_DIR)/bin mkdir -p $(DIBS_X86_DIR)/data mkdir -p $(DIBS_X86_DIR)/etc mkdir -p $(DIBS_ARM_DIR)/bin @for target in $(TARGET_DIRS); do \ case "$$target" in \ i386-softmmu) \ mkdir -p $(DIBS_X86_DIR)/data/bios ;\ echo "Copying i386-softmmu/qemu-system-i386$(EXESUF) to $(DIBS_X86__DIR)/bin/emulator-x86$(EXESUF)" ;\ cp ../../i386-softmmu/qemu-system-i386$(EXESUF) $(DIBS_X86_DIR)/bin/emulator-x86$(EXESUF) ;\ echo "Copying bioses to $(DIBS_X86_DIR)/data/bios" ;\ cp -pP ../../pc-bios/bios-256k.bin $(DIBS_X86_DIR)/data/bios ;\ cp -pP ../../pc-bios/linuxboot.bin $(DIBS_X86_DIR)/data/bios ;\ cp -pP ../../pc-bios/efi-virtio.rom $(DIBS_X86_DIR)/data/bios ;\ cp -pP ../../pc-bios/acpi-dsdt.aml $(DIBS_X86_DIR)/data/bios ;\ ;; \ arm-softmmu) \ echo "Copying arm-softmmu/qemu-system-arm$(EXESUF) to $(DIBS_ARM_DIR)/bin/emulator-arm$(EXESUF)" ;\ cp -pP ../../arm-softmmu/qemu-system-arm$(EXESUF) $(DIBS_ARM_DIR)/bin/emulator-arm$(EXESUF) ;\ ;; \ esac; \ done cp -pP ../../qemu-img$(EXESUF) $(DIBS_COMMON_DIR)/bin ifndef CONFIG_WIN32 cp -pP scripts/emulator.sh $(DIBS_COMMON_DIR)/bin else cp -pP scripts/emulator.bat $(DIBS_COMMON_DIR)/bin endif # resources and jar for skin ifdef CONFIG_SDL cp -pP skin/client/emulator-skin.jar $(DIBS_COMMON_DIR)/bin cp -pP skin/client/resource/images/blank-guide.png $(DIBS_COMMON_DIR)/images else ifdef CONFIG_USE_SHM cp -pP skin/client/emulator-skin.jar $(DIBS_COMMON_DIR)/bin endif endif # check capabilities of OpenGL, Webcam and proxy cp -pP util/check-gl$(EXESUF) $(DIBS_COMMON_DIR)/bin cp -pP util/check-cam$(EXESUF) $(DIBS_COMMON_DIR)/bin cp -pP util/check-net$(EXESUF) $(DIBS_COMMON_DIR)/bin # Enable HW Virtualization on Linux ifdef CONFIG_LINUX cp -pP ../supplements/SDK/tizen-kvm $(DIBS_X86_DIR)/etc cp -pP ../supplements/SDK/45-tizen-kvm.rules $(DIBS_X86_DIR)/etc endif # check HW Virtualization on Windows and MAC OS X. ifndef CONFIG_LINUX cp -pP util/check-hax$(EXESUF) $(DIBS_COMMON_DIR)/bin endif # give a title name for sdb terminal. ifdef CONFIG_DARWIN cp -pP scripts/sdbscript $(DIBS_COMMON_DIR)/bin endif # use shared memory for display framebuffer ifdef CONFIG_USE_SHM ifdef CONFIG_LINUX cp -pP skin/client/native_src/libshared.so $(DIBS_COMMON_DIR)/bin endif ifdef CONFIG_DARWIN cp -pP skin/client/native_src/libshared.dylib $(DIBS_COMMON_DIR)/bin endif endif # use GTK for CopyToClipboard on Ubuntu 12.04 64bit ifdef CONFIG_LINUX cp -pP skin/client/native_src/clipboard.py $(DIBS_COMMON_DIR)/bin endif # change loading path of dynamic shared libraries on MAC OS X ifdef CONFIG_DARWIN install_name_tool -change /opt/local/lib/libgthread-2.0.*.dylib @loader_path/libgthread-2.0.0.dylib $(DIBS_COMMON_DIR)/bin/qemu-img install_name_tool -change /opt/local/lib/libglib-2.0.*.dylib @loader_path/libglib-2.0.0.dylib $(DIBS_COMMON_DIR)/bin/qemu-img install_name_tool -change /opt/local/lib/libintl.8.dylib @loader_path/libintl.8.dylib $(DIBS_COMMON_DIR)/bin/qemu-img install_name_tool -change /opt/local/lib/gcc47/libgcc_s.1.dylib @loader_path/libgcc_s.1.dylib $(DIBS_COMMON_DIR)/bin/qemu-img install_name_tool -change /opt/local/lib/libz.1.dylib @loader_path/libz.1.dylib $(DIBS_COMMON_DIR)/bin/qemu-img install_name_tool -change /opt/local/lib/libcurl.4.dylib @loader_path/libcurl.4.dylib $(DIBS_COMMON_DIR)/bin/qemu-img install_name_tool -change /opt/local/lib/libglib-2.0.*.dylib @loader_path/libglib-2.0.0.dylib $(DIBS_COMMON_DIR)/bin/check-gl install_name_tool -change /opt/local/lib/libintl.8.dylib @loader_path/libintl.8.dylib $(DIBS_COMMON_DIR)/bin/check-gl install_name_tool -change /opt/local/lib/gcc47/libgcc_s.1.dylib @loader_path/libgcc_s.1.dylib $(DIBS_COMMON_DIR)/bin/check-gl @for target in $(TARGET_DIRS); do \ case "$$target" in \ i386-softmmu) \ install_name_tool -change /opt/local/lib/libgthread-2.0.*.dylib @loader_path/libgthread-2.0.0.dylib $(DIBS_X86_DIR)/bin/emulator-x86 ;\ install_name_tool -change /opt/local/lib/libglib-2.0.*.dylib @loader_path/libglib-2.0.0.dylib $(DIBS_X86_DIR)/bin/emulator-x86 ;\ install_name_tool -change /opt/local/lib/libintl.8.dylib @loader_path/libintl.8.dylib $(DIBS_X86_DIR)/bin/emulator-x86 ;\ install_name_tool -change /opt/local/lib/gcc47/libgcc_s.1.dylib @loader_path/libgcc_s.1.dylib $(DIBS_X86_DIR)/bin/emulator-x86 ;\ install_name_tool -change /opt/local/lib/libz.1.dylib @loader_path/libz.1.dylib $(DIBS_X86_DIR)/bin/emulator-x86 ;\ install_name_tool -change /opt/local/lib/libncurses.5.dylib @loader_path/libncurses.5.dylib $(DIBS_X86_DIR)/bin/emulator-x86 ;\ install_name_tool -change /opt/local/lib/libcurl.4.dylib @loader_path/libcurl.4.dylib $(DIBS_X86_DIR)/bin/emulator-x86 ;\ install_name_tool -change /opt/local/lib/libpixman-1.0.dylib @loader_path/libpixman-1.0.dylib $(DIBS_X86_DIR)/bin/emulator-x86 ;\ install_name_tool -change /opt/local/lib/libpng16.16.dylib @loader_path/libpng16.dylib $(DIBS_X86_DIR)/bin/emulator-x86; \ ifdef CONFIG_QT install_name_tool -change /opt/local/Library/Frameworks/QtQml.framework/Versions/5/QtQml @loader_path/QtQml $(DIBS_X86_DIR)/bin/emulator-x86; \ install_name_tool -change /opt/local/Library/Frameworks/QtNetwork.framework/Versions/5/QtNetwork @loader_path/QtNetwork $(DIBS_X86_DIR)/bin/emulator-x86; \ install_name_tool -change /opt/local/Library/Frameworks/QtOpenGL.framework/Versions/5/QtOpenGL @loader_path/QtOpenGL $(DIBS_X86_DIR)/bin/emulator-x86; \ install_name_tool -change /opt/local/Library/Frameworks/QtWidgets.framework/Versions/5/QtWidgets @loader_path/QtWidgets $(DIBS_X86_DIR)/bin/emulator-x86; \ install_name_tool -change /opt/local/Library/Frameworks/QtGui.framework/Versions/5/QtGui @loader_path/QtGui $(DIBS_X86_DIR)/bin/emulator-x86; \ install_name_tool -change /opt/local/Library/Frameworks/QtCore.framework/Versions/5/QtCore @loader_path/QtCore $(DIBS_X86_DIR)/bin/emulator-x86; \ endif ;; \ arm-softmmu) \ ;; \ esac; \ done endif else all: @echo "Please call configure before running make!" @exit 1 endif