(autotools) make does not decent to src

This is a discussion on (autotools) make does not decent to src within the Linux Programming forums, part of the Platform Specific Boards category; Hi, I have only one small cpp file but I am having hard time building it with autotools. Before I ...

  1. #1
    Registered User kroiz's Avatar
    Join Date
    Jun 2007
    Posts
    116

    (autotools) make does not decent to src

    Hi,
    I have only one small cpp file but I am having hard time building it with autotools.
    Before I started with autotools I built it with:
    g++ main.cpp `sdl-config --cflags --libs`
    and that worked fine.
    I created a subdir named src and put my main.cpp there.
    I made a Makefile.am and put SUBDIR = src in it.
    I made a configure.ac with:
    Code:
    #                                               -*- Autoconf -*-
    # Process this file with autoconf to produce a configure script.
    
    AC_PREREQ(2.61)
    AC_INIT(spankytanky, 0.1.0, krizuy@gmail.net)
    AC_CONFIG_SRCDIR([src/main.cpp])
    AC_CONFIG_HEADER([config.h])
    
    # Checks for programs.
    AC_PROG_CXX
    
    # Checks for libraries.
    
    # Checks for header files.
    
    # Checks for typedefs, structures, and compiler characteristics.
    AC_HEADER_STDBOOL
    AC_C_CONST
    
    # Checks for library functions.
    
    AC_CONFIG_FILES([Makefile
                     src/Makefile])
    AM_INIT_AUTOMAKE
    AC_OUTPUT
    I made src/Makefile.am with:
    Code:
    bin_PROGRAMS = spankytanky
    spankytanky_SOURCES = main.cpp
    spankytanky_LDADD = /usr/lib SDL
    spankytanky_CPPFLAGS =/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
    When I do:
    autoreconf
    ./configure

    make
    make all-am
    make[1]: Entering directory `/home/kroiz/spankytanky'
    make[1]: Leaving directory `/home/kroiz/spankytanky'
    seems like it does not decent to src.
    why? if you please.

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    I don't get autotools, but this looks wrong to me:
    Code:
    AC_CONFIG_SRCDIR([src/main.cpp])
    src/main.cpp is not a directory.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    Registered User kroiz's Avatar
    Join Date
    Jun 2007
    Posts
    116
    Quote Originally Posted by CornedBee View Post
    I don't get autotools, but this looks wrong to me:
    Code:
    AC_CONFIG_SRCDIR([src/main.cpp])
    src/main.cpp is not a directory.
    That is actually ok.
    AC_CONFIG_SRCDIR parameter, is some file that is in the package's source directory; configure checks for this file's existence to make sure that the directory that it is told that contains the source code, in fact does; it is a safety check.

  4. #4
    Registered User kroiz's Avatar
    Join Date
    Jun 2007
    Posts
    116
    spankytanky_LDADD = -L/usr/lib -lSDL
    spankytanky_CPPFLAGS =-I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT

    I had to fix Makefile.am and the Makefile.am in the project directory
    /s/SUBDIR/SUBDIRS

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Establishing 'make clean' with GNU make
    By Jesdisciple in forum C Programming
    Replies: 9
    Last Post: 04-11-2009, 10:10 AM
  2. How to make a Packet sniffer/filter?
    By shown in forum C++ Programming
    Replies: 2
    Last Post: 02-22-2009, 09:51 PM
  3. "Cannot make pipe"
    By crepincdotcom in forum C Programming
    Replies: 5
    Last Post: 08-16-2004, 01:43 PM
  4. HELP!wanting to make full screen game windowed
    By rented in forum Game Programming
    Replies: 3
    Last Post: 06-11-2004, 05:19 AM
  5. make all rule
    By duffy in forum C Programming
    Replies: 9
    Last Post: 09-11-2003, 02:05 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21