This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: make errors
- From: Ish Rattan <ishwar at pali dot cps dot cmich dot edu>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Sun, 26 May 2002 13:08:52 -0400 (EDT)
- Subject: Re: make errors
On Sun, 26 May 2002, Shalendra Chhabra wrote:
> I was writing a make file
>
> CC=gcc
> CFLAGS=-Wall -I/usr/include
> HEADERS=defines.h
> SOURCES=main.c hello.c math.c
> #OBJECTS=main.o hello.o math.o
> OBJECTS=$(SOURCES:.c=.o)
> #Object files have the same name as the .c files but extension .o
> PROGRAM=hello
> $(PROGRAM): $(OBJECTS)
> $(CC) $(OBJECTS) -o $(PROGRAM)
>
> main.o: hello.c math.c defines.h
> hello.o: defines.h math.c
> math.o: defines.h hello.c
> clean:
> rm -rf *.o $(PROGRAM)
<tab>rm -rf *.o etc..
Time to read man page for makefile?