Makefile Help

P

pycraze

Hi ,

I have written the below Makefile .


srcdir = ./lib
o = .o

LDFLAGS =
CC = gcc
CFLAGS = -O2 -Wall -Wno-implicit
INCLUDES = -I. -I$(srcdir)

COMPILE = $(CC) $(INCLUDES) $(CFLAGS)
LINK = $(CC) -o $@ $(CFLAGS) $(LDFLAGS)

RM = rm -f

OBJ = read_conf$o config_affairs$o getpass$o utilities$o \
des$o md4$o http_header$o ntlm_procs$o ntlm_message$o \
ntlm_auth$o base64$o basic_auth$o sig_hand$o \
proxy_client$o server$o main$o

all: myaps

..o.c: $(CC) $(CFLAGS) $(INCLUDES) -c $<

myaps: $(OBJ) gcc $(CFLAGS) -o $@ $(OBJ)

..PHONY: clean

clean: $(RM) *.o


After do make -n i get

gcc -O2 -Wall -Wno-implicit -c -o read_conf.o read_conf.c
gcc -O2 -Wall -Wno-implicit -c -o config_affairs.o config_affairs.c
gcc -O2 -Wall -Wno-implicit -c -o getpass.o getpass.c
gcc -O2 -Wall -Wno-implicit -c -o utilities.o utilities.c
gcc -O2 -Wall -Wno-implicit -c -o des.o des.c
gcc -O2 -Wall -Wno-implicit -c -o md4.o md4.c
gcc -O2 -Wall -Wno-implicit -c -o http_header.o http_header.c
gcc -O2 -Wall -Wno-implicit -c -o ntlm_procs.o ntlm_procs.c
gcc -O2 -Wall -Wno-implicit -c -o ntlm_message.o ntlm_message.c
gcc -O2 -Wall -Wno-implicit -c -o ntlm_auth.o ntlm_auth.c
gcc -O2 -Wall -Wno-implicit -c -o base64.o base64.c
gcc -O2 -Wall -Wno-implicit -c -o basic_auth.o basic_auth.c
gcc -O2 -Wall -Wno-implicit -c -o sig_hand.o sig_hand.c
gcc -O2 -Wall -Wno-implicit -c -o proxy_client.o proxy_client.c
gcc -O2 -Wall -Wno-implicit -c -o server.o server.c
gcc -O2 -Wall -Wno-implicit -c -o main.o main.c
make: *** No rule to make target `gcc', needed by `myaps'. Stop.


I do not find the reason why i get the message -" No rule to make
target `gcc', needed by `myaps'. Stop." with my Makefile .

Can anyone help me with this problem
 
B

Ben Pfaff

pycraze said:
I have written the below Makefile .

Questions about makefiles are better asked elsewhere. Perhaps
comp.unix.programmer is an appropriate place.
 
P

pycraze

pycraze said:
I have written the below Makefile .

Questions about makefiles are better asked elsewhere. Perhaps
comp.unix.programmer is an appropriate place.
--
int main(void){char p[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.\
\n",*q="kl BIcNBFr.NKEzjwCIxNJC";int i=sizeof p/2;char *strchr();int putchar(\
);while(*q){i+=strchr(p,*q++)-p;if(i>=(int)sizeof p)i-=sizeof p-1;putchar(p\
);}return 0;}


Thank you Ben . I will surely consider your suggestion .
 
M

Mark Bluemel

pycraze said:
Hi ,

I have written the below Makefile .

And what does this have to do with the C programming language?

[snip]

A bit of non-topical advice follows :-
myaps: $(OBJ) gcc $(CFLAGS) -o $@ $(OBJ)

Read the manual pages for make files. The line above is a dependency
line. It says that to make "myaps" you need, among other things, an
object locally called "gcc". It doesn't know how to make "gcc".

As Jacob has already told you (and you said you'd consider his
contribution - what the hell does that mean?) the command to build
"myaps" must be on a newline (and preceded by at least one TAB
character, if I recall correctly).

Next time:
a) read the <insert expletive here> manual
b) if you're still stuck find an appropriate newsgroup at which to ask -
this one is about C, not about general programming
 

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,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top