C Board  

Go Back   C Board > Platform Specific Boards > Linux Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 01-28-2009, 04:27 PM   #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:
Quote:
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.
kroiz is offline   Reply With Quote
Old 01-28-2009, 04:57 PM   #2
Cat without Hat
 
CornedBee's Avatar
 
Join Date: Apr 2003
Posts: 8,492
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
CornedBee is offline   Reply With Quote
Old 01-28-2009, 11:39 PM   #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.
kroiz is offline   Reply With Quote
Old 01-29-2009, 02:12 PM   #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
kroiz is offline   Reply With Quote
Reply

Tags
autotools, configure.ac, makefile.am

Thread Tools
Display Modes

Forum Jump

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


All times are GMT -6. The time now is 12:04 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

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