problem with a makefile

F

fabio

http://rafb.net/paste/results/zJOE1P93.html

it's all there! any help would be appreciated..
bye!

p.s. but sure i can paste it here too! :)
START FILE:

all: client server


server: server.o mymutex.o error.o changedir.o
gcc -o server -lpthread server.o mymutex.o error.o changedir.o

server.o: server.c error.h debug.h defines.h server.h
gcc -g -DDEBUG -c server.c

client: client.o mymutex.o copia.o error.o
gcc -o client -lpthread client.o mymutex.o copia.o error.o c_transfer.o

client.o: client.c client.h
gcc -g -DDEBUG -DCLIENT -c client.c

c_transfer.o: c_transfer.c client.h
gcc -g -DDEBUG -DCLIENT -c c_transfer.c

mymutex.o: mymutex.c mymutex.h server.h
gcc -g -DDEBUG -c mymutex.c

error.o: error.c error.h debug.h defines.h server.h
gcc -g -DDEBUG_ERROR -c error.c

copia.o: copia.c error.h debug.h defines.h
gcc -g -DDEBUG -DCLIENT -c copia.c

changedir.o: changedir.c error.h debug.h defines.h server.h
gcc -g -DDEBUG -DCLIENT -c changedir.c


clean:
/bin/rm -f client server client.o server.o mymutex.o copia.o changedir. o c_transfer.o

END FILE

this is the error:
faz@debian:/progetto/prova2$ make
gcc -g -DDEBUG -DCLIENT -c client.c
client.c: In function `main':
client.c:155: warning: assignment makes pointer from integer without a cast
gcc -g -DDEBUG -c mymutex.c
gcc -g -DDEBUG -DCLIENT -c copia.c
gcc -o client -lpthread client.o mymutex.o copia.o error.o c_transfer.o
gcc: c_transfer.o: No such file or directory
make: *** [client] Error 1

so... why it can't found c_transfer.o? seems like is not been compiled..
 
W

Walter Roberson

fabio said:
p.s. but sure i can paste it here too! :)
START FILE:
all: client server

Makefiles are not part of the C standard, and discussions of make
are better made in a newsgroup specific to your programming
environment or specific to the tool suite you are using.
 
K

Keith Thompson

fabio said:
http://rafb.net/paste/results/zJOE1P93.html

it's all there! any help would be appreciated..
bye!

p.s. but sure i can paste it here too! :)
START FILE:

all: client server [snip]
clean:
/bin/rm -f client server client.o server.o mymutex.o copia.o changedir. o c_transfer.o

END FILE
this is the error:
faz@debian:/progetto/prova2$ make
gcc -g -DDEBUG -DCLIENT -c client.c
client.c: In function `main':
client.c:155: warning: assignment makes pointer from integer without a cast
gcc -g -DDEBUG -c mymutex.c
gcc -g -DDEBUG -DCLIENT -c copia.c
gcc -o client -lpthread client.o mymutex.o copia.o error.o c_transfer.o
gcc: c_transfer.o: No such file or directory
make: *** [client] Error 1

so... why it can't found c_transfer.o? seems like is not been compiled..

Sorry, we don't do Makefiles here. You might try
comp.unix.programmer. (I think I see the problem, but I'm not going
to go into the details in this newsgroup; if you post to
comp.unix.programmer, I'll answer there if somebody else doesn't beat
me to it. <OT>Hint: Ask yourself whether "client" depends on
"c_transfer.o", and if so, whether you've said so.</OT>)

You should fix the warning in client.c. You haven't shown us the C
source, so it's impossible to be certain, but a common cause of that
message is that you're calling malloc() without the required
"#include <stdlib.h>". (Resist the temptation to correct the problem
by adding a cast; that would mask the error without fixing it.)
 
F

fabio

Il Thu, 09 Mar 2006 21:37:45 +0000, Walter Roberson ha scritto:
Notice you are creating "client" based upon several .o files, but
not all of the .o files are listed as dependancies in the "client:" line.

Oh yes, i see..
thx both of you for response, and sorry if i was off-topic!
Bye!
 

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,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top