zte's code,first commit
Change-Id: I9a04da59e459a9bc0d67f101f700d9d7dc8d681b
diff --git a/cp/ps/build/frame/compiler/gcc_arm_linux.mk b/cp/ps/build/frame/compiler/gcc_arm_linux.mk
new file mode 100755
index 0000000..93db917
--- /dev/null
+++ b/cp/ps/build/frame/compiler/gcc_arm_linux.mk
@@ -0,0 +1,134 @@
+# /*****************************************************************************
+#* °æÈ¨ËùÓÐ (C)2014, ÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾¡£
+#*
+#* ÎļþÃû³Æ: gcc_arm_linux.mk
+#* Îļþ±êʶ: gcc_arm_linux.mk
+#* ÄÚÈÝÕªÒª: linux gcc±àÒëÆ÷ÅäÖÃÎļþ
+#* ʹÓ÷½·¨: include gcc_arm_linux.mk
+#*
+#* ÐÞ¸ÄÈÕÆÚ °æ±¾ºÅ Ð޸ıê¼Ç ÐÞ¸ÄÈË ÐÞ¸ÄÄÚÈÝ
+#* -----------------------------------------------------------------------------
+#* 2014/09/09 V1.0 Create ÁõÑÇÄÏ ´´½¨
+#*
+# ******************************************************************************/
+
+#===============================================================================
+# compiler tools path, CROSS_COMPILE_ROOT is set in root Makefile
+#===============================================================================
+GCC_ROOT = $(CROSS_COMPILE_ROOT)
+GCC_BIN = $(GCC_ROOT)/bin
+GCC_LIB = $(GCC_ROOT)/lib
+
+#===============================================================================
+# compiler tools setup
+#===============================================================================
+CC = $(GCC_BIN)/$(CROSS_COMPILE_PREFIX)gcc
+CXX = $(GCC_BIN)/$(CROSS_COMPILE_PREFIX)gcc
+ASM = $(GCC_BIN)/$(CROSS_COMPILE_PREFIX)as
+AR = $(GCC_BIN)/$(CROSS_COMPILE_PREFIX)ar
+AR2 = $(GCC_BIN)/$(CROSS_COMPILE_PREFIX)gcc-ar
+LD = $(GCC_BIN)/$(CROSS_COMPILE_PREFIX)ld
+ELF2BIN = $(GCC_BIN)/$(CROSS_COMPILE_PREFIX)objcopy
+ELF2SYM = $(GCC_BIN)/$(CROSS_COMPILE_PREFIX)nm
+
+#===============================================================================
+# C include path setup
+#===============================================================================
+INCLUDE = -I$(LINUX_ROOT)/arch/arm/include \
+ -I$(LINUX_ROOT)/arch/arm/include/uapi \
+ -I$(LINUX_ROOT)/arch/arm/include/generated \
+ -I$(LINUX_ROOT)/include \
+ -I$(LINUX_ROOT)/include/uapi \
+ -I$(LINUX_ROOT)/kernel \
+ -include $(LINUX_ROOT)/include/linux/kconfig.h \
+ -I$(LINUX_ROOT)/arch/arm/mach-$(PRJ_NAME)/include
+
+#===============================================================================
+# C++ STL(standard template library) include path setup
+#===============================================================================
+STDINCLUDE +=
+
+#===============================================================================
+# gcc flags setup
+#===============================================================================
+export CCFLAGS = -nostdinc -isystem $(CROSS_COMPILE_INCLUDE)
+export CCFLAGS += -mlittle-endian -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common
+export CCFLAGS += -Wno-format-security -fno-delete-null-pointer-checks
+#export CCFLAGS += -marm -fno-dwarf2-cfi-asm -mabi=aapcs-linux -mno-thumb-interwork -funwind-tables
+export CCFLAGS += -fno-dwarf2-cfi-asm -mabi=aapcs-linux
+ifeq ($(CONFIG_MIN_8M_VERSION), n)
+CCFLAGS += -funwind-tables
+endif
+export CCFLAGS += -msoft-float -Uarm -Wframe-larger-than=1024 -fno-stack-protector
+export CCFLAGS += -Wno-unused-but-set-variable -fomit-frame-pointer -g -fno-inline-functions-called-once
+export CCFLAGS += -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack
+export CCFLAGS += -Wno-redundant-decls -Wno-write-strings
+export CCFLAGS += -march=$(CPU_ARCH) -mno-unaligned-access
+#export CCFLAGS += -finstrument-functions
+
+export CCFLAGS += -fno-short-enums -fsigned-char -fstrict-volatile-bitfields
+export CCFLAGS += -fno-schedule-insns -fno-schedule-insns2
+export CCFLAGS += -Wfatal-errors -Wno-declaration-after-statement -Wno-unused-value
+export CCFLAGS += -Wno-unused-variable -Wno-unused-function -Wno-missing-braces
+export CCFLAGS += -Wno-unknown-pragmas -Wno-format-extra-args
+export CCFLAGS += -D__KERNEL__ -D__LINUX_ARM_ARCH__=7
+
+ifeq ($(THUMB), yes)
+export CCFLAGS += -mthumb -mthumb-interwork -Wa,-mimplicit-it=thumb
+ifeq ($(USE_CPPS_KO), yes)
+export CCFLAGS += -mlong-calls
+endif
+else
+export CCFLAGS += -marm
+endif
+
+ifeq ($(CONFIG_MIN_8M_VERSION), y)
+export CCFLAGS += -ffunction-sections
+endif
+
+export CCFLAGS += -Wl,--gc-sections
+export CCFLAGS += -g -Os -MD -c
+export CXXFLAGS = $(CCFLAGS)
+
+#===============================================================================
+# assembler flags setup
+#===============================================================================
+ASFLAGS = -march=$(CPU_ARCH)
+
+#===============================================================================
+# archieve flags setup
+#===============================================================================
+ARFLAGS = -rcs
+ARFLAGS2 = rcSTPD
+
+
+#===============================================================================
+# library include path setup
+#===============================================================================
+LDFLAG = -Wl,--no-check-sections -nostartfiles -L$(GCC_LIB) -T$(PRJ_PATH)/ws/dosmake/makefw/os/tos/tos.ld
+
+#===============================================================================
+# ld setup
+#===============================================================================
+LDOUT =
+LDMAP =
+
+#===============================================================================
+# elf to binary flags setup
+#===============================================================================
+ELF2BINOUT = -O binary
+
+#===============================================================================
+# elf to symbol flags setup
+#===============================================================================
+ELF2SYMOUT = -nCS --size-sort
+
+#===============================================================================
+# user defintion
+#===============================================================================
+export PLAT_GCC_OPTIMIZE = -O2
+export COM_GCC_OPTIMIZE = -O2
+export DRV_GCC_OPTIMIZE = -O2
+export PS_GCC_OPTIMIZE = -O2
+export TOOLS_GCC_OPTIMIZE = -O2
+
diff --git a/cp/ps/build/frame/compiler/gcc_arm_tos.mk b/cp/ps/build/frame/compiler/gcc_arm_tos.mk
new file mode 100644
index 0000000..80c9f68
--- /dev/null
+++ b/cp/ps/build/frame/compiler/gcc_arm_tos.mk
@@ -0,0 +1,100 @@
+# /*****************************************************************************
+#* °æÈ¨ËùÓÐ (C)2010, ÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾¡£
+#*
+#* ÎļþÃû³Æ: gcc_arm_tos.mk
+#* Îļþ±êʶ: gcc_arm_tos.mk
+#* ÄÚÈÝÕªÒª: tos gcc±àÒëÆ÷ÅäÖÃÎļþ
+#* ʹÓ÷½·¨: include gcc_arm.mk
+#*
+#* ÐÞ¸ÄÈÕÆÚ °æ±¾ºÅ Ð޸ıê¼Ç ÐÞ¸ÄÈË ÐÞ¸ÄÄÚÈÝ
+#* -----------------------------------------------------------------------------
+#* 2011/01/05 V1.0 Create ÁõÑÇÄÏ ´´½¨
+#*
+# ******************************************************************************/
+
+#===============================================================================
+# compiler tools path, TOS_GCC_ROOT is set in build_eCos.bat
+#===============================================================================
+GCC_ROOT = $(TOS_GCC_ROOT)
+GCC_BIN = $(GCC_ROOT)/$(TOS_GCC_PATH)/bin
+GCC_LIB = $(TOS_LIB)
+
+#===============================================================================
+# compiler tools setup
+#===============================================================================
+CC = $(GCC_BIN)/$(TOS_COMMAND_PREFIX)gcc
+CXX = $(GCC_BIN)/$(TOS_COMMAND_PREFIX)gcc
+ASM = $(GCC_BIN)/$(TOS_COMMAND_PREFIX)as
+AR = $(GCC_BIN)/$(TOS_COMMAND_PREFIX)ar
+LD = $(GCC_BIN)/$(TOS_COMMAND_PREFIX)ld
+ELF2BIN = $(GCC_BIN)/$(TOS_COMMAND_PREFIX)objcopy
+ELF2SYM = $(GCC_BIN)/$(TOS_COMMAND_PREFIX)nm
+
+#===============================================================================
+# C include path setup
+#===============================================================================
+INCLUDE = -I$(ZP_ROOT)/ \
+ -I$(TOS_INC) \
+ -I$(TOS_INC)/$(CPU_ARCH)
+
+#===============================================================================
+# C++ STL(standard template library) include path setup
+#===============================================================================
+STDINCLUDE +=
+
+#===============================================================================
+# gcc flags setup
+#===============================================================================
+export CCFLAGS = -I$(TOS_INC) \
+ -I$(TOS_INC)/$(CPU_ARCH)
+export CCFLAGS += -Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Wno-write-strings -Wno-missing-braces -Wno-redundant-decls -Wfatal-errors
+export CCFLAGS += -fdata-sections -fno-exceptions -fshort-enums -fsigned-char -fno-schedule-insns -fno-schedule-insns2 -fstrict-volatile-bitfields
+export CCFLAGS += -march=$(CPU_ARCH) -mno-unaligned-access
+#export CCFLAGS += -finstrument-functions
+ifeq ($(THUMB), yes)
+export CCFLAGS += -mthumb
+endif
+export CCFLAGS += -Wl,--gc-sections
+export CCFLAGS += -g -O2 -MD -c
+export CXXFLAGS = $(CCFLAGS)
+
+#===============================================================================
+# assembler flags setup
+#===============================================================================
+ASFLAGS = -march=$(CPU_ARCH)
+
+#===============================================================================
+# archieve flags setup
+#===============================================================================
+ARFLAGS = -rcs
+
+#===============================================================================
+# library include path setup
+#===============================================================================
+LDFLAG = -Wl,--no-check-sections -nostartfiles -L$(GCC_LIB) -T$(OBJ_PATH)/os/tos/tos.ld
+
+#===============================================================================
+# ld setup
+#===============================================================================
+LDOUT =
+LDMAP =
+
+#===============================================================================
+# elf to binary flags setup
+#===============================================================================
+ELF2BINOUT = -O binary
+
+#===============================================================================
+# elf to symbol flags setup
+#===============================================================================
+ELF2SYMOUT = -nCS --size-sort
+
+#===============================================================================
+# user defintion
+#===============================================================================
+export PLAT_GCC_OPTIMIZE = -O2
+export COM_GCC_OPTIMIZE = -O2
+export DRV_GCC_OPTIMIZE = -O2
+export PS_GCC_OPTIMIZE = -O2
+export TOOLS_GCC_OPTIMIZE = -O2
+
diff --git a/cp/ps/build/frame/compiler/gcc_csky.mk b/cp/ps/build/frame/compiler/gcc_csky.mk
new file mode 100644
index 0000000..e37fa4b
--- /dev/null
+++ b/cp/ps/build/frame/compiler/gcc_csky.mk
@@ -0,0 +1,86 @@
+# /*****************************************************************************
+#* °æÈ¨ËùÓÐ (C)2010, ÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾¡£
+#*
+#* ÎļþÃû³Æ: gcc_csky.mk
+#* Îļþ±êʶ: gcc_csky.mk
+#* ÄÚÈÝÕªÒª: ºË¸ß»ùgcc±àÒëÆ÷ÅäÖÃÎļþ
+#* ʹÓ÷½·¨: include gcc_csky.mk
+#*
+#* ÐÞ¸ÄÈÕÆÚ °æ±¾ºÅ Ð޸ıê¼Ç ÐÞ¸ÄÈË ÐÞ¸ÄÄÚÈÝ
+#* -----------------------------------------------------------------------------
+#* 2011/11/01 V1.0 Create ÁõÑÇÄÏ ´´½¨
+#*
+# ******************************************************************************/
+
+#===============================================================================
+# compiler tools path, TOS_GCC_ROOT is set in build_eCos.bat
+#===============================================================================
+GCC_ROOT = $(TOS_GCC_ROOT)
+GCC_BIN = $(GCC_ROOT)/$(TOS_GCC_PATH)/bin
+GCC_LIB = $(TOS_LIB)
+
+#===============================================================================
+# compiler tools setup
+#===============================================================================
+CC = $(GCC_BIN)/$(TOS_COMMAND_PREFIX)gcc
+CXX = $(GCC_BIN)/$(TOS_COMMAND_PREFIX)gcc
+ASM = $(GCC_BIN)/$(TOS_COMMAND_PREFIX)as
+AR = $(GCC_BIN)/$(TOS_COMMAND_PREFIX)ar
+LD = $(GCC_BIN)/$(TOS_COMMAND_PREFIX)ld
+ELF2BIN = $(GCC_BIN)/$(TOS_COMMAND_PREFIX)objcopy
+
+#===============================================================================
+# C include path setup
+#===============================================================================
+INCLUDE = -I$(ZP_ROOT)/ \
+ -I$(TOS_INC) \
+ -I$(TOS_INC)/$(CPU_ARCH)
+
+
+#===============================================================================
+# C++ STL(standard template library) include path setup
+#===============================================================================
+STDINCLUDE +=
+
+#===============================================================================
+# gcc flags setup
+#===============================================================================
+export CCFLAGS = -I$(GCC_INC) -Wall -Wstrict-prototypes -Winline -Wundef -Wa,-mfpf -Wl,--gc-sections -g -c -Os -fdata-sections -fno-exceptions -fshort-enums -fsigned-char -msoft-float -mcpu=$(CPU_ARCH)
+export CXXFLAGS = $(CCFLAGS)
+
+#===============================================================================
+# assembler flags setup
+#===============================================================================
+ASFLAGS = -mcpu=$(CPU_ARCH)
+
+#===============================================================================
+# archieve flags setup
+#===============================================================================
+ARFLAGS = -rcs
+#ARFLAGS = -r -o
+
+#===============================================================================
+# library include path setup
+#===============================================================================
+LDFLAG = -nostartfiles -L$(GCC_LIB) -Ttarget.ld
+
+#===============================================================================
+# ld setup
+#===============================================================================
+LDOUT =
+LDMAP =
+
+#===============================================================================
+# elf to binary tools setup
+#===============================================================================
+ELF2BINOUT = -O binary
+
+#===============================================================================
+# user defintion
+#===============================================================================
+export PLAT_GCC_OPTIMIZE = -O2
+export COM_GCC_OPTIMIZE = -O2
+export DRV_GCC_OPTIMIZE = -O2
+export PS_GCC_OPTIMIZE = -O2
+export TOOLS_GCC_OPTIMIZE = -O2
+
diff --git a/cp/ps/build/frame/compiler/msvc.mk b/cp/ps/build/frame/compiler/msvc.mk
new file mode 100644
index 0000000..bd41bf6
--- /dev/null
+++ b/cp/ps/build/frame/compiler/msvc.mk
@@ -0,0 +1,412 @@
+# ------------------------------------------------------------------------ #
+# Compiler makefile for Microsoft Visual C++ 6.0 #
+# ------------------------------------------------------------------------ #
+.PHONY :
+
+# ------------------------------------------------------------------------ #
+# Compiler tools
+# ------------------------------------------------------------------------ #
+CC = cl.exe
+CPP = cl.exe
+THUMBCC = cl.exe
+THUMBCPP = cl.exe
+ASM =
+LINK = link.exe
+CONV =
+AR = lib.exe
+
+
+
+# ---------------------------------------------------------------------------
+# Apply Rational Realtime when CODECOVERAGE=YES
+# ---------------------------------------------------------------------------
+# todo: for backward compatibility, should be removed later
+ifeq '$(DEBUGINFO)' ''
+ ifeq '$(BUILDMODE)' 'DEBUG'
+ DEBUGINFO=YES
+ endif
+endif
+
+ifeq '${CODECOVERAGE}' 'YES'
+ifeq '${TESTENVIRONMENT}' 'URRCM'
+ifneq '$(findstring ${BUILD_LIB},urrc urrcbp urrcdc urrcm)' ''
+CC = attolcc -proc=ret -call -block=logical -cond=modified -count --atl_multi_treads=1 -- cl.exe
+endif # ifneq '$(findstring ${BUILD_LIB},urrc urrcbp urrcdc urrcm)' ''
+endif # ifeq '${TESTENVIRONMENT}' 'URRCM'
+
+ifeq '${TESTENVIRONMENT}' 'UPDCP'
+ifneq '$(findstring ${BUILD_LIB},urabmupdcp sif)' ''
+CC = attolcc -proc=ret -call -block=logical -cond=modified -count --atl_multi_treads=1 -- cl.exe
+endif # ifneq '$(findstring ${BUILD_LIB},urabmupdcp sif)' ''
+endif # ifeq '${TESTENVIRONMENT}' 'UPDCP'
+
+ifeq '${TESTENVIRONMENT}' 'URLC'
+ifneq '$(findstring ${BUILD_LIB},urlcc urlcdl urlcul)' ''
+CC = attolcc -proc=ret -call -block=logical -cond=modified -count --atl_multi_treads=1 -- cl.exe
+endif # ifneq '$(findstring ${BUILD_LIB},urlcc urlcdl urlcul)' ''
+endif # ifeq '${TESTENVIRONMENT}' 'URLC'
+
+ifeq '${TESTENVIRONMENT}' 'UMAC'
+ifneq '$(findstring ${BUILD_LIB},umac security ugdci)' ''
+CC = attolcc -proc=ret -call -block=logical -cond=modified -count --atl_multi_treads=1 -- cl.exe
+endif # ifneq '$(findstring ${BUILD_LIB},umac security ugdci)' ''
+endif # ifeq '${TESTENVIRONMENT}' 'UMAC'
+
+ifeq '${TESTENVIRONMENT}' 'USIM'
+ifneq '$(findstring ${BUILD_LIB},usim)' ''
+CC = attolcc -proc=ret -call -block=logical -cond=modified -count --atl_multi_treads=1 -- cl.exe
+endif # ifneq '$(findstring ${BUILD_LIB},usim)' ''
+endif # ifeq '${TESTENVIRONMENT}' 'USIM'
+
+endif # ifeq '${CODECOVERAGE}' 'YES'
+
+# ------------------------------------------------------------------------ #
+# Extensions for standard files
+# ------------------------------------------------------------------------ #
+OBJFILEEXT = obj
+DEPFILEEXT = dep
+OUTPUTFILEEXT = exe
+SRCFILEEXT = src
+MAPFILEEXT = map
+LIBFILEEXT = lib
+ERRFILEEXT = err
+SBRFILEEXT = sbr
+PDBFILEEXT = pdb
+
+CC_DEFPREFIX = -D
+CC_INCPREFIX = -I
+
+export COMPILER_VERSION := $(shell $(CC) 2>&1 | $(SED) -n "s/.*Version *\([0-9]*\).*/\1/p")
+
+msvc_version :
+ -@$(ECHO) "COMPILER VERSION: $(COMPILER_VERSION)"
+
+
+# ======================================================================== #
+# Common compiler switches for C and C++ compiler
+# ======================================================================== #
+CC_CPP_OPTIONS = /nologo # no logo and info messages
+
+ifeq '$(WARNINGS)' 'YES'
+ CC_CPP_OPTIONS += /W3 # Warning level 3 - recommended for production purposes
+else
+ifeq '$(WARNINGS)' 'NO'
+ CC_CPP_OPTIONS += /W0 # Warning level 0 - disable all warnings
+else
+ CC_CPP_OPTIONS += /W3 # Warning level 3 - default
+endif
+endif
+
+CC_CPP_OPTIONS += /c # compile without linking
+CC_CPP_OPTIONS += /Od # no optimization, speed compilation, debugging
+CC_CPP_OPTIONS += ${CC_DEFPREFIX}_MBCS # default define:
+CC_CPP_OPTIONS += ${CC_DEFPREFIX}_MSC # default define:
+CC_CPP_OPTIONS += ${CC_DEFPREFIX}_CONSOLE # default define:
+CC_CPP_OPTIONS += ${CC_DEFPREFIX}_LIB # default define:
+CC_CPP_OPTIONS += ${CC_DEFPREFIX}_Windows # default define:
+CC_CPP_OPTIONS += ${CC_DEFPREFIX}MSVCWIN # default define:
+CC_CPP_OPTIONS += ${CC_DEFPREFIX}_WIN32 # default define:
+
+ifeq '$(DEBUGINFO)' 'YES' # --- debug info
+ CC_CPP_OPTIONS += ${CC_DEFPREFIX}_DEBUG
+ CC_CPP_OPTIONS += /MTd # multithread debug
+ ifeq '$(COMPILER_VERSION)' '14'
+ CC_CPP_OPTIONS += /RTC1 # catch release build errors
+ else
+ CC_CPP_OPTIONS += /GZ # catch release build errors
+ endif
+ CC_CPP_OPTIONS += /Zi # create additional debug library
+ CC_CPP_OPTIONS += /Fd${LIBDIR}/$(basename ${BUILD_LIB}).${PDBFILEEXT} # location of PDB library
+else # --- release mode
+ CC_CPP_OPTIONS += /MT # multithread
+ CC_CPP_OPTIONS += /Gi- # dissable incremental compilation
+endif
+
+ifneq '$(TESTENVIRONMENT)' ''
+ CC_CPP_OPTIONS += /D__thumb # compile test build like target build
+ CC_CPP_OPTIONS += /DUNITEST # define UniTest build
+ CC_CPP_OPTIONS += /DSID_DEFINED #
+ CC_CPP_OPTIONS += /DWIN32_LEAN_AND_MEAN # don't include unwanted Microsoft specific header files
+ CC_CPP_OPTIONS += /DNOGDI # ditto
+ CC_CPP_OPTIONS += /DNOCRYPT # ditto
+endif
+
+# --- add compiler and library specific compile switches
+CC_CPP_OPTIONS += ${MSVC_OPTIONS} $(MSVC_CC_CPP_OPTIONS_$(BUILD_LIB))
+
+# --- assembler files - not used yet
+ifneq '$(ASMCODEGEN)' ''
+endif
+
+# --- the *_CMD variable contains options that may not go into via-file
+CC_CPP_OPTIONS_CMD += /Fo${OBJDIR}/${BUILD_LIB}/$(@F) # specifiy obj name
+CC_CPP_OPTIONS_CMD += $(subst \,/,$<) # source file
+ifneq '$(TESTENVIRONMENT)' ''
+ CC_CPP_OPTIONS_CMD += /FR${SBRDIR}/${BUILD_LIB}/$(basename ${@F}).${SBRFILEEXT} # create browse info file
+endif
+ifeq '${ERRORLOG}' 'YES'
+ CC_CPP_OPTIONS_CMD += 2>&1 > ${ERRDIR}/${BUILD_LIB}/$(basename ${@F}).${ERRFILEEXT}
+endif
+
+
+# ======================================================================== #
+# C and C++ specific compiler switches
+# ======================================================================== #
+CC_INCL = $(strip $(addprefix ${CC_INCPREFIX}, \
+ ${CC_INCLUDE} \
+ ${${BUILD_LIB}_INC} \
+ ) )
+CC_DEF = $(strip $(addprefix ${CC_DEFPREFIX},$(SYSTEM_DEFS) \
+ ${L1_DEFS} \
+ ${CC_DEFS} \
+ ${CCC_DEFS_PLATFORM} ) )
+CPP_INCL = $(strip $(addprefix ${CC_INCPREFIX}, \
+ ${CPP_INCLUDE} \
+ ${${BUILD_LIB}_INC}\
+ ) )
+CPP_DEF = $(strip $(addprefix ${CC_DEFPREFIX},${SYSTEM_DEFS} \
+ ${L1_DEFS} \
+ ${CPP_DEFS} \
+ ${CPP_DEFS_PLATFORM} ) )
+
+CC_OPTIONS = ${CC_INCL} ${CC_DEF} ${MSVC_CC_OPTIONS} $(MSVC_CC_OPTIONS_$(BUILD_LIB))
+CPP_OPTIONS = ${CPP_INCL} ${CPP_DEF} ${MSVC_CPP_OPTIONS} $(MSVC_CPP_OPTIONS_$(BUILD_LIB))
+CPP_OPTIONS+= -we4150 # turn warning C4150 into error since it's to serious
+
+# precompiled header are only supported for cpp
+ifeq '$(findstring hpp,${PCH_FILE})' 'hpp'
+ PCH_FILENAME = ${OBJDIR}/$(BUILD_LIB)/$(basename $(PCH_BUILD_FILE)).pch
+ # add pch-options to source-options
+ PCH_USE_OPTIONS += /Yu${PCH_FILE} /Fp${PCH_FILENAME}
+ # build specific pch-options
+ PCH_CREATE_OPTIONS += /Yc${PCH_FILE} /Fp${PCH_FILENAME}
+endif
+
+
+# ======================================================================== #
+# combining, via files
+# ======================================================================== #
+CC_COMPLETE_TMP = ${CC_CPP_OPTIONS} ${CC_OPTIONS}
+CPP_COMPLETE_TMP = ${CC_CPP_OPTIONS} ${CPP_OPTIONS} ${PCH_USE_OPTIONS}
+PCH_COMPLETE_TMP = ${CC_CPP_OPTIONS} ${CPP_OPTIONS} ${PCH_CREATE_OPTIONS}
+
+ifeq '${VIAFILE}' 'YES'
+ VIA_CC_COMPLETE = ${CC_COMPLETE_TMP}
+ VIA_CPP_COMPLETE = ${CPP_COMPLETE_TMP}
+ VIA_PCH_COMPLETE = ${PCH_COMPLETE_TMP}
+ CC_COMPLETE = @${OBJDIR}/${BUILD_LIB}/cc.via
+ CPP_COMPLETE = @${OBJDIR}/${BUILD_LIB}/cpp.via
+ PCH_COMPLETE = @${OBJDIR}/${BUILD_LIB}/pch.via
+else
+ CC_COMPLETE = ${CC_COMPLETE_TMP}
+ CPP_COMPLETE = ${CPP_COMPLETE_TMP}
+ PCH_COMPLETE = ${PCH_COMPLETE_TMP}
+endif # VIAFILE
+
+
+# ======================================================================== #
+# command lines
+# ======================================================================== #
+ASM_CMDLINE = # we're not using an assembler on win32
+ifeq '$(ERRORLOG)' 'YES'
+ CMDLINE_ERROR_POSTPROC=|| ( $(CAT) ${ERRDIR}/${BUILD_LIB}/$(basename ${@F}).${ERRFILEEXT} && exit 3)
+endif
+
+ASM_CMDLINE = # we're not using an assembler on win32
+CC_CMDLINE = $(strip ${CC} ${CC_COMPLETE} ${CC_CPP_OPTIONS_CMD} ) $(CMDLINE_ERROR_POSTPROC)
+CPP_CMDLINE = $(strip ${CPP} ${CPP_COMPLETE} ${CC_CPP_OPTIONS_CMD} ) $(CMDLINE_ERROR_POSTPROC)
+PCH_CMDLINE = $(strip ${CPP} ${PCH_COMPLETE} ${CC_CPP_OPTIONS_CMD} ) $(CMDLINE_ERROR_POSTPROC)
+
+
+
+# no specific THUMB-stuff!
+THUMBCC_CMDLINE = ${CC_CMDLINE}
+THUMBCPP_CMDLINE = ${CPP_CMDLINE}
+
+
+# ------------------------------------------------------------------------ #
+# Howto make dependencies per file
+# ------------------------------------------------------------------------ #
+# jwo: dep/file deactivated as we build dep-file on a per-lib base
+ifeq '0' '1'
+CC_MAKEDEP_CMDLINE = ${MKDEP} \
+ $(addprefix /I ,$(subst /,\,${${BUILD_LIB}_INC})) \
+ /T "" \
+ /X \
+ /o $(subst /,\,${DEPDIR}/${BUILD_LIB}/${BUILD_LIB}.${DEPFILEEXT}) \
+ $(subst /,\,$^)
+THUMBCC_MAKEDEP_CMDLINE = ${CC_MAKEDEP_CMDLINE}
+CPP_MAKEDEP_CMDLINE = ${CC_MAKEDEP_CMDLINE}
+THUMBCPP_MAKEDEP_CMDLINE = ${CC_MAKEDEP_CMDLINE}
+endif
+
+# ------------------------------------------------------------------------ #
+# How to run the SDL code generation
+# ------------------------------------------------------------------------ #
+runsdlcmd:
+ $(SDL_MAKE_CMD)
+
+
+# ------------------------------------------------------------------------ #
+# Target rule for 'all'
+# ------------------------------------------------------------------------ #
+ifeq '${SDLCODEGEN}' 'YES'
+ all: runsdlcmd runsdlscr config createdirs ${MAKEDIR}/${PROJECTNAME}.${OUTPUTFILEEXT}
+else # SDLCODEGEN
+ ifeq '${SDLSCR}' 'YES'
+ all: runsdlscr config createdirs ${MAKEDIR}/${PROJECTNAME}.${OUTPUTFILEEXT}
+ else # SDLSCR
+ all: config createdirs ${MAKEDIR}/${PROJECTNAME}.${OUTPUTFILEEXT}
+ endif # SDL source code reduction
+endif # SDLCODEGEN
+
+
+# ------------------------------------------------------------------------ #
+# creating the .lib
+# ------------------------------------------------------------------------ #
+L_OPTIONS = /nologo
+LINKER_CMDLINE=${AR}
+FILTEROUTFILE = $(notdir $(LIB_DEPFILE)) # jwo probably using $^ instead of ^F would be smarter
+ifeq '${VIAFILE}' 'YES'
+ LINKER_CMDLINE += @${OBJDIR}/${BUILD_LIB}/lib.via
+ VIA_LIB_COMPLETE = \
+ ${L_OPTIONS} \
+ /MACHINE:IX86 \
+ /out:${LIBDIR}/${BUILD_LIB}.${LIBFILEEXT} \
+ $(addprefix ${OBJDIR}/${BUILD_LIB}/,$(filter-out ${FILTEROUTFILE},$(^F))) \
+ ${OBJSTOLINK}
+else
+ LINKER_CMDLINE += \
+ ${L_OPTIONS} \
+ /MACHINE:IX86 \
+ /out:${LIBDIR}/${BUILD_LIB}.${LIBFILEEXT} \
+ $(addprefix ${OBJDIR}/${BUILD_LIB}/,$(filter-out ${FILTEROUTFILE},$(^F))) \
+ ${OBJSTOLINK}
+endif
+
+
+# ------------------------------------------------------------------------ #
+# Linker
+# ------------------------------------------------------------------------ #
+L_FLAGS = /subsystem:console
+L_FLAGS += /machine:I386
+L_FLAGS += /pdbtype:sept
+L_FLAGS += /verbose:lib
+L_FLAGS += /nodefaultlib:libc.lib
+L_FLAGS += /nodefaultlib:libcd.lib
+L_FLAGS += /nodefaultlib:libcmt.lib
+L_FLAGS += /nodefaultlib:libcmtd.lib
+
+L_STANDARDLIBS = # init
+ifeq '$(DEBUGINFO)' 'YES'
+ L_STANDARDLIBS += libcmtd.lib
+else
+ L_STANDARDLIBS += libcmt.lib
+endif
+L_STANDARDLIBS += kernel32.lib
+L_STANDARDLIBS += user32.lib
+L_STANDARDLIBS += ws2_32.lib
+L_STANDARDLIBS += netapi32.lib
+L_STANDARDLIBS += comctl32.lib
+L_STANDARDLIBS += gdi32.lib
+L_STANDARDLIBS += comdlg32.lib
+L_STANDARDLIBS += advapi32.lib
+L_STANDARDLIBS += winmm.lib
+L_STANDARDLIBS += imagehlp.lib
+L_STANDARDLIBS += shell32.lib
+
+# todo: check & fix this, why do apoxi need DEBUG always?
+ifeq '$(findstring APOXI,${APPLICATIONS})' 'APOXI'
+ L_FLAGS += /DEBUG
+else # APOXI
+ ifeq '$(DEBUGINFO)' 'YES'
+ L_FLAGS += /DEBUG
+ else
+ ifeq '$(findstring ${BUILD_LIB},${DEBUGLIBS})' '${BUILD_LIB}'
+ L_FLAGS += /DEBUG
+ endif # DEBUGMODE
+ endif # DEBUGMODE
+endif # APOXI
+
+
+# ------------------------------------------------------------------------ #
+# Target rule for 'link'ing executable
+# ------------------------------------------------------------------------ #
+ARC_CMDLINE = ${LINK} ${L_FLAGS}
+ARC_CMDLINE += /out:${MAKEDIR}/${PROJECTNAME}.${OUTPUTFILEEXT}
+ifeq '$(DEBUGINFO)' 'YES'
+ ARC_CMDLINE += /pdb:${MAKEDIR}/${PROJECTNAME}.pdb
+endif
+ARC_CMDLINE += /libpath:${LIBDIR}
+ARC_CMDLINE += /libpath:${GLOBALPATH}/stack-interface/sdl/msvc50
+ARC_CMDLINE += ${L_STANDARDLIBS}
+ARC_CMDLINE += ${LIBSTOBUILD} ${LIBSTOLINK}
+
+link: ${MAKEDIR}/sys_version.c
+ $(ECHO) Creating executable $(MAKEDIR)/$(PROJECTNAME).${OUTPUTFILEEXT} ...
+ ${ARC_CMDLINE}
+ifneq '${CMDPEREXE}' ''
+ ${CMDPEREXE}
+endif # CMDPEREXE
+
+
+# ------------------------------------------------------------------------ #
+# Rule to build the executable
+# ------------------------------------------------------------------------ #
+${MAKEDIR}/${PROJECTNAME}.${OUTPUTFILEEXT} : ${LIBSTOBUILD}
+ $(MAKE) link
+
+
+
+# ------------------------------------------------------------------------
+# create a dependency file per lib
+# msvc doesn't provide dep-generation so mkdep.exe (comneon-made, not to be
+# mixed up with gnu's mkdep) is used
+# there is one dependency file per library <lib>.dep
+# ------------------------------------------------------------------------
+#
+ifneq '$(DEPENDENCIES)' 'NO'
+ LIB_DEPFILE=${DEPDIR}/${BUILD_LIB}/${BUILD_LIB}.$(DEPFILEEXT)
+endif
+
+# adapt pathes to cygwin
+ifeq '${BUILDPCOS}' 'WIN32'
+PATH_DELIM=\\
+else
+PATH_DELIM=/
+endif
+
+# adapt path of executable
+MKDEP := $(subst \,${PATH_DELIM},${MKDEP})
+
+# this is tricky, but mkdep expects INCLUDE_DEP to contain a ";" separated list of directories
+# add a ":" before and after each token, then we replace ": :" with ";" and remove single ":" (start & end)
+NULL:=
+SPACE:= $(NULL) # this is a space
+# we don't modify INCLUDE as this is used by compilers; muc uses "include" (lowercase)
+export INCLUDE_DEP=$(strip $(INCLUDE))$(strip $(include))
+INCLUDE_DEP +=$(strip $(subst :,,$(subst : :,;,$(addprefix :,$(addsuffix :,${${BUILD_LIB}_INC})))))
+INCLUDE_DEP:=$(subst ;$(SPACE),;,$(INCLUDE_DEP))
+
+${DEPDIR}/${BUILD_LIB}/${BUILD_LIB}.$(DEPFILEEXT) : \
+ ${${BUILD_LIB}_THUMB_FILES} \
+ ${${BUILD_LIB}_FILES}
+ -@$(ECHO) --- generating dependency file $@ ---
+ # this command get's too long most of the time so we create a viafile anyway
+ $(shell echo $(wordlist 1,1,$($^)) > ${DEPDIR}/${BUILD_LIB}/${BUILD_LIB}.via )
+ $(foreach str, $^, $(shell echo ${str} >> ${DEPDIR}/${BUILD_LIB}/${BUILD_LIB}.via) )
+ ${MKDEP} \
+ /T "$(OBJ_DIR)" \
+ /X \
+ /E INCLUDE_DEP \
+ /o $(subst /,${PATH_DELIM},${DEPDIR}/${BUILD_LIB}/${BUILD_LIB}.${DEPFILEEXT}) \
+ @$(subst /,${PATH_DELIM},${DEPDIR}/${BUILD_LIB}/${BUILD_LIB}.via)
+# /T <dir> obj file directory <dir>
+# /X enable unix style ("/") support
+# /o write output to file <file>
+# /v verbose output
+# /S<c> file separator (\ by default)
+# /i<c> inc path seperator (; by default)
+# /x o generate dependencies with .o files (.obj is default)
+# $(addprefix /I ,$(subst /,\,${${BUILD_LIB}_INC}))
+
diff --git a/cp/ps/build/frame/compiler/rvct.mk b/cp/ps/build/frame/compiler/rvct.mk
new file mode 100644
index 0000000..e75641e
--- /dev/null
+++ b/cp/ps/build/frame/compiler/rvct.mk
@@ -0,0 +1,128 @@
+#***********************************************************************
+# °æÈ¨ËùÓÐ (C)2001,ÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾¡£
+#
+# ÎļþÃû³Æ£º rvct.mk
+# Îļþ±êʶ£º ¶¨ÒåARM RealView Compilation Tools±àÒëÆ÷Ïà¹ØÄÚÈÝ
+# ÄÚÈÝÕªÒª£º
+#
+# ÐÞ¸ÄÈÕÆÚ °æ±¾ºÅ Ð޸ıê¼Ç ÐÞ¸ÄÈË ÐÞ¸ÄÄÚÈÝ
+# ---------------------------------------------------------------------
+# 2007/11/16 V1.0 xiaxinguo create
+#***********************************************************************/
+
+# ======================================================================== #
+# ·¾¶
+# ======================================================================== #
+RCVT_ROOT ?= /cygdrive/c/arm
+RVCT_VER ?= 4.0/400
+# Cortex-R7/Cortex-M0/ARM1176JZF-S/ARM926EJ-S
+RVCT_CPU ?= Cortex-R7
+RVCT_BIN = $(RCVT_ROOT)/RVCT/Programs/$(RVCT_VER)/win_32-pentium
+RVCT_LIB = $(RCVT_ROOT)/RVCT/Data/$(RVCT_VER)/Lib
+RVCT_INC = $(RCVT_ROOT)/RVCT/Data/$(RVCT_VER)/include/windows
+
+# ------------------------------------------------------------------------ #
+# Compiler tools
+# ------------------------------------------------------------------------ #
+CC = $(RVCT_BIN)/armcc
+CXX = $(RVCT_BIN)/armcc
+ASM = $(RVCT_BIN)/armasm
+AR = $(RVCT_BIN)/armar
+LD = $(RVCT_BIN)/armlink
+ELF2BIN = $(RVCT_BIN)/fromelf
+
+# ------------------------------------------------------------------------ #
+# INCLUDE
+# ------------------------------------------------------------------------ #
+INCLUDE +=
+
+# ------------------------------------------------------------------------ #
+# STDINCLUDE
+# ------------------------------------------------------------------------ #
+STDINCLUDE += -I$(RVCT_INC)
+
+# ------------------------------------------------------------------------ #
+# CCFLAGS
+# ------------------------------------------------------------------------ #
+CCFLAGS =
+CCFLAGS += -c --no_debug_macros
+
+ifeq ($(THUMB), YES)
+ CCFLAGS += --thumb
+endif
+
+#CCFLAGS += -W
+CCFLAGS += --cpu $(RVCT_CPU) --apcs /noswstackcheck/interwork --littleend --fpu softvfp --diag_remark 188,870
+CCFLAGS += --library_interface=aeabi_clib90
+CCFLAGS += --split_sections
+
+#generate dependencies
+CCFLAGS += --depend $(patsubst %.o,%.d,$@)
+
+#enable compiler optimizations depending on flavor
+ifeq ($(FLAVOR),debug)
+CCFLAGS += -O2 --debug
+else
+ifeq ($(FLAVOR),release)
+CCFLAGS += --no_debug -O2 -Otime --diag_remark 174
+else
+$(error FLAVOR is invalid:[FLAVOR=$(FLAVOR)] )
+endif
+endif
+
+CXXFLAGS = $(CCFLAGS)
+
+# ------------------------------------------------------------------------ #
+# ASFLAGS
+# ------------------------------------------------------------------------ #
+ASFLAGS =
+ifeq ($(FLAVOR),debug)
+ASFLAGS += --debug
+endif
+ASFLAGS += --cpu $(RVCT_CPU) --apcs /noswstackcheck --littleend --fpu softvfp
+
+# ------------------------------------------------------------------------ #
+# ARFLAGS
+# ------------------------------------------------------------------------ #
+ARFLAGS = --create
+
+# ------------------------------------------------------------------------ #
+# LDFLAGS
+# ------------------------------------------------------------------------ #
+LDFLAGS +=
+ifeq ($(FLAVOR),debug)
+LDFLAGS += --debug --no_inline
+else
+LDFLAGS += --no_debug --inline
+endif
+LDFLAGS += --remove --diag_suppress 6314 --reloc --partial --libpath $(RVCT_LIB)
+LDOUT = --output $@
+LDMAP = --map --locals --symbols --info totals,sizes --xref --list $(OBJDIR)/2930.map
+
+# ------------------------------------------------------------------------ #
+# ELF2BINOUT
+# ------------------------------------------------------------------------ #
+ELF2BINOUT = -output
+
+# ------------------------------------------------------------------------ #
+# DEFINE
+# ------------------------------------------------------------------------ #
+ifeq ($(PS_TYPE), ps_comneon)
+DEFINE += -D_USE_PS_COMNEON #use COMNEON's ps
+DEFINE += -D_USE_L1G #init GSM modle clocl
+DEFINE += -DEXTERNAL_SDL_DEBUG # outup trace information when use COMNEON's ps
+DEFINE += -D_USE_DPRAM_BYPASS #include "dpram_api.h" but not "dpram_td_api.h" in the drv_api.h
+endif
+
+ifeq ($(PS_TD_SWITCH), yes)
+DEFINE += -DPS_TD_SWITCH
+endif
+
+#DEFINE += -D_USE_SDL #-DNV_ON_NAND
+
+DEFINE += -DLITTLE_ENDIAN
+
+# ------------------------------------------------------------------------ #
+# LIBS
+# ------------------------------------------------------------------------ #
+LIBS +=
diff --git a/cp/ps/build/frame/rules/lib_rules.mk b/cp/ps/build/frame/rules/lib_rules.mk
new file mode 100644
index 0000000..c610094
--- /dev/null
+++ b/cp/ps/build/frame/rules/lib_rules.mk
@@ -0,0 +1,59 @@
+# /*****************************************************************************
+#* °æÈ¨ËùÓÐ (C)2015, ÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾¡£
+#*
+#* ÎļþÃû³Æ: lib_rules.mk
+#* Îļþ±êʶ: lib_rules.mk
+#* ÄÚÈÝÕªÒª: ¿âÎļþ¹æÔò
+#* ʹÓ÷½·¨: include lib_rules.mk
+#*
+#* ÐÞ¸ÄÈÕÆÚ °æ±¾ºÅ Ð޸ıê¼Ç ÐÞ¸ÄÈË ÐÞ¸ÄÄÚÈÝ
+#* -----------------------------------------------------------------------------
+#* 2015/05/20 V1.0 ÕûºÏ ÁõÑÇÄÏ ÕûºÏ
+#*
+# ******************************************************************************/
+
+define BUILD_GCC_LIBRARY
+$(if $(wildcard $(_SUBSYS_NAME)ar.mac),@$(RM) $(_SUBSYS_NAME)ar.mac)
+$(if $(filter %.o,$(_ALL_OBJECTS)),$(VERB) $(AR) $(ARFLAGS) $@ $(filter %.o, $(_ALL_OBJECTS)))
+$(if $(filter %.a, $(_ALL_OBJECTS)),
+$(if $(filter %.o,$(_ALL_OBJECTS)),
+@$(ECHO) OPEN $@ > $(_SUBSYS_LIB_PATH)/$(_SUBSYS_NAME)ar.mac,
+@$(ECHO) CREATE $@ > $(_SUBSYS_LIB_PATH)/$(_SUBSYS_NAME)ar.mac
+)
+$(foreach LIB, $(filter %.a, $(_ALL_OBJECTS)),
+@echo ADDLIB $(LIB) >> $(_SUBSYS_LIB_PATH)/$(_SUBSYS_NAME)ar.mac
+)
+@$(ECHO) SAVE >> $(_SUBSYS_LIB_PATH)/$(_SUBSYS_NAME)ar.mac
+@$(ECHO) END >> $(_SUBSYS_LIB_PATH)/$(_SUBSYS_NAME)ar.mac
+@$(AR) -M < $(_SUBSYS_LIB_PATH)/$(_SUBSYS_NAME)ar.mac
+@$(RM) $(_SUBSYS_LIB_PATH)/$(_SUBSYS_NAME)ar.mac
+)
+endef
+
+lib: $(_SUBSYS_LIB_PATH)/$(_SUBSYS_NAME).a
+
+$(_SUBSYS_LIB_PATH)/$(_SUBSYS_NAME).a: $(_ALL_MDLS)
+ @$(ECHO) ""
+ @-$(MKDIR) $(_SUBSYS_LIB_PATH)
+ifeq ($(USE_ENABLE_LTO),yes)
+ifneq ($(DISABLE_LTO_ONCE),yes)
+ @$(RM) $(_SUBSYS_LIB_PATH)/$(_SUBSYS_NAME)-builtin.o
+ @$(AR2) $(ARFLAGS2) $(_SUBSYS_LIB_PATH)/$(_SUBSYS_NAME)-builtin.o $(sort $(_ALL_OBJECTS))
+else
+ $(AR) $(ARFLAGS) $@ $(_ALL_OBJECTS)
+endif
+else
+ $(AR) $(ARFLAGS) $@ $(_ALL_OBJECTS)
+endif
+ @$(ECHO) "=================================================================="
+ @$(ECHO) "--- make lib $@ done."
+ @$(ECHO) "=================================================================="
+ @$(ECHO) ""
+
+clean: $(addsuffix clean, $(_ALL_MDLS))
+ @-$(RM) $(_SUBSYS_LIB_PATH)/$(_SUBSYS_NAME).a
+ @$(ECHO) "=================================================================="
+ @$(ECHO) "--- clean lib file $(_SUBSYS_LIB_PATH)/$(_SUBSYS_NAME).a done."
+ @$(ECHO) "=================================================================="
+ @$(ECHO) ""
+
diff --git a/cp/ps/build/frame/rules/mdl_rules.mk b/cp/ps/build/frame/rules/mdl_rules.mk
new file mode 100644
index 0000000..a008926
--- /dev/null
+++ b/cp/ps/build/frame/rules/mdl_rules.mk
@@ -0,0 +1,100 @@
+# /*****************************************************************************
+#* °æÈ¨ËùÓÐ (C)2015, ÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾¡£
+#*
+#* ÎļþÃû³Æ: mdl_rules.mk
+#* Îļþ±êʶ: mdl_rules.mk
+#* ÄÚÈÝÕªÒª: Ä£¿éÎļþ¹æÔò
+#* ʹÓ÷½·¨: include mdl_rules.mk
+#*
+#* ÐÞ¸ÄÈÕÆÚ °æ±¾ºÅ Ð޸ıê¼Ç ÐÞ¸ÄÈË ÐÞ¸ÄÄÚÈÝ
+#* -----------------------------------------------------------------------------
+#* 2015/05/20 V1.0 ÕûºÏ ÁõÑÇÄÏ ÕûºÏ
+#*
+# ******************************************************************************/
+
+#===============================================================================
+# ¶ÔÏóÎļþ¼¯ºÏ¹æÔò
+#===============================================================================
+_ALL_OBJECTS = $(addprefix $(_MDL_OBJ_PATH)/, \
+ $(subst .c,.o, $(notdir $(_C_SOURCE))))
+
+_ALL_OBJECTS += $(addprefix $(_MDL_OBJ_PATH)/, \
+ $(subst .cpp,.o, $(notdir $(_CPP_SOURCE))))
+
+_ALL_OBJECTS += $(addprefix $(_MDL_OBJ_PATH)/, \
+ $(subst .s,.o, $(notdir $(_s_SOURCE))))
+
+_ALL_OBJECTS += $(addprefix $(_MDL_OBJ_PATH)/, \
+ $(subst .S,.o, $(notdir $(_S_SOURCE))))
+
+ifeq ($(USE_ENABLE_LTO),yes)
+ifneq ($(DISABLE_LTO_ONCE),yes)
+ CCFLAGS += -flto -fno-toplevel-reorder -fno-fat-lto-objects
+endif
+endif
+
+#===============================================================================
+# ¶ÔÏóÎļþÉú³É¹æÔò
+#===============================================================================
+$(_MDL_OBJ_PATH)/%.o:$(_MDL_SRC_PATH)/%.cpp
+ @$(ECHO) Compile $<
+ @-$(MKDIR) $(_MDL_OBJ_PATH)
+ $(VERB)$(CXX) $(CXXFLAGS) $(CPU_PUB_DEFINE) $(DEFINE) $(STDINCLUDE) $(INCLUDE) -c $< -o $@
+ @$(ECHO) Done!
+
+$(_MDL_OBJ_PATH)/%.o:$(_MDL_SRC_PATH)/%.c
+ @$(ECHO) Compile $<
+ @-$(MKDIR) $(_MDL_OBJ_PATH)
+ifeq ($(CONFIG_MIN_8M_VERSION), y)
+ $(VERB)$(CC) $(CCFLAGS) $(CPU_PUB_DEFINE) $(DEFINE) -Wno-builtin-macro-redefined -U __FILE__ -D '__FILE__=""' $(STDINCLUDE) $(INCLUDE) -c $< -o $@
+else
+ $(VERB)$(CC) $(CCFLAGS) $(CPU_PUB_DEFINE) $(DEFINE) -Wno-builtin-macro-redefined -U __FILE__ -D '__FILE__="$(shell basename $<)"' $(STDINCLUDE) $(INCLUDE) -c $< -o $@
+endif
+ @$(ECHO) Done!
+
+$(_MDL_OBJ_PATH)/%.o:$(_MDL_SRC_PATH)/%.S
+ @$(ECHO) Compile $<
+ @-$(MKDIR) $(_MDL_OBJ_PATH)
+ @$(CC) $(CCFLAGS) $(ASFLAGS) $(CPU_PUB_DEFINE) $(DEFINE) -o $@ $(INCLUDE) $<
+ @$(ECHO) Done!
+
+$(_MDL_OBJ_PATH)/%.o:$(_MDL_SRC_PATH)/%.s
+ @$(ECHO) Compile $<
+ @-$(MKDIR) $(_MDL_OBJ_PATH)
+ @$(ASM) $(ASFLAGS) -o $@ $(INCLUDE) $<
+ @$(ECHO) Done!
+
+#===============================================================================
+#¼ì²é¹æÔò
+#===============================================================================
+_ALL_LINT =
+
+ifeq ($(LINTCHK), yes)
+_ALL_LINT = $(addprefix $(_MDL_OBJ_PATH)/lnt/, \
+ $(subst .c,.lnt, $(notdir $(_C_SOURCE))))
+
+$(_MDL_OBJ_PATH)/lnt/%.lnt:$(_MDL_SRC_PATH)/%.c
+ @$(ECHO) Lint $<
+ @-$(MKDIR) $(_MDL_OBJ_PATH)/lnt
+ @$(PCLINT) -u -b +fdi $(INCLUDE) $(STDINCLUDE) $(CPU_PUB_DEFINE) $(DEFINE) $(LINTOPTION) $<>>$(OBJ_PATH)/$(PRJ_NAME).lnt
+ @$(ECHO) Done!
+endif
+
+#===============================================================================
+#Ä£¿é¹æÔò
+#===============================================================================
+default: mdl
+clean: mdlclean
+
+mdl:$(_ALL_OBJECTS) $(_ALL_LINT)
+ @$(ECHO) Compile module $(_MDL_NAME) done!
+ @$(ECHO) ""
+
+mdlclean:
+ @-$(RM) $(_MDL_OBJ_PATH)/lnt/*
+ @-$(RMDIR) $(_MDL_OBJ_PATH)/lnt
+ @-$(RM) $(_MDL_OBJ_PATH)/*
+ @-$(RM) $(OBJ_PATH)/$(PRJ_NAME).lnt
+ @-$(RMDIR) $(_MDL_OBJ_PATH)
+ @$(ECHO) "--- clean obj file $(_MDL_OBJ_PATH)/* done."
+ @$(ECHO) ""
diff --git a/cp/ps/build/frame/rules/target_rules.mk b/cp/ps/build/frame/rules/target_rules.mk
new file mode 100644
index 0000000..a810ab3
--- /dev/null
+++ b/cp/ps/build/frame/rules/target_rules.mk
@@ -0,0 +1,110 @@
+# /*****************************************************************************
+#* °æÈ¨ËùÓÐ (C)2015, ÖÐÐËͨѶ¹É·ÝÓÐÏÞ¹«Ë¾¡£
+#*
+#* ÎļþÃû³Æ: target_rules.mk
+#* Îļþ±êʶ: target_rules.mk
+#* ÄÚÈÝÕªÒª: Ä¿±êÎļþ¹æÔò
+#* ʹÓ÷½·¨: include target_rules.mk
+#*
+#* ÐÞ¸ÄÈÕÆÚ °æ±¾ºÅ Ð޸ıê¼Ç ÐÞ¸ÄÈË ÐÞ¸ÄÄÚÈÝ
+#* -----------------------------------------------------------------------------
+#* 2015/05/20 V1.0 ÕûºÏ ÁõÑÇÄÏ ÕûºÏ
+#*
+# ******************************************************************************/
+
+#===============================================================================
+# ¶ÔÏóÎļþ¹æÔò
+#===============================================================================
+_ALL_OBJECTS = $(addprefix $(_SUBSYS_OBJ_PATH)/, \
+ $(subst .c,.o, $(notdir $(_ALL_SOURCE))))
+
+ifeq ($(COMPILER),gcc_arm_tos.mk)
+_ALL_OBJECTS += $(addprefix $(_SUBSYS_OBJ_PATH)/, \
+ $(subst .S,.o,$(notdir $(_ALL_S_SOURCE))))
+vpath %S $(_VPATH_S)
+endif
+
+ifeq ($(COMPILER),gcc_arm_linux.mk)
+_ALL_OBJECTS += $(addprefix $(_SUBSYS_OBJ_PATH)/, \
+ $(subst .S,.o,$(notdir $(_ALL_S_SOURCE))))
+vpath %S $(_VPATH_S)
+endif
+
+ifeq ($(COMPILER),rvct.mk)
+_ALL_OBJECTS += $(addprefix $(_SUBSYS_OBJ_PATH)/, \
+ $(subst .s,.o,$(notdir $(_ALL_s_SOURCE))))
+vpath %s $(_VPATH_S)
+endif
+
+vpath %c $(_VPATH_C)
+vpath %h $(_VPATH_H)
+
+#===============================================================================
+#PC-LINT rules
+#===============================================================================
+_ALL_LINT_FILES =
+ifeq ($(LINTCHK),yes)
+_ALL_LINT_FILES = $(addprefix $(_SUBSYS_OBJ_PATH)/lnt/, \
+ $(subst .c,.lnt, $(notdir $(_ALL_SOURCE))))
+endif
+
+#_ALL_LINT_PATH = $(subst -I, -i, $(INCLUDE) $(STDINCLUDE) $(addprefix -i, $(_VPATH_H)))
+
+#_ALL_LINT_PATH = $(subst /,\, $(addsuffix ", $(foreach item, $(INCLUDE) $(STDINCLUDE), $(subst -I,-i", $(item)))))
+
+#===============================================================================
+#¿âÎļþ¹æÔò
+#===============================================================================
+.PHONY: lib clean
+
+lib: libenv $(_SUBSYS_LIB_PATH)/$(_SUBSYS_NAME).a
+
+$(_SUBSYS_LIB_PATH)/$(_SUBSYS_NAME).a:$(_ALL_OBJECTS) $(_ALL_LINT_FILES)
+ @$(ECHO) ""
+ @-$(MKDIR) $(_SUBSYS_LIB_PATH)
+ $(VERB)$(LD) $(LDFLAGS) -o $@ $(_ALL_OBJECTS)
+ @$(ECHO) "=================================================================="
+ @$(ECHO) "--- make lib $@ done."
+ @$(ECHO) "=================================================================="
+ @$(ECHO) ""
+
+clean:
+ @-$(RM) $(_SUBSYS_OUTPUT_LIB)
+ @$(ECHO) "--- clean lib file $(_SUBSYS_OUTPUT_LIB) done."
+ @-$(RM) $(_SUBSYS_OBJ_PATH)/lnt/*
+ @-$(RMDIR) $(_SUBSYS_OBJ_PATH)/lnt
+ @-$(RM) $(_SUBSYS_OBJ_PATH)/*
+ @-$(RMDIR) $(_SUBSYS_OBJ_PATH)
+ @$(ECHO) "--- clean obj file $(_SUBSYS_OBJ_PATH)/* done."
+ @$(ECHO) ""
+
+#===============================================================================
+# ¶ÔÏóÎļþÉú³É¹æÔò
+#===============================================================================
+$(_SUBSYS_OBJ_PATH)/%.o:%.c
+ @$(ECHO) Compile $<
+ @-$(MKDIR) $(_SUBSYS_OBJ_PATH)
+ $(VERB)$(CC) $(CCFLAGS) $(CPU_PUB_DEFINE) $(DEFINE) $(INCLUDE) $(STDINCLUDE) -c $< -o $@
+ @$(ECHO) Done!
+
+$(_SUBSYS_OBJ_PATH)/%.o:%.s
+ @$(ECHO) Compile $<
+ @-$(MKDIR) $(_SUBSYS_OBJ_PATH)
+ @$(ASM) $(ASFLAGS) -o $@ $(INCLUDE) $<
+ @$(ECHO) Done!
+
+$(_SUBSYS_OBJ_PATH)/%.o:%.S
+ @$(ECHO) Compile $<
+ @-$(MKDIR) $(_SUBSYS_OBJ_PATH)
+ @$(CC) $(CCFLAGS) $(ASFLAGS) -o $@ $(INCLUDE) $<
+ @$(ECHO) Done!
+
+#===============================================================================
+# lntÎļþÉú³É¹æÔò
+#===============================================================================
+$(_SUBSYS_OBJ_PATH)/lnt/%.lnt:%.c
+ @$(ECHO) lint $<
+ @-$(MKDIR) $(_SUBSYS_OBJ_PATH)/lnt
+ @$(PCLINT) -u -b +fdi $(CPU_PUB_DEFINE) $(DEFINE) $(LINTOPTION) $(INCLUDE) $(STDINCLUDE) $< > $@
+ @$(ECHO) Done!
+