Makefile question
Hi all,
I am new to Makefile. The question is:
I have a large number of .c files in a directory other than the directory where Makefile resides. The structure is like:
----/
|
|---- build
| |
| |--- linux
| |
| |- Makefile
|
|-----src
| |
| |--- *.c
In the Makefile, I have a list of .c files defined as:
SRCS=file1.c file2.c ..... file100.c
The Makefile was in the same directory with all the .c files and the following line works.
%(CC) $(CFLAG) -c $(SRCS)
However, as the Makefile is moved to the new directory. It cannot find those source file any more.
My question is how I should define the path so that Makefile can find all the .c files in the src directory.
I don't want to add the path name manually to each .c file. There must be a standard way to doing this.
Can anyone help me?
Regards,
Ray
Last edited by silentray; 12-17-2009 at 01:08 PM.
|