You must change your do_compile build step as this for this to work.
do_compile() {
${CXX} ${S}/rcu-service.cpp -o rcu-service
}
In do_install you should change ${WORKDIR}/git/rcu-service.service to ${S}/git/rcu-service.service
Extract from the yocto project manual
By default, the OpenEmbedded build system uses the S and B variables to locate unpacked recipe source code and to build it, respectively. When your recipe inherits the externalsrc class, you use the EXTERNALSRC and EXTERNALSRC_BUILD variables to ultimately define S and B.
So in your case S and B will have the following values
S="/home/chtan/rcu-service"
B="/home/chtan/rcu-service"
Note you dont need to set ${WORKDIR}/rcu-service since the
command dir is already ${WORKDIR} you could check this by adding the following line
bbwarn $(pwd)
in your do_compile task.
You should also remove the following line since it gets overwriten by the externalsrc.bbclass
S = "${WORKDIR}"
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…