[Android Q&A, Help & Troubleshooting] Piteryo:
Hi to all! I`m compling rom for an unsupported device. And there are some errros.

Log

piteryo7@ubuntu:~/cm10.1$ brunch finder
including vendor/cm/vendorsetup.sh
Trying dependencies-only mode on a non-existing device tree?

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.2.2
CM_VERSION=
TARGET_PRODUCT=cm_finder
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.5.0-23-generic-x86_64-with-Ubuntu-12.04-precise
HOST_BUILD_TYPE=release
BUILD_ID=JDQ39E
OUT_DIR=/home/piteryo7/cm10.1/out
============================================

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.2.2
CM_VERSION=
TARGET_PRODUCT=cm_finder
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.5.0-23-generic-x86_64-with-Ubuntu-12.04-precise
HOST_BUILD_TYPE=release
BUILD_ID=JDQ39E
OUT_DIR=/home/piteryo7/cm10.1/out
============================================
external/bluetooth/bluedroid/Android.mk:8: NO BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR, using only generic configuration
No private recovery resources for TARGET_DEVICE finder
build/core/tasks/kernel.mk:191: предупреждение: переопределение команд для цели `/home/piteryo7/cm10.1/out/target/product/finder/kernel'
device/oppo/finder/AndroidBoard.mk:28: предупреждение: старые команды для цели `/home/piteryo7/cm10.1/out/target/product/finder/kernel' игнорируются
Export includes file: system/core/libmincrypt/Android.mk -- /home/piteryo7/cm10.1/out/host/linux-x86/obj/STATIC_LIBRARIES/libmincrypt_intermediates/export_includes
Import includes file: /home/piteryo7/cm10.1/out/host/linux-x86/obj/EXECUTABLES/mkbootimg_intermediates/import_includes
Header: /home/piteryo7/cm10.1/out/host/linux-x86/obj/include/libexpat/expat.h
Header: /home/piteryo7/cm10.1/out/host/linux-x86/obj/include/libexpat/expat_external.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/libexpat/expat.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/libexpat/expat_external.h
Header: /home/piteryo7/cm10.1/out/host/linux-x86/obj/include/libpng/png.h
Header: /home/piteryo7/cm10.1/out/host/linux-x86/obj/include/libpng/pngconf.h
Header: /home/piteryo7/cm10.1/out/host/linux-x86/obj/include/libpng/pngusr.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/libpng/png.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/libpng/pngconf.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/libpng/pngusr.h
Header: /home/piteryo7/cm10.1/out/host/linux-x86/obj/include/selinux/selinux.h
Header: /home/piteryo7/cm10.1/out/host/linux-x86/obj/include/selinux/label.h
Header: /home/piteryo7/cm10.1/out/host/linux-x86/obj/include/selinux/context.h
Header: /home/piteryo7/cm10.1/out/host/linux-x86/obj/include/selinux/avc.h
Header: /home/piteryo7/cm10.1/out/host/linux-x86/obj/include/selinux/android.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/selinux/selinux.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/selinux/label.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/selinux/context.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/selinux/avc.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/selinux/android.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/libsonivox/eas.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/libsonivox/eas_types.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/libsonivox/eas_reverb.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/libsonivox/jet.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/libsonivox/ARM_synth_constants_gnu.inc
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/libwpa_client/wpa_ctrl.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/mm-core/omxcore/OMX_Audio.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/mm-core/omxcore/OMX_Component.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/mm-core/omxcore/OMX_ContentPipe.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/mm-core/omxcore/OMX_Core.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/mm-core/omxcore/OMX_Image.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/mm-core/omxcore/OMX_Index.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/mm-core/omxcore/OMX_IVCommon.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/mm-core/omxcore/OMX_Other.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/mm-core/omxcore/OMX_QCOMExtns.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/mm-core/omxcore/OMX_Types.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/mm-core/omxcore/OMX_Video.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/mm-core/omxcore/qc_omx_common.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/mm-core/omxcore/qc_omx_component.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/mm-core/omxcore/qc_omx_msg.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/mm-core/omxcore/QOMX_AudioExtensions.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/mm-core/omxcore/QOMX_AudioIndexExtensions.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/mm-core/omxcore/OMX_CoreExt.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/mm-core/omxcore/QOMX_CoreExtensions.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/mm-core/omxcore/QOMX_FileFormatExtensions.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/mm-core/omxcore/QOMX_IVCommonExtensions.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/mm-core/omxcore/QOMX_SourceExtensions.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/mm-core/omxcore/QOMX_VideoExtensions.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/mm-core/omxcore/OMX_IndexExt.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/mm-core/omxcore/QOMX_StreamingExtensions.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/mm-core/omxcore/QCMediaDefs.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/mm-core/omxcore/QCMetaData.h
Header: /home/piteryo7/cm10.1/out/target/product/finder/obj/include/mm-video/DivxDrmDecrypt/DivXDrmDecrypt.h
host C: mkbootimg <= system/core/mkbootimg/mkbootimg.c
system/core/mkbootimg/mkbootimg.c: In function 'write_padding':
system/core/mkbootimg/mkbootimg.c:89:34: warning: comparison between signed and unsigned integer exp​ressions [-Wsign-compare]
system/core/mkbootimg/mkbootimg.c: In function 'main':
system/core/mkbootimg/mkbootimg.c:191:5: warning: pointer targets in passing argument 1 of 'strcpy' differ in signedness [-Wpointer-sign]
/home/piteryo7/cm10.1/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6/bin/../sysroot/usr/include/string.h:84:14: note: expected 'char * __restrict__' but argument is of type 'unsigned char *'
system/core/mkbootimg/mkbootimg.c:236:9: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
system/core/mkbootimg/mkbootimg.c:249:48: warning: comparison between signed and unsigned integer exp​ressions [-Wsign-compare]
system/core/mkbootimg/mkbootimg.c:252:50: warning: comparison between signed and unsigned integer exp​ressions [-Wsign-compare]
system/core/mkbootimg/mkbootimg.c:256:52: warning: comparison between signed and unsigned integer exp​ressions [-Wsign-compare]
Import includes file: /home/piteryo7/cm10.1/out/host/linux-x86/obj/STATIC_LIBRARIES/libmincrypt_intermediates/import_includes
host C: libmincrypt <= system/core/libmincrypt/rsa.c
host C: libmincrypt <= system/core/libmincrypt/rsa_e_3.c
host C: libmincrypt <= system/core/libmincrypt/rsa_e_f4.c
host C: libmincrypt <= system/core/libmincrypt/sha.c
system/core/libmincrypt/sha.c: In function 'SHA_update':
system/core/libmincrypt/sha.c:153:16: warning: comparison between signed and unsigned integer exp​ressions [-Wsign-compare]
host StaticLib: libmincrypt (/home/piteryo7/cm10.1/out/host/linux-x86/obj/STATIC_LIBRARIES/libmincrypt_intermediates/libmincrypt.a)
Export includes file: system/core/mkbootimg/Android.mk -- /home/piteryo7/cm10.1/out/host/linux-x86/obj/EXECUTABLES/mkbootimg_intermediates/export_includes
host Executable: mkbootimg (/home/piteryo7/cm10.1/out/host/linux-x86/obj/EXECUTABLES/mkbootimg_intermediates/mkbootimg)
Export includes file: build/libs/host/Android.mk -- /home/piteryo7/cm10.1/out/host/linux-x86/obj/STATIC_LIBRARIES/libhost_intermediates/export_includes
Import includes file: /home/piteryo7/cm10.1/out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/import_includes
host C: acp <= build/tools/acp/acp.c
Import includes file: /home/piteryo7/cm10.1/out/host/linux-x86/obj/STATIC_LIBRARIES/libhost_intermediates/import_includes
host C++: libhost <= build/libs/host/pseudolocalize.cpp
host C: libhost <= build/libs/host/CopyFile.c
host StaticLib: libhost (/home/piteryo7/cm10.1/out/host/linux-x86/obj/STATIC_LIBRARIES/libhost_intermediates/libhost.a)
Export includes file: build/tools/acp/Android.mk -- /home/piteryo7/cm10.1/out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/export_includes
host Executable: acp (/home/piteryo7/cm10.1/out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp)
Install: /home/piteryo7/cm10.1/out/host/linux-x86/bin/acp
Notice file: system/core/libmincrypt/NOTICE -- /home/piteryo7/cm10.1/out/host/linux-x86/obj/NOTICE_FILES/src//lib/libmincrypt.a.txt
Install: /home/piteryo7/cm10.1/out/host/linux-x86/bin/mkbootimg
mkdir -p /home/piteryo7/cm10.1/out/target/product/finder/obj/KERNEL_OBJ
mkdir -p /home/piteryo7/cm10.1/out/target/product/finder/system/lib/modules
make -C kernel/oppo/finder O=/home/piteryo7/cm10.1/out/target/product/finder/obj/KERNEL_OBJ ARCH=arm CROSS_COMPILE=" /home/piteryo7/cm10.1/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-" VARIANT_DEFCONFIG= SELINUX_DEFCONFIG= msm8660-perf_defconfig
make[1]: Entering directory `/home/piteryo7/cm10.1/kernel/oppo/finder'
HOSTCC scripts/basic/fixdep
/home/piteryo7/cm10.1/kernel/oppo/finder/scripts/mkmakefile: line 5: $'\r': command not found
/home/piteryo7/cm10.1/kernel/oppo/finder/scripts/mkmakefile: line 11: $'\r': command not found
/home/piteryo7/cm10.1/kernel/oppo/finder/scripts/mkmakefile: line 12: $'\r': command not found
/home/piteryo7/cm10.1/kernel/oppo/finder/scripts/mkmakefile: line 59: warning: here-document at line 24 delimited by end-of-file (wanted `EOF')
/home/piteryo7/cm10.1/kernel/oppo/finder/scripts/mkmakefile: line 60: syntax error: unexpected end of file
make[2]: *** [outputmakefile] Error 2
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory `/home/piteryo7/cm10.1/kernel/oppo/finder'
make: *** [/home/piteryo7/cm10.1/out/target/product/finder/obj/KERNEL_OBJ/.config] Error 2
piteryo7@ubuntu:~/cm10.1$

Mkmakefile

#!/bin/sh
# Generates a small Makefile used in the root of the output
# directory, to allow make to be started from there.
# The Makefile also allow for more convinient build of external modules

# Usage
# $1 - Kernel src directory
# $2 - Output directory
# $3 - version
# $4 - patchlevel

test ! -r $2/Makefile -o -O $2/Makefile || exit 0
# Only overwrite automatically generated Makefiles
# (so we do not overwrite kernel Makefile)
if test -e $2/Makefile && ! grep -q Automatically $2/Makefile
then
exit 0
fi
if [ "${quiet}" != "silent_" ]; then
echo " GEN $2/Makefile"
fi

cat << EOF > $2/Makefile
# Automatically generated by $0: don't edit

VERSION = $3
PATCHLEVEL = $4

lastword = \$(word \$(words \$(1)),\$(1))
makedir := \$(dir \$(call lastword,\$(MAKEFILE_LIST)))

ifeq ("\$(origin V)", "command line")
VERBOSE := \$(V)
endif
ifneq (\$(VERBOSE),1)
Q := @
endif

MAKEARGS := -C $1
MAKEARGS += O=\$(if \$(patsubst /%,,\$(makedir)),\$(CURDIR)/)\$(patsubst %/,%,\$(makedir))

MAKEFLAGS += --no-print-directory

.PHONY: all \$(MAKECMDGOALS)

all	:= \$(filter-out all Makefile,\$(MAKECMDGOALS))

all:
\$(Q)\$(MAKE) \$(MAKEARGS) \$(all)

Makefile:;

\$(all): all
@:

%/: all
@:
EOF

Please help, what"s wrong?