Ignore:
Timestamp:
Nov 27, 2011, 4:36:15 PM (13 years ago)
Author:
rybkin
Message:

See C.L. 465

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CMT/HEAD/source/cmt_constituent.cxx

    r561 r588  
    4747      if (symbol.type != Symbol::SymbolAction) continue;
    4848
     49      /*
    4950      if (symbol.value_lists.size () < 1) continue;
    5051
     
    5556          add_for_action (symbol.name);
    5657        }
     58      */
     59      add_for_action (symbol);
    5760    }
    5861
     
    368371      //cerr << "Constituent " << name << " Analyzing module " << ew << endl;
    369372
    370       if (ew.substr (0, 13) == "action_value=")
    371         {
    372           it.set (ew);
    373         }
    374       else
    375         {
     373//       if (ew.substr (0, 13) == "action_value=")
     374//      {
     375//           it.set (ew);
     376//      }
     377//       else
     378//      {
    376379          CmtSystem::split (ew, " \t", ws);
    377380
     
    383386              it.set (w);
    384387            }
    385         }
     388//      }
    386389    }
    387390
     
    417420
    418421//----------------------------------------------------------
    419 Constituent* Constituent::add_for_action (const cmt_string& name)
    420 {
    421   Constituent* constituent;
    422 
    423   constituent = add (Document, name, "cmt_action_runner");
     422Constituent* Constituent::add_for_action (const Symbol& symbol)
     423//Constituent* Constituent::add_for_action (const cmt_string& name)
     424{
     425  Constituent* constituent (0);
     426  if (symbol.value_lists.size () < 1) return constituent;
     427
     428  const Tag* tag = Tag::find ("target_" + symbol.name);
     429  const bool target_tag_used
     430    (Tag::check_tag_used (tag) || Symbol::check_tag_used (tag));
     431
     432  cmt_string value = symbol.build_macro_value ();
     433  if ( "" == value && !target_tag_used) return constituent;
     434
     435  constituent = add (Document, symbol.name, "cmt_action_runner");
    424436
    425437  constituent->group = Group::add ("cmt_actions");
    426   constituent->has_target_tag = true;
     438
     439  // Do NOT assign target_<name> by default
     440  // but only if this tag is used somewhere
     441  if (target_tag_used)
     442    constituent->has_target_tag = true;
    427443
    428444  cmt_string& p1 = constituent->parameters.add ();
    429445  p1 = "action_value=";
    430   p1 += "$(";
    431   p1 += name;
    432   p1 += ")";
     446  Symbol::expand (value);
     447  // quote since split will later be applied
     448  // - in parse
     449  p1 += CmtSystem::quote (value, " \t");
     450//   p1 += "$(";
     451//   p1 += symbol.name;
     452//   p1 += ")";
    433453
    434454  return (constituent);
     
    549569  if (!simulation)
    550570    {
    551       Generator::build_constituent_makefile (*this);
     571      bool dependencies (false);
     572      Generator::build_constituent_makefile (*this, dependencies);
    552573    }
    553574}
Note: See TracChangeset for help on using the changeset viewer.