Hi jim ,
its great its working fine with the path specified in the VPATH variable
now when i run make it is giving the following error.
[user1@scmtest mk4]$ make
cc -c main.c
cc -c sec.o
cc: sec.o: No such file or directory
cc: no input files
make: *** [sec.o] Error 1
[user1@scmtest mk4]$
The contents of makefile is
PHP Code:
VPATH=/usr/include
myfile : main.o sec.o
cc -o myfile main.o sec.o
main.o : main.c stdio.h
cc -c main.c
sec.o : sec.c stdio.h
cc -c sec.o
The contents of main.c file is
PHP Code:
main()
{
printf("HEllo this is from main");
mynextprog();
}
The contents of sec.o is
PHP Code:
mynextprog()
{
printf("helllo this is from my next prog");
printf("Bye bye");
}
even though sec.o is existing it says cc: sec.o: No such file or directory
but when i compile and create the sec.o separately , it is working fine. with the following error message
cc -o myfile main.o sec.o
this means the next rule after stdio.h statement is not bieng executed. if i create the obj file seperately it is working fine
My Question is
1) is it possible to include stdio.h file in the make without including it in the source code file.?
Thanks Jim
Regards
Victor vinod