This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Compiler/linker options and search parths (drives me crazy)
- From: Muthukumar Ratty <muthu at iqmail dot net>
- To: Manuel Schmitt <manuel at manitu dot de>
- Cc: <gcc-help at gcc dot gnu dot org>
- Date: Sun, 6 Apr 2003 12:02:42 -0700 (PDT)
- Subject: Re: Compiler/linker options and search parths (drives me crazy)
>
> I will try to be short. So we have the following folders and files.
>
> ./shared
> ./shared/shared1.h
> ./shared/shared1.cpp
>
> ./target1
> ./target1/target1.cpp
> ./target1/Makefile
>
> I order to avoid writing each Makefile for the targets manually, I wanted to
> have something like
>
SHRDIR = <dir where the "shared" is located>
> DIR = /root/test
>
> all : main
>
> main : target1.cpp
> gcc -I$(DIR) -c target1.cpp
> gcc -I$(DIR) shared/shared1.o target1.o -o target1
>
gcc -I$(DIR) $(SHRDIR)/shared/shared1.o target1.o -o target1
>
> This does not work because gcc will not find shared/shared1.o. Okay, I could
> write ../shared/shared1.o but this will bring
> me into other trouble.
The above should work and may be acceptable for you? :)