Changeset 547 for CMT


Ignore:
Timestamp:
Aug 3, 2010, 5:11:00 PM (14 years ago)
Author:
rybkin
Message:

See C.L. 432

Location:
CMT/HEAD
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • CMT/HEAD/ChangeLog

    r546 r547  
     12010-08-03    <rybkin@lal.in2p3.fr> 432
     2
     3        * source/cmt_parser.h: Add to ActionType action_build_constituents_config,
     4        action_build_constituent_config
     5        * source/cmt_commands.cxx: Introduce commands "cmt build
     6        constituents_config", and "cmt build constituent_config" and their help
     7        messages
     8        * source/cmt_tag.h: In class Tag functions show_definition, show, add
     9        optional argument of type ostream
     10        * source/cmt_tag.cxx: Implement optional argument
     11        * source/cmt_std.h: Add header and shortcut for ostringstream
     12        * source/cmt_symbol.h: In class Symbol function show_macro, add optional
     13        argument of type ostream
     14        * source/cmt_symbol.cxx: Implement optional argument, add actions
     15        action_build_constituents_config, action_build_constituent_config in same
     16        context as action_build_tag_makefile
     17        * source/cmt.h: In class Cmt, introduce functions
     18        do_build_constituents_config, do_build_constituent_config, for functions
     19        do_show_setup, do_show_path, do_show_tags, do_show_uses, print_macros add
     20        optional argument of type ostream
     21        * source/cmt_parser.cxx: Implement Cmt class functions and optional
     22        argument, add actions
     23        action_build_constituents_config, action_build_constituent_config in same
     24        context as action_build_constituents_makefile and
     25        action_build_constituent_makefile, make use of functions
     26        do_build_constituents_config and do_build_constituent_config, and in same
     27        context as action_build_tag_makefile
     28        * source/cmt_project.h: In class Project function show_paths, add optional
     29        argument of type ostream
     30        * source/cmt_project.cxx: Implement optional argument
     31        * source/cmt_use.h: In class Use functions show_all, show_sub_uses, add
     32        optional argument of type ostream
     33        * source/cmt_use.cxx: Implement optional argument
     34        * source/cmt_generators.cxx: In class ConstituentsMakefileGenerator
     35        function build, parse option -outdir=
     36        * src/Makefile.header: Make use of "cmt build constituents_config" command,
     37        use .DEFAULT for (almost) all possible targets (rather than common_target)
     38        * src/NMakefile.header: Make use of "cmt build constituents_config" command
     39        * mgr/fragments/nmake/constituents_header: No longer use commands
     40        "cmt build tag_makefile" or "cmt show setup"
     41        * mgr/fragments/constituent: Make use of "cmt build constituent_config"
     42        command, ensure QUICK mode can be used for from scratch build
     43        * mgr/fragments/constituent_lock: idem
     44        * mgr/fragments/nmake/constituent: idem
     45        * mgr/fragments/nmake/constituent_lock: idem
     46        * mgr/fragments/dependencies: Do not use QUICK switch (dependencies should
     47        be rebuilt as needed by Make)
     48        * mgr/fragments/nmake/dependencies: idem
     49       
    1502010-07-02    <rybkin@lal.in2p3.fr> 431
    251
  • CMT/HEAD/mgr/fragments/constituent

    r492 r547  
    6969
    7070ifndef QUICK
    71 $(cmt_local_${CONSTITUENT}_makefile) : $(${CONSTITUENT}_dependencies) $(cmt_local_tagfile_${CONSTITUENT}) build_library_links
     71$(cmt_local_${CONSTITUENT}_makefile) : $(${CONSTITUENT}_dependencies) build_library_links
     72#$(cmt_local_${CONSTITUENT}_makefile) : $(${CONSTITUENT}_dependencies) $(cmt_local_tagfile_${CONSTITUENT}) build_library_links
     73        $(echo) "(constituents.make) Building ${CONSTITUENT}.make"; \
     74          $(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) build constituent_config -out=$(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}
    7275else
    73 $(cmt_local_${CONSTITUENT}_makefile) : $(cmt_local_tagfile_${CONSTITUENT})
     76$(cmt_local_${CONSTITUENT}_makefile) : $(${CONSTITUENT}_dependencies)
     77#$(cmt_local_${CONSTITUENT}_makefile) : $(cmt_local_tagfile_${CONSTITUENT})
     78        if [ ! -f $@ ]; then \
     79          test -z "$(cmtmsg)" || \
     80          echo "$(CMTMSGPREFIX)" "(constituents.make) Building ${CONSTITUENT}.make"; \
     81          $(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) build constituent_config -out=$(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}; \
     82          fi
    7483endif
    75         $(echo) "(constituents.make) Building ${CONSTITUENT}.make"; \
    76           $(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) build constituent_makefile -out=$(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}
     84
     85#         $(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) build constituent_makefile -out=$(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}
    7786
    7887${CONSTITUENT} :: $(${CONSTITUENT}_dependencies) $(cmt_local_${CONSTITUENT}_makefile) dirs ${CONSTITUENT}dirs
  • CMT/HEAD/mgr/fragments/constituent_lock

    r492 r547  
    6969
    7070ifndef QUICK
    71 $(cmt_local_${CONSTITUENT}_makefile) : $(${CONSTITUENT}_dependencies) $(cmt_local_tagfile_${CONSTITUENT}) build_library_links
     71$(cmt_local_${CONSTITUENT}_makefile) : $(${CONSTITUENT}_dependencies) build_library_links
     72#$(cmt_local_${CONSTITUENT}_makefile) : $(${CONSTITUENT}_dependencies) $(cmt_local_tagfile_${CONSTITUENT}) build_library_links
     73        $(echo) "(constituents.make) Building ${CONSTITUENT}.make"; \
     74          $(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) build constituent_config -out=$(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}
    7275else
    73 $(cmt_local_${CONSTITUENT}_makefile) : $(cmt_local_tagfile_${CONSTITUENT})
     76$(cmt_local_${CONSTITUENT}_makefile) : $(${CONSTITUENT}_dependencies)
     77#$(cmt_local_${CONSTITUENT}_makefile) : $(cmt_local_tagfile_${CONSTITUENT})
     78        if [ ! -f $@ ]; then \
     79          test -z "$(cmtmsg)" || \
     80          echo "$(CMTMSGPREFIX)" "(constituents.make) Building ${CONSTITUENT}.make"; \
     81          $(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) build constituent_config -out=$(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}; \
     82          fi
    7483endif
    75         $(echo) "(constituents.make) Building ${CONSTITUENT}.make"; \
    76           $(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) build constituent_makefile -out=$(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}
     84
     85#         $(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) build constituent_makefile -out=$(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}
    7786
    7887${CONSTITUENT} :: $(${CONSTITUENT}_dependencies) $(cmt_local_${CONSTITUENT}_makefile) dirs ${CONSTITUENT}dirs
  • CMT/HEAD/mgr/fragments/dependencies

    r487 r547  
    55#$(bin)${CONSTITUENT}_dependencies.make :: dirs
    66
    7 ifndef QUICK
     7#ifndef QUICK
    88$(bin)${CONSTITUENT}_dependencies.make : ${LINE} $(use_requirements) $(cmt_final_setup_${CONSTITUENT})
    99        $(echo) "(${CONSTITUENT}.make) Rebuilding $@"; \
    1010          $(build_dependencies) ${CONSTITUENT} -all_sources -out=$@ ${LINE}
    11 endif
     11#endif
    1212
    1313#$(${CONSTITUENT}_dependencies)
  • CMT/HEAD/mgr/fragments/nmake/constituent

    r492 r547  
    1919!endif
    2020
    21 !if "$(QUICK)" == "" || !exist ($(cmt_local_tagfile_${CONSTITUENT}))
     21#!if "$(QUICK)" == "" || !exist ($(cmt_local_tagfile_${CONSTITUENT}))
    2222
    23 !if [$(echo) (constituents.nmake) Rebuilding $(cmt_local_tagfile_${CONSTITUENT})] == 0
    24 !endif
    25 !if [cmt -tag=$(tags) $(${CONSTITUENT}_extratags) build tag_makefile >$(cmt_local_tagfile_${CONSTITUENT})] == 0
    26 !endif
     23#!if [$(echo) (constituents.nmake) Rebuilding $(cmt_local_tagfile_${CONSTITUENT})] == 0
     24#!endif
     25#!if [cmt -tag=$(tags) $(${CONSTITUENT}_extratags) build tag_makefile >$(cmt_local_tagfile_${CONSTITUENT})] == 0
     26#!endif
    2727
    28 !if [$(echo) (constituents.nmake) Rebuilding $(cmt_final_setup_${CONSTITUENT})] == 0
    29 !endif
    30 !if [$(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) show setup >$(cmt_local_setup_${CONSTITUENT})] == 0
    31 !endif
     28#!if [$(echo) (constituents.nmake) Rebuilding $(cmt_final_setup_${CONSTITUENT})] == 0
     29#!endif
     30#!if [$(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) show setup >$(cmt_local_setup_${CONSTITUENT})] == 0
     31#!endif
    3232
    33 !if exist ($(cmt_final_setup_${CONSTITUENT})) && [ echo n|comp $(cmt_final_setup_${CONSTITUENT}) $(cmt_local_setup_${CONSTITUENT}) >nul 2>&1 ] == 0
    34 !if [ del $(cmt_local_setup_${CONSTITUENT}) ] == 0
    35 !endif
    36 !else
    37 !if [ move /y $(cmt_local_setup_${CONSTITUENT}) $(cmt_final_setup_${CONSTITUENT}) >nul ] == 0
    38 !endif
    39 !endif
     33#!if exist ($(cmt_final_setup_${CONSTITUENT})) && [ echo n|comp $(cmt_final_setup_${CONSTITUENT}) $(cmt_local_setup_${CONSTITUENT}) >nul 2>&1 ] == 0
     34#!if [ del $(cmt_local_setup_${CONSTITUENT}) ] == 0
     35#!endif
     36#!else
     37#!if [ move /y $(cmt_local_setup_${CONSTITUENT}) $(cmt_final_setup_${CONSTITUENT}) >nul ] == 0
     38#!endif
     39#!endif
    4040
    41 !endif
     41#!endif
    4242
    4343!else
     
    5252!endif
    5353
    54 !if "$(QUICK)" == ""
    55 $(cmt_local_${CONSTITUENT}_makefile) : $(${CONSTITUENT}_dependencies) $(cmt_local_tagfile_${CONSTITUENT})
    56 !else
    57 $(cmt_local_${CONSTITUENT}_makefile) : $(cmt_local_tagfile_${CONSTITUENT})
    58 !endif
     54#!if "$(QUICK)" == ""
     55#$(cmt_local_${CONSTITUENT}_makefile) : $(${CONSTITUENT}_dependencies) $(cmt_local_tagfile_${CONSTITUENT})
     56#!else
     57#$(cmt_local_${CONSTITUENT}_makefile) : $(cmt_local_tagfile_${CONSTITUENT})
     58#!endif
     59
     60!if "$(QUICK)" == "" || !exist ($(cmt_local_${CONSTITUENT}_makefile)) || !exist ($(cmt_local_tagfile_${CONSTITUENT})) || !exist ($(cmt_final_setup_${CONSTITUENT}))
     61$(cmt_local_${CONSTITUENT}_makefile) : $(${CONSTITUENT}_dependencies)
    5962        $(echo) (constituents.nmake) Building ${CONSTITUENT}.nmake
    6063        @set include=$(include)
    6164        @set lib=$(lib)
    62         @$(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) build -nmake constituent_makefile -out=$@ ${CONSTITUENT}
     65        @$(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) build -nmake constituent_config -out=$@ ${CONSTITUENT}
     66#       @$(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) build -nmake constituent_makefile -out=$@ ${CONSTITUENT}
    6367#       $(echo) (constituents.nmake) ${CONSTITUENT}.nmake done
     68!else
     69$(cmt_local_${CONSTITUENT}_makefile) : $(${CONSTITUENT}_dependencies) ;
     70!endif
    6471
    6572cmt_${CONSTITUENT}_${HASDEPENDENCIES} = 1
     
    104111
    105112#${CONSTITUENT}uninstall :: $(cmt_local_${CONSTITUENT}_makefile)
    106 ${CONSTITUENT}uninstall :: $(cmt_local_tagfile_${CONSTITUENT})
     113#${CONSTITUENT}uninstall :: $(cmt_local_tagfile_${CONSTITUENT})
     114${CONSTITUENT}uninstall ::
    107115        $(echo) (constituents.nmake) Starting uninstall ${CONSTITUENT}
    108116        @set include=$(include)
    109117        @set lib=$(lib)
    110         @if not exist $(cmt_local_${CONSTITUENT}_makefile) $(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) build -nmake constituent_makefile -out=$(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}
     118        @if not exist $(cmt_local_${CONSTITUENT}_makefile) $(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) build -nmake constituent_config -out=$(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}
     119#       @if not exist $(cmt_local_${CONSTITUENT}_makefile) $(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) build -nmake constituent_makefile -out=$(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}
    111120        @-$(MAKE) /nologo /f $(cmt_local_${CONSTITUENT}_makefile) /$(MAKEFLAGS) bin=$(bin) build_strategy=keep_makefiles uninstall tag=$(tag)
    112121        $(echo) (constituents.nmake) uninstall ${CONSTITUENT} done
  • CMT/HEAD/mgr/fragments/nmake/constituent_lock

    r492 r547  
    1919!endif
    2020
    21 !if "$(QUICK)" == "" || !exist ($(cmt_local_tagfile_${CONSTITUENT}))
     21#!if "$(QUICK)" == "" || !exist ($(cmt_local_tagfile_${CONSTITUENT}))
    2222
    23 !if [$(echo) (constituents.nmake) Rebuilding $(cmt_local_tagfile_${CONSTITUENT})] == 0
    24 !endif
    25 !if [cmt -tag=$(tags) $(${CONSTITUENT}_extratags) build tag_makefile >$(cmt_local_tagfile_${CONSTITUENT})] == 0
    26 !endif
     23#!if [$(echo) (constituents.nmake) Rebuilding $(cmt_local_tagfile_${CONSTITUENT})] == 0
     24#!endif
     25#!if [cmt -tag=$(tags) $(${CONSTITUENT}_extratags) build tag_makefile >$(cmt_local_tagfile_${CONSTITUENT})] == 0
     26#!endif
    2727
    28 !if [$(echo) (constituents.nmake) Rebuilding $(cmt_final_setup_${CONSTITUENT})] == 0
    29 !endif
    30 !if [$(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) show setup >$(cmt_local_setup_${CONSTITUENT})] == 0
    31 !endif
     28#!if [$(echo) (constituents.nmake) Rebuilding $(cmt_final_setup_${CONSTITUENT})] == 0
     29#!endif
     30#!if [$(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) show setup >$(cmt_local_setup_${CONSTITUENT})] == 0
     31#!endif
    3232
    33 !if exist ($(cmt_final_setup_${CONSTITUENT})) && [ echo n|comp $(cmt_final_setup_${CONSTITUENT}) $(cmt_local_setup_${CONSTITUENT}) >nul 2>&1 ] == 0
    34 !if [ del $(cmt_local_setup_${CONSTITUENT}) ] == 0
    35 !endif
    36 !else
    37 !if [ move /y $(cmt_local_setup_${CONSTITUENT}) $(cmt_final_setup_${CONSTITUENT}) >nul ] == 0
    38 !endif
    39 !endif
     33#!if exist ($(cmt_final_setup_${CONSTITUENT})) && [ echo n|comp $(cmt_final_setup_${CONSTITUENT}) $(cmt_local_setup_${CONSTITUENT}) >nul 2>&1 ] == 0
     34#!if [ del $(cmt_local_setup_${CONSTITUENT}) ] == 0
     35#!endif
     36#!else
     37#!if [ move /y $(cmt_local_setup_${CONSTITUENT}) $(cmt_final_setup_${CONSTITUENT}) >nul ] == 0
     38#!endif
     39#!endif
    4040
    41 !endif
     41#!endif
    4242
    4343!else
     
    5252!endif
    5353
    54 !if "$(QUICK)" == ""
    55 $(cmt_local_${CONSTITUENT}_makefile) : $(${CONSTITUENT}_dependencies) $(cmt_local_tagfile_${CONSTITUENT})
    56 !else
    57 $(cmt_local_${CONSTITUENT}_makefile) : $(cmt_local_tagfile_${CONSTITUENT})
    58 !endif
     54#!if "$(QUICK)" == ""
     55#$(cmt_local_${CONSTITUENT}_makefile) : $(${CONSTITUENT}_dependencies) $(cmt_local_tagfile_${CONSTITUENT})
     56#!else
     57#$(cmt_local_${CONSTITUENT}_makefile) : $(cmt_local_tagfile_${CONSTITUENT})
     58#!endif
     59
     60!if "$(QUICK)" == "" || !exist ($(cmt_local_${CONSTITUENT}_makefile)) || !exist ($(cmt_local_tagfile_${CONSTITUENT})) || !exist ($(cmt_final_setup_${CONSTITUENT}))
     61$(cmt_local_${CONSTITUENT}_makefile) : $(${CONSTITUENT}_dependencies)
    5962        $(echo) (constituents.nmake) Building ${CONSTITUENT}.nmake
    6063        @set include=$(include)
    6164        @set lib=$(lib)
    62         @$(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) build -nmake constituent_makefile -out=$@ ${CONSTITUENT}
     65        @$(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) build -nmake constituent_config -out=$@ ${CONSTITUENT}
     66#       @$(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) build -nmake constituent_makefile -out=$@ ${CONSTITUENT}
    6367#       $(echo) (constituents.nmake) ${CONSTITUENT}.nmake done
     68!else
     69$(cmt_local_${CONSTITUENT}_makefile) : $(${CONSTITUENT}_dependencies) ;
     70!endif
    6471
    6572cmt_${CONSTITUENT}_${HASDEPENDENCIES} = 1
     
    108115
    109116#${CONSTITUENT}uninstall :: $(cmt_local_${CONSTITUENT}_makefile)
    110 ${CONSTITUENT}uninstall :: $(cmt_local_tagfile_${CONSTITUENT})
     117#${CONSTITUENT}uninstall :: $(cmt_local_tagfile_${CONSTITUENT})
     118${CONSTITUENT}uninstall ::
    111119        $(echo) (constituents.nmake) Starting uninstall ${CONSTITUENT}
    112120        @set include=$(include)
    113121        @set lib=$(lib)
    114         @if not exist $(cmt_local_${CONSTITUENT}_makefile) $(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) build -nmake constituent_makefile -out=$(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}
     122        @if not exist $(cmt_local_${CONSTITUENT}_makefile) $(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) build -nmake constituent_config -out=$(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}
     123#       @if not exist $(cmt_local_${CONSTITUENT}_makefile) $(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) build -nmake constituent_makefile -out=$(cmt_local_${CONSTITUENT}_makefile) ${CONSTITUENT}
    115124        @-$(MAKE) /nologo /f $(cmt_local_${CONSTITUENT}_makefile) /$(MAKEFLAGS) bin=$(bin) build_strategy=keep_makefiles uninstall tag=$(tag)
    116125        $(echo) (constituents.nmake) uninstall ${CONSTITUENT} done
  • CMT/HEAD/mgr/fragments/nmake/constituents_header

    r487 r547  
    1818cmt_final_setup = $(bin)setup.nmake
    1919
    20 !if "$(QUICK)" == "" || !exist ($(cmt_local_tagfile))
     20#!if "$(QUICK)" == "" || !exist ($(cmt_local_tagfile))
    2121
    22 #!if [$(echo) (constituents.nmake) Rebuilding $(${PACKAGE}_tag).nmake] == 0
    23 !if [$(echo) (constituents.nmake) Rebuilding $(cmt_local_tagfile)] == 0
    24 !endif
    25 #!if [cmt build tag_makefile -tag_add=$(tags) >$(${PACKAGE}_tag).nmake] == 0
    26 !if [cmt build tag_makefile -tag_add=$(tags) >$(cmt_local_tagfile)] == 0
    27 !endif
     22#!if [$(echo) (constituents.nmake) Rebuilding $(cmt_local_tagfile)] == 0
     23#!endif
     24#!if [cmt build tag_makefile -tag_add=$(tags) >$(cmt_local_tagfile)] == 0
     25#!endif
    2826
    29 !if [$(echo) (constituents.nmake) Rebuilding $(cmt_final_setup)] == 0
    30 !endif
    31 !if [cmt -tag=$(tags) show setup >$(cmt_local_setup)] == 0
    32 !endif
     27#!if [$(echo) (constituents.nmake) Rebuilding $(cmt_final_setup)] == 0
     28#!endif
     29#!if [cmt -tag=$(tags) show setup >$(cmt_local_setup)] == 0
     30#!endif
    3331
    34 !if exist ($(cmt_final_setup)) && [ echo n|comp $(cmt_final_setup) $(cmt_local_setup) >nul 2>&1 ] == 0
    35 !if [ del $(cmt_local_setup) ] == 0
    36 !endif
    37 !else
    38 !if [ move /y $(cmt_local_setup) $(cmt_final_setup) >nul ] == 0
    39 !endif
    40 !endif
     32#!if exist ($(cmt_final_setup)) && [ echo n|comp $(cmt_final_setup) $(cmt_local_setup) >nul 2>&1 ] == 0
     33#!if [ del $(cmt_local_setup) ] == 0
     34#!endif
     35#!else
     36#!if [ move /y $(cmt_local_setup) $(cmt_final_setup) >nul ] == 0
     37#!endif
     38#!endif
    4139
    42 !endif
     40#!endif
    4341
    4442#!include $(${PACKAGE}_tag).nmake
  • CMT/HEAD/mgr/fragments/nmake/dependencies

    r488 r547  
    11#-- start of dependency ------------------
    22
    3 !if "$(QUICK)" == ""
     3#!if "$(QUICK)" == ""
    44
    55#!if exist ("$(CMTROOT)/$(CMTBIN)/cmt.exe")
     
    1717        $(build_dependencies) ${CONSTITUENT} -all_sources -out:$@ ${LINE}
    1818
    19 !endif
     19#!endif
    2020
    2121!if exist ($(bin)${CONSTITUENT}_dependencies.nmake)
  • CMT/HEAD/source/cmt.h

    r535 r547  
    107107  static void do_broadcast (const ArgParser& ap);
    108108  static void do_build_constituent_makefile (const ArgParser& ap);
     109  static void do_build_constituent_config (const ArgParser& ap);
    109110  static void do_build_constituents_makefile (const ArgParser& ap);
     111  static void do_build_constituents_config (const ArgParser& ap);
    110112  static void do_build_dependencies (const ArgParser& ap,
    111113                                     int argc,
     
    179181  static void do_show_manager (const ArgParser& ap);
    180182  static void do_show_packages (const ArgParser& ap);
    181   static void do_show_path (const ArgParser& ap);
     183  static void do_show_path (const ArgParser& ap, ostream& out = cout);
    182184  static void do_show_pattern (const ArgParser& ap);
    183185  static void do_show_pattern_names (const ArgParser& ap);
     
    186188  static void do_show_project_author (const ArgParser& ap); 
    187189  static void do_show_pwd (const ArgParser& ap);
    188   static void do_show_setup (const ArgParser& ap);
     190  static void do_show_setup (const ArgParser& ap, ostream& out = cout);
    189191  static void do_show_set (const ArgParser& ap);
    190192  static void do_show_set_names (const ArgParser& ap);
     
    192194  static void do_show_sets (const ArgParser& ap);
    193195  static void do_show_strategies (const ArgParser& ap);
    194   static void do_show_tags (const ArgParser& ap);
     196  static void do_show_tags (const ArgParser& ap, ostream& out = cout);
    195197  static void do_show_use_paths (const ArgParser& ap);
    196   static void do_show_uses (const ArgParser& ap);
     198  static void do_show_uses (const ArgParser& ap, ostream& out = cout);
    197199  static void do_show_version (const ArgParser& ap);
    198200  static void do_show_versions (const ArgParser& ap);
     
    254256  static void print_clean (PrintMode mode);
    255257  static void print_context (Use& use, PrintMode mode, const cmt_string& tag);
    256   static void print_macros (PrintMode mode, const cmt_string& pattern = "");
     258  static void print_macros (PrintMode mode, const cmt_string& pattern = "",
     259                            ostream& out = cout);
     260  //  static void print_macros (PrintMode mode, const cmt_string& pattern = "");
    257261  static void print_symbol_names (PrintMode mode, const cmt_string& pattern = "");
    258262  static void print_tabs (int tabs);
  • CMT/HEAD/source/cmt_commands.cxx

    r541 r547  
    584584            }
    585585        }
     586      else if (arg == "constituent_config")
     587        {
     588          //      if (argc > 0)
     589          if (argc == 1 ||
     590              argc == 2 &&
     591              (cmt_string (argv[0]).substr (0, 5) == "-out=" ||
     592               cmt_string (argv[1]).substr (0, 5) == "-out=")
     593              )
     594            {
     595              //fill_one_argument ();
     596              fill_arguments ();
     597              cmt.m_action = action_build_constituent_config;
     598            }
     599          else if (argc > 0)
     600            {
     601              CmtMessage::error ("syntax: wrong arguments");
     602//            if (!cmt.m_quiet) cerr << "#CMT> syntax error : wrong arguments" << endl;
     603              cmt.m_action = action_build_constituent_config;
     604              help_action = action_help;
     605            }
     606          else
     607            {
     608              CmtMessage::error ("syntax: constituent name missing");
     609              //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : constituent name missing" << endl;
     610              cmt.m_action = action_build_constituent_config;
     611              help_action = action_help;
     612            }
     613        }
    586614      else if (arg == "constituents_makefile")
    587615        {
    588616          fill_arguments ();
    589617          cmt.m_action = action_build_constituents_makefile;
     618        }
     619      else if (arg == "constituents_config")
     620        {
     621          fill_arguments ();
     622          cmt.m_action = action_build_constituents_config;
    590623        }
    591624      else if (arg == "dependencies")
     
    22352268  help_texts.add () =  "build <option>          : build actions. (Try cmt help build)";
    22362269  help_texts.add () =  "build constituent_makefile <constituent>  : generate constituent Makefile fragment";
     2270  help_texts.add () =  "build constituent_config <constituent>  : generate constituent Makefile fragment, also tag specific Makefile, and setup definitions file, if constituent has associated tag (via -target_tag option, or is action)";
    22372271  help_texts.add () =  "build constituents_makefile : generate constituents.make";
     2272  help_texts.add () =  "build constituents_config : generate constituents.make, tag specific Makefile, and setup definitions file";
    22382273  help_texts.add () =  "build dependencies      : generate dependencies";
    22392274  help_texts.add () =  "build library_links     : build symbolic links towards all imported libraries";
     
    23352370  help.add (action_build, help_texts[action_build]);
    23362371  help.add (action_build_constituent_makefile, help_texts[action_build_constituent_makefile]);
     2372  help.add (action_build_constituent_config, help_texts[action_build_constituent_config]);
    23372373  help.add (action_build_constituents_makefile, help_texts[action_build_constituents_makefile]);
     2374  help.add (action_build_constituents_config, help_texts[action_build_constituents_config]);
    23382375  help.add (action_build_dependencies, help_texts[action_build_dependencies]);
    23392376  help.add (action_build_library_links, help_texts[action_build_library_links]);
  • CMT/HEAD/source/cmt_generators.cxx

    r527 r547  
    25242524  reset ();
    25252525
    2526   cmt_string file_name;
     2526  cmt_string file_name, dir_name;
    25272527
    25282528  if (arguments.size () > 0)
     
    25332533          arg.erase (0, 5);
    25342534          file_name = arg;
     2535        }
     2536      else if (arg.substr (0, 8) == "-outdir=")
     2537        {
     2538          arg.erase (0, 8);
     2539          dir_name = arg;
    25352540        }
    25362541    }
     
    25502555          file_name += "make";
    25512556        }
     2557    }
     2558
     2559  if (dir_name != "")
     2560    {
     2561      if (dir_name [dir_name.size () - 1] != CmtSystem::file_separator ())
     2562        dir_name += CmtSystem::file_separator ();
     2563      file_name = dir_name + file_name;
    25522564    }
    25532565
  • CMT/HEAD/source/cmt_parser.cxx

    r541 r547  
    21062106
    21072107//----------------------------------------------------------
     2108void Cmt::do_build_constituent_config (const ArgParser& ap)
     2109{
     2110  if (CmtLock::check () == CmtLock::locked_by_another_user)
     2111    {
     2112      CmtError::set (CmtError::conflicting_lock, "build_constituent_config>");
     2113      return;
     2114    }
     2115  if (ap.arguments.size () == 0) return;
     2116  set_standard_macros ();
     2117
     2118  CmtSystem::cmt_string_vector files (2);
     2119  cmt_string  outdir, name;
     2120  for (int i = 0; i < ap.arguments.size (); i++)
     2121    {
     2122      cmt_string arg = ap.arguments[i];
     2123      if (arg.substr (0, 5) == "-out=")
     2124        {
     2125          arg.erase (0, 5);
     2126          CmtSystem::dirname (arg, outdir);
     2127        }
     2128      else
     2129        {
     2130          name = arg;
     2131        }
     2132    }
     2133
     2134  Generator::build_constituent_makefile (ap.arguments);
     2135
     2136  const Constituent* constituent = Constituent::find (name);
     2137  if (constituent == 0)
     2138    {
     2139      // generate error
     2140      return;
     2141    }
     2142  if (!constituent->has_target_tag) return;
     2143  //  cerr << "constituent: " << name << endl;
     2144
     2145  cmt_string tag;
     2146  {
     2147    Symbol* macro = Symbol::find ("tag");
     2148    if (macro != 0)
     2149      {
     2150        tag = macro->build_macro_value ();
     2151        Symbol::expand (tag);
     2152      }
     2153  }
     2154
     2155  //cmt_local_tagfile = $(bin)$(tag).make
     2156  //cmt_final_setup = $(bin)setup.make
     2157  //cmt_local_tagfile_${CONSTITUENT} = $(bin)$(${PACKAGE}_tag)_${CONSTITUENT}.make
     2158  //cmt_final_setup_${CONSTITUENT} = $(bin)setup_${CONSTITUENT}.make
     2159  files[0] = tag + "_" + name;
     2160  files[1] = "setup_" + name;
     2161  for (int i = 0; i < files.size (); i++)
     2162    {
     2163      if (Cmt::build_nmake ())
     2164        files[i] += ".nmake";
     2165      else
     2166        files[i] += ".make";
     2167
     2168      if (outdir != "")
     2169        {
     2170          if (outdir [outdir.size () - 1] != CmtSystem::file_separator ())
     2171            outdir += CmtSystem::file_separator ();
     2172          files[i] = outdir + files[i];
     2173        }
     2174      //      cerr << "files[" << i << "]: " << files[i] << endl;
     2175    }
     2176
     2177  ofstream t (files[0]);
     2178  if (!t)
     2179    {
     2180      CmtError::set (CmtError::file_access_error, files[0]);
     2181      return;
     2182    }
     2183  t.exceptions (ios::failbit | ios::badbit);
     2184  try
     2185    {
     2186      print_macros (Make, "", t);
     2187      t.close (); // ios_base::failbit
     2188    }
     2189  catch (const ios::failure& e)
     2190    {
     2191      CmtSystem::close_ostream (NULL, files[0] + ": " + cmt_string (e.what ()));
     2192    }
     2193
     2194  bool gen_setup (true);
     2195  ostringstream os;
     2196  ofstream s;
     2197  s.open (files[1], ios::in);
     2198  if (s) // file already exists
     2199    {
     2200      //      cerr << files[1] << " already exists" << endl;
     2201      do_show_setup (ap, os);
     2202      ostringstream osn;
     2203      osn << s.rdbuf ();
     2204      if (os.str () == osn.str ())
     2205        {
     2206          //      cerr << files[1] << " up-to-date" << endl;
     2207          gen_setup = false;
     2208        }
     2209    }
     2210  s.clear ();
     2211  s.close ();
     2212  if (gen_setup)
     2213    {
     2214      s.open (files[1]);
     2215      if (!s)
     2216        {
     2217          CmtError::set (CmtError::file_access_error, files[1]);
     2218          return;
     2219        }
     2220      s.exceptions (ios::failbit | ios::badbit);
     2221      try
     2222        {
     2223          if (os.str ().size () != 0)
     2224            {
     2225              //              cerr << files[1] << " contents already generated" << endl;
     2226              s << os.str ();
     2227            }
     2228          else
     2229            {
     2230              do_show_setup (ap, s);
     2231            }
     2232          s.close (); // ios_base::failbit
     2233        }
     2234      catch (const ios::failure& e)
     2235        {
     2236          CmtSystem::close_ostream (NULL, files[1] + ": " + cmt_string (e.what ()));
     2237        }
     2238    }
     2239}
     2240
     2241//----------------------------------------------------------
    21082242void Cmt::do_build_constituents_makefile (const ArgParser& ap)
    21092243{
     
    21142248    }
    21152249  set_standard_macros ();
     2250
     2251  Generator::build_constituents_makefile (Me.m_current_package, ap.arguments);
     2252}
     2253
     2254//----------------------------------------------------------
     2255void Cmt::do_build_constituents_config (const ArgParser& ap)
     2256{
     2257  if (CmtLock::check () == CmtLock::locked_by_another_user)
     2258    {
     2259      CmtError::set (CmtError::conflicting_lock, "build_constituents_config>");
     2260      return;
     2261    }
     2262  set_standard_macros ();
     2263
     2264  CmtSystem::cmt_string_vector files (2);
     2265  cmt_string outdir;
     2266  if (ap.arguments.size () > 0)
     2267    {
     2268      cmt_string arg = ap.arguments[0];
     2269      if (arg.substr (0, 5) == "-out=")
     2270        {
     2271          arg.erase (0, 5);
     2272          CmtSystem::dirname (arg, outdir);
     2273        }
     2274      else if (arg.substr (0, 8) == "-outdir=")
     2275        {
     2276          arg.erase (0, 8);
     2277          outdir = arg;
     2278        }
     2279    }
     2280  //  cerr << "outdir: " << outdir << endl;
     2281
     2282  cmt_string tag;
     2283  {
     2284    Symbol* macro = Symbol::find ("tag");
     2285    if (macro != 0)
     2286      {
     2287        tag = macro->build_macro_value ();
     2288        Symbol::expand (tag);
     2289      }
     2290  }
     2291
     2292  //cmt_local_tagfile = $(bin)$(tag).make
     2293  //cmt_final_setup = $(bin)setup.make
     2294  files[0] = tag;
     2295  files[1] = "setup";
     2296  for (int i = 0; i < files.size (); i++)
     2297    {
     2298      if (Cmt::build_nmake ())
     2299        files[i] += ".nmake";
     2300      else
     2301        files[i] += ".make";
     2302
     2303      if (outdir != "")
     2304        {
     2305          if (outdir [outdir.size () - 1] != CmtSystem::file_separator ())
     2306            outdir += CmtSystem::file_separator ();
     2307          files[i] = outdir + files[i];
     2308        }
     2309      //      cerr << "files[" << i << "]: " << files[i] << endl;
     2310    }
     2311
     2312  //  files[0] = "/dev/full";
     2313  ofstream t (files[0]);
     2314  if (!t)
     2315    {
     2316      CmtError::set (CmtError::file_access_error, files[0]);
     2317      return;
     2318    }
     2319  t.exceptions (ios::failbit | ios::badbit);
     2320  try
     2321    {
     2322      print_macros (Make, "", t);
     2323      t.close (); // ios_base::failbit
     2324    }
     2325  catch (const ios::failure& e)
     2326    {
     2327      CmtSystem::close_ostream (NULL, files[0] + ": " + cmt_string (e.what ()));
     2328    }
     2329
     2330  bool gen_setup (true);
     2331  ostringstream os;
     2332  ofstream s;
     2333  s.open (files[1], ios::in);
     2334  if (s) // file already exists
     2335    {
     2336      //      cerr << files[1] << " already exists" << endl;
     2337      do_show_setup (ap, os);
     2338      ostringstream osn;
     2339      osn << s.rdbuf ();
     2340      if (os.str () == osn.str ())
     2341        {
     2342          //      cerr << files[1] << " up-to-date" << endl;
     2343          gen_setup = false;
     2344        }
     2345    }
     2346  s.clear ();
     2347  s.close ();
     2348  if (gen_setup)
     2349    {
     2350      s.open (files[1]);
     2351      if (!s)
     2352        {
     2353          CmtError::set (CmtError::file_access_error, files[1]);
     2354          return;
     2355        }
     2356      s.exceptions (ios::failbit | ios::badbit);
     2357      try
     2358        {
     2359          if (os.str ().size () != 0)
     2360            {
     2361              //              cerr << files[1] << " contents already generated" << endl;
     2362              s << os.str ();
     2363            }
     2364          else
     2365            {
     2366              do_show_setup (ap, s);
     2367            }
     2368          s.close (); // ios_base::failbit
     2369        }
     2370      catch (const ios::failure& e)
     2371        {
     2372          CmtSystem::close_ostream (NULL, files[1] + ": " + cmt_string (e.what ()));
     2373        }
     2374    }
    21162375
    21172376  Generator::build_constituents_makefile (Me.m_current_package, ap.arguments);
     
    42684527
    42694528//----------------------------------------------------------
    4270 void Cmt::do_show_path (const ArgParser& ap)
    4271 {
    4272   Project::show_paths (ap.arguments);
     4529void Cmt::do_show_path (const ArgParser& ap, ostream& out)
     4530{
     4531  Project::show_paths (ap.arguments, out);
    42734532}
    42744533
     
    43064565
    43074566//----------------------------------------------------------
    4308 void Cmt::do_show_setup (const ArgParser& ap)
    4309 {
    4310   cout << "----------> uses" << endl;
    4311   do_show_uses (ap);
     4567void Cmt::do_show_setup (const ArgParser& ap, ostream& out)
     4568//void Cmt::do_show_setup (const ArgParser& ap)
     4569{
     4570  out << "----------> uses" << endl;
     4571  do_show_uses (ap, out);
    43124572  // This is temporary to ensure that Make - which runs "cmt show setup" -
    43134573  // does not fail for packages with unresolved uses
     
    43154575    CmtError::clear ();
    43164576
    4317   cout << "----------> tags" << endl;
    4318   do_show_tags (ap);
    4319 
    4320   cout << "----------> CMTPATH" << endl;
    4321   do_show_path (ap);
     4577  out << "----------> tags" << endl;
     4578  do_show_tags (ap, out);
     4579
     4580  out << "----------> CMTPATH" << endl;
     4581  do_show_path (ap, out);
    43224582}
    43234583
     
    44704730
    44714731//----------------------------------------------------------
    4472 void Cmt::do_show_tags (const ArgParser& /*ap*/)
     4732void Cmt::do_show_tags (const ArgParser& /*ap*/, ostream& out)
    44734733{
    44744734  Tag::TagPtrVector tags = Tag::tags ();
     
    44824742      if (tag != 0)
    44834743        {
    4484           tag->show (Me.m_quiet);
     4744          tag->show (Me.m_quiet, out);
    44854745        }
    44864746    }
     
    44994759
    45004760//----------------------------------------------------------
    4501 void Cmt::do_show_uses (const ArgParser& /*ap*/)
    4502 {
    4503   Use::show_all ();
     4761void Cmt::do_show_uses (const ArgParser& /*ap*/, ostream& out)
     4762{
     4763  Use::show_all (false, out);
    45044764}
    45054765
     
    59826242    case action_broadcast :
    59836243    case action_build_constituent_makefile :
     6244    case action_build_constituent_config :
    59846245    case action_build_constituents_makefile :
     6246    case action_build_constituents_config :
    59856247    case action_build_dependencies :
    59866248    case action_build_library_links :
     
    60956357    case action_broadcast :
    60966358    case action_build_constituent_makefile :
     6359    case action_build_constituent_config :
    60976360    case action_build_constituents_makefile :
     6361    case action_build_constituents_config :
    60986362    case action_build_dependencies :
    60996363    case action_build_library_links :
     
    62006464    case action_broadcast :
    62016465    case action_build_constituent_makefile :
     6466    case action_build_constituent_config :
    62026467    case action_build_constituents_makefile :
     6468    case action_build_constituents_config :
    62036469    case action_build_dependencies :
    62046470    case action_build_library_links :
     
    63176583          // case action_broadcast :
    63186584        case action_build_constituent_makefile :
     6585        case action_build_constituent_config :
    63196586        case action_build_constituents_makefile :
     6587        case action_build_constituents_config :
    63206588        case action_build_dependencies :
    63216589        case action_build_library_links :
     
    64326700          do_build_constituent_makefile (ap);
    64336701          break;
     6702        case action_build_constituent_config :
     6703          do_build_constituent_config (ap);
     6704          break;
    64346705        case action_build_constituents_makefile :
    64356706          do_build_constituents_makefile (ap);
     6707          break;
     6708        case action_build_constituents_config :
     6709          do_build_constituents_config (ap);
    64366710          break;
    64376711        case action_build_dependencies :
     
    70517325 * in recursively read requirements files.
    70527326 */
    7053 void Cmt::print_macros (PrintMode mode, const cmt_string& pattern)
     7327void Cmt::print_macros (PrintMode mode, const cmt_string& pattern, ostream& out)
     7328//void Cmt::print_macros (PrintMode mode, const cmt_string& pattern)
    70547329{
    70557330  int number;
     
    70847359              (symbol.type == Symbol::SymbolAction)) continue;
    70857360        }
    7086       else if (Me.m_action == action_build_tag_makefile)
     7361      else if ((Me.m_action == action_build_tag_makefile) ||
     7362               (Me.m_action == action_build_constituents_config) ||
     7363               (Me.m_action == action_build_constituent_config))
    70877364        {
    70887365          // Exclude scripts and actions
     
    70987375      if (symbol.value_lists.size () < 1) continue;
    70997376
    7100       symbol.show_macro (mode);
     7377      symbol.show_macro (mode, out);
     7378      //      symbol.show_macro (mode);
    71017379    }
    71027380}
     
    82478525            else
    82488526              {
    8249                 if (Me.m_action == action_build_constituents_makefile)
     8527                if (Me.m_action == action_build_constituents_makefile ||
     8528                    Me.m_action == action_build_constituents_config)
    82508529                  CmtMessage::warning ("package " + import +
    82518530                                       " cannot be imported (requested for " +
  • CMT/HEAD/source/cmt_parser.h

    r531 r547  
    223223
    224224  action_build_constituent_makefile,
     225  action_build_constituent_config,
    225226  action_build_constituents_makefile,
     227  action_build_constituents_config,
    226228  action_build_dependencies,
    227229  action_build_library_links,
  • CMT/HEAD/source/cmt_project.cxx

    r541 r547  
    14231423
    14241424/*----------------------------------------------------------*/
    1425 void Project::show_paths (const CmtSystem::cmt_string_vector& arguments)
     1425void Project::show_paths (const CmtSystem::cmt_string_vector& arguments,
     1426                          ostream& out)
    14261427//void Project::show_paths ()
    14271428{
    1428   if (arguments.size () == 0)
     1429  if (arguments.size () == 0 ||
     1430      Cmt::get_action () != action_show_path)
    14291431    {
    14301432      const ProjectPtrVector& Ordered = Project::ordered_projects ();
     
    14391441          if (CmtSystem::test_directory (w))
    14401442            {
    1441               cout << "# Add path " << w << " from " << s << endl;
     1443              out << "# Add path " << w << " from " << s << endl;
    14421444            }
    14431445        }
     
    14561458          if (CmtSystem::test_directory (w))
    14571459            {
    1458               cout << "# Create path " << w << " from " << s << endl;
     1460              out << "# Create path " << w << " from " << s << endl;
    14591461            }
    14601462        }
  • CMT/HEAD/source/cmt_project.h

    r541 r547  
    115115  static void show_container (const cmt_string& path = "");
    116116  static void show_specified_strategies_for_all ();
    117   static void show_paths (const CmtSystem::cmt_string_vector& arguments);
     117  static void show_paths (const CmtSystem::cmt_string_vector& arguments, ostream& out = cout);
    118118  //  static void show_paths ();
    119119  static const cmt_string& get_project_file_name ();
  • CMT/HEAD/source/cmt_std.h

    r274 r547  
    2727#include <iostream.h>
    2828#include <fstream.h>
     29#include <sstream.h>
    2930
    3031#define ios_base ios
     
    3738#include <iostream>
    3839#include <fstream>
     40#include <sstream>
    3941
    4042#define cout std::cout
     
    4345#define ofstream std::ofstream
    4446#define ifstream std::ifstream
     47#define ostringstream std::ostringstream
    4548#define istream std::istream
    4649#define ostream std::ostream
  • CMT/HEAD/source/cmt_symbol.cxx

    r545 r547  
    719719
    720720            if ((!Cmt::get_quiet ()) &&
    721                 (action != action_build_tag_makefile))
     721                (action != action_build_constituents_config) &&
     722                (action != action_build_constituent_config))
    722723              {
    723724                cmt_string s1;
     
    18411842
    18421843//-------------------------------------------------------------
    1843 void Symbol::show_macro (PrintMode mode)
     1844void Symbol::show_macro (PrintMode mode, ostream& out)
     1845//void Symbol::show_macro (PrintMode mode)
    18441846{
    18451847  if (Cmt::get_debug ())
     
    18541856  if ((!Cmt::get_quiet ()) &&
    18551857      (action != action_build_tag_makefile) &&
     1858      (action != action_build_constituents_config) &&
     1859      (action != action_build_constituent_config) &&
    18561860      (action != action_show_macros) &&
    18571861      (action != action_show_actions) &&
    18581862      (action != action_show_sets))
    18591863    {
    1860       cout << "#" << endl;
    1861       cout << "# Selection : " << endl;
     1864      out << "#" << endl;
     1865      out << "# Selection : " << endl;
    18621866    }
    18631867
     
    18711875          (action == action_show_action) ||
    18721876          (action == action_build_tag_makefile) ||
     1877          (action == action_build_constituents_config) ||
     1878          (action == action_build_constituent_config) ||
    18731879          (action == action_load) ||
    18741880          (!Cmt::get_quiet ()))
     
    18761882          if (mode == Make)
    18771883            {
    1878               cout << name << "=";
     1884              out << name << "=";
    18791885            }
    18801886          else
    18811887            {
    1882               cout << name << "='";
     1888              out << name << "='";
    18831889            }
    18841890        }
     
    18901896          expand (value);
    18911897        }
    1892       else if (action == action_build_tag_makefile)
     1898      else if (action == action_build_tag_makefile ||
     1899               action == action_build_constituents_config ||
     1900               action == action_build_constituent_config)
    18931901        {
    18941902            /*
     
    19031911        }
    19041912
    1905       cout << value;
     1913      out << value;
    19061914
    19071915      if ((action == action_show_macro) ||
     
    19121920          (action == action_show_action) ||
    19131921          (action == action_build_tag_makefile) ||
     1922          (action == action_build_constituents_config) ||
     1923          (action == action_build_constituent_config) ||
    19141924          (action == action_load) ||
    19151925          (!Cmt::get_quiet ()))
     
    19171927          if (mode != Make)
    19181928            {
    1919               cout << "'";
     1929              out << "'";
    19201930            }
    19211931#ifdef WIN32
    19221932          else
    19231933            {
    1924               cout << " ";
     1934              out << " ";
    19251935            }
    19261936#endif
    19271937        }
    19281938
    1929       cout << endl;
     1939      out << endl;
    19301940    }
    19311941}
  • CMT/HEAD/source/cmt_symbol.h

    r144 r547  
    120120  cmt_string clean_macro_value () const;
    121121  cmt_string resolve_macro_value (const cmt_string& tag_name = "");
    122   void show_macro (PrintMode mode);
     122  void show_macro (PrintMode mode, ostream& out = cout);
     123  //  void show_macro (PrintMode mode);
    123124
    124125  ValueBuilder* builder;
  • CMT/HEAD/source/cmt_tag.cxx

    r546 r547  
    716716
    717717/*----------------------------------------------------------*/
    718 void Tag::show_definition (bool quiet) const
     718void Tag::show_definition (bool quiet, ostream& out) const
    719719{
    720720  static const cmt_string priority_text[] = {
     
    730730  if (m_name == "Default") return;
    731731
    732   cout << m_name;
     732  out << m_name;
    733733
    734734  if (!quiet)
     
    740740          if (m_def_use != 0)
    741741            {
    742               cout << " (from ";
    743               if (m_context != "use") cout << m_context;
    744               cout << "package " << m_def_use->get_package_name () << ")";
     742              out << " (from ";
     743              if (m_context != "use") out << m_context;
     744              out << "package " << m_def_use->get_package_name () << ")";
    745745            }
    746746        }
    747747      else
    748748        {
    749           cout << " (from " << m_context << ")";
     749          out << " (from " << m_context << ")";
    750750        }
    751       //cout << " (" << priority_text[m_priority] << ")";
     751      //out << " (" << priority_text[m_priority] << ")";
    752752     
    753753      if (m_tag_refs.size () > 0)
     
    757757          if (m_ref_uses.size () != 0)
    758758            {
    759               cout << " package [";
     759              out << " package [";
    760760              for (number = 0; number < m_ref_uses.size (); number++)
    761761                {
    762762                  Use* use = m_ref_uses[number];
    763                   if (number > 0) cout << " ";
    764                   cout << use->get_package_name ();
     763                  if (number > 0) out << " ";
     764                  out << use->get_package_name ();
    765765                }
    766               cout << "]";
     766              out << "]";
    767767            }
    768768          /*
    769769          if (m_set_use != 0)
    770770            {
    771               cout << " package " << m_set_use->get_package_name ();
     771              out << " package " << m_set_use->get_package_name ();
    772772            }
    773773          */
    774774         
    775           cout << " implies [";
     775          out << " implies [";
    776776         
    777777          for (number = 0; number < m_tag_refs.size (); number++)
    778778            {
    779779              Tag* ref = m_tag_refs[number];
    780               if (number > 0) cout << " ";
    781               cout << ref->m_name;
     780              if (number > 0) out << " ";
     781              out << ref->m_name;
    782782            }
    783783         
    784           cout << "]";
     784          out << "]";
    785785        }
    786786     
     
    791791          if (m_set_use != 0)
    792792            {
    793               cout << " package " << m_set_use->get_package_name ();
     793              out << " package " << m_set_use->get_package_name ();
    794794            }
    795795         
    796           cout << " excludes [";
     796          out << " excludes [";
    797797         
    798798          for (number = 0; number < m_tag_excludes.size (); number++)
    799799            {
    800800              Tag* ref = m_tag_excludes[number];
    801               if (number > 0) cout << " ";
    802               cout << ref->m_name;
     801              if (number > 0) out << " ";
     802              out << ref->m_name;
    803803            }
    804804         
    805           cout << "]";
     805          out << "]";
    806806        }
    807807    }
    808   cout << endl;
    809 }
    810 
    811 /*----------------------------------------------------------*/
    812 void Tag::show (bool quiet) const
    813 {
    814   if (is_primary () && is_selected ()) show_definition (quiet);
     808  out << endl;
     809}
     810
     811/*----------------------------------------------------------*/
     812void Tag::show (bool quiet, ostream& out) const
     813{
     814  if (is_primary () && is_selected ()) show_definition (quiet, out);
    815815}
    816816
  • CMT/HEAD/source/cmt_tag.h

    r546 r547  
    5252  void unmark ();
    5353  void mark ();
    54   void show_definition (bool quiet) const;
    55   void show (bool quiet) const;
     54  void show_definition (bool quiet, ostream& out = cout) const;
     55  //  void show_definition (bool quiet) const;
     56  void show (bool quiet, ostream& out = cout) const;
     57  //  void show (bool quiet) const;
    5658  bool is_selected () const;
    5759  bool is_primary () const;
  • CMT/HEAD/source/cmt_use.cxx

    r538 r547  
    364364
    365365//----------------------------------------------------------
    366 void Use::show_all (bool skip_discarded)
    367 {
    368   show_all ("use ", skip_discarded);
     366void Use::show_all (bool skip_discarded, ostream& out)
     367//void Use::show_all (bool skip_discarded)
     368{
     369  show_all ("use ", skip_discarded, out);
    369370}
    370371
     
    470471
    471472//----------------------------------------------------------
    472 void Use::show_all (const cmt_string& prefix, bool skip_discarded)
     473void Use::show_all (const cmt_string& prefix, bool skip_discarded, ostream& out)
     474//void Use::show_all (const cmt_string& prefix, bool skip_discarded)
    473475{
    474476  static UsePtrVector& uses = get_ordered_uses ();
     
    496498  use = &(current ());
    497499  use->unselect ();
    498   if (!Cmt::get_quiet ()) use->show_sub_uses ("", skip_discarded);
     500  if (!Cmt::get_quiet ()) use->show_sub_uses ("", skip_discarded, out);
    499501
    500502  if (uses.size () > 0)
     
    502504      if (!Cmt::get_quiet ())
    503505        {
    504           cout << "#\n";
    505           cout << "# Selection :\n";
     506          out << "#\n";
     507          out << "# Selection :\n";
    506508        }
    507509
     
    528530              if (!Cmt::get_quiet ())
    529531                {
    530                   cout << "# package " << use->get_package_name () <<
     532                  out << "# package " << use->get_package_name () <<
    531533                    " " << use->version << " " << use->path <<
    532534                    " not found" <<
     
    549551                }
    550552             
    551               cout << prefix << use->get_package_name ()
     553              out << prefix << use->get_package_name ()
    552554                   << " " << use->version;
    553555
     
    556558                  if (!Cmt::get_quiet ())
    557559                    {
    558                       cout << " (" << use->path << ")";
     560                      out << " (" << use->path << ")";
    559561                    }
    560562                }
    561563              else
    562564                {
    563                   cout << " " << use->path;
     565                  out << " " << use->path;
    564566                }
    565567
    566568              if (!Cmt::get_quiet ())
    567569                {
    568                   if (p != "") cout << " (" << p << ")";
    569                   if (use->auto_imports == Off) cout << " (no_auto_imports)";
     570                  if (p != "") out << " (" << p << ")";
     571                  if (use->auto_imports == Off) out << " (no_auto_imports)";
    570572                }
    571573
    572               cout << endl;
     574              out << endl;
    573575            }
    574576        }
     
    577579      if (suse != 0 && !suse->discarded && !suse->m_hidden && suse->located ())
    578580        {
    579           cout << prefix << suse->get_package_name ()
     581          out << prefix << suse->get_package_name ()
    580582               << " " << suse->version;
    581583          if (!Cmt::get_quiet ())
    582584            {
    583               cout << " (" << suse->path << ")";
    584             }
    585           cout << endl;
     585              out << " (" << suse->path << ")";
     586            }
     587          out << endl;
    586588        }
    587589      suse = Use::find (CmtSystem::get_user_context_package ());
    588590      if (suse != 0 && !suse->discarded && !suse->m_hidden && suse->located ())
    589591        {
    590           cout << prefix << suse->get_package_name ()
     592          out << prefix << suse->get_package_name ()
    591593               << " " << suse->version;
    592594          if (!Cmt::get_quiet ())
    593595            {
    594               cout << " (" << suse->path << ")";
    595             }
    596           cout << endl;
     596              out << " (" << suse->path << ")";
     597            }
     598          out << endl;
    597599        }
    598600      /*
    599601      if (Cmt::get_cmt_home () != "")
    600602        {
    601           cout << prefix << CmtSystem::get_home_package () << " v0";
     603          out << prefix << CmtSystem::get_home_package () << " v0";
    602604          if (!Cmt::get_quiet ())
    603605            {
    604               cout << " (" << Cmt::get_cmt_home () << ")";
    605             }
    606           cout << endl;
     606              out << " (" << Cmt::get_cmt_home () << ")";
     607            }
     608          out << endl;
    607609        }
    608610
    609611      if (Cmt::get_cmt_user_context () != "")
    610612        {
    611           cout << prefix << CmtSystem::get_user_context_package () << " v0";
     613          out << prefix << CmtSystem::get_user_context_package () << " v0";
    612614          if (!Cmt::get_quiet ())
    613615            {
    614               cout << " (" << Cmt::get_cmt_user_context () << ")";
    615             }
    616           cout << endl;
     616              out << " (" << Cmt::get_cmt_user_context () << ")";
     617            }
     618          out << endl;
    617619        }
    618620      */
     
    39513953
    39523954//----------------------------------------------------------
    3953 void Use::show_sub_uses (const cmt_string& request, bool skip_discarded)
     3955void Use::show_sub_uses (const cmt_string& request, bool skip_discarded, ostream& out)
     3956//void Use::show_sub_uses (const cmt_string& request, bool skip_discarded)
    39543957{
    39553958  Use* current = &(Use::current ());
     
    39633966  if (level > 0)
    39643967    {
    3965       cout << "# ";
    3966       for (n = 0; n < (level-1); n++) cout << "  ";
     3968      out << "# ";
     3969      for (n = 0; n < (level-1); n++) out << "  ";
    39673970
    39683971      if (request == "")
    39693972        {
    3970           cout << "use " << get_package_name () << " " << specified_version;
     3973          out << "use " << get_package_name () << " " << specified_version;
    39713974
    39723975          if (this == current)
    39733976            {
    3974               cout << " (current)";
     3977              out << " (current)";
    39753978            }
    39763979          else
    39773980            {
    3978               if (specified_path != "") cout << " " << specified_path;
     3981              if (specified_path != "") out << " " << specified_path;
    39793982            }
    39803983        }
    39813984      else
    39823985        {
    3983           cout << "use " << request;
     3986          out << "use " << request;
    39843987        }
    39853988
    39863989      if (version_alias != "")
    39873990        {
    3988           cout << " | " << version_alias << " " << path_alias;
    3989         }
    3990 
    3991       if (initial_scope == ScopeUnspecified) cout << " (unspecified)";
    3992       else if (initial_scope != ScopePublic) cout << " (private)";
    3993 
    3994       if (auto_imports == Off) cout << " (no_auto_imports)";
    3995 
    3996       if (structuring_style == without_version_directory) cout << " (no_version_directory)";
    3997       //      if (style == no_version_style) cout << " (no_version_directory)";
     3991          out << " | " << version_alias << " " << path_alias;
     3992        }
     3993
     3994      if (initial_scope == ScopeUnspecified) out << " (unspecified)";
     3995      else if (initial_scope != ScopePublic) out << " (private)";
     3996
     3997      if (auto_imports == Off) out << " (no_auto_imports)";
     3998
     3999      if (structuring_style == without_version_directory) out << " (no_version_directory)";
     4000      //      if (style == no_version_style) out << " (no_version_directory)";
    39984001
    39994002      if (m_has_native_version)
     
    40064009            {
    40074010              cmt_string value = s->resolve_macro_value ();
    4008               cout << " (native_version=" << value << ")";
     4011              out << " (native_version=" << value << ")";
    40094012            }
    40104013        }
    40114014
    4012       cout << endl;
     4015      out << endl;
    40134016    }
    40144017
     
    40304033      use->auto_imports = sub_use_auto_imports[n];
    40314034
    4032       use->show_sub_uses (request, skip_discarded);
     4035      use->show_sub_uses (request, skip_discarded, out);
    40334036
    40344037      use->initial_scope = saved_scope;
  • CMT/HEAD/source/cmt_use.h

    r536 r547  
    4646  static void select_clients (const cmt_string& package,
    4747                              const cmt_string& version);
    48   static void show_all (bool skip_discarded = false);
    49   static void show_all (const cmt_string& prefix, bool skip_discarded = false);
     48  static void show_all (bool skip_discarded = false, ostream& out = cout );
     49  //  static void show_all (bool skip_discarded = false);
     50  static void show_all (const cmt_string& prefix, bool skip_discarded = false,
     51                        ostream& out = cout);
     52  //  static void show_all (const cmt_string& prefix, bool skip_discarded = false);
    5053
    5154  static Use& current ();
     
    185188  bool is_client (const cmt_string& package,
    186189                  const cmt_string& version);
    187   void show_sub_uses (const cmt_string& request, bool skip_discarded = false);
     190  void show_sub_uses (const cmt_string& request, bool skip_discarded = false,
     191                      ostream& out = cout);
     192  //  void show_sub_uses (const cmt_string& request, bool skip_discarded = false);
    188193  bool select_alternate ();
    189194  Use* get_selected_version ();
  • CMT/HEAD/src/Makefile.header

    r535 r547  
    3131#  Generic entry points for all targets
    3232#
    33 ifndef QUICK
    34 all :: check_config ;
    35 else
    36 all :: no_check_config ;
    37 endif
     33#ifndef QUICK
     34#all :: check_config ;
     35#else
     36#all :: no_check_config ;
     37#endif
     38#all :: $(cmt_constituents_makefile)
     39#       @$(MAKE) --no-print-directory -f $(cmt_constituents_makefile) $@
     40default :: all ;
    3841
    3942check_config ::
    4043        @$(cmtexe) check configuration; retval=$$?; \
    41         if test $${retval} = 0; then \
    42           $(MAKE) --no-print-directory target="all" common_target; \
    43         else \
     44        if test $${retval} -ne 0; then \
    4445          test -z "$(cmtmsg)" || \
    4546          echo "$(CMTMSGPREFIX)" "(Makefile.header) Configuration error(s). Please correct" >&2; \
    46         fi
     47        fi; exit $${retval}
    4748
    48 no_check_config ::
    49         @$(MAKE) --no-print-directory target="all" common_target
     49#       @$(cmtexe) check configuration; retval=$$?; \
     50#       if test $${retval} = 0; then \
     51#         $(MAKE) --no-print-directory target="all" common_target; \
     52#       else \
     53#         test -z "$(cmtmsg)" || \
     54#         echo "$(CMTMSGPREFIX)" "(Makefile.header) Configuration error(s). Please correct" >&2; \
     55#       fi
     56
     57#no_check_config ::
     58#       @$(MAKE) --no-print-directory target="all" common_target
    5059
    5160binclean ::
     
    5867        fi
    5968
    60 clean ::
    61         @$(cmtexe) check configuration
    62         @$(MAKE) --no-print-directory target="$@" common_target
     69#clean uninstall :: check_config
     70#       @$(MAKE) --no-print-directory -f $(cmt_constituents_makefile) $@
     71#       @$(cmtexe) check configuration
     72#       @$(MAKE) --no-print-directory target="$@" common_target
    6373
    6474.DEFAULT ::
    65         @$(cmtexe) check configuration
    66         @$(MAKE) --no-print-directory target="$@" common_target
     75        @$(MAKE) $(cmt_constituents_makefile)
     76        @$(MAKE) --no-print-directory -f $(cmt_constituents_makefile) $@
     77
     78#       @$(cmtexe) check configuration
     79#       @$(MAKE) --no-print-directory target="$@" common_target
    6780#       @$(MAKE) --no-print-directory target="config $@" common_target
    6881
     
    7083#  Capture all possible targets
    7184#
    72 common_target : $(cmt_constituents_makefile)
    73         @$(MAKE) --no-print-directory -f $(cmt_constituents_makefile) $(target)
    74 #       @$(MAKE) --no-print-directory -f $< cmt_lock_pid=$(cmt_lock_pid) $(target)
     85#common_target : $(cmt_constituents_makefile)
     86#       @$(MAKE) --no-print-directory -f $(cmt_constituents_makefile) $(target)
    7587
    76 $(cmt_constituents_makefile) : $(cmt_local_tagfile)
     88#$(cmt_constituents_makefile) : $(cmt_local_tagfile)
     89
     90ifndef QUICK
     91$(cmt_constituents_makefile) : check_config
     92else
     93$(cmt_constituents_makefile) :
     94endif
    7795        $(echo) "(Makefile.header) Rebuilding $@"; \
    7896          if test ! -d $(@D) ; then $(mkdir) -p $(@D); fi; \
    79           $(cmtexe) -tag=$(tags) build constituents_makefile -out=$@; \
     97          $(cmtexe) -tag=$(tags) build constituents_config -out=$@; \
    8098          retval=$$?; \
    81           if test $${retval} != 0; then \
     99          if test $${retval} -ne 0; then \
    82100            test -z "$(cmtmsg)" || \
    83101            echo "$(CMTMSGPREFIX)" "(Makefile.header) Cannot generate $@" >&2; \
     
    103121            \rm $(cmt_local_setup); else \
    104122            \mv -f $(cmt_local_setup) $(cmt_final_setup); fi
    105 
    106 #         && /bin/echo $@ ok   
    107 #       $(echo) CMTCONFIG=$(CMTCONFIG) ; \
    108 #
    109123
    110124#
     
    150164# explicit rule not to remake
    151165${CMTROOT}/src/Makefile.header : ;
     166
     167# for multiple command line goals,
     168# avoid race conditions when (re)writing constituents.make
     169.NOTPARALLEL :
  • CMT/HEAD/src/NMakefile.header

    r487 r547  
    7777!if [$(echo) (NMakefile.header) Rebuilding $(cmt_constituents_makefile)] == 0
    7878!endif
    79 !if [$(cmtexe) -tag=$(tags) build constituents_makefile -out=$(cmt_constituents_makefile)] == 0
     79!if [$(cmtexe) -tag=$(tags) build constituents_config -out=$(cmt_constituents_makefile)] == 0
     80#!if [$(cmtexe) -tag=$(tags) build constituents_makefile -out=$(cmt_constituents_makefile)] == 0
    8081!endif
    8182
Note: See TracChangeset for help on using the changeset viewer.