This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

questions for the C programmer


Hi!

My problem is:-
I have a directory structure as follows ( I have simplified things by
reducing the number of directories and .c files).


			main directory
				|
		   ------------------------------------------------
		   |				|				   |
	 	dir1			    dir2          		dir3
	   (Makefile)			|                          |
					---------------             -------------
					|              |	          |            |
				    A.c              B.c          A.h         B.h


I need to compile the code such that all the object files are created in
dir1 and the final execuatble is also created in dir1. I cannot use an
implicit declaration in my Makefile like

.o.c :
	$(CC) $(CFLAGS) -c $*.c

because the .c files are in different directories. There could be an
alternative if I can declare something like a search path. Essentially, my
problem is "Is there such an implicit declaration possible?"
and if yes How do you set the search path for the .c files in a Makefile ?
thanks
Kunal



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]