DragonFly BSD
DragonFly submit List (threaded) for 2004-11
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

usr.bin/make more code cleanups


From: Max Okumoto <okumoto@xxxxxxxx>
Date: Thu, 18 Nov 2004 11:00:57 -0800

More patches, they do not change functionality

Max


PatchSet 257 Date: 2002/07/28 04:52:41 Author: jmallett o Print a warning when we are given two scripts for one target. This is neither as wide-reaching nor intensive as NetBSD's similar, but the warning uses the same text.

PatchSet 260 Date: 2002/08/19 04:07:55 Author: jmallett
    o Remove local prototypes for main().

PatchSet 263 Date: 2002/08/31 08:18:40 Author: peter
    o Deal with bootstrapping from an old -current (almost exactly a
      year old) which fails the make tests (doesn't understand
      ${notdef:U}) and therefore fails on __FBSDID in usr.bin/make/*.
      -DBOOTSTRAPPING is no help here since this is before we are
      using the new share/mk/* files, and it would conflict with the
      builtin -DBOOTSTRAPPING support later.. so use a different flag.

PatchSet 270 Date: 2002/09/26 02:39:22 Author: jmallett
    o Don't declare things as extern when they will be static.


PatchSet 271 Date: 2002/09/26 07:40:04 Author: jmallett o When formatting the time for a target, use %H instead of %k, which is mostly the same, but uses a non-extension option.

PatchSet 273 Date: 2002/09/27 10:21:07 Author: ru
    o Document the parsing bug.

PatchSet 278 Date: 2002/09/29 01:20:28 Author: jmallett
    o Fix spurious three-space indentation in a four-space indentation
      file.

PatchSet 279 Date: 2002/10/02 17:03:26 Author: jmallett
    o Remove 6-years-stale #if0, the behaviour isn't ever going to
      be limited to compatible mode, as far as I know, since we use
      it...

PatchSet 280 Date: 2002/10/02 17:06:39 Author: jmallett
    o Code that has been #if0'd with the comment "WHY" since revision
      1.1 can disappear.

---------------------
PatchSet 257
Date: 2002/07/28 04:52:41
Author: jmallett
Log:
Print a warning when we are given two scripts for one target.  This is neither
as wide-reaching nor intensive as NetBSD's similar, but the warning uses the
same text.

Inspired by:	NetBSD

Members: 
	parse.c:1.37->1.38 

Index: parse.c
===================================================================
RCS file: /usr/home/okumoto/Work/make/fbsd-cvs/src/usr.bin/make/parse.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- parse.c	20 Jun 2002 19:51:13 -0000	1.37
+++ parse.c	28 Jul 2002 03:52:41 -0000	1.38
@@ -1499,6 +1499,10 @@
     /* if target already supplied, ignore commands */
     if (!(gn->type & OP_HAS_COMMANDS))
 	(void)Lst_AtEnd(gn->commands, cmd);
+    else
+	Parse_Error(PARSE_WARNING,
+		    "duplicate script for target \"%s\" ignored",
+		    gn->name);
     return(0);
 }
 
---------------------
PatchSet 260
Date: 2002/08/19 04:07:55
Author: jmallett
Log:
Remove local prototypes for main().

Members: 
	nonints.h:1.14->1.15 

Index: nonints.h
===================================================================
RCS file: /usr/home/okumoto/Work/make/fbsd-cvs/src/usr.bin/make/nonints.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- nonints.h	12 Jun 2002 04:11:01 -0000	1.14
+++ nonints.h	19 Aug 2002 03:07:55 -0000	1.15
@@ -63,7 +63,6 @@
 
 /* main.c */
 void Main_ParseArgLine(char *);
-int main(int, char **);
 char *Cmd_Exec(char *, char **);
 void Error(const char *, ...);
 void Fatal(const char *, ...);
