2
votes

I created a simple test application + library that I am building using autotools. The problem is that the Makefile that is generated doesn't understand the "all" target.

Makefile.am:

ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src
VERSION=0:0:0
EXTRA_DIST = autogen.sh

bin_PROGRAMS = testApp

libtest_la_SOURCES = src/testLibrary.c
libtest_la_LDFLAGS = -version-info ${VERSION}

testApp_SOURCES = src/testApp.c
testApp_LDADD = libtest.la
lib_LTLIBRARIES = libtest.la

configure.ac:

AC_INIT(foobar, 1.0, [email protected])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_SRCDIR(src)
AC_PROG_CC
AM_PROG_CC_C_O
LT_INIT
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([subdir-objects])
AC_OUTPUT(Makefile)

Output of the command "make":

Making all in src
make[1]: *** No rule to make target `all'.  Stop.
make: *** [all-recursive] Error 1

Yet make understands the "testApp" target and builds it successfully. From my limited knowledge of autotools, the bin_PROGRAMS variable should supply the "all" target with its data?

1

1 Answers

1
votes

You seem to be combining recursive and non-recursive make rules.

If you remove this line:

SUBDIRS = src

this error might go away. It's looking for an all rule in src/Makefile.