[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Using automake



Laurent Guignard wrote, On 15-02-09 18:58:
Joris Dobbelsteen a écrit :
Hello,

I'm trying to build a application and was trying to use automake with
it. Now I've stumbled upon an issue, see below, I cannot resolve for a
few days. I think it is somewhere(tm) in the manual though.

Can anyone point me to the problem and/or solution?

Thanks,

- Joris

=====================

The error I get is:

make -k all
make  all-recursive
make[1]: Entering directory
`/home/joris/livecdrecorder-project/liverecorder'
Making all in src
make[2]: Entering directory
`/home/joris/livecdrecorder-project/liverecorder/src'
g++ -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT streamprocessor.o -MD -MP
-MF .deps/streamprocessor.Tpo -c -o streamprocessor.o `test -f
'libsp/streamprocessor.cpp' || echo './'`libsp/streamprocessor.cpp
mv -f .deps/streamprocessor.Tpo .deps/streamprocessor.Po
rm -f libsp.a
ar cru libsp.a streamprocessor.o
ranlib libsp.a
make[2]: *** No rule to make target `livecdrecorder.o', needed by
`livecdrecorder'.
make[2]: Target `all' not remade because of errors.
make[2]: Leaving directory
`/home/joris/livecdrecorder-project/liverecorder/src'
make[2]: Entering directory
`/home/joris/livecdrecorder-project/liverecorder'
make[2]: Leaving directory
`/home/joris/livecdrecorder-project/liverecorder'
make[1]: Leaving directory
`/home/joris/livecdrecorder-project/liverecorder'
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

===================

makefile.am:

SUBDIRS = src
dist_doc_DATA = README


====================

src/makefile.am:

#SUBDIRS = libsp livecdrecorder

bin_PROGRAMS = livecdrecorder
lib_LIBRARIES = libsp.a

livecdrecorder_SOURCE = livecdrecorder/main.c
livecdrecorder_LDADD = libsp

libsp_a_SOURCES = libsp/streamprocessor.cpp
include_HEADERS = libsp/streamprocessor.h


=====================

configure.ac

AC_INIT([livecdrecorder], [0.1], [myname@mydomain])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_PROG_CC
AC_PROG_CXX
AC_PROG_RANLIB
#AC_PROG_LIBTOOL
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([
    Makefile
    src/Makefile
])
AC_OUTPUT



Hi Joris,
I think that you need a Makefile in your directory "livecdrecorder" to
build all sources in this directory.
For me projects, i build a Makefile.am in each sub-drirectories of
project and include SUBDIRS directive in parent directory Makefile.am
So after you build the livecdrecorder.o, you will be able to build your
software.
I think it's the same for your libsp/streamprocessor.o
May be i am wrong, or it isn't the good way to get the binary, but in my
projects this is working.

I think you mean that you mean the SUBDIRS directive should be enabled again and the respective _SOURCE _LDADD BIN_ LIB_ directives should move to the subdirecties makefile.am? That was the path I had taken earlier and it was the same (worse actually) misery as I'm currently in.

If you don't mind, I would really like to see an example of your configure.ac and makefile.am files as reference. The examples in the automake manual are just too trivial for my taste. I really don't have any clue in how to get this thing to work.

Thanks,

- Joris

Best regards,
Laurent

- --
Laurent Guignard, Registered as user #301590 with the Linux Counter
Site : http://www.famille-guignard.org
Blog : http://blog.famille-guignard.org
Projet : http://sicontact.sourceforge.net
GULL de Villefranche sur Saône : http://www.cagull.org


Reply to: