VirtualBox

Changeset 24 in kBuild for branches/FREEBSD/src/kmk/make.h


Ignore:
Timestamp:
Nov 26, 2002 9:24:54 PM (22 years ago)
Author:
bird
Message:

Import of RELENG_4_7_0_RELEASE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/FREEBSD/src/kmk/make.h

    r10 r24  
    3636 * SUCH DAMAGE.
    3737 *
    38  *      @(#)make.h      8.3 (Berkeley) 6/13/95
    39  * $FreeBSD: src/usr.bin/make/make.h,v 1.23 2002/10/10 19:27:48 jmallett Exp $
     38 *      from: @(#)make.h        8.3 (Berkeley) 6/13/95
     39 * $FreeBSD: src/usr.bin/make/make.h,v 1.12.2.2 2001/02/13 03:13:58 will Exp $
    4040 */
    4141
     
    4646
    4747#ifndef _MAKE_H_
    48 #define _MAKE_H_
     48#define _MAKE_H_
    4949
    5050#include <sys/types.h>
     
    5252#include <string.h>
    5353#include <ctype.h>
    54 
     54#include <err.h>
     55
     56#if !defined(MAKE_BOOTSTRAP) && defined(BSD4_4)
     57# include <sys/cdefs.h>
     58#else
     59# ifndef __P
     60#  if defined(__STDC__) || defined(__cplusplus)
     61#   define      __P(protos)     protos          /* full-blown ANSI C */
     62#  else
     63#   define      __P(protos)     ()              /* traditional C preprocessor */
     64#  endif
     65# endif
     66# ifndef __STDC__
     67#  ifndef const
     68#   define const
     69#  endif
     70#  ifndef volatile
     71#   define volatile
     72#  endif
     73# endif
     74#endif
     75
     76#ifdef __STDC__
    5577#include <stdlib.h>
    5678#include <unistd.h>
     79#endif
    5780#include "sprite.h"
    5881#include "lst.h"
     
    6487 * pieces of data associated with it.
    6588 *      1) the name of the target it describes
    66  *      2) the location of the target file in the filesystem.
     89 *      2) the location of the target file in the file system.
    6790 *      3) the type of operator used to define its sources (qv. parse.c)
    6891 *      4) whether it is involved in this invocation of make
     
    143166
    144167/*
     168 * Manifest constants
     169 */
     170#define NILGNODE        ((GNode *) NIL)
     171
     172/*
    145173 * The OP_ constants are used when parsing a dependency line as a way of
    146174 * communicating to other parts of the program the way in which a target
     
    151179 * righthand side...
    152180 */
    153 #define OP_DEPENDS      0x00000001  /* Execution of commands depends on
     181#define OP_DEPENDS      0x00000001  /* Execution of commands depends on
    154182                                     * kids (:) */
    155 #define OP_FORCE        0x00000002  /* Always execute commands (!) */
    156 #define OP_DOUBLEDEP    0x00000004  /* Execution of commands depends on kids
     183#define OP_FORCE        0x00000002  /* Always execute commands (!) */
     184#define OP_DOUBLEDEP    0x00000004  /* Execution of commands depends on kids
    157185                                     * per line (::) */
    158 #define OP_OPMASK       (OP_DEPENDS|OP_FORCE|OP_DOUBLEDEP)
    159 
    160 #define OP_OPTIONAL     0x00000008  /* Don't care if the target doesn't
     186#define OP_OPMASK       (OP_DEPENDS|OP_FORCE|OP_DOUBLEDEP)
     187
     188#define OP_OPTIONAL     0x00000008  /* Don't care if the target doesn't
    161189                                     * exist and can't be created */
    162 #define OP_USE          0x00000010  /* Use associated commands for parents */
    163 #define OP_EXEC         0x00000020  /* Target is never out of date, but always
     190#define OP_USE          0x00000010  /* Use associated commands for parents */
     191#define OP_EXEC         0x00000020  /* Target is never out of date, but always
    164192                                     * execute commands anyway. Its time
    165193                                     * doesn't matter, so it has none...sort
    166194                                     * of */
    167 #define OP_IGNORE       0x00000040  /* Ignore errors when creating the node */
    168 #define OP_PRECIOUS     0x00000080  /* Don't remove the target when
     195#define OP_IGNORE       0x00000040  /* Ignore errors when creating the node */
     196#define OP_PRECIOUS     0x00000080  /* Don't remove the target when
    169197                                     * interrupted */
    170 #define OP_SILENT       0x00000100  /* Don't echo commands when executed */
    171 #define OP_MAKE         0x00000200  /* Target is a recurrsive make so its
     198#define OP_SILENT       0x00000100  /* Don't echo commands when executed */
     199#define OP_MAKE         0x00000200  /* Target is a recurrsive make so its
    172200                                     * commands should always be executed when
    173201                                     * it is out of date, regardless of the
    174202                                     * state of the -n or -t flags */
    175 #define OP_JOIN         0x00000400  /* Target is out-of-date only if any of its
     203#define OP_JOIN         0x00000400  /* Target is out-of-date only if any of its
    176204                                     * children was out-of-date */
    177 #define OP_INVISIBLE    0x00004000  /* The node is invisible to its parents.
     205#define OP_INVISIBLE    0x00004000  /* The node is invisible to its parents.
    178206                                     * I.e. it doesn't show up in the parents's
    179207                                     * local variables. */
    180 #define OP_NOTMAIN      0x00008000  /* The node is exempt from normal 'main
     208#define OP_NOTMAIN      0x00008000  /* The node is exempt from normal 'main
    181209                                     * target' processing in parse.c */
    182 #define OP_PHONY        0x00010000  /* Not a file target; run always */
     210#define OP_PHONY        0x00010000  /* Not a file target; run always */
    183211/* Attributes applied by PMake */
    184 #define OP_TRANSFORM    0x80000000  /* The node is a transformation rule */
    185 #define OP_MEMBER       0x40000000  /* Target is a member of an archive */
    186 #define OP_LIB          0x20000000  /* Target is a library */
    187 #define OP_ARCHV        0x10000000  /* Target is an archive construct */
    188 #define OP_HAS_COMMANDS 0x08000000  /* Target has all the commands it should.
     212#define OP_TRANSFORM    0x80000000  /* The node is a transformation rule */
     213#define OP_MEMBER       0x40000000  /* Target is a member of an archive */
     214#define OP_LIB          0x20000000  /* Target is a library */
     215#define OP_ARCHV        0x10000000  /* Target is an archive construct */
     216#define OP_HAS_COMMANDS 0x08000000  /* Target has all the commands it should.
    189217                                     * Used when parsing to catch multiple
    190218                                     * commands for a target */
    191 #define OP_SAVE_CMDS    0x04000000  /* Saving commands on .END (Compat) */
    192 #define OP_DEPS_FOUND   0x02000000  /* Already processed by Suff_FindDeps */
     219#define OP_SAVE_CMDS    0x04000000  /* Saving commands on .END (Compat) */
     220#define OP_DEPS_FOUND   0x02000000  /* Already processed by Suff_FindDeps */
    193221
    194222/*
     
    196224 * object of a dependency operator
    197225 */
    198 #define OP_NOP(t)       (((t) & OP_OPMASK) == 0x00000000)
     226#define OP_NOP(t)       (((t) & OP_OPMASK) == 0x00000000)
    199227
    200228/*
     
    204232 * is given, a new, empty node will be created for the target, placed in the
    205233 * table of all targets and its address returned. If TARG_NOCREATE is given,
    206  * a NULL pointer will be returned.
    207  */
    208 #define TARG_CREATE     0x01      /* create node if not found */
    209 #define TARG_NOCREATE   0x00      /* don't create it */
     234 * a NIL pointer will be returned.
     235 */
     236#define TARG_CREATE     0x01      /* create node if not found */
     237#define TARG_NOCREATE   0x00      /* don't create it */
    210238
    211239/*
     
    218246 * schemes allocate in powers of two.
    219247 */
    220 #define MAKE_BSIZE              256     /* starting size for expandable buffers */
     248#define MAKE_BSIZE              256     /* starting size for expandable buffers */
    221249
    222250/*
     
    229257 * Str_Concat returns.
    230258 */
    231 #define STR_ADDSPACE    0x01    /* add a space when Str_Concat'ing */
    232 #define STR_DOFREE      0x02    /* free source strings after concatenation */
    233 #define STR_ADDSLASH    0x04    /* add a slash when Str_Concat'ing */
     259#define STR_ADDSPACE    0x01    /* add a space when Str_Concat'ing */
     260#define STR_DOFREE      0x02    /* free source strings after concatenation */
     261#define STR_ADDSLASH    0x04    /* add a slash when Str_Concat'ing */
    234262
    235263/*
     
    238266 * as the first argument to Parse_Error.
    239267 */
    240 #define PARSE_WARNING   2
    241 #define PARSE_FATAL     1
     268#define PARSE_WARNING   2
     269#define PARSE_FATAL     1
    242270
    243271/*
    244272 * Values returned by Cond_Eval.
    245273 */
    246 #define COND_PARSE      0       /* Parse the next lines */
    247 #define COND_SKIP       1       /* Skip the next lines */
    248 #define COND_INVALID    2       /* Not a conditional statement */
     274#define COND_PARSE      0       /* Parse the next lines */
     275#define COND_SKIP       1       /* Skip the next lines */
     276#define COND_INVALID    2       /* Not a conditional statement */
    249277
    250278/*
    251279 * Definitions for the "local" variables. Used only for clarity.
    252280 */
    253 #define TARGET            "@"   /* Target of dependency */
    254 #define OODATE            "?"   /* All out-of-date sources */
    255 #define ALLSRC            ">"   /* All sources */
    256 #define IMPSRC            "<"   /* Source implied by transformation */
    257 #define PREFIX            "*"   /* Common prefix */
    258 #define ARCHIVE           "!"   /* Archive in "archive(member)" syntax */
    259 #define MEMBER            "%"   /* Member in "archive(member)" syntax */
    260 
    261 #define FTARGET           "@F"  /* file part of TARGET */
    262 #define DTARGET           "@D"  /* directory part of TARGET */
    263 #define FIMPSRC           "<F"  /* file part of IMPSRC */
    264 #define DIMPSRC           "<D"  /* directory part of IMPSRC */
    265 #define FPREFIX           "*F"  /* file part of PREFIX */
    266 #define DPREFIX           "*D"  /* directory part of PREFIX */
     281#define TARGET            "@"   /* Target of dependency */
     282#define OODATE            "?"   /* All out-of-date sources */
     283#define ALLSRC            ">"   /* All sources */
     284#define IMPSRC            "<"   /* Source implied by transformation */
     285#define PREFIX            "*"   /* Common prefix */
     286#define ARCHIVE           "!"   /* Archive in "archive(member)" syntax */
     287#define MEMBER            "%"   /* Member in "archive(member)" syntax */
     288
     289#define FTARGET           "@F"  /* file part of TARGET */
     290#define DTARGET           "@D"  /* directory part of TARGET */
     291#define FIMPSRC           "<F"  /* file part of IMPSRC */
     292#define DIMPSRC           "<D"  /* directory part of IMPSRC */
     293#define FPREFIX           "*F"  /* file part of PREFIX */
     294#define DPREFIX           "*D"  /* directory part of PREFIX */
    267295
    268296/*
     
    274302extern Lst      dirSearchPath;  /* The list of directories to search when
    275303                                 * looking for targets */
    276 extern Lst      parseIncPath;   /* The list of directories to search when
    277                                  * looking for includes */
    278 
    279 extern Boolean  jobsRunning;    /* True if jobs are running */
     304
    280305extern Boolean  compatMake;     /* True if we are make compatible */
    281306extern Boolean  ignoreErrors;   /* True if should ignore all errors */
     
    336361#define DEBUG_TARG      0x0100
    337362#define DEBUG_VAR       0x0200
    338 #define DEBUG_FOR       0x0400
    339 #define DEBUG_LOUD      0x0800
    340 
    341 #define CONCAT(a,b)     a##b
     363#define DEBUG_FOR       0x0400
     364#define DEBUG_LOUD      0x0800
     365
     366#ifdef __STDC__
     367#define CONCAT(a,b)     a##b
     368#else
     369#define I(a)            a
     370#define CONCAT(a,b)     I(a)b
     371#endif /* __STDC__ */
    342372
    343373#define DEBUG(module)   (debug & CONCAT(DEBUG_,module))
    344 #define DEBUGF(module,args)             \
    345 do {                                            \
    346         if (DEBUG(module)) {                    \
    347                 Debug args ;                    \
    348         }                                       \
    349 } while (0)
    350 #define ISDOT(c) ((c)[0] == '.' && (((c)[1] == '\0') || ((c)[1] == '/')))
    351 #define ISDOTDOT(c) ((c)[0] == '.' && ISDOT(&((c)[1])))
     374#define ISDOT(c) ((c)[0] == '.' && (((c)[1] == '\0') || ((c)[1] == '/')))
     375#define ISDOTDOT(c) ((c)[0] == '.' && ISDOT(&((c)[1])))
    352376
    353377/*
     
    357381#include "nonints.h"
    358382
    359 int Make_TimeStamp(GNode *, GNode *);
    360 Boolean Make_OODate(GNode *);
    361 int Make_HandleUse(GNode *, GNode *);
    362 void Make_Update(GNode *);
    363 void Make_DoAllVar(GNode *);
    364 Boolean Make_Run(Lst);
     383int Make_TimeStamp __P((GNode *, GNode *));
     384Boolean Make_OODate __P((GNode *));
     385int Make_HandleUse __P((GNode *, GNode *));
     386void Make_Update __P((GNode *));
     387void Make_DoAllVar __P((GNode *));
     388Boolean Make_Run __P((Lst));
    365389
    366390#endif /* _MAKE_H_ */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette