VirtualBox

Changeset 3138 in kBuild for vendor/gnumake/current/dep.h


Ignore:
Timestamp:
Mar 12, 2018 7:32:29 PM (7 years ago)
Author:
bird
Message:

Imported make 4.2.1 (2e55f5e4abdc0e38c1d64be703b446695e70b3b6) from https://git.savannah.gnu.org/git/make.git.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/gnumake/current/dep.h

    r2596 r3138  
    11/* Definitions of dependency data structures for GNU Make.
    2 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
    3 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
    4 2010 Free Software Foundation, Inc.
     2Copyright (C) 1988-2016 Free Software Foundation, Inc.
    53This file is part of GNU Make.
    64
     
    1715this program.  If not, see <http://www.gnu.org/licenses/>.  */
    1816
    19 /* Flag bits for the second argument to `read_makefile'.
    20    These flags are saved in the `changed' field of each
    21    `struct dep' in the chain returned by `read_all_makefiles'.  */
    2217
    23 #define RM_NO_DEFAULT_GOAL      (1 << 0) /* Do not set default goal.  */
    24 #define RM_INCLUDED             (1 << 1) /* Search makefile search path.  */
    25 #define RM_DONTCARE             (1 << 2) /* No error if it doesn't exist.  */
    26 #define RM_NO_TILDE             (1 << 3) /* Don't expand ~ in file name.  */
    27 #define RM_NOFLAG               0
     18/* Structure used in chains of names, for parsing and globbing.  */
     19
     20#define NAMESEQ(_t)     \
     21    _t *next;           \
     22    const char *name
     23
     24struct nameseq
     25  {
     26    NAMESEQ (struct nameseq);
     27  };
     28
     29/* Flag bits for the second argument to 'read_makefile'.
     30   These flags are saved in the 'flags' field of each
     31   'struct goaldep' in the chain returned by 'read_all_makefiles'.  */
     32
     33#define RM_NO_DEFAULT_GOAL      (1 << 0) /* Do not set default goal.  */
     34#define RM_INCLUDED             (1 << 1) /* Search makefile search path.  */
     35#define RM_DONTCARE             (1 << 2) /* No error if it doesn't exist.  */
     36#define RM_NO_TILDE             (1 << 3) /* Don't expand ~ in file name.  */
     37#define RM_NOFLAG               0
    2838
    2939/* Structure representing one dependency of a file.
    30    Each struct file's `deps' points to a chain of these,
    31    chained through the `next'. `stem' is the stem for this
    32    dep line of static pattern rule or NULL.
     40   Each struct file's 'deps' points to a chain of these, through 'next'.
     41   'stem' is the stem for this dep line of static pattern rule or NULL.  */
    3342
    34    Note that the first two words of this match a struct nameseq.  */
     43#define DEP(_t)                                 \
     44    NAMESEQ (_t);                               \
     45    struct file *file;                          \
     46    const char *stem;                           \
     47    unsigned short flags : 8;                   \
     48    unsigned short changed : 1;                 \
     49    unsigned short ignore_mtime : 1;            \
     50    unsigned short staticpattern : 1;           \
     51    unsigned short need_2nd_expansion : 1
    3552
    3653struct dep
    3754  {
    38     struct dep *next;
    39     const char *name;
    40     const char *stem;
    41     struct file *file;
    42     unsigned int changed : 8;
    43     unsigned int ignore_mtime : 1;
    44     unsigned int staticpattern : 1;
    45     unsigned int need_2nd_expansion : 1;
    46     unsigned int dontcare : 1;
     55    DEP (struct dep);
    4756  };
    4857
     58/* Structure representing one goal.
     59   The goals to be built constitute a chain of these, chained through 'next'.
     60   'stem' is not used, but it's simpler to include and ignore it.  */
    4961
    50 /* Structure used in chains of names, for parsing and globbing.  */
    51 
    52 struct nameseq
     62struct goaldep
    5363  {
    54     struct nameseq *next;
    55     const char *name;
     64    DEP (struct goaldep);
     65    unsigned short error;
     66    floc floc;
    5667  };
    5768
     69/* Options for parsing lists of filenames.  */
    5870
    59 #define PARSEFS_NONE    (0x0000)
    60 #define PARSEFS_NOSTRIP (0x0001)
    61 #define PARSEFS_NOAR    (0x0002)
    62 #define PARSEFS_NOGLOB  (0x0004)
    63 #define PARSEFS_EXISTS  (0x0008)
    64 #define PARSEFS_NOCACHE (0x0010)
     71#define PARSEFS_NONE    0x0000
     72#define PARSEFS_NOSTRIP 0x0001
     73#define PARSEFS_NOAR    0x0002
     74#define PARSEFS_NOGLOB  0x0004
     75#define PARSEFS_EXISTS  0x0008
     76#define PARSEFS_NOCACHE 0x0010
    6577
    6678#define PARSE_FILE_SEQ(_s,_t,_c,_p,_f) \
    6779            (_t *)parse_file_seq ((_s),sizeof (_t),(_c),(_p),(_f))
     80#define PARSE_SIMPLE_SEQ(_s,_t) \
     81            (_t *)parse_file_seq ((_s),sizeof (_t),MAP_NUL,NULL,PARSEFS_NONE)
    6882
    6983#ifdef VMS
     
    7185#else
    7286void *parse_file_seq (char **stringp, unsigned int size,
    73                       int stopchar, const char *prefix, int flags);
     87                      int stopmap, const char *prefix, int flags);
    7488#endif
    7589
     
    8094#endif
    8195
    82 #define dep_name(d)     ((d)->name == 0 ? (d)->file->name : (d)->name)
     96#define dep_name(d)        ((d)->name ? (d)->name : (d)->file->name)
    8397
    84 #define alloc_dep()     (xcalloc (sizeof (struct dep)))
    85 #define free_ns(_n)     free (_n)
    86 #define free_dep(_d)    free_ns (_d)
     98#define alloc_seq_elt(_t)   xcalloc (sizeof (_t))
     99void free_ns_chain (struct nameseq *n);
     100
     101#if defined(MAKE_MAINTAINER_MODE) && defined(__GNUC__)
     102/* Use inline to get real type-checking.  */
     103#define SI static inline
     104SI struct nameseq *alloc_ns()      { return alloc_seq_elt (struct nameseq); }
     105SI struct dep *alloc_dep()         { return alloc_seq_elt (struct dep); }
     106SI struct goaldep *alloc_goaldep() { return alloc_seq_elt (struct goaldep); }
     107
     108SI void free_ns(struct nameseq *n)      { free (n); }
     109SI void free_dep(struct dep *d)         { free_ns ((struct nameseq *)d); }
     110SI void free_goaldep(struct goaldep *g) { free_dep ((struct dep *)g); }
     111
     112SI void free_dep_chain(struct dep *d)      { free_ns_chain((struct nameseq *)d); }
     113SI void free_goal_chain(struct goaldep *g) { free_dep_chain((struct dep *)g); }
     114#else
     115# define alloc_ns()          alloc_seq_elt (struct nameseq)
     116# define alloc_dep()         alloc_seq_elt (struct dep)
     117# define alloc_goaldep()     alloc_seq_elt (struct goaldep)
     118
     119# define free_ns(_n)         free (_n)
     120# define free_dep(_d)        free_ns (_d)
     121# define free_goaldep(_g)    free_dep (_g)
     122
     123# define free_dep_chain(_d)  free_ns_chain ((struct nameseq *)(_d))
     124# define free_goal_chain(_g) free_ns_chain ((struct nameseq *)(_g))
     125#endif
    87126
    88127struct dep *copy_dep_chain (const struct dep *d);
    89 void free_dep_chain (struct dep *d);
    90 void free_ns_chain (struct nameseq *n);
    91 struct dep *read_all_makefiles (const char **makefiles);
    92 void eval_buffer (char *buffer);
    93 int update_goal_chain (struct dep *goals);
     128
     129struct goaldep *read_all_makefiles (const char **makefiles);
     130void eval_buffer (char *buffer, const floc *floc);
     131enum update_status update_goal_chain (struct goaldep *goals);
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