Exemplo n.º 1
0
struct macro_definition *
lookup_macro_definition(const char *name)
{
	ndptr p;

	p = ohash_find(&macros, ohash_qlookup(&macros, name));
	if (p)
		return p->d;
	else
		return NULL;
}
Exemplo n.º 2
0
Arquivo: make.c Projeto: aharri/base
/* Add stuff to the toBeMade queue. we try to sort things so that stuff 
 * that can be done directly is done right away.  This won't be perfect,
 * since some dependencies are only discovered later (e.g., SuffFindDeps).
 */
static void
add_targets_to_make(Lst todo)
{
	GNode *gn;

	unsigned int slot;

	AppendList2Array(todo, &examine);

	while ((gn = Array_Pop(&examine)) != NULL) {
		if (gn->must_make) 	/* already known */
			continue;
		gn->must_make = true;

		slot = ohash_qlookup(&targets, gn->name);
		if (!ohash_find(&targets, slot))
			ohash_insert(&targets, slot, gn);


		look_harder_for_target(gn);
		kludge_look_harder_for_target(gn);
		/*
		 * Apply any .USE rules before looking for implicit
		 * dependencies to make sure everything that should have
		 * commands has commands ...
		 */
		Lst_ForEach(&gn->children, MakeHandleUse, gn);
		expand_all_children(gn);

		if (gn->unmade != 0) {
			if (DEBUG(MAKE))
				printf("%s: not queuing (%d unmade children)\n",
				    gn->name, gn->unmade);
			Lst_ForEach(&gn->children, MakeAddChild,
			    &examine);
		} else {
			if (DEBUG(MAKE))
				printf("%s: queuing\n", gn->name);
			Array_Push(&toBeMade, gn);
		}
	}
	if (randomize_queue)
		randomize_garray(&toBeMade);
}
Exemplo n.º 3
0
/*
 * find name in the hash table
 */
ndptr
lookup(const char *name)
{
	return ohash_find(&macros, ohash_qlookup(&macros, name));
}