From owner-freebsd-hackers@freebsd.org Mon May 16 16:45:10 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 440A0B3D735 for ; Mon, 16 May 2016 16:45:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 3512612D2; Mon, 16 May 2016 16:45:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 2B4671ACD; Mon, 16 May 2016 16:45:10 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id C174B1D319; Mon, 16 May 2016 16:45:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id p1roxLcNJqqn; Mon, 16 May 2016 16:45:03 +0000 (UTC) Subject: Re: bsd.incs.mk: include subdirectories DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com DECDE1D313 To: Demetrius Siluanius , freebsd-hackers@freebsd.org References: From: Bryan Drewery Organization: FreeBSD Message-ID: <73a9d590-c845-910e-12ff-dd1580b81500@FreeBSD.org> Date: Mon, 16 May 2016 09:45:00 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2016 16:45:10 -0000 On 5/11/16 1:08 PM, Demetrius Siluanius wrote: > Hello everyone! >=20 > Recently I started porting a number of my projects to BSD world. I real= ized it > would be great if I could use a native make(1) tool instead of GNU make= . I'm > really impressed how easy it is to create a makefile for a library with= almost > a single '.include bsd.lib.mk' statement. Thank you guys for such an am= azing > build system! >=20 > The only thing I couldn't deal with is when headers must be placed into > subdirectories. For simplicity let's assume that project's headers hier= archy is > the following one: > include/ > mylib/ > A/ > A0.h > A1.h > B/ > B0.h > B1.h > base.h >=20 > The only header that will be used is "mylib/base.h", but it includes ot= her > headers using statements '#include "A/A0.h". What should I do to instal= l files > like this? I can't really understand what's happening inside of bsd.inc= s.mk > file, but I guess there should be something simpler than overriding the= default > 'installincludes' target. >=20 > I could't find any relevant information; I tried to find an example Mak= efile > which could have a similar headers hierarchy, but didn't succeed. Could= you > help me, please? Thank you! If I understand correctly then you want something like this in the Makefi= le: INCSGROUPS=3D A B INCS INCS=3D base.h INCSDIR=3D /usr/include/mylib A=3D A0.h A1.h ADIR=3D ${INCSDIR}/A B=3D B0.h B1.h BDIR=3D ${INCSDIR}/B The trick is that INCSGROUPS defines a and you can use DIR MODE GRP OWN and to define multiple groups of includes and where and how they should be installed. The default value for INCSGROUPS is just 'INCS' which is why INCSDIR and INCSOWN, etc, work= . Regards, Bryan Drewery