make errors

Ish Rattan ishwar@pali.cps.cmich.edu
Sun May 26 13:54:00 GMT 2002


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?



More information about the Gcc-help mailing list