[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Where to place include files
From: |
Guido Draheim |
Subject: |
Re: Where to place include files |
Date: |
Fri, 28 Sep 2001 19:45:25 +0200 |
I never had problems with letting header and source files
be in the same subdir which has the name of the project itself.
Instead it gets easier to build different-named subprojects
together at the same time. W.r.t. to a "prodesk" I'd simply
bind all *.h and *.c into a subdir prodesk/prodesk, there
is just one SUBDIR=prodesk in the toplevel prodesk/ dir,
and the subdir /prodesk makefile contains just "-I$(srcdir)/.."
btw, that way it's damn easy to have a "gdk/" and "gtk/" subdir
side-by-side under the same toplevel makefile and get to the
headers from each subproject - there's really no need to split
them into different tarballs/rpms for distribution. But that
may be a different story...
Julio Merino wrote:
>
> Hi all,
>
> I'm wondering about how to organize the header (.h) files on my project.
> The structure is like the following: the directory "prodesk", which is
> the toplevel directory, contains a subdirectory named "core", and another
> one named "include", both hanging from the topdir.
>
> In my header files, I need to do some #include's of other .h files I've
> written. These files are all placed in prodesk/core subdirectory.
> I want to put these files when they are installed on
> /usr/include/prodesk. And here, the problem arises.
>
> I include headers from headers like: (for example)
> #include <prodesk/string.h>
>
> As you may notice, there is the "prodesk/" directory preceding the header
> file, so this will work when it gets installed.
>
> But, to solve the include problems because missing files if the package
> is not yet installed I've done the following. I've created a subdirectory
> in prodesk/include, that is called prodesk itself. So, I try to shadow
> the real include's dir layout.
>
> Then, I've populated that directory with symlinks:
> (wherever I am)/prodesk/include/prodesk $ ln -s ../../core/*.h .
>
> This way, when building the library, it can include the files fine, and
> when is installed I guess that it will work fine.
>
> Do you think this is a "logical" way to do this?? Or this is weird?
>
> Thanks! (And sorry for this so long message)
>
> --
> Make a better partition table: http://www.jmmv.f2s.com/ept
>
> Julio Merino <address@hidden> ICQ: 18961975
>
>
> --------------------------------------------------------------------------------------------------------------------------------
> Part 1.2Type: application/pgp-signature
-- guido Edel sei der Mensch, hilfreich und gut
GCS/E/S/P C++$++++ ULHS L++w- N++@ d(+-) s+a- r+@>+++ y++ 5++X- (geekcode)