---------------------
PatchSet 263
Date: 2002/08/31 08:18:40
Author: peter
Log:
Deal with bootstrapping from an old -current (almost exactly a year old)
which fails the make tests (doesn't understand ${notdef:U}) and therefore
fails on __FBSDID in usr.bin/make/*.  -DBOOTSTRAPPING is no help here since
this is before we are using the new share/mk/* files, and it would conflict
with the builtin -DBOOTSTRAPPING support later.. so use a different flag.

Members: 
	Makefile:1.25->1.26 

Index: Makefile
===================================================================
RCS file: /usr/home/okumoto/Work/make/fbsd-cvs/src/usr.bin/make/Makefile,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- Makefile	25 Aug 2002 02:45:04 -0000	1.25
+++ Makefile	31 Aug 2002 07:18:40 -0000	1.26
@@ -16,6 +16,9 @@
 NOSHARED?=	YES
 
-CFLAGS+=-DMAKE_VERSION=\"5200205220\"
+CFLAGS+=-DMAKE_VERSION=\"5200208240\"
+.if defined(_UPGRADING)
+CFLAGS+=-D__FBSDID=__RCSID
+.endif
 
 main.o: ${MAKEFILE}
 
---------------------
PatchSet 270
Date: 2002/09/26 02:39:22
Author: jmallett
Log:
Don't declare things as extern when they will be static.

Sponsored by:	Rachel Hestilow <rachel@xxxxxxxxxxxx>

Members: 
	job.h:1.17->1.18 

Index: job.h
===================================================================
RCS file: /usr/home/okumoto/Work/make/fbsd-cvs/src/usr.bin/make/job.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- job.h	17 Sep 2002 21:29:06 -0000	1.17
+++ job.h	26 Sep 2002 01:39:22 -0000	1.18
@@ -203,7 +203,11 @@
     char          *exit;	/* exit on error */
 }               Shell;
 
-
+/*
+ * If REMOTE is defined then these things need exposed, otherwise they are
+ * static to job.c!
+ */
+#ifdef REMOTE
 extern char 	*targFmt;   	/* Format string for banner that separates
 				 * output from multiple jobs. Contains a
 				 * single %s where the name of the node being
@@ -218,6 +222,7 @@
 extern Lst  	stoppedJobs;	/* List of jobs that are stopped or didn't
 				 * quite get started */
 extern Boolean	jobFull;    	/* Non-zero if no more jobs should/will start*/
+#endif
 extern int	maxJobs;        /* Number of jobs that may run */
 
 void Job_Touch(GNode *, Boolean);
---------------------
PatchSet 271
Date: 2002/09/26 07:40:04
Author: jmallett
Log:
When formatting the time for a target, use %H instead of %k, which is mostly
the same, but uses a non-extension option.

Sponsored by:	Rachel Hestilow <rachel@xxxxxxxxxxxx>

Members: 
	targ.c:1.21->1.22 

Index: targ.c
===================================================================
RCS file: /usr/home/okumoto/Work/make/fbsd-cvs/src/usr.bin/make/targ.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- targ.c	18 Sep 2002 16:13:03 -0000	1.21
+++ targ.c	26 Sep 2002 06:40:04 -0000	1.22
@@ -464,7 +464,7 @@
 
     parts = localtime(&time);
 
-    strftime(buf, sizeof buf, "%k:%M:%S %b %d, %Y", parts);
+    strftime(buf, sizeof buf, "%H:%M:%S %b %d, %Y", parts);
     buf[sizeof(buf) - 1] = '\0';
     return(buf);
 }
---------------------
PatchSet 273
Date: 2002/09/27 10:21:07
Author: ru
Log:
Document the parsing bug.

Members: 
	make.1:1.58->1.59 

Index: make.1
===================================================================
RCS file: /usr/home/okumoto/Work/make/fbsd-cvs/src/usr.bin/make/make.1,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- make.1	6 Sep 2002 17:33:11 -0000	1.58
+++ make.1	27 Sep 2002 09:21:07 -0000	1.59
@@ -1244,14 +1244,26 @@
 not the other way around, which doesn't work.
 .Pp
 For loops are expanded before tests, so a fragment such as:
