I'm trying to create a very simple build script using the autoconf/automake tool chain (mostly as a learning exercise.)
Most examples seem to indicate that you need a separate Makefile.am in every source directory, and that the Makefile.am file in the project root should include a SUBDIRS directive which tells autoconf where to look for additional Makefiles.
I thought it might be possible, for a very simple project, to have a single Makefile.am in the project root directory. However, when I try to do this, and run the generated configure script - it creates a single Makefile in the project root which is empty (0 bytes.)
I'm not really sure what I'm doing wrong here.
So, my directory structure is extremely simple:
MyProject
---src
------myproject.cpp
---Makefile.am
---configure.ac
The configure.ac file is minimal:
AC_INIT(myproject, 1.0)
AC_MSG_NOTICE([My Project])
AC_PROG_CXX
AC_LANG(C++)
AC_CHECK_HEADERS(iostream)
AC_CONFIG_SRCDIR(src/myproject.cpp)
AM_INIT_AUTOMAKE(MyProject, 1.0)
AC_OUTPUT(Makefile)
And the Makefile.am is also very simple:
bin_PROGRAMS = myproject
myproject_SOURCES = src/myproject.cpp
myproject_CPPFLAGS = --std=c++11
I run:
autoconf configure.ac > configure
When I run the configure script, there are no errors.
Then I see it generated a Makefile in the project root directory:
# ls -lh | grep Make
-rw-r--r-- 1 root root 0 Nov 8 16:13 Makefile
-rw-r--r-- 1 root root 98 Nov 8 15:53 Makefile.am
-rw-r--r-- 1 root root 0 Nov 8 15:00 Makefile.in
And you can see, the Makefile it generated is completely empty.
So I'm obviously misunderstanding something fundamental about how autoconf/automake is supposed to work. What am I doing incorrectly here?
automake? - reinierpost