本文介绍了Bitbake AutoTools找不到Makefile的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用自动工具生成我的项目。我正在使用Yocto和Bitbake制作Linux映像。
我已经阅读了一些汽车制作教程,并遵循了我在GitHub上找到的基本指南。这在我当前的项目中效果不是很好。
我的项目结构如下:
michael@michael-VirtualBox:~/Documents/MAIN_custom/MAIN_layers/meta-MAINapplication/recipes-core/MAIN_Application$ tree . ├── files │ ├── MAIN_Application │ │ ├── autogen.sh │ │ ├── configure.ac │ │ ├── Makefile.am │ │ ├── project.yml │ │ ├── src │ │ │ ├── include │ │ │ │ ├── main.h │ │ │ │ ├── scheduler.h │ │ │ │ └── utilities │ │ │ │ └── time_conversions.h │ │ │ └── src │ │ │ ├── main.c │ │ │ ├── scheduler.c │ │ │ └── utilities │ │ │ └── time_conversions.c │ │ └── test │ │ ├── test_scheduler.c │ │ └── test_time_conversions.c │ └── services │ └── mainapplication.service └── mainapplication_0.0.bbAutogen.sh:
#!/bin/sh echo "Generating configure files... may take a while." autoreconf --install --force && echo "Preparing was successful if there was no error messages above." && echo "Now type:" && echo " ./configure && make" && echo "Run './configure --help' for more information"Makefile.am
AUTOMAKE_OPTIONS = foreign CFLAGS = -Wall -pedantic -O2 include_HEADERS = main.h bin_PROGRAMS = EVCC_Application EVCC_Application_SOURCES = main.cconfigure.ac
# -*- Autoconf -*- AC_PREREQ(2.60) AC_INIT([EVCC_Application],[0.0.1],[michaelminer@smartrendmfg]) AM_INIT_AUTOMAKE([1.9 foreign]) AC_PROG_CC AC_PROG_INSTALL AC_PROG_MAKE_SET AM_SILENT_RULES([yes]) AC_CONFIG_MACRO_DIRS([m4]) AC_CONFIG_FILES([Makefile]) AC_OUTPUT我的bb文件也很简单:
LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" FILESEXTRAPATHS:prepend := "${THISDIR}/files/MAIN_Application:" FILESEXTRAPATHS:prepend := "${THISDIR}/files/MAIN_Application/src:" FILESEXTRAPATHS:prepend := "${THISDIR}/files/services:" SRC_URI = " file://mainapplication.service file://src/utilities/time_conversions.c file://src/main.c file://src/scheduler.c file://include/main.h file://include/scheduler.h file://include/utilities/time_conversions.h file://Makefile " inherit systemd autotools S = "${WORKDIR}" SYSTEMD_SERVICE_${PN} = "mainapplication.service" do_install_append () { install -d ${D}${systemd_system_unitdir} install -m 0644 ${S}/mainapplication.service ${D}${systemd_system_unitdir} sed -i -e 's,@BINDIR@,${bindir},g' ${D}${systemd_system_unitdir}/mainapplication.service }当我在我的终端中运行augen.sh时,我得到以下输出:
configure.ac:4: installing './compile' configure.ac:2: installing './install-sh' configure.ac:2: installing './missing' Makefile.am: installing './depcomp' checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /usr/bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking whether gcc understands -c and -o together... yes checking whether make supports the include directive... yes (GNU style) checking dependency style of gcc... gcc3 checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: executing depfiles commands谁能解释一下为什么我的bitbake版本报告找不到Makefile。
编辑:Bitbake找不到我的Makefile,因为它不存在。我有一个Makefile.am。当我将其重命名为Makefile时,收到OE_runmake错误。
推荐答案以下是我的评论:
我建议指定完整的项目文件夹,但不指定FILESEXTRAPATHS
SRC_URI = "file://MAIN_Application" SRC_URI += "file://services/"然后您需要将S变量指定到源文件文件夹:
S = "${WORKDIR}/MAIN_Application"还要注意,autotools类将尝试在${S}中查找以下文件之一:
- 生成文件
- 生成文件
- GNUMake文件
如果存在,它将运行oe_runmake clean。
因此,请确保您正确命名了Makefile并向其中添加了clean目标。
有关autotools如何工作的更多详细信息,请检查link
中的类编辑
为确保一切顺利,请手动运行任务:
- 检查S变量值:
- 解压并检查S下的文件:
您需要查看文件夹MAIN_Application及其内容。
- 尝试在systemd之前继承autotools。
EDIT2
我尝试为您的Github示例链接创建配方,以下是最终配方:
LICENSE = "MIT" LIC_FILES_CHKSUM = "file://LICENSE;md5=96af5705d6f64a88e035781ef00e98a8" SRC_URI = "git://github/DynamicDevices/bbexample;protocol=https" PV = "0.1+git${SRCPV}" SRCREV = "b9fb7785e9e1f357f29bef63dce8f1d91adb6170" S = "${WORKDIR}/git" inherit autotools EXTRA_OECONF = ""它可以正确编译,因此,针对您的情况只需设置:
LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" SRC_URI = " file://MAIN_Application file://services " inherit autotools systemd S = "${WORKDIR}/MAIN_Application" SYSTEMD_SERVICE_${PN} = "mainapplication.service" do_install_append () { install -d ${D}${systemd_system_unitdir} install -m 0644 ${WORKDIR}/services/mainapplication.service ${D}${systemd_system_unitdir} sed -i -e 's,@BINDIR@,${bindir},g' ${D}${systemd_system_unitdir}/mainapplication.service }更多推荐
Bitbake AutoTools找不到Makefile
发布评论