From owner-freebsd-arch Wed Jan 24 1:40:50 2001 Delivered-To: freebsd-arch@freebsd.org Received: from ringworld.nanolink.com (ringworld.nanolink.com [195.24.48.189]) by hub.freebsd.org (Postfix) with SMTP id EC90D37B400 for ; Wed, 24 Jan 2001 01:40:29 -0800 (PST) Received: (qmail 4668 invoked by uid 1000); 24 Jan 2001 09:39:02 -0000 Date: Wed, 24 Jan 2001 11:39:02 +0200 From: Peter Pentchev To: freebsd-arch@FreeBSD.org Subject: patch for bsd.lib.mk to create include and lib dirs Message-ID: <20010124113902.B332@ringworld.oblivion.bg> Mail-Followup-To: freebsd-arch@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, I tried to use bsd.lib.mk for a library I'm writing, and stumbled into a little difficulty: if a library tries to place its include files in a non-existing directory, bsd.lib.mk does not attempt to create it, but just tries to install files there. This might have strange side effects like installing a file with the name of the desired subdir. Attached is a little proposed patch to try to create ${DESTDIR}${INCDIR} and ${DESTDIR}${LIBDIR} if CREATEDESTDIRS is defined. And yes, I *am* aware of mtree and hierarchy; but until the actual advent of custom mtree files for ports (and maybe even then), I still think this might be a better solution than overriding beforeinstall and manually invoking '${MAKE} _includeinstall' after creating the directories needed. G'luck, Peter -- Do you think anybody has ever had *precisely this thought* before? Index: src/share/mk/bsd.lib.mk =================================================================== RCS file: /home/ncvs/src/share/mk/bsd.lib.mk,v retrieving revision 1.93 diff -u -r1.93 bsd.lib.mk --- src/share/mk/bsd.lib.mk 2000/10/02 08:48:49 1.93 +++ src/share/mk/bsd.lib.mk 2001/01/24 09:30:01 @@ -260,10 +260,16 @@ .if !target(install) .if !target(beforeinstall) beforeinstall: _includeinstall +.if defined(CREATEDESTDIRS) + ${MKDIR} ${DESTDIR}${LIBDIR} .endif +.endif _includeinstall: .if defined(INCS) +.if defined(CREATEDESTDIRS) + ${MKDIR} ${DESTDIR}${INCDIR} +.endif .for header in ${INCS} cd ${.CURDIR} && \ ${INSTALL} -C -o ${INCOWN} -g ${INCGRP} -m ${INCMODE} \ Index: src/share/mk/sys.mk =================================================================== RCS file: /home/ncvs/src/share/mk/sys.mk,v retrieving revision 1.46 diff -u -r1.46 sys.mk --- src/share/mk/sys.mk 2000/04/21 23:51:58 1.46 +++ src/share/mk/sys.mk 2001/01/24 09:30:01 @@ -57,6 +57,8 @@ .endif .endif +MKDIR ?= mkdir -p + .if defined(%POSIX) FC ?= fort77 FFLAGS ?= -O 1 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message