make(1): remove header sprite.h Make is independent of the Sprite operating system.diff -r1.93 -r1.94 src/usr.bin/make/Makefile
(rillig)
--- src/usr.bin/make/Makefile 2020/08/25 16:39:19 1.93
+++ src/usr.bin/make/Makefile 2020/08/26 23:00:47 1.94
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | # $NetBSD: Makefile,v 1.93 2020/08/25 16:39:19 rillig Exp $ | 1 | # $NetBSD: Makefile,v 1.94 2020/08/26 23:00:47 rillig Exp $ | |
2 | # @(#)Makefile 5.2 (Berkeley) 12/28/90 | 2 | # @(#)Makefile 5.2 (Berkeley) 12/28/90 | |
3 | 3 | |||
4 | PROG= make | 4 | PROG= make | |
5 | SRCS= arch.c | 5 | SRCS= arch.c | |
6 | SRCS+= buf.c | 6 | SRCS+= buf.c | |
7 | SRCS+= compat.c | 7 | SRCS+= compat.c | |
8 | SRCS+= cond.c | 8 | SRCS+= cond.c | |
9 | SRCS+= dir.c | 9 | SRCS+= dir.c | |
10 | SRCS+= enum.c | 10 | SRCS+= enum.c | |
11 | SRCS+= for.c | 11 | SRCS+= for.c | |
12 | SRCS+= hash.c | 12 | SRCS+= hash.c | |
13 | SRCS+= job.c | 13 | SRCS+= job.c | |
14 | SRCS+= lst.c | 14 | SRCS+= lst.c | |
@@ -27,27 +27,26 @@ SRCS+= util.c | @@ -27,27 +27,26 @@ SRCS+= util.c | |||
27 | HDRS= buf.h | 27 | HDRS= buf.h | |
28 | HDRS+= config.h | 28 | HDRS+= config.h | |
29 | HDRS+= dir.h | 29 | HDRS+= dir.h | |
30 | HDRS+= enum.h | 30 | HDRS+= enum.h | |
31 | HDRS+= hash.h | 31 | HDRS+= hash.h | |
32 | HDRS+= job.h | 32 | HDRS+= job.h | |
33 | HDRS+= lst.h | 33 | HDRS+= lst.h | |
34 | HDRS+= make.h | 34 | HDRS+= make.h | |
35 | HDRS+= make_malloc.h | 35 | HDRS+= make_malloc.h | |
36 | HDRS+= meta.h | 36 | HDRS+= meta.h | |
37 | HDRS+= metachar.h | 37 | HDRS+= metachar.h | |
38 | HDRS+= nonints.h | 38 | HDRS+= nonints.h | |
39 | HDRS+= pathnames.h | 39 | HDRS+= pathnames.h | |
40 | HDRS+= sprite.h | |||
41 | HDRS+= strlist.h | 40 | HDRS+= strlist.h | |
42 | HDRS+= trace.h | 41 | HDRS+= trace.h | |
43 | 42 | |||
44 | # Whether to generate a coverage report after running the tests. | 43 | # Whether to generate a coverage report after running the tests. | |
45 | USE_COVERAGE?= no # works only with gcc; clang9 fails to link | 44 | USE_COVERAGE?= no # works only with gcc; clang9 fails to link | |
46 | .if ${USE_COVERAGE} == "yes" | 45 | .if ${USE_COVERAGE} == "yes" | |
47 | GCOV?= gcov | 46 | GCOV?= gcov | |
48 | COPTS+= --coverage -O0 -ggdb | 47 | COPTS+= --coverage -O0 -ggdb | |
49 | LDADD+= --coverage | 48 | LDADD+= --coverage | |
50 | .endif | 49 | .endif | |
51 | CLEANFILES+= *.gcda *.gcno *.gcov | 50 | CLEANFILES+= *.gcda *.gcno *.gcov | |
52 | 51 | |||
53 | # Whether to compile using the Undefined Behavior Sanitizer (GCC, Clang). | 52 | # Whether to compile using the Undefined Behavior Sanitizer (GCC, Clang). |
--- src/usr.bin/make/hash.c 2020/08/01 14:47:49 1.26
+++ src/usr.bin/make/hash.c 2020/08/26 23:00:47 1.27
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: hash.c,v 1.26 2020/08/01 14:47:49 rillig Exp $ */ | 1 | /* $NetBSD: hash.c,v 1.27 2020/08/26 23:00:47 rillig Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. | 4 | * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to Berkeley by | 7 | * This code is derived from software contributed to Berkeley by | |
8 | * Adam de Boor. | 8 | * Adam de Boor. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -60,48 +60,46 @@ | @@ -60,48 +60,46 @@ | |||
60 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 60 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
61 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 61 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
62 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | 62 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
63 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 63 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
64 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 64 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
65 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 65 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
66 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 66 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
67 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 67 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
68 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 68 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
69 | * SUCH DAMAGE. | 69 | * SUCH DAMAGE. | |
70 | */ | 70 | */ | |
71 | 71 | |||
72 | #ifndef MAKE_NATIVE | 72 | #ifndef MAKE_NATIVE | |
73 | static char rcsid[] = "$NetBSD: hash.c,v 1.26 2020/08/01 14:47:49 rillig Exp $"; | 73 | static char rcsid[] = "$NetBSD: hash.c,v 1.27 2020/08/26 23:00:47 rillig Exp $"; | |
74 | #else | 74 | #else | |
75 | #include <sys/cdefs.h> | 75 | #include <sys/cdefs.h> | |
76 | #ifndef lint | 76 | #ifndef lint | |
77 | #if 0 | 77 | #if 0 | |
78 | static char sccsid[] = "@(#)hash.c 8.1 (Berkeley) 6/6/93"; | 78 | static char sccsid[] = "@(#)hash.c 8.1 (Berkeley) 6/6/93"; | |
79 | #else | 79 | #else | |
80 | __RCSID("$NetBSD: hash.c,v 1.26 2020/08/01 14:47:49 rillig Exp $"); | 80 | __RCSID("$NetBSD: hash.c,v 1.27 2020/08/26 23:00:47 rillig Exp $"); | |
81 | #endif | 81 | #endif | |
82 | #endif /* not lint */ | 82 | #endif /* not lint */ | |
83 | #endif | 83 | #endif | |
84 | 84 | |||
85 | /* hash.c -- | 85 | /* hash.c -- | |
86 | * | 86 | * | |
87 | * This module contains routines to manipulate a hash table. | 87 | * This module contains routines to manipulate a hash table. | |
88 | * See hash.h for a definition of the structure of the hash | 88 | * See hash.h for a definition of the structure of the hash | |
89 | * table. Hash tables grow automatically as the amount of | 89 | * table. Hash tables grow automatically as the amount of | |
90 | * information increases. | 90 | * information increases. | |
91 | */ | 91 | */ | |
92 | #include "sprite.h" | |||
93 | #include "make.h" | 92 | #include "make.h" | |
94 | #include "hash.h" | |||
95 | 93 | |||
96 | /* | 94 | /* | |
97 | * Forward references to local procedures that are used before they're | 95 | * Forward references to local procedures that are used before they're | |
98 | * defined: | 96 | * defined: | |
99 | */ | 97 | */ | |
100 | 98 | |||
101 | static void RebuildTable(Hash_Table *); | 99 | static void RebuildTable(Hash_Table *); | |
102 | 100 | |||
103 | /* | 101 | /* | |
104 | * The following defines the ratio of # entries to # buckets | 102 | * The following defines the ratio of # entries to # buckets | |
105 | * at which we rebuild the table to make it larger. | 103 | * at which we rebuild the table to make it larger. | |
106 | */ | 104 | */ | |
107 | 105 |
--- src/usr.bin/make/lst.h 2020/08/26 22:55:46 1.44
+++ src/usr.bin/make/lst.h 2020/08/26 23:00:47 1.45
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: lst.h,v 1.44 2020/08/26 22:55:46 rillig Exp $ */ | 1 | /* $NetBSD: lst.h,v 1.45 2020/08/26 23:00:47 rillig Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. | 4 | * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to Berkeley by | 7 | * This code is derived from software contributed to Berkeley by | |
8 | * Adam de Boor. | 8 | * Adam de Boor. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -73,28 +73,26 @@ | @@ -73,28 +73,26 @@ | |||
73 | * from: @(#)lst.h 8.1 (Berkeley) 6/6/93 | 73 | * from: @(#)lst.h 8.1 (Berkeley) 6/6/93 | |
74 | */ | 74 | */ | |
75 | 75 | |||
76 | /*- | 76 | /*- | |
77 | * lst.h -- | 77 | * lst.h -- | |
78 | * Header for using the list library | 78 | * Header for using the list library | |
79 | */ | 79 | */ | |
80 | #ifndef MAKE_LST_H | 80 | #ifndef MAKE_LST_H | |
81 | #define MAKE_LST_H | 81 | #define MAKE_LST_H | |
82 | 82 | |||
83 | #include <sys/param.h> | 83 | #include <sys/param.h> | |
84 | #include <stdlib.h> | 84 | #include <stdlib.h> | |
85 | 85 | |||
86 | #include "sprite.h" | |||
87 | ||||
88 | /* | 86 | /* | |
89 | * basic typedef. This is what the Lst_ functions handle | 87 | * basic typedef. This is what the Lst_ functions handle | |
90 | */ | 88 | */ | |
91 | 89 | |||
92 | typedef struct List *Lst; | 90 | typedef struct List *Lst; | |
93 | typedef struct ListNode *LstNode; | 91 | typedef struct ListNode *LstNode; | |
94 | 92 | |||
95 | typedef void *LstCopyProc(void *); | 93 | typedef void *LstCopyProc(void *); | |
96 | typedef void LstFreeProc(void *); | 94 | typedef void LstFreeProc(void *); | |
97 | typedef int LstFindProc(const void *, const void *); | 95 | typedef int LstFindProc(const void *, const void *); | |
98 | typedef int LstActionProc(void *, void *); | 96 | typedef int LstActionProc(void *, void *); | |
99 | 97 | |||
100 | /* | 98 | /* |
--- src/usr.bin/make/make.h 2020/08/24 20:15:51 1.126
+++ src/usr.bin/make/make.h 2020/08/26 23:00:47 1.127
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: make.h,v 1.126 2020/08/24 20:15:51 rillig Exp $ */ | 1 | /* $NetBSD: make.h,v 1.127 2020/08/26 23:00:47 rillig Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1988, 1989, 1990, 1993 | 4 | * Copyright (c) 1988, 1989, 1990, 1993 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to Berkeley by | 7 | * This code is derived from software contributed to Berkeley by | |
8 | * Adam de Boor. | 8 | * Adam de Boor. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -118,27 +118,57 @@ | @@ -118,27 +118,57 @@ | |||
118 | #elif defined(__GNUC__) | 118 | #elif defined(__GNUC__) | |
119 | #define MAKE_ATTR_DEAD __volatile | 119 | #define MAKE_ATTR_DEAD __volatile | |
120 | #else | 120 | #else | |
121 | #define MAKE_ATTR_DEAD /* delete */ | 121 | #define MAKE_ATTR_DEAD /* delete */ | |
122 | #endif | 122 | #endif | |
123 | 123 | |||
124 | #if MAKE_GNUC_PREREQ(2, 7) | 124 | #if MAKE_GNUC_PREREQ(2, 7) | |
125 | #define MAKE_ATTR_PRINTFLIKE(fmtarg, firstvararg) \ | 125 | #define MAKE_ATTR_PRINTFLIKE(fmtarg, firstvararg) \ | |
126 | __attribute__((__format__ (__printf__, fmtarg, firstvararg))) | 126 | __attribute__((__format__ (__printf__, fmtarg, firstvararg))) | |
127 | #else | 127 | #else | |
128 | #define MAKE_ATTR_PRINTFLIKE(fmtarg, firstvararg) /* delete */ | 128 | #define MAKE_ATTR_PRINTFLIKE(fmtarg, firstvararg) /* delete */ | |
129 | #endif | 129 | #endif | |
130 | 130 | |||
131 | #include "sprite.h" | 131 | /* | |
132 | * A boolean type is defined as an integer, not an enum. This allows a | |||
133 | * boolean argument to be an expression that isn't strictly 0 or 1 valued. | |||
134 | */ | |||
135 | ||||
136 | typedef int Boolean; | |||
137 | #ifndef TRUE | |||
138 | #define TRUE 1 | |||
139 | #endif /* TRUE */ | |||
140 | #ifndef FALSE | |||
141 | #define FALSE 0 | |||
142 | #endif /* FALSE */ | |||
143 | ||||
144 | /* | |||
145 | * Functions that must return a status can return a ReturnStatus to | |||
146 | * indicate success or type of failure. | |||
147 | */ | |||
148 | ||||
149 | typedef int ReturnStatus; | |||
150 | ||||
151 | /* | |||
152 | * The following statuses overlap with the first 2 generic statuses | |||
153 | * defined in status.h: | |||
154 | * | |||
155 | * SUCCESS There was no error. | |||
156 | * FAILURE There was a general error. | |||
157 | */ | |||
158 | ||||
159 | #define SUCCESS 0x00000000 | |||
160 | #define FAILURE 0x00000001 | |||
161 | ||||
132 | #include "lst.h" | 162 | #include "lst.h" | |
133 | #include "hash.h" | 163 | #include "hash.h" | |
134 | #include "config.h" | 164 | #include "config.h" | |
135 | #include "buf.h" | 165 | #include "buf.h" | |
136 | #include "make_malloc.h" | 166 | #include "make_malloc.h" | |
137 | 167 | |||
138 | typedef enum { | 168 | typedef enum { | |
139 | UNMADE, /* Not examined yet */ | 169 | UNMADE, /* Not examined yet */ | |
140 | DEFERRED, /* Examined once (building child) */ | 170 | DEFERRED, /* Examined once (building child) */ | |
141 | REQUESTED, /* on toBeMade list */ | 171 | REQUESTED, /* on toBeMade list */ | |
142 | BEINGMADE, /* Target is already being made. | 172 | BEINGMADE, /* Target is already being made. | |
143 | * Indicates a cycle in the graph. */ | 173 | * Indicates a cycle in the graph. */ | |
144 | MADE, /* Was out-of-date and has been made */ | 174 | MADE, /* Was out-of-date and has been made */ |