This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
questions for the C programmer
- To: gcc-help at gcc dot gnu dot org
- Subject: questions for the C programmer
- From: Kunal Jain <kuj3+ at pitt dot edu>
- Date: Thu, 21 Jun 2001 11:35:58 -0400 (EDT)
- Cc: Arun Dev Qamra <ADQamra at yantra dot com>,"Thalis A. Kalfigopoulos" <thalis at cs dot pitt dot edu>
- Reply-to: Kunal Jain <kuj3 at pitt dot edu>
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