bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: help me


From: Chuck Swiger
Subject: Re: help me
Date: Wed, 27 Apr 2005 13:37:38 -0400
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414

address@hidden wrote:
hello,
I'm trying to to create a makefile of this following small program.
[ ... ]
makefile
OBJS = prg1.o
CC = gcc
CFLAGS = -wall -g
all : $(OBJS) $(CC) $(OBJS) -o prg.exe
prg1.o : prg1.c $(CC) $(FLAGS) -c prg1.c -o prg1.o
main.o : main.c $(CC) $(CFLAGS) -c main.c -o main.o
clean: rm -f core *.o


When I do the make, I get following error :
make: *** No rule to make target `gcc', needed by `prg1.o'.  Stop.

You're not using the right syntax for Makefiles.
Something like this should do better:

CC= gcc
CFLAGS= -Wall -g
OBJS= prg1.o

all: prg.exe

prg.exe: $(OBJS)
        $(CC) $(CFLAGS) -o prg.exe $(OBJS)

clean:
        rm -f core *.o prg.exe

--
-Chuck





reply via email to

[Prev in Thread] Current Thread [Next in Thread]