unstick r69887

Revision 69887

Date:
1995/06/13 15:40:33
Author:
christos
Revision Log:
- posix compliance: Don't create .[A-Z]* targets
- support for .PHONY targets

Files:

Legend:

 
Added
 
Removed
 
Modified
  • usr.bin/make/make.1

     
    3 3 .\"
    4 4 .\" %sccs.include.redist.roff%
    5 5 .\"
    6 .\" @(#)make.1 8.7 (Berkeley) 04/29/95
    6 .\" @(#)make.1 8.8 (Berkeley) 06/13/95
    7 7 .\"
    8 8 .Dd
    9 9 .Dt MAKE 1
     
    734 734 .Nm make
    735 735 can't figure out how to create it, it will ignore this fact and assume
    736 736 the file isn't needed or already exists.
    737 .It Ic .PHONY
    738 If this special target is present in a Makefile, all sources for the
    739 target will considered to be `phony' targets. I.e. they don't refer
    740 to real files, and they will always be considered out-of-date. This
    741 is useful in case one wants to create a target called `install', in
    742 a directory where a file `install' already exists.
    737 743 .It Ic .PRECIOUS
    738 744 When
    739 745 .Nm make
  • usr.bin/make/make.c

     
    11 11 */
    12 12
    13 13 #ifndef lint
    14 static char sccsid[] = "@(#)make.c 8.2 (Berkeley) 04/28/95";
    14 static char sccsid[] = "@(#)make.c 8.3 (Berkeley) 06/13/95";
    15 15 #endif /* not lint */
    16 16
    17 17 /*-
     
    127 127 * Certain types of targets needn't even be sought as their datedness
    128 128 * doesn't depend on their modification time...
    129 129 */
    130 if ((gn->type & (OP_JOIN|OP_USE|OP_EXEC)) == 0) {
    130 if ((gn->type & (OP_JOIN|OP_USE|OP_EXEC|OP_PHONY)) == 0) {
    131 131 (void) Dir_MTime (gn);
    132 132 if (DEBUG(MAKE)) {
    133 133 if (gn->mtime != 0) {
     
    152 152 * These weird rules are brought to you by Backward-Compatability and
    153 153 * the strange people who wrote 'Make'.
    154 154 */
    155 if (gn->type & OP_USE) {
    155 if (gn->type & OP_PHONY) {
    156 156 /*
    157 * A PHONY node is always out of date
    158 */
    159 if (DEBUG(MAKE))
    160 printf("phony...");
    161 return TRUE;
    162 } else if (gn->type & OP_USE) {
    163 /*
    157 164 * If the node is a USE node it is *never* out of date
    158 165 * no matter *what*.
    159 166 */
  • usr.bin/make/make.h

     
    9 9 *
    10 10 * %sccs.include.redist.c%
    11 11 *
    12 * @(#)make.h 8.2 (Berkeley) 04/28/95
    12 * @(#)make.h 8.3 (Berkeley) 06/13/95
    13 13 */
    14 14
    15 15 /*-
     
    166 166 * local variables. */
    167 167 #define OP_NOTMAIN 0x00008000 /* The node is exempt from normal 'main
    168 168 * target' processing in parse.c */
    169 #define OP_PHONY 0x00010000 /* Not a file target; run always */
    169 170 /* Attributes applied by PMake */
    170 171 #define OP_TRANSFORM 0x80000000 /* The node is a transformation rule */
    171 172 #define OP_MEMBER 0x40000000 /* Target is a member of an archive */
  • usr.bin/make/parse.c

     
    11 11 */
    12 12
    13 13 #ifndef lint
    14 static char sccsid[] = "@(#)parse.c 8.5 (Berkeley) 04/28/95";
    14 static char sccsid[] = "@(#)parse.c 8.6 (Berkeley) 06/13/95";
    15 15 #endif /* not lint */
    16 16
    17 17 /*-
     
    138 138 Order, /* .ORDER */
    139 139 ExPath, /* .PATH */
    140 140 Precious, /* .PRECIOUS */
    141 Reserved, /* .RESERVED or .[A-Z]* */
    141 142 ExShell, /* .SHELL */
    142 143 Silent, /* .SILENT */
    143 144 SingleShell, /* .SINGLESHELL */
     
    165 166 ParseSpecial spec; /* Type when used as a target */
    166 167 int op; /* Operator when used as a source */
    167 168 } parseKeywords[] = {
    169 #define DOT_BEGIN 0
    168 170 { ".BEGIN", Begin, 0 },
    171 #define DOT_DEFAULT 1
    169 172 { ".DEFAULT", Default, 0 },
    170 { ".OPTIONAL", Attribute, OP_OPTIONAL },
    173 #define DOT_END 2
    171 174 { ".END", End, 0 },
    175 #define DOT_EXEC 3
    172 176 { ".EXEC", Attribute, OP_EXEC },
    177 #define DOT_IGNORE 4
    173 178 { ".IGNORE", Ignore, OP_IGNORE },
    179 #define DOT_INCLUDES 5
    174 180 { ".INCLUDES", Includes, 0 },
    181 #define DOT_INTERRUPT 6
    175 182 { ".INTERRUPT", Interrupt, 0 },
    183 #define DOT_INVISIBLE 7
    176 184 { ".INVISIBLE", Attribute, OP_INVISIBLE },
    185 #define DOT_JOIN 8
    177 186 { ".JOIN", Attribute, OP_JOIN },
    187 #define DOT_LIBS 9
    178 188 { ".LIBS", Libs, 0 },
    189 #define DOT_MAIN 10
    179 190 { ".MAIN", Main, 0 },
    191 #define DOT_MAKE 11
    180 192 { ".MAKE", Attribute, OP_MAKE },
    193 #define DOT_MAKEFLAGS 12
    181 194 { ".MAKEFLAGS", MFlags, 0 },
    195 #define DOT_MFLAGS 13
    182 196 { ".MFLAGS", MFlags, 0 },
    197 #define DOT_NOTMAIN 14
    183 198 { ".NOTMAIN", Attribute, OP_NOTMAIN },
    199 #define DOT_NOTPARALLEL 15
    184 200 { ".NOTPARALLEL", NotParallel, 0 },
    201 #define DOT_NULL 16
    185 202 { ".NULL", Null, 0 },
    203 #define DOT_OPTIONAL 17
    204 { ".OPTIONAL", Attribute, OP_OPTIONAL },
    205 #define DOT_ORDER 18
    186 206 { ".ORDER", Order, 0 },
    207 #define DOT_PATH 19
    187 208 { ".PATH", ExPath, 0 },
    209 #define DOT_PHONY 20
    210 { ".PHONY", Attribute, OP_PHONY },
    211 #define DOT_PRECIOUS 21
    188 212 { ".PRECIOUS", Precious, OP_PRECIOUS },
    213 #define DOT_RECURSIVE 22
    189 214 { ".RECURSIVE", Attribute, OP_MAKE },
    215 #define DOT_RESERVED 23
    216 { ".RESERVED", Reserved, 0 },
    217 #define DOT_SHELL 24
    190 218 { ".SHELL", ExShell, 0 },
    219 #define DOT_SILENT 25
    191 220 { ".SILENT", Silent, OP_SILENT },
    221 #define DOT_SINGLESHELL 26
    192 222 { ".SINGLESHELL", SingleShell, 0 },
    223 #define DOT_SUFFIXES 27
    193 224 { ".SUFFIXES", Suffixes, 0 },
    225 #define DOT_USE 28
    194 226 { ".USE", Attribute, OP_USE },
    195 227 };
    196 228
     
    251 283 start = cur + 1;
    252 284 }
    253 285 } while (start <= end);
    254 return (-1);
    286
    287 cur = 0;
    288 for (++str; *str; str++)
    289 if (!isupper((unsigned char) *str))
    290 break;
    291 return *str ? -1 : DOT_RESERVED;
    255 292 }
    256 293
    257 294 /*-
     
    777 814 case Order:
    778 815 predecessor = NILGNODE;
    779 816 break;
    817 case Reserved:
    818 /*
    819 * A posix reserved target that we don't know
    820 * how to deal with.
    821 */
    822 return;
    780 823 default:
    781 824 break;
    782 825 }