-.Bd -literal
+.Bd -literal -offset indent
 \&.for TMACHINE in ${SHARED_ARCHS}
 \&.if ${TMACHINE} = ${MACHINE}
      ...
 \&.endif
 \&.endfor
 .Ed
+.Pp
 won't work, and should be rewritten the other way around.
+.Pp
+The parsing code is broken with respect to handling a semicolon
+after a colon, so a fragment like this will fail:
+.Bd -literal -offset indent
+HDRS=   foo.h bar.h
+
+all:
+\&.for h in ${HDRS:S;^;${.CURDIR}/;}
+     ...
+\&.endfor
+.Ed
 .Sh SEE ALSO
 .Xr mkdep 1 ,
 .Xr make.conf 5
---------------------
PatchSet 278
Date: 2002/09/29 01:20:28
Author: jmallett
Log:
Fix spurious three-space indentation in a four-space indentation file.

Members: 
	job.c:1.42->1.43 

Index: job.c
===================================================================
RCS file: /usr/home/okumoto/Work/make/fbsd-cvs/src/usr.bin/make/job.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- job.c	28 Sep 2002 20:03:26 -0000	1.42
+++ job.c	29 Sep 2002 00:20:28 -0000	1.43
@@ -2707,7 +2707,7 @@
 
     aborting = ABORT_INTERRUPT;
 
-   (void) Lst_Open(jobs);
+    (void) Lst_Open(jobs);
     while ((ln = Lst_Next(jobs)) != NULL) {
 	job = (Job *) Lst_Datum(ln);
 
@@ -2748,7 +2748,7 @@
     }
 
 #ifdef REMOTE
-   (void)Lst_Open(stoppedJobs);
+    (void)Lst_Open(stoppedJobs);
     while ((ln = Lst_Next(stoppedJobs)) != NULL) {
 	job = (Job *) Lst_Datum(ln);
 
---------------------
PatchSet 279
Date: 2002/10/02 17:03:26
Author: jmallett
Log:
Remove 6-years-stale #if0, the behaviour isn't ever going to be limited to
compatible mode, as far as I know, since we use it...

Members: 
	parse.c:1.45->1.46 

Index: parse.c
===================================================================
RCS file: /usr/home/okumoto/Work/make/fbsd-cvs/src/usr.bin/make/parse.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- parse.c	28 Sep 2002 23:35:07 -0000	1.45
+++ parse.c	2 Oct 2002 16:03:26 -0000	1.46
@@ -2254,11 +2254,7 @@
 		break;
 	    case '#':
 		if (!ignComment) {
-		    if (
-#if 0
-		    compatMake &&
-#endif
-		    (lastc != '\\')) {
+		    if (lastc != '\\') {
 			/*
 			 * If the character is a hash mark and it isn't escaped
 			 * (or we're being compatible), the thing is a comment.
---------------------
PatchSet 280
Date: 2002/10/02 17:06:39
Author: jmallett
Log:
Code that has been #if0'd with the comment "WHY" since revision 1.1 can
disappear.

Members: 
	make.c:1.21->1.22 

Index: make.c
===================================================================
RCS file: /usr/home/okumoto/Work/make/fbsd-cvs/src/usr.bin/make/make.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- make.c	28 Sep 2002 23:35:07 -0000	1.21
+++ make.c	2 Oct 2002 16:06:39 -0000	1.22
@@ -232,15 +232,8 @@
 	    DEBUGF(MAKE, (":: operator and no sources..."));
 	}
 	oodate = TRUE;
-    } else {
-#if 0
-	/* WHY? */
-	DEBUGF(MAKE, ("source %smade...", gn->childMade ? "" : "not "));
-	oodate = gn->childMade;
-#else
+    } else
 	oodate = FALSE;
-#endif /* 0 */
-    }
 
     /*
      * If the target isn't out-of-date, the parents need to know its


[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]