Changeset 428 for CMT/HEAD


Ignore:
Timestamp:
Oct 31, 2007, 4:48:32 PM (17 years ago)
Author:
rybkin
Message:

See C.L. 334

Location:
CMT/HEAD
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • CMT/HEAD/ChangeLog

    r427 r428  
     12007-10-31    <rybkin@lal.in2p3.fr> 334
     2
     3        * source/cmt_parser.cxx: idem
     4        * source/cmt_commands.cxx: idem
     5        * source/cmt_generator.h: idem
     6        * source/cmt_generator.cxx: idem
     7        * source/cmt_generators.h: idem
     8        * source/cmt_generators.cxx: Implement the new -out=file option of the
     9        cmt build constituent_makefile command
     10        * mgr/fragments/constituent: Make use of the new -out=file option of the
     11        cmt build constituent_makefile command to allow simultaneous builds for multiple
     12        binary tags
     13
    1142007-09-01    <rybkin@lal.in2p3.fr> 333
    215
  • CMT/HEAD/mgr/fragments/constituent

    r198 r428  
    4343$(cmt_local_${CONSTITUENT}_makefile) :: $(${CONSTITUENT}_dependencies) $(cmt_local_tagfile_${CONSTITUENT}) build_library_links dirs
    4444        @echo "------> (constituents.make) Building ${CONSTITUENT}.make"; \
    45           $(cmtexe) -quiet -tag=$(tags) $(${CONSTITUENT}_extratags) build constituent_makefile ${CONSTITUENT} ; \
    46           if test ! "$(bin)" = "./"; then /bin/mv -f ${CONSTITUENT}.make $(cmt_local_${CONSTITUENT}_makefile); fi
     45          $(cmtexe) -quiet -tag=$(tags) $(${CONSTITUENT}_extratags) build constituent_makefile -out=$(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}
    4746
    4847${CONSTITUENT} :: $(${CONSTITUENT}_dependencies) $(cmt_local_${CONSTITUENT}_makefile)
  • CMT/HEAD/source/cmt_commands.cxx

    r388 r428  
    559559      if (arg == "constituent_makefile")
    560560        {
    561           if (argc > 0)
    562             {
    563               fill_one_argument ();
     561          //      if (argc > 0)
     562          if (argc == 1 || (argc == 2 && cmt_string (argv[0]).substr (0, 5) == "-out="))
     563            {
     564              //fill_one_argument ();
     565              fill_arguments ();
    564566              cmt.m_action = action_build_constituent_makefile;
     567            }
     568          else if (argc > 0)
     569            {
     570              if (!cmt.m_quiet) cerr << "#CMT> syntax error : wrong arguments" << endl;
     571              cmt.m_action = action_build_constituent_makefile;
     572              help_action = action_help;
    565573            }
    566574          else
  • CMT/HEAD/source/cmt_generator.cxx

    r400 r428  
    219219//--------------------------------------------------
    220220bool CmtGenerator::prepare_output (const cmt_string& package,
    221                                    const Constituent& constituent)
     221                                   const Constituent& constituent,
     222                                   const cmt_string& file)
    222223{
    223224  m_PACKAGE = package;
     
    238239    }
    239240 
     241  if (file != "") m_output_file_name = file;
     242
    240243  m_output_file_name += "new";
    241244
     
    692695
    693696//--------------------------------------------------
    694 int Generator::build_constituent_makefile (const Constituent& constituent)
     697int Generator::build_constituent_makefile (const Constituent& constituent,
     698                                           const cmt_string& file)
    695699{
    696700  const cmt_string& package = Cmt::get_current_package ();
     
    699703    {
    700704    case Application:
    701       ApplicationContext.build (package, constituent);
     705      ApplicationContext.build (package, constituent, file);
    702706      break;
    703707    case Library:
    704       LibraryContext.build (package, constituent);
     708      LibraryContext.build (package, constituent, file);
    705709      break;
    706710    case Document:
    707       DocumentContext.build (package, constituent);
     711      DocumentContext.build (package, constituent, file);
    708712      break;
    709713    }
     
    713717
    714718//--------------------------------------------------
    715 void Generator::build_constituent_makefile (const cmt_string& name)
    716 {
     719void Generator::build_constituent_makefile (const CmtSystem::cmt_string_vector& arguments)
     720{
     721  cmt_string name;
     722  cmt_string file;
     723
     724  if (arguments.size () == 1)
     725    {
     726      file = "";
     727      name = arguments[0];
     728    }
     729  else if (arguments.size () == 2) // arguments[0].substr (0, 5) == "-out="
     730    {
     731      cmt_string arg = arguments[0];
     732      arg.erase (0, 5);
     733      file = arg;
     734      name = arguments[1];
     735    }
     736  else
     737    {
     738      cerr << "#CMT> build constituent_makefile : wrong arguments" << endl;
     739      return;
     740    }
     741
    717742  const Constituent* constituent = Constituent::find (name);
    718   if (constituent != 0) build_constituent_makefile (*constituent);
     743  if (constituent != 0) build_constituent_makefile (*constituent, file);
    719744}
    720745
  • CMT/HEAD/source/cmt_generator.h

    r11 r428  
    5050  void reset ();
    5151  bool prepare_output (const cmt_string& package,
    52                        const Constituent& constituent);
     52                       const Constituent& constituent,
     53                       const cmt_string& file = "");
    5354  void commit (const cmt_string& name);
    5455  static void check (const cmt_string& name);
     
    160161
    161162    // Build the makefile fragment for one constituent
    162   static int build_constituent_makefile (const Constituent& constituent);
    163   static void build_constituent_makefile (const cmt_string& name);
     163  static int build_constituent_makefile (const Constituent& constituent,
     164                                         const cmt_string& file = "");
     165  static void build_constituent_makefile (const CmtSystem::cmt_string_vector& arguments);
    164166
    165167  static void build_default_makefile ();
  • CMT/HEAD/source/cmt_generators.cxx

    r427 r428  
    1010#include "cmt_symbol.h"
    1111#include "cmt_log.h"
     12#include <assert.h>
    1213
    1314//--------------------------------------------------
     
    395396//--------------------------------------------------
    396397void LibraryGenerator::build (const cmt_string& package,
    397                               const Constituent& constituent)
     398                              const Constituent& constituent,
     399                              const cmt_string& file_name)
    398400{
    399401  static cmt_string lib;
     
    408410  reset ();
    409411
    410   if (!prepare_output (package, constituent)) return;
     412  if (!prepare_output (package, constituent, file_name)) return;
    411413
    412414  switch (constituent.type)
     
    856858//--------------------------------------------------
    857859void DocumentGenerator::build (const cmt_string& package,
    858                                const Constituent& constituent)
     860                               const Constituent& constituent,
     861                               const cmt_string& file_name)
    859862{
    860863  static cmt_string names;
     
    869872  reset ();
    870873
    871   if (!prepare_output (package, constituent)) return;
     874  if (!prepare_output (package, constituent, file_name)) return;
    872875
    873876  is_library = false;
  • CMT/HEAD/source/cmt_generators.h

    r427 r428  
    3535  DocumentGenerator ();
    3636  void build (const cmt_string& package,
    37               const Constituent& constituent);
     37              const Constituent& constituent,
     38              const cmt_string& file = "");
    3839
    3940private:
     
    5152  LibraryGenerator ();
    5253  void build (const cmt_string& package,
    53               const Constituent& constituent);
     54              const Constituent& constituent,
     55              const cmt_string& file = "");
    5456
    5557protected:
  • CMT/HEAD/source/cmt_parser.cxx

    r411 r428  
    16411641    {
    16421642      set_standard_macros ();
    1643       Generator::build_constituent_makefile (ap.arguments[0]);
     1643      Generator::build_constituent_makefile (ap.arguments);
    16441644    }
    16451645}
Note: See TracChangeset for help on using the changeset viewer.