make: *** No rule to make target `main.c', needed by `main.o'. Stop.
I had a doubt regarding Makefile..i have created a Makefile.But i get error like make: *** No rule to make target `main.c', needed by `main.o'. Stop.
My source files main.c,hello.c ,hello1.c resides in src directory and include files function.h function1.h resides in inc directory.These two directories src and inc are in work directory.Make file resides in work directory
---------------------------------------------------
CC=gcc
vpath src
vpath inc
CPPFLAGS=-I inc
main : main.o hello.o hello1.o
$(CC) -o $(CPPFLAGS) $<
..c.o:
main.o : main.c function.h function1.h
$(CC) -c $(CPPFLAGS) $<
hello.o : hello.c function.h
$(CC) -c $(CPPFLAGS) $<
hello1.o : hello1.c function1.h
$(CC) -c $(CPPFLAGS) $<
.PHONY clean:
rm -rf *.o
---------------------------------------------------
can nyone fix this problem plz???
|