diff options
author | jlam <jlam> | 2004-09-27 12:00:56 +0000 |
---|---|---|
committer | jlam <jlam> | 2004-09-27 12:00:56 +0000 |
commit | 4b7a794184cce1def093ae963053726f337b8436 (patch) | |
tree | 79a979c192970ea2113be5a5c66c4522a1f00e7b | |
parent | f070b09429420850ca0afa24d07c93031a26909a (diff) | |
download | pkgsrc-4b7a794184cce1def093ae963053726f337b8436.tar.gz |
Define PKGSRC_TOPDIR as the path to the top of the pkgsrc tree relative
to the Makefile on which make is invoked. Use it instead of doing the
same dance for finding defs.${OPSYS}.mk and bsd.pkg.defaults.mk.
-rw-r--r-- | mk/bsd.prefs.mk | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/mk/bsd.prefs.mk b/mk/bsd.prefs.mk index 1e13e8d5e0f..ee14836868c 100644 --- a/mk/bsd.prefs.mk +++ b/mk/bsd.prefs.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.prefs.mk,v 1.166 2004/09/21 15:01:39 jlam Exp $ +# $NetBSD: bsd.prefs.mk,v 1.167 2004/09/27 12:00:56 jlam Exp $ # # Make file, included to get the site preferences, if any. Should # only be included by package Makefiles before any .if defined() @@ -212,13 +212,18 @@ OBJECT_FMT?= a.out . endif .endif +# Calculate depth +.if exists(${.CURDIR}/../../mk/bsd.pkg.mk) +PKGSRC_TOPDIR= ${.CURDIR}/../.. +.elif exists(${.CURDIR}/../mk/bsd.pkg.mk) +PKGSRC_TOPDIR= ${.CURDIR}/.. +.elif exists(${.CURDIR}/mk/bsd.pkg.mk) +PKGSRC_TOPDIR= ${.CURDIR} +.endif + # include the defaults file -.if exists(${.CURDIR}/../../mk/bsd.pkg.defaults.mk) -. include "${.CURDIR}/../../mk/bsd.pkg.defaults.mk" -.elif exists(${.CURDIR}/../mk/bsd.pkg.defaults.mk) -. include "${.CURDIR}/../mk/bsd.pkg.defaults.mk" -.elif exists(${.CURDIR}/mk/bsd.pkg.defaults.mk) -. include "${.CURDIR}/mk/bsd.pkg.defaults.mk" +.if exists(${PKGSRC_TOPDIR}/mk/bsd.pkg.defaults.mk) +. include "${PKGSRC_TOPDIR}/mk/bsd.pkg.defaults.mk" .endif .if ${OPSYS} == "NetBSD" @@ -252,18 +257,10 @@ SHAREMODE?= ${DOCMODE} # Load the OS-specific definitions for program variables. Default to loading # the NetBSD ones if an OS-specific file doesn't exist. -.if exists(${.CURDIR}/../../mk/defs.${OPSYS}.mk) -. include "${.CURDIR}/../../mk/defs.${OPSYS}.mk" -.elif exists(${.CURDIR}/../mk/defs.${OPSYS}.mk) -. include "${.CURDIR}/../mk/defs.${OPSYS}.mk" -.elif exists(${.CURDIR}/mk/defs.${OPSYS}.mk) -. include "${.CURDIR}/mk/defs.${OPSYS}.mk" -.elif exists(${.CURDIR}/../../mk/defs.NetBSD.mk) -. include "${.CURDIR}/../../mk/defs.NetBSD.mk" -.elif exists(${.CURDIR}/../mk/defs.NetBSD.mk) -. include "${.CURDIR}/../mk/defs.NetBSD.mk" -.elif exists(${.CURDIR}/mk/defs.NetBSD.mk) -. include "${.CURDIR}/mk/defs.NetBSD.mk" +.if exists(${PKGSRC_TOPDIR}/mk/defs.${OPSYS}.mk) +. include "${PKGSRC_TOPDIR}/mk/defs.${OPSYS}.mk" +.elif exists(${PKGSRC_TOPDIR}/mk/defs.NetBSD.mk) +. include "${PKGSRC_TOPDIR}/mk/defs.NetBSD.mk" .endif PKGDIRMODE?= 755 |