Question about makefile

F

fl

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
 
S

Seebs

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
 
J

Jens Thoms Toerring

fl said:
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.

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
 
F

fl

fl said:
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.

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

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.
 
J

Jens Thoms Toerring

<sorry, off topic again>

fl said:
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
 
J

Jorgen Grahn

<sorry, off topic again>

fl said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top