From 8eb37231d4405088a481324c2ec41ac851e8d8f7 Mon Sep 17 00:00:00 2001 From: jkh Date: Mon, 24 Jun 1996 04:26:21 +0000 Subject: Bring in my changes for removing the pestilent obj links (unless you really want them) from /usr/src. This is the final version of the patches, incorporating the feedback I've received from -current. --- usr.bin/colldef/data/Makefile | 6 +++--- usr.bin/make/main.c | 33 +++++++-------------------------- usr.bin/make/pathnames.h | 4 ++-- usr.bin/mklocale/data/Makefile | 6 +++--- usr.bin/sgmls/Makefile.inc | 6 +++--- usr.bin/tip/tip/Makefile | 4 ++-- usr.bin/tn3270/mset/Makefile | 4 ++-- usr.bin/tn3270/tn3270/Makefile | 16 ++++++++-------- 8 files changed, 30 insertions(+), 49 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/colldef/data/Makefile b/usr.bin/colldef/data/Makefile index 00b7b47..6e653c6 100644 --- a/usr.bin/colldef/data/Makefile +++ b/usr.bin/colldef/data/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.5 1995/10/22 00:58:41 ache Exp $ +# $Id: Makefile,v 1.1 1995/11/03 14:53:50 ache Exp $ NOMAN=YES CLEANFILES+= ${LOCALES:S/$/.out/g} @@ -6,8 +6,8 @@ CLEANFILES+= ${LOCALES:S/$/.out/g} LOCALES= ru_SU.KOI8-R ru_SU.CP866 lt_LN.ISO_8859-1 LOCALEDIR= ${DESTDIR}/usr/share/locale -.if exists(${.CURDIR}/../obj) -COLLDEF=${.CURDIR}/../obj/colldef +.if exists(${.OBJDIR}/../colldef) +COLLDEF=${.OBJDIR}/../colldef .else COLLDEF=${.CURDIR}/../colldef .endif diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c index 1698000..4094276 100644 --- a/usr.bin/make/main.c +++ b/usr.bin/make/main.c @@ -375,6 +375,7 @@ main(argc, argv) char mdpath[MAXPATHLEN + 1]; char obpath[MAXPATHLEN + 1]; char cdpath[MAXPATHLEN + 1]; + char *realobjdir; /* Where we'd like to go */ struct utsname utsname; char *machine = getenv("MACHINE"); @@ -424,12 +425,10 @@ main(argc, argv) * and modify the paths for the Makefiles apropriately. The * current directory is also placed as a variable for make scripts. */ - if (!(path = getenv("MAKEOBJDIR"))) { + if (!(path = getenv("MAKEOBJDIR"))) path = _PATH_OBJDIR; - (void) sprintf(mdpath, "%s.%s", path, machine); - } - else - (void) strncpy(mdpath, path, MAXPATHLEN + 1); + (void) snprintf(mdpath, MAXPATHLEN, "%s%s", path, curdir); + realobjdir = mdpath; /* This is where we'd _like_ to be, anyway */ if (stat(mdpath, &sb) == 0 && S_ISDIR(sb.st_mode)) { @@ -447,27 +446,8 @@ main(argc, argv) objdir = mdpath; } } - else { - if (stat(path, &sb) == 0 && S_ISDIR(sb.st_mode)) { - - if (chdir(path)) { - (void)fprintf(stderr, "make warning: %s: %s.\n", - path, strerror(errno)); - objdir = curdir; - } - else { - if (path[0] != '/') { - (void) sprintf(obpath, "%s/%s", curdir, - path); - objdir = obpath; - } - else - objdir = obpath; - } - } - else - objdir = curdir; - } + else + objdir = curdir; setenv("PWD", objdir, 1); @@ -509,6 +489,7 @@ main(argc, argv) if (objdir != curdir) Dir_AddDir(dirSearchPath, curdir); Var_Set(".CURDIR", curdir, VAR_GLOBAL); + Var_Set(".TARGETOBJDIR", realobjdir, VAR_GLOBAL); Var_Set(".OBJDIR", objdir, VAR_GLOBAL); /* diff --git a/usr.bin/make/pathnames.h b/usr.bin/make/pathnames.h index 2c25ead..a96942c 100644 --- a/usr.bin/make/pathnames.h +++ b/usr.bin/make/pathnames.h @@ -31,10 +31,10 @@ * SUCH DAMAGE. * * from: @(#)pathnames.h 5.2 (Berkeley) 6/1/90 - * $Id: pathnames.h,v 1.2 1993/08/01 18:11:58 mycroft Exp $ + * $Id: pathnames.h,v 1.2 1995/01/23 21:01:52 jkh Exp $ */ -#define _PATH_OBJDIR "obj" +#define _PATH_OBJDIR "/usr/obj" #define _PATH_DEFSHELLDIR "/bin" #define _PATH_DEFSYSMK "/usr/share/mk/sys.mk" #define _PATH_DEFSYSPATH "/usr/share/mk" diff --git a/usr.bin/mklocale/data/Makefile b/usr.bin/mklocale/data/Makefile index fb6161f..809390e 100644 --- a/usr.bin/mklocale/data/Makefile +++ b/usr.bin/mklocale/data/Makefile @@ -1,4 +1,4 @@ -# $Id$ +# $Id: Makefile,v 1.2 1995/11/03 14:51:45 ache Exp $ NOMAN=YES CLEANFILES+= ${LOCALES:S/$/.out/g} @@ -6,8 +6,8 @@ CLEANFILES+= ${LOCALES:S/$/.out/g} LOCALES= ja_JP.EUC ru_SU.KOI8-R lt_LN.ASCII lt_LN.ISO_8859-1 ru_SU.CP866 LOCALEDIR= ${DESTDIR}/usr/share/locale -.if exists(${.CURDIR}/../obj) -MKLOCALE=${.CURDIR}/../obj/mklocale +.if exists(${.OBJDIR}/..) +MKLOCALE=${.OBJDIR}/../mklocale .else MKLOCALE=${.CURDIR}/../mklocale .endif diff --git a/usr.bin/sgmls/Makefile.inc b/usr.bin/sgmls/Makefile.inc index bf94a8d..e1ed57f 100644 --- a/usr.bin/sgmls/Makefile.inc +++ b/usr.bin/sgmls/Makefile.inc @@ -1,15 +1,15 @@ # # Bmakefile for rast # -# $Id: Makefile.inc,v 1.2 1996/06/04 19:08:04 jfieber Exp $ +# $Id: Makefile.inc,v 1.3 1996/06/19 20:36:35 jkh Exp $ # .if exists(${.CURDIR}/../../Makefile.inc) .include "${.CURDIR}/../../Makefile.inc" .endif -.if exists(${.CURDIR}/../libsgmls/obj) -LIBSGMLS= ${.CURDIR}/../libsgmls/obj/libsgmls.a +.if exists(${.OBJDIR}/../libsgmls) +LIBSGMLS= ${.OBJDIR}/../libsgmls/libsgmls.a .else LIBSGMLS= ${.CURDIR}/../libsgmls/libsgmls.a .endif diff --git a/usr.bin/tip/tip/Makefile b/usr.bin/tip/tip/Makefile index c97a929..ece0803 100644 --- a/usr.bin/tip/tip/Makefile +++ b/usr.bin/tip/tip/Makefile @@ -7,8 +7,8 @@ # /var/log/aculog ACU accounting file, owned by ${OWNER} and # mode 6?? {if ACULOG defined} -.if exists(${.CURDIR}/../libacu/obj) -LIBACU=${.CURDIR}/../libacu/obj/libacu.a +.if exists(${.OBJDIR}/../libacu) +LIBACU=${.OBJDIR}/../libacu/libacu.a .else LIBACU=${.CURDIR}/../libacu/libacu.a .endif diff --git a/usr.bin/tn3270/mset/Makefile b/usr.bin/tn3270/mset/Makefile index 53af87f..db31b2e 100644 --- a/usr.bin/tn3270/mset/Makefile +++ b/usr.bin/tn3270/mset/Makefile @@ -14,8 +14,8 @@ CLEANFILES+= astosc.OUT astosc.out DEPSRCS+= astosc.OUT map3270.c mset.c -.if exists(${.CURDIR}/../tools/mkastosc/obj) -MKOBJ=${.CURDIR}/../tools/mkastosc/obj +.if exists(${.OBJDIR}/../tools/mkastosc) +MKOBJ=${.OBJDIR}/../tools/mkastosc .else MKOBJ=${.CURDIR}/../tools/mkastosc .endif diff --git a/usr.bin/tn3270/tn3270/Makefile b/usr.bin/tn3270/tn3270/Makefile index 75f029d..7dd1952 100644 --- a/usr.bin/tn3270/tn3270/Makefile +++ b/usr.bin/tn3270/tn3270/Makefile @@ -30,26 +30,26 @@ DEPSRCS+= genbsubs.c globals.c system.c termout.c DEPSRCS+= commands.c main.c network.c ring.c sys_bsd.c telnet.c terminal.c DEPSRCS+= tn3270.c utilities.c -.if exists(${.CURDIR}/../tools/mkastosc/obj) -MKASTOSCDIR= ${.CURDIR}/../tools/mkastosc/obj +.if exists(${.OBJDIR}/../tools/mkastosc) +MKASTOSCDIR= ${.OBJDIR}/../tools/mkastosc .else MKASTOSCDIR= ${.CURDIR}/../tools/mkastosc .endif -.if exists(${.CURDIR}/../tools/mkastods/obj) -MKASTODSDIR= ${.CURDIR}/../tools/mkastods/obj +.if exists(${.OBJDIR}/../tools/mkastods) +MKASTODSDIR= ${.OBJDIR}/../tools/mkastods .else MKASTODSDIR= ${.CURDIR}/../tools/mkastods .endif -.if exists(${.CURDIR}/../tools/mkdstoas/obj) -MKDSTOASDIR= ${.CURDIR}/../tools/mkdstoas/obj +.if exists(${.OBJDIR}/../tools/mkdstoas) +MKDSTOASDIR= ${.OBJDIR}/../tools/mkdstoas .else MKDSTOASDIR= ${.CURDIR}/../tools/mkdstoas .endif -.if exists(${.CURDIR}/../tools/mkhits/obj) -MKHITSDIR= ${.CURDIR}/../tools/mkhits/obj +.if exists(${.OBJDIR}/../tools/mkhits) +MKHITSDIR= ${.OBJDIR}/../tools/mkhits .else MKHITSDIR= ${.CURDIR}/../tools/mkhits .endif -- cgit v1.1