【发布时间】:2020-11-03 16:00:18
【问题描述】:
我在 ${STAGING_INCDIR}/botan-2 中有 botan.h。我喜欢在我的 yocto 配方中使用它和我的 Makefile,我的理想是让 Makefile 中提到的“编译”而不是完全占据配方。附上我的食谱和 Makefile
食谱.bb
SUMMARY = "Makefile Demo"
SECTION = "apps"
LICENSE = "CLOSED"
DEPENDS = "botan"
APP_NAME = "integrated_app"
localdir = "/usr/local"
bindir = "${localdir}/bin"
TARGET_CC_ARCH += "${LDFLAGS}"
SRC_URI = "file://main.cpp \
file://Makefile \
"
S = "${WORKDIR}"
inherit pkgconfig
do_compile() {
# make -f Makefile
oe_runmake
}
do_install () {
install -m 0755 -d ${D}${localdir}
install -m 0755 -d ${D}${bindir}
cd ${S}
install -m 0755 ${APP_NAME} ${D}${bindir}
}
FILES_${PN}-dev = ""
FILES_${PN} = "${bindir}/*"
生成文件
obj = main.o
target = integrated_app
S = "${WORKDIR}"
INC=/home/kjlau/yocto/build/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/botan-app/1.0-r0/recipe-sysroot/usr/include/botan-2
all: $(obj)
${CXX} ${CXXFLAGS} ${LDFLAGS} $(obj) -o $(target)
%.o:%.cpp
${CXX} ${CXXFLAGS} -I ${INC} -c $^ -o $@
.PHONY: clean
clean:
rm -rf $(obj) $(target)
虽然它可以成功编译,但我想知道我们可以在 Makefile 中使用 ${STAGING_INCDIR}/botan-2 吗?我试过了,但它不起作用。我不认为我正确实施了 INC,我的意思是它“不够常见”,比如我不能假设每个用户都是 kjlau 对吗?无论如何让它变得更好?
谢谢
【问题讨论】:
-
botan2.h 是否使用不同的配方安装?如果是这样,你可以只 DEPENDS = "botan2" 吗?
标签: makefile embedded-linux yocto bitbake openembedded