I am attempting to use autotools to build my project. I am using Yocto and bitbake to make a Linux image.
I have read a few automake tutorials and followed a basic guide I found on GitHub. This does not work so well with my current project.
My project structure is as follows:
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.bb
autogen.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.c
configure.ac
# -*- Autoconf -*-
AC_PREREQ(2.60)
AC_INIT([EVCC_Application],[0.0.1],[michaelminer@smartrendmfg.com])
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
My bb file is also very simple:
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
}
When I run autogen.sh in my terminal I get the following output:
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
Can anyone explain why my bitbake build reports that it cannot find the Makefile.
Edit: Bitbake cannot find my Makefile because it does not exist. I have a Makefile.am. When I rename this to Makefile I get an oe_runmake error.