summaryrefslogtreecommitdiff
path: root/usr.bin/make
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1996-03-27 19:33:22 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1996-03-27 19:33:22 +0000
commitb4d055c56d56b705a9874806044897b6f933a892 (patch)
treeea6944e4424f24dce67f9a7422a498a2e3e97486 /usr.bin/make
parentd413353d829242c97addbbe6aace0c12d53c4772 (diff)
From NetBSD: merge of 960317
Diffstat (limited to 'usr.bin/make')
-rw-r--r--usr.bin/make/Makefile5
-rw-r--r--usr.bin/make/PSD.doc/tutorial.ms3
-rw-r--r--usr.bin/make/arch.c8
-rw-r--r--usr.bin/make/main.c11
-rw-r--r--usr.bin/make/make.18
-rw-r--r--usr.bin/make/make.c10
-rw-r--r--usr.bin/make/make.h3
-rw-r--r--usr.bin/make/parse.c8
-rw-r--r--usr.bin/make/pathnames.h4
9 files changed, 42 insertions, 18 deletions
diff --git a/usr.bin/make/Makefile b/usr.bin/make/Makefile
index 1405f3ee50f..b9b15eb0e89 100644
--- a/usr.bin/make/Makefile
+++ b/usr.bin/make/Makefile
@@ -1,10 +1,11 @@
-# $NetBSD: Makefile,v 1.9 1996/02/04 22:20:27 christos Exp $
+# $OpenBSD: Makefile,v 1.3 1996/03/27 19:32:34 niklas Exp $
+# $NetBSD: Makefile,v 1.10 1996/03/11 13:45:31 christos Exp $
# @(#)Makefile 5.2 (Berkeley) 12/28/90
PROG= make
CFLAGS+= -I${.CURDIR} -DPOSIX -DSYSVINCLUDE
SRCS= arch.c buf.c compat.c cond.c dir.c for.c hash.c job.c main.c \
- make.c parse.c str.c suff.c targ.c var.c
+ make.c parse.c str.c suff.c targ.c var.c util.c
SRCS+= lstAppend.c lstAtEnd.c lstAtFront.c lstClose.c lstConcat.c \
lstDatum.c lstDeQueue.c lstDestroy.c lstDupl.c lstEnQueue.c \
lstFind.c lstFindFrom.c lstFirst.c lstForEach.c lstForEachFrom.c \
diff --git a/usr.bin/make/PSD.doc/tutorial.ms b/usr.bin/make/PSD.doc/tutorial.ms
index 69c2c308c97..67a7c2cc05b 100644
--- a/usr.bin/make/PSD.doc/tutorial.ms
+++ b/usr.bin/make/PSD.doc/tutorial.ms
@@ -1,4 +1,5 @@
-.\" $NetBSD: tutorial.ms,v 1.2 1995/06/14 15:20:31 christos Exp $
+.\" $OpenBSD: tutorial.ms,v 1.3 1996/03/27 19:32:44 niklas Exp $
+.\" $NetBSD: tutorial.ms,v 1.3 1996/03/06 00:15:31 christos Exp $
.\" Copyright (c) 1988, 1989 by Adam de Boor
.\" Copyright (c) 1989 by Berkeley Softworks
.\" Copyright (c) 1988, 1989, 1993
diff --git a/usr.bin/make/arch.c b/usr.bin/make/arch.c
index a66af088ed9..3a95fe3c6e7 100644
--- a/usr.bin/make/arch.c
+++ b/usr.bin/make/arch.c
@@ -1,4 +1,5 @@
-/* $NetBSD: arch.c,v 1.13 1996/02/04 22:20:34 christos Exp $ */
+/* $OpenBSD: arch.c,v 1.4 1996/03/27 19:32:35 niklas Exp $ */
+/* $NetBSD: arch.c,v 1.14 1996/03/12 18:04:27 christos Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -41,8 +42,9 @@
#ifndef lint
#if 0
static char sccsid[] = "@(#)arch.c 5.7 (Berkeley) 12/28/90";
+static char rcsid[] = "$NetBSD: arch.c,v 1.14 1996/03/12 18:04:27 christos Exp $";
#else
-static char rcsid[] = "$NetBSD: arch.c,v 1.13 1996/02/04 22:20:34 christos Exp $";
+static char rcsid[] = "$OpenBSD: arch.c,v 1.4 1996/03/27 19:32:35 niklas Exp $";
#endif
#endif /* not lint */
@@ -1064,7 +1066,7 @@ Arch_LibOODate (gn)
oodate = TRUE;
}
#else
- oodata = FALSE;
+ oodate = FALSE;
#endif
}
return (oodate);
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c
index 4f7b2cba68b..0bf0ab56f1d 100644
--- a/usr.bin/make/main.c
+++ b/usr.bin/make/main.c
@@ -1,4 +1,5 @@
-/* $NetBSD: main.c,v 1.24 1996/02/04 22:20:49 christos Exp $ */
+/* $OpenBSD: main.c,v 1.6 1996/03/27 19:32:36 niklas Exp $ */
+/* $NetBSD: main.c,v 1.26 1996/03/11 13:45:33 christos Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -47,8 +48,9 @@ char copyright[] =
#ifndef lint
#if 0
static char sccsid[] = "@(#)main.c 5.25 (Berkeley) 4/1/91";
+static char rcsid[] = "$NetBSD: main.c,v 1.26 1996/03/11 13:45:33 christos Exp $";
#else
-static char rcsid[] = "$NetBSD: main.c,v 1.24 1996/02/04 22:20:49 christos Exp $";
+static char rcsid[] = "$OpenBSD: main.c,v 1.6 1996/03/27 19:32:36 niklas Exp $";
#endif
#endif /* not lint */
@@ -86,7 +88,6 @@ static char rcsid[] = "$NetBSD: main.c,v 1.24 1996/02/04 22:20:49 christos Exp $
#include <sys/signal.h>
#include <sys/stat.h>
#include <sys/utsname.h>
-#include <sys/resource.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
@@ -454,11 +455,15 @@ main(argc, argv)
* MACHINE_ARCH is always known at compile time.
*/
if (!machine) {
+#ifndef MACHINE
if (uname(&utsname) == -1) {
perror("make: uname");
exit(2);
}
machine = utsname.machine;
+#else
+ machine = MACHINE;
+#endif
}
/*
diff --git a/usr.bin/make/make.1 b/usr.bin/make/make.1
index 22d997ec01a..85777b15f2e 100644
--- a/usr.bin/make/make.1
+++ b/usr.bin/make/make.1
@@ -1,4 +1,5 @@
-.\" $NetBSD: make.1,v 1.12 1995/12/16 05:03:09 christos Exp $
+.\" $OpenBSD: make.1,v 1.6 1996/03/27 19:32:37 niklas Exp $
+.\" $NetBSD: make.1,v 1.14 1996/03/15 21:52:32 christos Exp $
.\" Copyright (c) 1990 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -871,6 +872,11 @@ The sources are directories which are to be searched for files not
found in the current directory.
If no sources are specified, any previously specified directories are
deleted.
+.It Ic .PHONY
+Apply the
+.Ic .PHONY
+attribute to any specified sources. Targets with this attribute are always
+considered to be out of date.
.It Ic .PRECIOUS
Apply the
.Ic .PRECIOUS
diff --git a/usr.bin/make/make.c b/usr.bin/make/make.c
index c142029dbd0..c366518faae 100644
--- a/usr.bin/make/make.c
+++ b/usr.bin/make/make.c
@@ -1,4 +1,5 @@
-/* $NetBSD: make.c,v 1.7 1995/06/14 15:19:40 christos Exp $ */
+/* $OpenBSD: make.c,v 1.2 1996/03/27 19:32:38 niklas Exp $ */
+/* $NetBSD: make.c,v 1.8 1996/03/15 21:52:37 christos Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -41,8 +42,9 @@
#ifndef lint
#if 0
static char sccsid[] = "@(#)make.c 5.3 (Berkeley) 6/1/90";
+static char rcsid[] = "$NetBSD: make.c,v 1.8 1996/03/15 21:52:37 christos Exp $";
#else
-static char rcsid[] = "$NetBSD: make.c,v 1.7 1995/06/14 15:19:40 christos Exp $";
+static char rcsid[] = "$OpenBSD: make.c,v 1.2 1996/03/27 19:32:38 niklas Exp $";
#endif
#endif /* not lint */
@@ -213,7 +215,7 @@ Make_OODate (gn)
printf(".JOIN node...");
}
oodate = gn->childMade;
- } else if (gn->type & (OP_FORCE|OP_EXEC)) {
+ } else if (gn->type & (OP_FORCE|OP_EXEC|OP_PHONY)) {
/*
* A node which is the object of the force (!) operator or which has
* the .EXEC attribute is always considered out-of-date.
@@ -221,6 +223,8 @@ Make_OODate (gn)
if (DEBUG(MAKE)) {
if (gn->type & OP_FORCE) {
printf("! operator...");
+ } else if (gn->type & OP_PHONY) {
+ printf(".PHONY node...");
} else {
printf(".EXEC node...");
}
diff --git a/usr.bin/make/make.h b/usr.bin/make/make.h
index 3da7124bf2b..c5f1a668ed5 100644
--- a/usr.bin/make/make.h
+++ b/usr.bin/make/make.h
@@ -1,4 +1,5 @@
-/* $NetBSD: make.h,v 1.8 1996/02/04 22:20:53 christos Exp $ */
+/* $OpenBSD: make.h,v 1.5 1996/03/27 19:32:39 niklas Exp $ */
+/* $NetBSD: make.h,v 1.9 1996/03/06 00:15:21 christos Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c
index bc14d48084c..a2099bd76b5 100644
--- a/usr.bin/make/parse.c
+++ b/usr.bin/make/parse.c
@@ -1,4 +1,5 @@
-/* $NetBSD: parse.c,v 1.19 1996/02/07 23:04:04 thorpej Exp $ */
+/* $OpenBSD: parse.c,v 1.7 1996/03/27 19:32:41 niklas Exp $ */
+/* $NetBSD: parse.c,v 1.22 1996/03/15 21:52:41 christos Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -42,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)parse.c 5.18 (Berkeley) 2/19/91";
#else
-static char rcsid[] = "$NetBSD: parse.c,v 1.19 1996/02/07 23:04:04 thorpej Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.22 1996/03/15 21:52:41 christos Exp $";
#endif
#endif /* not lint */
@@ -170,6 +171,7 @@ typedef enum {
Order, /* .ORDER */
Parallel, /* .PARALLEL */
ExPath, /* .PATH */
+ Phony, /* .PHONY */
Precious, /* .PRECIOUS */
ExShell, /* .SHELL */
Silent, /* .SILENT */
@@ -222,6 +224,7 @@ static struct {
{ ".ORDER", Order, 0 },
{ ".PARALLEL", Parallel, 0 },
{ ".PATH", ExPath, 0 },
+{ ".PHONY", Phony, OP_PHONY },
{ ".PRECIOUS", Precious, OP_PRECIOUS },
{ ".RECURSIVE", Attribute, OP_MAKE },
{ ".SHELL", ExShell, 0 },
@@ -832,6 +835,7 @@ ParseDoDependency (line)
* life easier later, when we'll
* use Make_HandleUse to actually
* apply the .DEFAULT commands.
+ * .PHONY The list of targets
* .BEGIN
* .END
* .INTERRUPT Are not to be considered the
diff --git a/usr.bin/make/pathnames.h b/usr.bin/make/pathnames.h
index b8ffcab31a9..3b4d50fc7f3 100644
--- a/usr.bin/make/pathnames.h
+++ b/usr.bin/make/pathnames.h
@@ -1,4 +1,5 @@
-/* $NetBSD: pathnames.h,v 1.3 1995/06/14 15:19:52 christos Exp $ */
+/* $OpenBSD: pathnames.h,v 1.3 1996/03/27 19:32:42 niklas Exp $ */
+/* $NetBSD: pathnames.h,v 1.4 1996/03/06 00:15:26 christos Exp $ */
/*
* Copyright (c) 1990 The Regents of the University of California.
@@ -33,7 +34,6 @@
* SUCH DAMAGE.
*
* from: @(#)pathnames.h 5.2 (Berkeley) 6/1/90
- * $Id: pathnames.h,v 1.2 1996/02/23 18:33:00 niklas Exp $
*/
#define _PATH_OBJDIR "obj"