made .CURDIR be absolute, not relative, thereby eliminating

the need for some of the makefile trickery when making objects,
and fixing a few .PATH bugs
This commit is contained in:
cgd 1993-03-23 07:26:38 +00:00
parent b8f99e3690
commit 883c20ae5a
3 changed files with 6 additions and 14 deletions

View File

@ -146,10 +146,9 @@ tags: ${SRCS}
obj:
.else
obj:
@cd ${.CURDIR}; \
@cd ${.CURDIR}; rm -f obj > /dev/null 2>&1 || true; \
here=`pwd`; subdir=`echo $$here | sed 's,^/usr/src/,,'`; \
if test $$here != $$subdir ; then \
rm -rf obj; \
dest=/usr/obj/$$subdir ; \
echo "$$here -> $$dest"; ln -s $$dest obj; \
if test -d /usr/obj -a ! -d $$dest; then \
@ -160,7 +159,6 @@ obj:
else \
true ; \
dest=$$here/obj ; \
/bin/rm -f $$dest 2> /dev/null || true; \
echo "making $$here/obj" ; \
if test ! -d obj ; then \
mkdir $$here/obj; \

View File

@ -153,10 +153,9 @@ lint: ${SRCS} _PROGSUBDIR
obj: _PROGSUBDIR
.else
obj: _PROGSUBDIR
@cd ${.CURDIR}; \
@cd ${.CURDIR}; rm -f obj > /dev/null 2>&1 || true; \
here=`pwd`; subdir=`echo $$here | sed 's,^/usr/src/,,'`; \
if test $$here != $$subdir ; then \
rm -rf obj; \
dest=/usr/obj/$$subdir ; \
echo "$$here -> $$dest"; ln -s $$dest obj; \
if test -d /usr/obj -a ! -d $$dest; then \
@ -167,7 +166,6 @@ obj: _PROGSUBDIR
else \
true ; \
dest=$$here/obj ; \
/bin/rm -f $$dest 2> /dev/null || true; \
echo "making $$here/obj" ; \
if test ! -d obj ; then \
mkdir $$here/obj; \

View File

@ -365,14 +365,10 @@ main(argc, argv)
if (!(path = getenv("MAKEOBJDIR")))
path = _PATH_OBJDIR;
if (!lstat(path, &sb)) {
if (S_ISDIR(sb.st_mode))
curdir = "..";
else {
curdir = emalloc((u_int)MAXPATHLEN + 1);
if (!getwd(curdir)) {
(void)fprintf(stderr, "make: %s.\n", curdir);
exit(2);
}
curdir = emalloc((u_int)MAXPATHLEN + 1);
if (!getwd(curdir)) {
(void)fprintf(stderr, "make: %s.\n", curdir);
exit(2);
}
if (chdir(path)) {
(void)fprintf(stderr, "make: %s: %s.\n",