summaryrefslogtreecommitdiff
path: root/usr.sbin/config/mkmakefile.c
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>2001-01-05 02:55:25 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>2001-01-05 02:55:25 +0000
commitdc3d34b1095b7244f22a1198c1a4f4fbc0b81a51 (patch)
treeefad9bf9ca89426f5d7b7c6a04d6dcaeec9a2b31 /usr.sbin/config/mkmakefile.c
parentfa517008b47da24e884bd9dfc3022a7aa085a184 (diff)
Generate Makefiles that don't get confused if the source layout (with
regards to depth and symbolic links) is not what's expected.
Diffstat (limited to 'usr.sbin/config/mkmakefile.c')
-rw-r--r--usr.sbin/config/mkmakefile.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/usr.sbin/config/mkmakefile.c b/usr.sbin/config/mkmakefile.c
index d681fbbeb0f..a470bf0fe54 100644
--- a/usr.sbin/config/mkmakefile.c
+++ b/usr.sbin/config/mkmakefile.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mkmakefile.c,v 1.7 1997/11/13 08:21:55 deraadt Exp $ */
+/* $OpenBSD: mkmakefile.c,v 1.8 2001/01/05 02:55:24 angelos Exp $ */
/* $NetBSD: mkmakefile.c,v 1.34 1997/02/02 21:12:36 thorpej Exp $ */
/*
@@ -198,16 +198,23 @@ emitdefs(fp)
return (1);
if (fprintf(fp, "PARAM=-DMAXUSERS=%d\n", maxusers) < 0)
return (1);
- if (*srcdir == '/' || *srcdir == '.') {
+ switch (*srcdir) {
+ case '/':
if (fprintf(fp, "S=\t%s\n", srcdir) < 0)
return (1);
- } else {
+ break;
+ case '.':
+ if (fprintf(fp, "S!=\techo `/bin/pwd`/%s\n", srcdir) < 0)
+ return (1);
+ break;
+ default:
/*
* libkern and libcompat "Makefile.inc"s want relative S
* specification to begin with '.'.
*/
- if (fprintf(fp, "S=\t./%s\n", srcdir) < 0)
+ if (fprintf(fp, "S!=\techo .`/bin/pwd`/%s\n", srcdir) < 0)
return (1);
+ break;
}
for (nv = mkoptions; nv != NULL; nv = nv->nv_next)
if (fprintf(fp, "%s=%s\n", nv->nv_name, nv->nv_str) < 0)