=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/make/parse.c,v retrieving revision 1.105 retrieving revision 1.106 diff -u -r1.105 -r1.106 --- src/usr.bin/make/parse.c 2012/09/21 07:55:20 1.105 +++ src/usr.bin/make/parse.c 2012/10/02 10:29:31 1.106 @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.c,v 1.105 2012/09/21 07:55:20 espie Exp $ */ +/* $OpenBSD: parse.c,v 1.106 2012/10/02 10:29:31 espie Exp $ */ /* $NetBSD: parse.c,v 1.29 1997/03/10 21:20:04 christos Exp $ */ /* @@ -106,10 +106,6 @@ Lst systemIncludePath = &theSysIncPath; Lst userIncludePath = &theUserIncPath; -#ifdef CLEANUP -static LIST targCmds; /* command lines for targets */ -#endif - static GNode *mainNode; /* The main target to create. This is the * first target on the first dependency * line in the first makefile */ @@ -169,35 +165,7 @@ static unsigned int handle_special_targets(Lst); static void dump_targets(void); -#define SPECIAL_EXEC 4U -#define SPECIAL_IGNORE 5U -#define SPECIAL_INCLUDES 6U -#define SPECIAL_INVISIBLE 8U -#define SPECIAL_JOIN 9U -#define SPECIAL_LIBS 10U -#define SPECIAL_MADE 11U -#define SPECIAL_MAIN 12U -#define SPECIAL_MAKE 13U -#define SPECIAL_MFLAGS 14U -#define SPECIAL_NOTMAIN 15U -#define SPECIAL_NOTPARALLEL 16U -#define SPECIAL_NULL 17U -#define SPECIAL_OPTIONAL 18U -#define SPECIAL_ORDER 19U -#define SPECIAL_PARALLEL 20U -#define SPECIAL_PHONY 22U -#define SPECIAL_PRECIOUS 23U -#define SPECIAL_SILENT 25U -#define SPECIAL_SINGLESHELL 26U -#define SPECIAL_SUFFIXES 27U -#define SPECIAL_USE 28U -#define SPECIAL_WAIT 29U -#define SPECIAL_NOPATH 30U -#define SPECIAL_ERROR 31U -#define SPECIAL_CHEAP 32U -#define SPECIAL_EXPENSIVE 33U - #define P(k) k, sizeof(k), K_##k static struct { @@ -209,10 +177,10 @@ } specials[] = { { P(NODE_EXEC), SPECIAL_EXEC | SPECIAL_TARGETSOURCE, OP_EXEC, }, { P(NODE_IGNORE), SPECIAL_IGNORE | SPECIAL_TARGETSOURCE, OP_IGNORE, }, - { P(NODE_INCLUDES), SPECIAL_INCLUDES | SPECIAL_TARGET, 0, }, + { P(NODE_INCLUDES), SPECIAL_DEPRECATED | SPECIAL_TARGET, 0, }, { P(NODE_INVISIBLE),SPECIAL_INVISIBLE | SPECIAL_TARGETSOURCE,OP_INVISIBLE, }, { P(NODE_JOIN), SPECIAL_JOIN | SPECIAL_TARGETSOURCE, OP_JOIN, }, - { P(NODE_LIBS), SPECIAL_LIBS | SPECIAL_TARGET, 0, }, + { P(NODE_LIBS), SPECIAL_DEPRECATED | SPECIAL_TARGET, 0, }, { P(NODE_MADE), SPECIAL_MADE | SPECIAL_TARGETSOURCE, OP_MADE, }, { P(NODE_MAIN), SPECIAL_MAIN | SPECIAL_TARGET, 0, }, { P(NODE_MAKE), SPECIAL_MAKE | SPECIAL_TARGETSOURCE, OP_MAKE, }, @@ -221,7 +189,7 @@ { P(NODE_NOTMAIN), SPECIAL_NOTMAIN | SPECIAL_TARGETSOURCE, OP_NOTMAIN, }, { P(NODE_NOTPARALLEL),SPECIAL_NOTPARALLEL | SPECIAL_TARGET, 0, }, { P(NODE_NO_PARALLEL),SPECIAL_NOTPARALLEL | SPECIAL_TARGET, 0, }, - { P(NODE_NULL), SPECIAL_NULL | SPECIAL_TARGET, 0, }, + { P(NODE_NULL), SPECIAL_DEPRECATED | SPECIAL_TARGET, 0, }, { P(NODE_OPTIONAL), SPECIAL_OPTIONAL | SPECIAL_TARGETSOURCE,OP_OPTIONAL, }, { P(NODE_ORDER), SPECIAL_ORDER | SPECIAL_TARGET, 0, }, { P(NODE_PARALLEL), SPECIAL_PARALLEL | SPECIAL_TARGET, 0, }, @@ -547,13 +515,6 @@ gn->type &= ~OP_DUMMY; } - /* try to find a proper location for a target in a file, by - * filling it repeatedly until the target has commands.. - * This is not perfect for .USE targets... - */ - if ((gn->type & OP_HAS_COMMANDS) == 0) - Parse_FillLocation(&gn->origin); - Array_AtEnd(>argets, gn); } @@ -737,8 +698,7 @@ if (seen_normal != 0) { specType = SPECIAL_NONE; return 0; - } - else if (seen_path != 0) { + } else if (seen_path != 0) { specType = SPECIAL_PATH; return 0; } else if (seen_special == 0) { @@ -910,8 +870,7 @@ * NOW GO FOR THE SOURCES */ if (specType == SPECIAL_SUFFIXES || specType == SPECIAL_PATH || - specType == SPECIAL_INCLUDES || specType == SPECIAL_LIBS || - specType == SPECIAL_NULL) { + specType == SPECIAL_DEPRECATED) { while (*line) { /* * If the target was one that doesn't take files as its @@ -952,15 +911,6 @@ Dir_AddDiri((Lst)Lst_Datum(ln), line, cp); break; } - case SPECIAL_INCLUDES: - Suff_AddIncludei(line, cp); - break; - case SPECIAL_LIBS: - Suff_AddLibi(line, cp); - break; - case SPECIAL_NULL: - Suff_SetNulli(line, cp); - break; default: break; } @@ -1454,9 +1404,6 @@ Array_ForEach(targets, ParseAddCmd, cmd); -#ifdef CLEANUP - Lst_AtEnd(&targCmds, cmd); -#endif } static bool @@ -1595,24 +1542,7 @@ Array_Init(>argets, TARGETS_SIZE); Array_Init(&gsources, SOURCES_SIZE); create_special_nodes(); - - LowParse_Init(); -#ifdef CLEANUP - Static_Lst_Init(&targCmds); -#endif } - -#ifdef CLEANUP -void -Parse_End(void) -{ - Lst_Destroy(&targCmds, (SimpleProc)free); - Lst_Destroy(systemIncludePath, Dir_Destroy); - Lst_Destroy(userIncludePath, Dir_Destroy); - LowParse_End(); -} -#endif - void Parse_MainName(Lst listmain) /* result list */