automake not descending into subdirectories to create Makefile.in's
I'm a newbie at this. I am trying to convert an existing project to use auto* tools. My directory struct looks like this: topdir/ src/ src/basic_utilities src/ethernet_tests/bc5709_tests src/ethernet_tests/bc57711_tests src/mezzanine_card_tests My files: topdir/configure.ac: AC_PREREQ(2.59) AC_INIT(cisco_diags, 1.0.1) AC_CONFIG_SRCDIR([Makefile]) AM_CONFIG_HEADER([src/include/diags_config.h]) AM_INIT_AUTOMAKE(no-installinfo, no-installman, nostdinc, no-texinfo.tex) AC_CONFIG_SUBDIRS(src) # Checks for programs. AC_PROG_CC AC_PROG_INSTALL AC_PROG_RANLIB # Checks for libraries. # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([fcntl.h limits.h stddef.h stdint.h stdlib.h string.h unistd.h]) # Checks for library functions. AC_CHECK_FUNCS([strchr strrchr strtol]) AC_CONFIG_FILES([Makefile basic_utilities/Makefile ethernet_tests/Makefile ethernet_tests/bc5709_tests/Makefile ethernet_tests/bc57711_tests/Makefile mezzanine_card_tests/Makefile]) AC_OUTPUT topdir/Makefile.am AUTOMAKE_OPTIONS = foreign EXTRA_CFLAGS = @EXTRA_CFLAGS@ AM_CFLAGS = -Wall -W -Wstrict-prototypes $(EXTRA_CFLAGS) SUBDIRS = src topdir/src/Makefile.am AUTOMAKE_OPTIONS = foreign CC = @CC@ EXTRA_CFLAGS = @EXTRA_CFLAGS@ AM_CFLAGS = -Wall -W -Wstrict-prototypes $(EXTRA_CFLAGS) SUBDIRS = basic_utilities ethernet_tests mezzanine_card_tests topdir/src/basic_utilities/Makefile.am bin_PROGRAMS = basic_util basic_util_SOURCES = show_hardware_info.c EXTRA_CFLAGS = @EXTRA_CFLAGS@ CC = @CC@ AM_CFLAGS = -Wall -W -Wstrict-prototypes $(EXTRA_CFLAGS) topdir/src/ethernet_tests/Makefile.am EXTRA_CFLAGS = @EXTRA_CFLAGS@ AM_CFLAGS = -Wall -W -Wstrict-prototypes $(EXTRA_CFLAGS) SUBDIRS = bc5709_tests bc57711_tests topdir/src/ethernet_tests/bc5709_tests/Makefile.am bin_PROGRAMS = bcm5709 bcm5709_SOURCES = bc5709_ext_loopback.c EXTRA_CFLAGS = @EXTRA_CFLAGS@ CC = @CC@ AM_CFLAGS = -Wall -W -Wstrict-prototypes $(EXTRA_CFLAGS) topdir/src/ethernet_tests/bc57711_tests/Makefile.am bin_PROGRAMS = bcm57711 bcm57711_SOURCES = bc57711_ext_loopback.c EXTRA_CFLAGS = @EXTRA_CFLAGS@ CC = @CC@ AM_CFLAGS = -Wall -W -Wstrict-prototypes $(EXTRA_CFLAGS) topdir/src/mezzanine_card_tests/Makefile.am bin_PROGRAMS = mezz mezz_SOURCES = mezzanine_card_test1.c EXTRA_CFLAGS = @EXTRA_CFLAGS@ CC = @CC@ AM_CFLAGS = -Wall -W -Wstrict-prototypes $(EXTRA_CFLAGS) This is the error I get: lh: aclocal lh: automake configure.ac:25: required file `basic_utilities/Makefile.in' not found configure.ac:25: required file `ethernet_tests/Makefile.in' not found configure.ac:25: required file `ethernet_tests/bc5709_tests/Makefile.in' not found configure.ac:25: required file `ethernet_tests/bc57711_tests/Makefile.in' not found configure.ac:25: required file `mezzanine_card_tests/Makefile.in' not found autoconf: automake failed with exit status: 1 I'm using autoconf 2.63 and automake version 1.10 which I downloaded and installed yesterday. Linux. What am I doing wrong? I appreciate any insite provided! Laura
Re: automake not descending into subdirectories to create Makefile.in's
Laura Hughes (lahughes) [EMAIL PROTECTED] writes: My directory struct looks like this: topdir/ src/ src/basic_utilities src/ethernet_tests/bc5709_tests src/ethernet_tests/bc57711_tests src/mezzanine_card_tests [...] AC_CONFIG_FILES([Makefile basic_utilities/Makefile ethernet_tests/Makefile ethernet_tests/bc5709_tests/Makefile ethernet_tests/bc57711_tests/Makefile mezzanine_card_tests/Makefile]) It looks to me that there is a missing src/ at the beginning of most of those lines. -- I was born lazy. I am no lazier now than I was forty years ago, but that is because I reached the limit forty years ago. You can't go beyond possibility. --Mark Twain
Re: automake not descending into subdirectories to create Makefile.in's
Hello Laura, * Laura Hughes (lahughes) wrote on Thu, Sep 25, 2008 at 09:44:07PM CEST: My directory struct looks like this: topdir/ src/ src/basic_utilities src/ethernet_tests/bc5709_tests src/ethernet_tests/bc57711_tests src/mezzanine_card_tests My files: topdir/configure.ac: AC_PREREQ(2.59) AC_INIT(cisco_diags, 1.0.1) AC_CONFIG_SRCDIR([Makefile]) The Makefile file is not actually part of the source tree: it is generated by configure in the build tree (from the Makefile.in file in the source tree). So it's better to list some file like a .c file: AC_CONFIG_SRCDIR([src/basic_utilities/show_hardware_info.c]) AM_CONFIG_HEADER([src/include/diags_config.h]) AM_INIT_AUTOMAKE(no-installinfo, no-installman, nostdinc, no-texinfo.tex) Automake's options need to be listed space-separated here. I think the commas will pretty much cause it to ignore all but the first option. AC_CONFIG_SUBDIRS(src) Do you actually need this? It is necessary only if you have another configure script in src/. # Checks for programs. AC_PROG_CC AC_PROG_INSTALL AC_PROG_RANLIB [...] AC_CHECK_FUNCS([strchr strrchr strtol]) AC_CONFIG_FILES([Makefile basic_utilities/Makefile ethernet_tests/Makefile ethernet_tests/bc5709_tests/Makefile ethernet_tests/bc57711_tests/Makefile mezzanine_card_tests/Makefile]) It looks like you should list src/Makefile here, too. Wait: wouldn't that be src/ethernet_tests/Makefile instead of ethernet_tests/Makefile and likewise for the other Makefiles? That explains the errors you are seeing. AC_OUTPUT topdir/Makefile.am AUTOMAKE_OPTIONS = foreign You don't need this line if you add foreign to the list of options as argument to AM_INIT_AUTOMAKE in configure.ac. EXTRA_CFLAGS = @EXTRA_CFLAGS@ You don't need this line if you put AC_SUBST([EXTRA_CFLAGS], ...) in configure.ac. Same issues in the other Makefile.am files. AM_CFLAGS = -Wall -W -Wstrict-prototypes $(EXTRA_CFLAGS) SUBDIRS = src topdir/src/Makefile.am AUTOMAKE_OPTIONS = foreign CC = @CC@ You don't need this line. EXTRA_CFLAGS = @EXTRA_CFLAGS@ AM_CFLAGS = -Wall -W -Wstrict-prototypes $(EXTRA_CFLAGS) SUBDIRS = basic_utilities ethernet_tests mezzanine_card_tests [...] configure.ac:25: required file `basic_utilities/Makefile.in' not found configure.ac:25: required file `ethernet_tests/Makefile.in' not found configure.ac:25: required file `ethernet_tests/bc5709_tests/Makefile.in' not found configure.ac:25: required file `ethernet_tests/bc57711_tests/Makefile.in' not found configure.ac:25: required file `mezzanine_card_tests/Makefile.in' not found Hope that helps. Cheers, Ralf