Question about makefile

Discussion in 'C Programming' started by fl, Oct 11, 2010.

  1. fl

    fl Guest

    Hi,
    I am learning a sample program for my project. When I run the make to
    the Makefile (which is below ....... line) in a Linux OS, I get the
    message below (between **** lines). I do not understand why make
    generates 'ansi/MMakefile'. The make process halts there.
    This is really bizarre. Could you tell me the reason? Thanks a lot.





    *****************
    cd bnd; make bnd.o
    make[1]: Entering directory `/home/jeff/LDPC_examples/DavidMackay/MNC/
    bnd'
    Makefile:2: ansi/MMakefile: No such file or directory
    make[1]: *** No rule to make target `ansi/MMakefile'. Stop.
    make[1]: Leaving directory `/home/jeff/LDPC_examples/DavidMackay/MNC/
    bnd'
    make: *** [bnd/bnd.o] Error 2
    ****************
    .....
    # MAKEFILE FOR `code'

    CFLAGS = $(INCDIRS) \
    -ansi -pedantic -g \
    -Wall -Wconversion -Wstrict-prototypes\
    -Wformat -Wmissing-prototypes -Wshadow\
    -Wpointer-arith -Wcast-qual -Wwrite-strings

    # -O2 -funroll-loops
    #
    # to profile gprof opt2
    # to not profile, remove -pg here and below.
    #
    # to optimize add -O2 -funroll-loops
    CC = gcc
    #

    # LIBS = -L/home/mackay/lib -ldbmalloc -lm
    LIBS = -lm

    #clean:
    # rm *.o

    all: r2b s2t t2r t2y y2b r2z zb2x

    tar:
    tar cvf ../../pub/code/MNC.tar ./*.c ./*.h ./*_var ./
    commander.p ./Makefile ./ansi/*.c ./ansi/*.h ./ansi/Makefile ./bnd/
    bnd.c ./bnd/bnd.h ./bnd/Makefile ./bnd/bnd_var* ./bnd/commander.p ./
    bnd/ansi ./SUMMARY _s/16 _s/4 _s/12 _r/12 _b/12 _y/12 _t/12 _z/12 _x/4
    radford/mod2mat.h radford/mod2mat.c radford/Makefile codes/12.4.3.111
    util/randfile
    gzip -f ../../pub/code/MNC.tar

    zb2x: zb2x.o ansi/r.o ansi/nrutil.o ansi/cmatrix.o bnd/bnd.o ansi/
    rand2b.o
    $(CC) zb2x.o ansi/r.o ansi/nrutil.o ansi/cmatrix.o bnd/bnd.o
    ansi/rand2b.o $(LIBS) -o zb2x

    ansi/smartall.o: ansi/smartall.c ansi/smartall.h
    cd ansi; make smartall.o
    zb2x.o: zb2x.c zb2x.h ansi/r.h ansi/rand2.h ansi/mynr.h ansi/cmatrix.h
    bnd/bnd_var_str.h zb2x_var_str.h
    s2t.o: s2t.c ansi/r.h ansi/rand2.h ansi/mynr.h ansi/cmatrix.h
    s2t_var_str.h radford/mod2mat.h
    s2t: s2t.o ansi/r.o ansi/nrutil.o ansi/cmatrix.o ansi/rand2b.o radford/
    mod2mat.o
    $(CC) s2t.o ansi/r.o ansi/nrutil.o ansi/cmatrix.o ansi/
    rand2b.o radford/mod2mat.o $(LIBS) -o s2t
    s2t_var_str.h: s2t_var commander.p
    commander.p s2t_var
    makecode.o: makecode.c ansi/r.h ansi/mynr.h ansi/cmatrix.h
    mkcode_var_str.h radford/mod2mat.h
    makecode: makecode.o ansi/r.o ansi/nrutil.o ansi/cmatrix.o ansi/
    rand2b.o radford/mod2mat.o
    $(CC) makecode.o ansi/r.o ansi/nrutil.o ansi/cmatrix.o ansi/
    rand2b.o radford/mod2mat.o $(LIBS) -o makecode

    mkcode_var_str.h: mkcode_var commander.p
    commander.p mkcode_var
    t2r.o: t2r.c ansi/r.h ansi/rand2.h ansi/mynr.h t2r_var_str.h
    t2r: t2r.o ansi/r.o ansi/nrutil.o ansi/cmatrix.o ansi/rand2b.o
    $(CC) t2r.o ansi/r.o ansi/nrutil.o ansi/rand2b.o $(LIBS) -o
    t2r
    t2y.o: t2y.c ansi/r.h ansi/rand2.h ansi/mynr.h t2y_var_str.h
    t2y: t2y.o ansi/r.o ansi/nrutil.o ansi/rand2b.o
    $(CC) t2y.o ansi/r.o ansi/nrutil.o ansi/rand2b.o $(LIBS) -o
    t2y
    t2y_var_str.h: t2y_var commander.p
    commander.p t2y_var
    r2z.o: r2z.c ansi/r.h ansi/rand2.h ansi/mynr.h r2z_var_str.h
    r2z: r2z.o ansi/r.o ansi/nrutil.o ansi/cmatrix.o ansi/rand2b.o
    $(CC) r2z.o ansi/r.o ansi/nrutil.o ansi/cmatrix.o ansi/
    rand2b.o $(LIBS) -o r2z
    r2z_var_str.h: r2z_var commander.p
    commander.p r2z_var
    r2b.o: r2b.c ansi/r.h ansi/rand2.h ansi/mynr.h r2b_var_str.h
    r2b: r2b.o ansi/r.o ansi/nrutil.o ansi/cmatrix.o ansi/rand2b.o
    $(CC) r2b.o ansi/r.o ansi/nrutil.o ansi/cmatrix.o ansi/
    rand2b.o $(LIBS) -o r2b
    r2b_var_str.h: r2b_var commander.p
    commander.p r2b_var
    y2b.o: y2b.c ansi/r.h ansi/mynr.h y2b_var_str.h
    y2b: y2b.o ansi/r.o ansi/nrutil.o ansi/cmatrix.o
    $(CC) y2b.o ansi/r.o ansi/nrutil.o $(LIBS) -o y2b
    y2b_var_str.h: y2b_var commander.p
    commander.p y2b_var

    radford/mod2mat.o: radford/mod2mat.c radford/mod2mat.h
    cd radford ; make mod2mat.o
    bnd/bnd.o: bnd/bnd.c bnd/bnd.h
    cd bnd; make bnd.o
     
    fl, Oct 11, 2010
    #1
    1. Advertising

  2. fl

    Seebs Guest

    On 2010-10-11, fl <> wrote:
    > Hi,
    > I am learning a sample program for my project. When I run the make to
    > the Makefile (which is below ....... line) in a Linux OS, I get the
    > message below (between **** lines). I do not understand why make
    > generates 'ansi/MMakefile'. The make process halts there.
    > This is really bizarre. Could you tell me the reason? Thanks a lot.


    I don't see a C question here. Maybe try a newsgroup related to make?
    I think people will often put up with make questions over in comp.unix.shell,
    just because make is a shell utility.

    -s
    --
    Copyright 2010, all wrongs reversed. Peter Seebach /
    http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
    http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
    I am not speaking for my employer, although they do rent some of my opinions.
     
    Seebs, Oct 11, 2010
    #2
    1. Advertising

  3. fl <> wrote:
    > I am learning a sample program for my project. When I run the make to
    > the Makefile (which is below ....... line) in a Linux OS, I get the
    > message below (between **** lines). I do not understand why make
    > generates 'ansi/MMakefile'. The make process halts there.
    > This is really bizarre. Could you tell me the reason? Thanks a lot.


    As Peter Seebach already pointed out the C newsgroup isn't the
    ideal choice for asking questions about a "different language"
    like the one make interprets. Another newsgroup you might con-
    sider beside the one Peter pointed out is comp.unix.programer.

    <off topic>

    > cd bnd; make bnd.o
    > make[1]: Entering directory `/home/jeff/LDPC_examples/DavidMackay/MNC/
    > bnd'


    This rather likely is due to the lines

    > bnd/bnd.o: bnd/bnd.c bnd/bnd.h
    > cd bnd; make bnd.o


    from the Makefile you posted. This tells make to go into the
    'bnd' subdirectory and start a new make process, using the
    Makefile in that 'bnd' directory to create the target 'bnd.o'.

    > Makefile:2: ansi/MMakefile: No such file or directory


    And this probably is an error message from the secondary make
    process, dealing with the Makefile in 'bnd'. So I would guess
    that there's an instruction in that Makefile that requires a
    file 'bnd/ansi/MMakefile' but which doesn't exist. Why this
    file is needed can't then be said without seeing the Makefile
    in the 'bnd' directory - what you posted is only the Makefile
    of the directory that 'bnd' is in. So if you repost in a more
    appropriate newsgroup I would recommend that you also post the
    Makefile from the 'bnd' subdirectory.

    </off topic>
    Regards, Jens
    --
    \ Jens Thoms Toerring ___
    \__________________________ http://toerring.de
     
    Jens Thoms Toerring, Oct 11, 2010
    #3
  4. fl

    fl Guest

    On 11 oct, 15:53, (Jens Thoms Toerring) wrote:
    > fl <> wrote:
    > > I am learning a sample program for my project. When I run the make to
    > > the Makefile (which is below ....... line) in a Linux OS, I get the
    > > message below (between **** lines). I do not understand why make
    > > generates 'ansi/MMakefile'. The make process halts there.
    > > This is really bizarre. Could you tell me the reason? Thanks a lot.

    >
    > As Peter Seebach already pointed out the C newsgroup isn't the
    > ideal choice for asking questions about a "different language"
    > like the one make interprets. Another newsgroup you might con-
    > sider beside the one Peter pointed out is comp.unix.programer.
    >
    > <off topic>
    >
    > > cd bnd; make bnd.o
    > > make[1]: Entering directory `/home/jeff/LDPC_examples/DavidMackay/MNC/
    > > bnd'

    >
    > This rather likely is due to the lines
    >
    > > bnd/bnd.o:      bnd/bnd.c bnd/bnd.h
    > >         cd bnd; make bnd.o

    >
    > from the Makefile you posted. This tells make to go into the
    > 'bnd' subdirectory and start a new make process, using the
    > Makefile in that 'bnd' directory to create the target 'bnd.o'.
    >
    > > Makefile:2: ansi/MMakefile: No such file or directory

    >
    > And this probably is an error message from the secondary make
    > process, dealing with the Makefile in 'bnd'. So I would guess
    > that there's an instruction in that Makefile that requires a
    > file 'bnd/ansi/MMakefile' but which doesn't exist. Why this
    > file is needed can't then be said without seeing the Makefile
    > in the 'bnd' directory - what you posted is only the Makefile
    > of the directory that 'bnd' is in. So if you repost in a more
    > appropriate newsgroup I would recommend that you also post the
    > Makefile from the 'bnd' subdirectory.
    >
    > </off topic>
    >                              Regards, Jens
    > --
    >   \   Jens Thoms Toerring  ___      
    >    \__________________________      http://toerring.de


    Thanks.
    The original C package is a little large and complex to me. There are
    several makefile in different subdirectories. Could you help me to
    check the website on the first source coding link?
    http://www.inference.phy.cam.ac.uk/mackay/S0.html
    I have tried many times still find no clues on the several makefiles.
    Thanks again.
     
    fl, Oct 12, 2010
    #4
  5. <sorry, off topic again>

    fl <> wrote:
    > The original C package is a little large and complex to me. There are
    > several makefile in different subdirectories. Could you help me to
    > check the website on the first source coding link?
    > http://www.inference.phy.cam.ac.uk/mackay/S0.html
    > I have tried many times still find no clues on the several makefiles.


    I guess this is about

    http://www.inference.phy.cam.ac.uk/mackay/code/MNC.tar.gz

    In that case the problem simply seems to be a broken package.
    There's a symbolic link 'ansi' in 'bnd' that points to a non-
    existend directory '../newansi'. And that, of course, throws
    off make when it's asked to include the file 'MMakefile' from
    the directory this (broken) link is supposed to point to (as
    the Makefile in the 'bnd' subdirectory at line 2 does). The
    only way to get that corrected is to ask to the authors of
    the package, it's unlikely that anyone else will be able to
    help you, sorry.

    </off topic>
    Regards, Jens
    --
    \ Jens Thoms Toerring ___
    \__________________________ http://toerring.de
     
    Jens Thoms Toerring, Oct 12, 2010
    #5
  6. fl

    Jorgen Grahn Guest

    On Tue, 2010-10-12, Jens Thoms Toerring wrote:
    > <sorry, off topic again>
    >
    > fl <> wrote:
    >> The original C package is a little large and complex to me. There are
    >> several makefile in different subdirectories. Could you help me to
    >> check the website on the first source coding link?
    >> http://www.inference.phy.cam.ac.uk/mackay/S0.html
    >> I have tried many times still find no clues on the several makefiles.

    >
    > I guess this is about
    >
    > http://www.inference.phy.cam.ac.uk/mackay/code/MNC.tar.gz
    >
    > In that case the problem simply seems to be a broken package.
    > There's a symbolic link 'ansi' in 'bnd' that points to [...]
    > the Makefile in the 'bnd' subdirectory at line 2 does). The
    > only way to get that corrected is to ask to the authors of
    > the package, it's unlikely that anyone else will be able to
    > help you, sorry.


    And the files are fifteen years old ...

    I'd like to add that the packaging is awful:
    - no version information
    - the tarball spreads lots of tiny files in the current directory
    when unpacked. Fortunately I expected that and unpacked it in a
    temporary directory.
    - Google "recursive make considered harmful"

    You probably have to *be* the original author to make sense of it.
    It doesn't seem intended for general use; he hasn't put the
    needed effort into the packaging. (I don't mind that: you can place
    anything on a web server. But reusable code doesn't come in packaging
    like this.)

    > </off topic>
    > Regards, Jens


    /Jorgen

    --
    // Jorgen Grahn <grahn@ Oo o. . .
    \X/ snipabacken.se> O o .
     
    Jorgen Grahn, Oct 12, 2010
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matthias Pieroth

    Makefile question

    Matthias Pieroth, Mar 4, 2004, in forum: C++
    Replies:
    3
    Views:
    363
    Jorge Rivera
    Mar 5, 2004
  2. jose luis fernandez diaz

    Question about simple gmake Makefile

    jose luis fernandez diaz, Apr 29, 2004, in forum: C++
    Replies:
    1
    Views:
    1,306
    Christopher Benson-Manica
    Apr 29, 2004
  3. Dan Bishop

    Python in Makefile Question

    Dan Bishop, Feb 11, 2005, in forum: Python
    Replies:
    4
    Views:
    535
    Bart van Deenen
    Feb 11, 2005
  4. Carson

    Makefile question

    Carson, Jul 4, 2005, in forum: C Programming
    Replies:
    1
    Views:
    336
    Rouben Rostamian
    Jul 4, 2005
  5. Replies:
    2
    Views:
    317
Loading...

Share This Page