/***********************************************************************1* *2* This software is part of the ast package *3* Copyright (c) 1984-2012 AT&T Intellectual Property *4* and is licensed under the *5* Eclipse Public License, Version 1.0 *6* by AT&T Intellectual Property *7* *8* A copy of the License is available at *9* http://www.eclipse.org/org/documents/epl-v10.html *10* (with md5 checksum b35adb5213ca9657e911e9befb180842) *11* *12* Information and Software Systems Research *13* AT&T Research *14* Florham Park NJ *15* *16* Glenn Fowler <[email protected]> *17* *18***********************************************************************/19#pragma prototyped20/*21* Glenn Fowler22* AT&T Research23*24* make option attributes and flag mappings25*26* omitted letters are avilable for option flags:27*28* abcdefghijklmnopqrstuvwxyz29* --------------------------30* ABCDEFGHIJK MNOPQRSTUV X31* abcdefg ijkl no rst vwx z32*/3334#define OPT(o) (o&((1<<9)-1)) /* get opt char from code */35#define Of (1<<8) /* cannot be set by flag */3637#define Oa (1<<9) /* multiple string values added */38#define Ob (1<<10) /* boolean value */39#define Oi (1<<11) /* state.* sense inverted */40#define Om (1<<13) /* internal option */41#define On (1<<14) /* numeric value */42#define Oo (1<<15) /* flag sense opposite */43#define Op (1L<<19) /* .mo probe prerequisite */44#define Os (1L<<16) /* string value */45#define Ov (1L<<17) /* value is optional */46#define Ox (1L<<18) /* not expanded in $(-) */4748#define OPT_COMPILE (1L<<26) /* compile into object */49#define OPT_DECLARE (1L<<27) /* compile declaration */50#define OPT_DEFAULT (1L<<28) /* := default value */51#define OPT_EXTERNAL (1L<<29) /* external by name */52#define OPT_READONLY (1L<<30) /* cannot reset til state.user */53#define OPT_SET (1L<<31) /* explicitly set */5455#define OPT_accept ('A'|Ob) /* accept existing targets */56#define OPT_alias ('a'|Ob) /* directory aliasing enabled */57#define OPT_base ('b'|Ob|Ox) /* compile base|global rules */58#define OPT_believe ('B'|On) /* believe state from this level*/59#define OPT_byname ('o'|Oa|Os|Ox) /* command line option by name */60#define OPT_compile ('c'|Ob|Ox) /* force makefile compilation */61#define OPT_compatibility ('C'|Ob|Ox) /* disable compatibility msgs */62#define OPT_corrupt ('X'|Os|Ov) /* corrupt statefile action */63#define OPT_cross ('J'|Ob) /* don't run gen'd executables */64#define OPT_debug ('d'|Oi|On) /* debug trace level */65#define OPT_define ('D'|Op|Os|Ox) /* passed to preprocessor */66#define OPT_errorid ('E'|Os) /* append to error output id */67#define OPT_exec ('n'|Ob|Oo) /* execute shell actions */68#define OPT_expandview ('x'|Ob) /* expand paths if fsview!=0 */69#define OPT_explain ('e'|Ob) /* explain actions */70#define OPT_file ('f'|Oa|Os|Ox) /* next arg is makefile */71#define OPT_force ('F'|Ob) /* force targets to be updated */72#define OPT_global ('g'|Oa|Os|Ov) /* next arg is global makefile */73#define OPT_ignore ('i'|Ob) /* ignore shell action errors */74#define OPT_ignorelock ('K'|Ob) /* ignore state file locking */75#define OPT_include ('I'|Os|Ox) /* passed to preprocessor */76#define OPT_intermediate ('G'|Ob) /* force intermediate targets */77#define OPT_jobs ('j'|On) /* job concurrency level */78#define OPT_keepgoing ('k'|Ob) /* do sibling prereqs on error */79#define OPT_list ('l'|Ob|Ox) /* list info and don't make */80#define OPT_mam ('M'|Os) /* generate mam */81#define OPT_never ('N'|Ob) /* really - don't exec anything */82#define OPT_option (101|Oa|Of|Os|Ox)/* define new option by name */83#define OPT_override (102|Ob|Of|Ox) /* override selected algorithms */84#define OPT_preprocess ('P'|Ob) /* preprocess all makefiles */85#define OPT_questionable ('Q'|On) /* enable questionable code */86#define OPT_readonly ('R'|Ob) /* current vars|opts readonly */87#define OPT_readstate ('S'|On|Ov) /* read state file on startup */88#define OPT_regress ('q'|Os|Ov) /* output for regression test */89#define OPT_reread (103|Ob|Of|Ox) /* force re-read all makefiles */90#define OPT_ruledump ('r'|Ob|Ox) /* dump rule definitions */91#define OPT_scan (104|Ob|Of) /* scan|check implicit prereqs */92#define OPT_serialize ('O'|Ob) /* serialize concurrent output */93#define OPT_silent ('s'|Ob) /* run silently */94#define OPT_strictview ('V'|Ob) /* strict views */95#define OPT_targetcontext (105|Ob|Of) /* expand in target dir context */96#define OPT_targetprefix (106|Os|Of) /* source dir target prefix sep */97#define OPT_test ('T'|On) /* enable test code */98#define OPT_tolerance ('z'|On) /* time comparison tolerance */99#define OPT_touch ('t'|Ob) /* touch out of date targets */100#define OPT_undef ('U'|Op|Os|Ox) /* passed to preprocessor */101#define OPT_vardump ('v'|Ob|Ox) /* dump variable definitions */102#define OPT_warn ('w'|Ob) /* enable source file warnings */103#define OPT_writeobject (107|Of|Os|Ov|Ox)/* write recompiled object */104#define OPT_writestate (108|Of|Os|Ov|Ox)/* write state file on exit */105106struct Option_s; typedef struct Option_s Option_t;107108struct Option_s /* option table entry */109{110char* name; /* option name */111unsigned long flags; /* O[a-z] and OPT_[A-Z]+ flags */112char* value; /* overloaded value */113char* set; /* call this on set */114char* description; /* description */115char* arg; /* arg name */116Option_t* next; /* external option list link */117};118119extern Option_t* optflag(int);120extern void optcheck(int);121extern void optinit(void);122123124