From owner-freebsd-questions@FreeBSD.ORG Wed Feb 16 17:00:45 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6BE3A16A4D4 for ; Wed, 16 Feb 2005 17:00:45 +0000 (GMT) Received: from xenial.mcc.ac.uk (xenial.mcc.ac.uk [130.88.203.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id F094B43D48 for ; Wed, 16 Feb 2005 17:00:25 +0000 (GMT) (envelope-from jcm@FreeBSD-uk.eu.org) Received: from dogma.freebsd-uk.eu.org ([130.88.200.97]) by xenial.mcc.ac.uk with esmtp (Exim 4.43 (FreeBSD)) id 1D1SXH-000FF8-9Q for freebsd-questions@freebsd.org; Wed, 16 Feb 2005 17:00:23 +0000 Received: from dogma.freebsd-uk.eu.org (localhost [127.0.0.1]) j1GH0M8b096340 for ; Wed, 16 Feb 2005 17:00:22 GMT (envelope-from jcm@dogma.freebsd-uk.eu.org) Received: (from jcm@localhost) by dogma.freebsd-uk.eu.org (8.13.1/8.12.6/Submit) id j1GH0MuL096335 for freebsd-questions@freebsd.org; Wed, 16 Feb 2005 17:00:22 GMT Date: Wed, 16 Feb 2005 17:00:22 +0000 From: Jonathon McKitrick To: freebsd-questions@freebsd.org Message-ID: <20050216170022.GB93269@dogma.freebsd-uk.eu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i Subject: Makefile and directory layout X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Feb 2005 17:00:46 -0000 Hi all, I'm about to port several libraries to *nix because a new customer needs it to run on an open source OS. I need some ideas for how to set this up. It's going to be a binary-only distribution, AFAIK, but I don't know if that should affect the directory layout. What I have are a lot of libraries (components, really), and many, but not all, have nested dependencies. Am I better off with a flat directory with subdirs for each library and one big subdir for all include files? Or, does it make more sense to place library source directories and header files *within* the directories of libraries that need them? So, if libfoo requires libbar and no other library does: proj/ Makefile include/ foo.h bar.h libfoo/ Makefile src/ foo.c libbar/ Makefile src/ bar.c **OR** proj/ Makefile include/ foo.h libfoo/ Makefile include/ bar.h src/ foo.c libbar/ Makefile src/ bar.c Is there a better way? Especially for header files just needed internally for the library itself versus headers shared between modules? Jonathon McKitrick -- My other computer is your Windows box.