summaryrefslogtreecommitdiff
path: root/usr.bin/make
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/make')
-rw-r--r--usr.bin/make/arch.c4
-rw-r--r--usr.bin/make/compat.c4
-rw-r--r--usr.bin/make/dir.c9
-rw-r--r--usr.bin/make/engine.c4
-rw-r--r--usr.bin/make/make.c5
-rw-r--r--usr.bin/make/targ.c32
-rw-r--r--usr.bin/make/targ.h3
-rw-r--r--usr.bin/make/timestamp.c18
-rw-r--r--usr.bin/make/timestamp.h4
9 files changed, 35 insertions, 48 deletions
diff --git a/usr.bin/make/arch.c b/usr.bin/make/arch.c
index 8000dece5be..c53d962b884 100644
--- a/usr.bin/make/arch.c
+++ b/usr.bin/make/arch.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: arch.c,v 1.65 2007/09/16 11:29:34 espie Exp $ */
+/* $OpenBSD: arch.c,v 1.66 2007/09/16 12:09:36 espie Exp $ */
/* $NetBSD: arch.c,v 1.17 1996/11/06 17:58:59 christos Exp $ */
/*
@@ -1035,7 +1035,7 @@ Arch_LibOODate(GNode *gn)
if (!is_out_of_date(modTimeTOC)) {
if (DEBUG(ARCH) || DEBUG(MAKE))
printf("%s modified %s...", RANLIBMAG,
- Targ_FmtTime(modTimeTOC));
+ time_to_string(modTimeTOC));
return is_strictly_before(modTimeTOC, gn->cmtime);
}
/* A library w/o a table of contents is out-of-date. */
diff --git a/usr.bin/make/compat.c b/usr.bin/make/compat.c
index f0a33bd2a5b..cd64ce24cb6 100644
--- a/usr.bin/make/compat.c
+++ b/usr.bin/make/compat.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: compat.c,v 1.55 2007/09/16 10:39:07 espie Exp $ */
+/* $OpenBSD: compat.c,v 1.56 2007/09/16 12:09:36 espie Exp $ */
/* $NetBSD: compat.c,v 1.14 1996/11/06 17:59:01 christos Exp $ */
/*
@@ -466,7 +466,7 @@ CompatMake(void *gnp, /* The node to make */
if (is_strictly_before(gn->mtime, gn->cmtime))
gn->mtime = gn->cmtime;
if (DEBUG(MAKE))
- printf("update time: %s\n", Targ_FmtTime(gn->mtime));
+ printf("update time: %s\n", time_to_string(gn->mtime));
if (!(gn->type & OP_EXEC)) {
pgn->childMade = true;
Make_TimeStamp(pgn, gn);
diff --git a/usr.bin/make/dir.c b/usr.bin/make/dir.c
index 12758db668c..0fcab51c559 100644
--- a/usr.bin/make/dir.c
+++ b/usr.bin/make/dir.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: dir.c,v 1.48 2007/09/16 10:43:53 espie Exp $ */
+/* $OpenBSD: dir.c,v 1.49 2007/09/16 12:09:36 espie Exp $ */
/* $NetBSD: dir.c,v 1.14 1997/03/29 16:51:26 christos Exp $ */
/*
@@ -80,7 +80,6 @@
#include "buf.h"
#include "gnode.h"
#include "arch.h"
-#include "targ.h"
#include "error.h"
#include "str.h"
#include "timestamp.h"
@@ -527,7 +526,7 @@ Dir_FindFileComplexi(const char *name, const char *ename, Lst path,
* needed, we don't have to fetch it again. */
if (DEBUG(DIR))
printf("Caching %s for %s\n",
- Targ_FmtTime(mtime), file);
+ time_to_string(mtime), file);
record_stamp(file, mtime);
#ifdef DEBUG_DIRECTORY_CACHE
nearmisses++;
@@ -577,7 +576,7 @@ Dir_FindFileComplexi(const char *name, const char *ename, Lst path,
ts_set_from_stat(stb, mtime);
if (DEBUG(DIR))
- printf("Caching %s for %s\n", Targ_FmtTime(mtime), q);
+ printf("Caching %s for %s\n", time_to_string(mtime), q);
record_stamp(q, mtime);
return q;
} else {
@@ -817,7 +816,7 @@ Dir_MTime(GNode *gn)
* actually go to the file system. */
if (DEBUG(DIR))
printf("Using cached time %s for %s\n",
- Targ_FmtTime(entry->mtime), fullName);
+ time_to_string(entry->mtime), fullName);
mtime = entry->mtime;
free(entry);
ohash_remove(&mtimes, slot);
diff --git a/usr.bin/make/engine.c b/usr.bin/make/engine.c
index a2ff9aff252..678c353ce0b 100644
--- a/usr.bin/make/engine.c
+++ b/usr.bin/make/engine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: engine.c,v 1.1 2007/09/16 10:39:07 espie Exp $ */
+/* $OpenBSD: engine.c,v 1.2 2007/09/16 12:09:36 espie Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
* Copyright (c) 1988, 1989 by Adam de Boor
@@ -398,7 +398,7 @@ Make_OODate(GNode *gn) /* the node to check */
(void)Dir_MTime(gn);
if (DEBUG(MAKE)) {
if (!is_out_of_date(gn->mtime)) {
- printf("modified %s...", Targ_FmtTime(gn->mtime));
+ printf("modified %s...", time_to_string(gn->mtime));
} else {
printf("non-existent...");
}
diff --git a/usr.bin/make/make.c b/usr.bin/make/make.c
index c097a816a6e..0b2bfa07157 100644
--- a/usr.bin/make/make.c
+++ b/usr.bin/make/make.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: make.c,v 1.37 2007/09/16 10:39:07 espie Exp $ */
+/* $OpenBSD: make.c,v 1.38 2007/09/16 12:09:36 espie Exp $ */
/* $NetBSD: make.c,v 1.10 1996/11/06 17:59:15 christos Exp $ */
/*
@@ -77,7 +77,6 @@
#include "job.h"
#include "suff.h"
#include "var.h"
-#include "targ.h"
#include "error.h"
#include "make.h"
#include "gnode.h"
@@ -197,7 +196,7 @@ Make_Update(GNode *cgn) /* the child node */
cgn->mtime = now;
}
if (DEBUG(MAKE)) {
- printf("update time: %s\n", Targ_FmtTime(cgn->mtime));
+ printf("update time: %s\n", time_to_string(cgn->mtime));
}
}
diff --git a/usr.bin/make/targ.c b/usr.bin/make/targ.c
index e8595bda924..9d4ab8d4e21 100644
--- a/usr.bin/make/targ.c
+++ b/usr.bin/make/targ.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: targ.c,v 1.40 2006/01/20 23:10:19 espie Exp $ */
+/* $OpenBSD: targ.c,v 1.41 2007/09/16 12:09:36 espie Exp $ */
/* $NetBSD: targ.c,v 1.11 1997/02/20 16:51:50 christos Exp $ */
/*
@@ -397,34 +397,6 @@ Targ_PrintCmd(void *cmd)
/*-
*-----------------------------------------------------------------------
- * Targ_FmtTime --
- * Format a modification time in some reasonable way and return it.
- *
- * Results:
- * The time reformatted.
- *
- * Side Effects:
- * The time is placed in a static area, so it is overwritten
- * with each call.
- *-----------------------------------------------------------------------
- */
-char *
-Targ_FmtTime(TIMESTAMP time)
-{
- struct tm *parts;
- static char buf[128];
- time_t t;
-
- t = timestamp2time_t(time);
-
- parts = localtime(&t);
- strftime(buf, sizeof buf, "%H:%M:%S %b %d, %Y", parts);
- buf[sizeof(buf) - 1] = '\0';
- return buf;
-}
-
-/*-
- *-----------------------------------------------------------------------
* Targ_PrintType --
* Print out a type field giving only those attributes the user can
* set.
@@ -486,7 +458,7 @@ TargPrintNode(GNode *gn, int pass)
if (! (gn->type & (OP_JOIN|OP_USE|OP_EXEC))) {
if (!is_out_of_date(gn->mtime)) {
printf("# last modified %s: %s\n",
- Targ_FmtTime(gn->mtime),
+ time_to_string(gn->mtime),
(gn->made == UNMADE ? "unmade" :
(gn->made == MADE ? "made" :
(gn->made == UPTODATE ? "up-to-date" :
diff --git a/usr.bin/make/targ.h b/usr.bin/make/targ.h
index 01078b74bdd..86d2bb7ed0e 100644
--- a/usr.bin/make/targ.h
+++ b/usr.bin/make/targ.h
@@ -1,7 +1,7 @@
#ifndef TARG_H
#define TARG_H
/* $OpenPackages$ */
-/* $OpenBSD: targ.h,v 1.1 2001/05/23 12:34:50 espie Exp $ */
+/* $OpenBSD: targ.h,v 1.2 2007/09/16 12:09:36 espie Exp $ */
/*
* Copyright (c) 2001 Marc Espie.
@@ -57,7 +57,6 @@ extern bool Targ_Silent(GNode *);
extern bool Targ_Precious(GNode *);
extern void Targ_SetMain(GNode *);
extern void Targ_PrintCmd(void *);
-extern char *Targ_FmtTime(TIMESTAMP);
extern void Targ_PrintType(int);
extern void Targ_PrintGraph(int);
diff --git a/usr.bin/make/timestamp.c b/usr.bin/make/timestamp.c
index 0fe87c4ad06..78610157044 100644
--- a/usr.bin/make/timestamp.c
+++ b/usr.bin/make/timestamp.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: timestamp.c,v 1.2 2004/04/07 13:11:36 espie Exp $ */
+/* $OpenBSD: timestamp.c,v 1.3 2007/09/16 12:09:36 espie Exp $ */
/*
* Copyright (c) 2001 Marc Espie.
@@ -52,3 +52,19 @@ set_times(const char *f)
return utime(f, &times);
#endif
}
+
+char *
+time_to_string(TIMESTAMP time)
+{
+ struct tm *parts;
+ static char buf[128];
+ time_t t;
+
+ t = timestamp2time_t(time);
+
+ parts = localtime(&t);
+ strftime(buf, sizeof buf, "%H:%M:%S %b %d, %Y", parts);
+ buf[sizeof(buf) - 1] = '\0';
+ return buf;
+}
+
diff --git a/usr.bin/make/timestamp.h b/usr.bin/make/timestamp.h
index 28572fb6866..49d90f62338 100644
--- a/usr.bin/make/timestamp.h
+++ b/usr.bin/make/timestamp.h
@@ -2,7 +2,7 @@
#define TIMESTAMP_H
/* $OpenPackages$ */
-/* $OpenBSD: timestamp.h,v 1.1 2001/05/23 12:34:51 espie Exp $ */
+/* $OpenBSD: timestamp.h,v 1.2 2007/09/16 12:09:36 espie Exp $ */
/*
* Copyright (c) 2001 Marc Espie.
@@ -101,5 +101,7 @@ extern int set_times(const char *);
extern TIMESTAMP now; /* The time at the start of this whole
* process */
+extern char *time_to_string(TIMESTAMP t);
+
#endif