tizen install: account for existing targets
authorIgor Mitsyanko <i.mitsyanko@samsung.com>
Wed, 27 Jun 2012 15:55:32 +0000 (19:55 +0400)
committerEvgeny Voevodin <e.voevodin@samsung.com>
Fri, 6 Jul 2012 07:59:40 +0000 (11:59 +0400)
Currently tizen's Makefile install target doesn't check what target emulators were actually
build and tries to install both x86 and ARM emulators. This results in error when only
one emulator was built.
This commit fixes this.

Signed-off-by: Igor Mitsyanko <i.mitsyanko@samsung.com>
tizen/src/Makefile

index bee84fe3b6bf2ebb4a49faed15a1a72b9bef1071..406ee2d5840430ad826d0560895e3eac386b1da3 100755 (executable)
@@ -47,26 +47,34 @@ distclean:
 install: all
        mkdir -p $(EMUL_DIR)/bin
        mkdir -p $(EMUL_DIR)/etc
-       mkdir -p $(EMUL_DIR)/x86
-       mkdir -p $(EMUL_DIR)/x86/data 
-       mkdir -p $(EMUL_DIR)/arm
-       mkdir -p $(EMUL_DIR)/arm/data
-       mkdir -p $(EMUL_DIR)/x86/data/pc-bios
-       cp ../../i386-softmmu/qemu-system-i386 $(EMUL_DIR)/bin/emulator-x86
-       cp ../../arm-softmmu/qemu-system-arm $(EMUL_DIR)/bin/emulator-arm
+       @for target in $(TARGET_DIRS); do \
+         case "$$target" in \
+         i386-softmmu) \
+           mkdir -p $(EMUL_DIR)/x86 ;\
+           mkdir -p $(EMUL_DIR)/x86/data ;\
+           mkdir -p $(EMUL_DIR)/x86/data/pc-bios ;\
+           cp ../../i386-softmmu/qemu-system-i386 $(EMUL_DIR)/bin/emulator-x86 ;\
+           cp -dpr ../../pc-bios/bios.bin $(EMUL_DIR)/x86/data/pc-bios ;\
+           cp -dpr ../../pc-bios/linuxboot.bin $(EMUL_DIR)/x86/data/pc-bios ;\
+           cp -dpr ../../pc-bios/pxe-rtl8139.rom $(EMUL_DIR)/x86/data/pc-bios ;\
+           cp -dpr ../../pc-bios/pxe-virtio.rom $(EMUL_DIR)/x86/data/pc-bios ;\
+           cp -dpr ../../pc-bios/vgabios-maruvga.bin $(EMUL_DIR)/x86/data/pc-bios \
+         ;; \
+         arm-softmmu) \
+           mkdir -p $(EMUL_DIR)/arm ;\
+           mkdir -p $(EMUL_DIR)/arm/data ;\
+           cp ../../arm-softmmu/qemu-system-arm $(EMUL_DIR)/bin/emulator-arm ; \
+           if [ ! -z "$$CONFIG_OPENGLES" ] ; then mkdir -p $(EMUL_DIR)/bin/lib ; \
+           cp -dpr ../../arm-softmmu/lib/gles $(EMUL_DIR)/bin/lib ; \
+           fi \
+         ;; \
+         esac \
+       done
        cp skin/client/emulator-skin.jar $(EMUL_DIR)/bin
-       @if test -d "../../arm-softmmu/lib/gles"; then \
-       mkdir -p $(EMUL_DIR)/bin/lib; cp -dpr ../../arm-softmmu/lib/gles $(EMUL_DIR)/bin/lib; fi
 ifdef CONFIG_WIN32
        cp check-hax.exe $(EMUL_DIR)/bin
-else
-       
 endif
        cp ../../qemu-img $(EMUL_DIR)/bin
        cp -dpr skin/client/skins $(EMUL_DIR)
        cp -dpr ../license $(EMUL_DIR)
-       cp -dpr ../../pc-bios/bios.bin $(EMUL_DIR)/x86/data/pc-bios
-       cp -dpr ../../pc-bios/linuxboot.bin $(EMUL_DIR)/x86/data/pc-bios
-       cp -dpr ../../pc-bios/pxe-rtl8139.rom $(EMUL_DIR)/x86/data/pc-bios
-       cp -dpr ../../pc-bios/pxe-virtio.rom $(EMUL_DIR)/x86/data/pc-bios
-       cp -dpr ../../pc-bios/vgabios-maruvga.bin $(EMUL_DIR)/x86/data/pc-bios
+