INSTALLDIR := usr/sbin
INITSCRIPTDIR := etc/init.d
RCSCRIPTDIR := etc/rc.d/rc3.d
+LAUNCH_SCRIPT := sdk_launch
UNAME := $(shell uname -sm)
ifneq (,$(findstring 86,$(UNAME)))
install :
mkdir -p $(DESTDIR)/$(INSTALLDIR)
install $(OBJDIR)/$(MODULE) $(DESTDIR)/$(INSTALLDIR)/$(MODULE)
+ install $(LAUNCH_SCRIPT) $(DESTDIR)/$(INSTALLDIR)/$(LAUNCH_SCRIPT)
ifeq ($(MODULE),sdbd)
mkdir -p $(DESTDIR)/$(INITSCRIPTDIR)
install script/sdbd $(DESTDIR)/$(INITSCRIPTDIR)/sdbd
--- /dev/null
+#!/bin/bash
+
+# Authors:
+# Kangho Kim <kh5325.kim@samsung.com>, Yoonki Park <yoonki.park@samsung.com>
+#
+# Description: front hand of app launcher
+
+APP_PATH_PREFIX=/opt/apps
+SDK_TOOLS_PATH=/home/developer/sdk_tools
+
+print_usage()
+{
+ echo "usage: $0 -p <pkgid> -e <executable> -m <run|debug|da|oprofile> [-P <port>] [-attach <pid>] -t <gtest,gcov> [<args...>]"
+}
+
+first="true"
+
+until [ -z "$1" ]; do
+ case "$1" in
+ -p)
+ if [ -z "$2" ]
+ then
+ print_usage
+ exit 1;
+ fi
+ pkgid=$2
+ shift 2;
+ ;;
+ -e)
+ if [ -z "$2" ]
+ then
+ print_usage
+ exit 1;
+ fi
+ exe=${2/%.exe/}
+ shift 2;
+ ;;
+ -m)
+ if [ "$2" != "run" ] && [ "$2" != "debug" ] && [ "$2" != "da" ] && [ "$2" != "oprofile" ]
+ then
+ print_usage
+ exit 1;
+ fi
+ mode=$2
+ shift 2;
+ ;;
+ -P)
+ if [ -z "$2" ]
+ then
+ print_usage
+ exit 1;
+ fi
+ port=$2
+ shift 2;
+ ;;
+ -attach)
+ if [ -z "$2" ]
+ then
+ print_usage
+ exit 1;
+ fi
+ attach_id=$2
+ shift 2;
+ ;;
+ -t)
+ if [ "$2" = "" ] || [ ${2:0:1} = "-" ]
+ then
+ shift 1;
+ else
+# parse -t option
+ OLD_IFS=$IFS;IFS=,;
+ for type in $2;do
+ if [ "$type" = "gtest" ]
+ then
+ COV_TEST_PREFIX="export LD_LIBRARY_PATH=%s/gtest/usr/lib && $COV_TEST_PREFIX"
+ if [ "" != "$result_mode" ]
+ then
+ result_mode="$result_mode,UNIT_TEST"
+ else
+ result_mode="OPROFILE,UNIT_TEST"
+ fi
+ fi
+ if [ "$type" = "gcov" ]
+ then
+ COV_TEST_PREFIX="export GCOV_PREFIX=/tmp/%s/data && export GCOV_PREFIX_STRIP=0 && $COV_TEST_PREFIX"
+ if [ "" != "$result_mode" ]
+ then
+ result_mode="$result_mode,CODE_COVERAGE"
+ else
+ result_mode="OPROFILE,CODE_COVERAGE"
+ fi
+ fi
+ done;
+ IFS=$OLD_IFS
+
+ shift 2;
+ fi
+ ;;
+ *)
+ if [ "$first" = "true" ]
+ then
+ first="false"
+ args="__DLP_UNIT_TEST_ARG__ $1"
+ else
+ args="$args","$1"
+ fi
+ shift 1;
+ esac
+done
+
+if [ "$mode" = "debug" ]
+then
+ if [ "" != "$attach_id" ]
+ #debug attach
+ then
+ cmd="$COV_TEST_PREFIX /home/developer/sdk_tools/gdbserver/gdbserver :$port --attach $attach_id"
+ #debug
+ else
+#debugging using debug_launchpad cmd="/usr/bin/launch_app $pkgid.$exe __AUL_SDK__ DEBUG __DLP_DEBUG_ARG__ :$port"
+ cmd="$COV_TEST_PREFIX /home/developer/sdk_tools/gdbserver/gdbserver :$port /opt/apps/$pkgid/bin/$exe"
+ fi
+else
+ if [ "$mode" = "run" ]
+ then
+ if [ "" != "$result_mode" ]
+ then
+ cmd="/usr/bin/launch_app $pkgid.$exe __AUL_SDK__ $result_mode $args"
+ else
+ cmd="/usr/bin/launch_app $pkgid.$exe"
+ fi
+ else
+ if [ "$mode" = "da" ]
+ then
+ if [ "" != "$result_mode" ]
+ then
+ result_mode="DYNAMIC_ANALYSIS,$result_mode"
+ else
+ result_mode="DYNAMIC_ANALYSIS"
+ fi
+ fi
+ if [ "$mode" = "oprofile" ]
+ then
+ if [ "" == "$result_mode" ]
+ then
+ result_mode="OPROFILE"
+ fi
+ fi
+ cmd="/usr/bin/launch_app $pkgid.$exe __AUL_SDK__ $result_mode $args"
+ fi
+fi
+
+# execute command
+echo $cmd
+#$cmd $args