![]() |
| | #1 | |
| Registered User Join Date: Jun 2007
Posts: 116
| (autotools) make does not decent to src 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
Code: bin_PROGRAMS = spankytanky spankytanky_SOURCES = main.cpp spankytanky_LDADD = /usr/lib SDL spankytanky_CPPFLAGS =/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT Quote:
why? if you please. | |
| kroiz is offline | |
| | #2 |
| Cat without Hat 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])
__________________ 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 | |
| | #3 | |
| Registered User Join Date: Jun 2007
Posts: 116
| Quote:
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 | |
| | #4 |
| Registered User 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 | |
![]() |
| Tags |
| autotools, configure.ac, makefile.am |
| Thread Tools | |
| Display Modes | |
|
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 |