Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   simple makefile (http://www.go4expert.com/forums/simple-makefile-t10043/)

answerme 15Apr2008 11:41

simple makefile
I have 2 dir one is src & include
src contains len.c string.c
include contains len.h
my makefile contains

vpath %.c src
CPPFLAGS =-I include

string : string.o len.o
        gcc $^ -o $@
string.o: string.c include/len.h
        gcc -c $<
len.o:len.c include/len.h
        gcc -c $<

After giving command make iam getting error


[root@localhost sting]# make
gcc -c src/string.c
src/string.c:2:16: error: len.h: No such file or directory
make: *** [string.o] Error 1

WHere iam getting wrong

All times are GMT +5.5. The time now is 13:59.