- Timestamp:
- Aug 3, 2010, 5:11:00 PM (14 years ago)
- Location:
- CMT/HEAD
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
CMT/HEAD/ChangeLog
r546 r547 1 2010-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 1 50 2010-07-02 <rybkin@lal.in2p3.fr> 431 2 51 -
CMT/HEAD/mgr/fragments/constituent
r492 r547 69 69 70 70 ifndef 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} 72 75 else 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 74 83 endif 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} 77 86 78 87 ${CONSTITUENT} :: $(${CONSTITUENT}_dependencies) $(cmt_local_${CONSTITUENT}_makefile) dirs ${CONSTITUENT}dirs -
CMT/HEAD/mgr/fragments/constituent_lock
r492 r547 69 69 70 70 ifndef 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} 72 75 else 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 74 83 endif 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} 77 86 78 87 ${CONSTITUENT} :: $(${CONSTITUENT}_dependencies) $(cmt_local_${CONSTITUENT}_makefile) dirs ${CONSTITUENT}dirs -
CMT/HEAD/mgr/fragments/dependencies
r487 r547 5 5 #$(bin)${CONSTITUENT}_dependencies.make :: dirs 6 6 7 ifndef QUICK7 #ifndef QUICK 8 8 $(bin)${CONSTITUENT}_dependencies.make : ${LINE} $(use_requirements) $(cmt_final_setup_${CONSTITUENT}) 9 9 $(echo) "(${CONSTITUENT}.make) Rebuilding $@"; \ 10 10 $(build_dependencies) ${CONSTITUENT} -all_sources -out=$@ ${LINE} 11 endif11 #endif 12 12 13 13 #$(${CONSTITUENT}_dependencies) -
CMT/HEAD/mgr/fragments/nmake/constituent
r492 r547 19 19 !endif 20 20 21 !if "$(QUICK)" == "" || !exist ($(cmt_local_tagfile_${CONSTITUENT}))21 #!if "$(QUICK)" == "" || !exist ($(cmt_local_tagfile_${CONSTITUENT})) 22 22 23 !if [$(echo) (constituents.nmake) Rebuilding $(cmt_local_tagfile_${CONSTITUENT})] == 024 !endif25 !if [cmt -tag=$(tags) $(${CONSTITUENT}_extratags) build tag_makefile >$(cmt_local_tagfile_${CONSTITUENT})] == 026 !endif23 #!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 27 27 28 !if [$(echo) (constituents.nmake) Rebuilding $(cmt_final_setup_${CONSTITUENT})] == 029 !endif30 !if [$(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) show setup >$(cmt_local_setup_${CONSTITUENT})] == 031 !endif28 #!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 32 32 33 !if exist ($(cmt_final_setup_${CONSTITUENT})) && [ echo n|comp $(cmt_final_setup_${CONSTITUENT}) $(cmt_local_setup_${CONSTITUENT}) >nul 2>&1 ] == 034 !if [ del $(cmt_local_setup_${CONSTITUENT}) ] == 035 !endif36 !else37 !if [ move /y $(cmt_local_setup_${CONSTITUENT}) $(cmt_final_setup_${CONSTITUENT}) >nul ] == 038 !endif39 !endif33 #!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 40 40 41 !endif41 #!endif 42 42 43 43 !else … … 52 52 !endif 53 53 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) 59 62 $(echo) (constituents.nmake) Building ${CONSTITUENT}.nmake 60 63 @set include=$(include) 61 64 @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} 63 67 # $(echo) (constituents.nmake) ${CONSTITUENT}.nmake done 68 !else 69 $(cmt_local_${CONSTITUENT}_makefile) : $(${CONSTITUENT}_dependencies) ; 70 !endif 64 71 65 72 cmt_${CONSTITUENT}_${HASDEPENDENCIES} = 1 … … 104 111 105 112 #${CONSTITUENT}uninstall :: $(cmt_local_${CONSTITUENT}_makefile) 106 ${CONSTITUENT}uninstall :: $(cmt_local_tagfile_${CONSTITUENT}) 113 #${CONSTITUENT}uninstall :: $(cmt_local_tagfile_${CONSTITUENT}) 114 ${CONSTITUENT}uninstall :: 107 115 $(echo) (constituents.nmake) Starting uninstall ${CONSTITUENT} 108 116 @set include=$(include) 109 117 @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} 111 120 @-$(MAKE) /nologo /f $(cmt_local_${CONSTITUENT}_makefile) /$(MAKEFLAGS) bin=$(bin) build_strategy=keep_makefiles uninstall tag=$(tag) 112 121 $(echo) (constituents.nmake) uninstall ${CONSTITUENT} done -
CMT/HEAD/mgr/fragments/nmake/constituent_lock
r492 r547 19 19 !endif 20 20 21 !if "$(QUICK)" == "" || !exist ($(cmt_local_tagfile_${CONSTITUENT}))21 #!if "$(QUICK)" == "" || !exist ($(cmt_local_tagfile_${CONSTITUENT})) 22 22 23 !if [$(echo) (constituents.nmake) Rebuilding $(cmt_local_tagfile_${CONSTITUENT})] == 024 !endif25 !if [cmt -tag=$(tags) $(${CONSTITUENT}_extratags) build tag_makefile >$(cmt_local_tagfile_${CONSTITUENT})] == 026 !endif23 #!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 27 27 28 !if [$(echo) (constituents.nmake) Rebuilding $(cmt_final_setup_${CONSTITUENT})] == 029 !endif30 !if [$(cmtexe) -tag=$(tags) $(${CONSTITUENT}_extratags) show setup >$(cmt_local_setup_${CONSTITUENT})] == 031 !endif28 #!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 32 32 33 !if exist ($(cmt_final_setup_${CONSTITUENT})) && [ echo n|comp $(cmt_final_setup_${CONSTITUENT}) $(cmt_local_setup_${CONSTITUENT}) >nul 2>&1 ] == 034 !if [ del $(cmt_local_setup_${CONSTITUENT}) ] == 035 !endif36 !else37 !if [ move /y $(cmt_local_setup_${CONSTITUENT}) $(cmt_final_setup_${CONSTITUENT}) >nul ] == 038 !endif39 !endif33 #!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 40 40 41 !endif41 #!endif 42 42 43 43 !else … … 52 52 !endif 53 53 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) 59 62 $(echo) (constituents.nmake) Building ${CONSTITUENT}.nmake 60 63 @set include=$(include) 61 64 @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} 63 67 # $(echo) (constituents.nmake) ${CONSTITUENT}.nmake done 68 !else 69 $(cmt_local_${CONSTITUENT}_makefile) : $(${CONSTITUENT}_dependencies) ; 70 !endif 64 71 65 72 cmt_${CONSTITUENT}_${HASDEPENDENCIES} = 1 … … 108 115 109 116 #${CONSTITUENT}uninstall :: $(cmt_local_${CONSTITUENT}_makefile) 110 ${CONSTITUENT}uninstall :: $(cmt_local_tagfile_${CONSTITUENT}) 117 #${CONSTITUENT}uninstall :: $(cmt_local_tagfile_${CONSTITUENT}) 118 ${CONSTITUENT}uninstall :: 111 119 $(echo) (constituents.nmake) Starting uninstall ${CONSTITUENT} 112 120 @set include=$(include) 113 121 @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} 115 124 @-$(MAKE) /nologo /f $(cmt_local_${CONSTITUENT}_makefile) /$(MAKEFLAGS) bin=$(bin) build_strategy=keep_makefiles uninstall tag=$(tag) 116 125 $(echo) (constituents.nmake) uninstall ${CONSTITUENT} done -
CMT/HEAD/mgr/fragments/nmake/constituents_header
r487 r547 18 18 cmt_final_setup = $(bin)setup.nmake 19 19 20 !if "$(QUICK)" == "" || !exist ($(cmt_local_tagfile))20 #!if "$(QUICK)" == "" || !exist ($(cmt_local_tagfile)) 21 21 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 28 26 29 !if [$(echo) (constituents.nmake) Rebuilding $(cmt_final_setup)] == 030 !endif31 !if [cmt -tag=$(tags) show setup >$(cmt_local_setup)] == 032 !endif27 #!if [$(echo) (constituents.nmake) Rebuilding $(cmt_final_setup)] == 0 28 #!endif 29 #!if [cmt -tag=$(tags) show setup >$(cmt_local_setup)] == 0 30 #!endif 33 31 34 !if exist ($(cmt_final_setup)) && [ echo n|comp $(cmt_final_setup) $(cmt_local_setup) >nul 2>&1 ] == 035 !if [ del $(cmt_local_setup) ] == 036 !endif37 !else38 !if [ move /y $(cmt_local_setup) $(cmt_final_setup) >nul ] == 039 !endif40 !endif32 #!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 41 39 42 !endif40 #!endif 43 41 44 42 #!include $(${PACKAGE}_tag).nmake -
CMT/HEAD/mgr/fragments/nmake/dependencies
r488 r547 1 1 #-- start of dependency ------------------ 2 2 3 !if "$(QUICK)" == ""3 #!if "$(QUICK)" == "" 4 4 5 5 #!if exist ("$(CMTROOT)/$(CMTBIN)/cmt.exe") … … 17 17 $(build_dependencies) ${CONSTITUENT} -all_sources -out:$@ ${LINE} 18 18 19 !endif19 #!endif 20 20 21 21 !if exist ($(bin)${CONSTITUENT}_dependencies.nmake) -
CMT/HEAD/source/cmt.h
r535 r547 107 107 static void do_broadcast (const ArgParser& ap); 108 108 static void do_build_constituent_makefile (const ArgParser& ap); 109 static void do_build_constituent_config (const ArgParser& ap); 109 110 static void do_build_constituents_makefile (const ArgParser& ap); 111 static void do_build_constituents_config (const ArgParser& ap); 110 112 static void do_build_dependencies (const ArgParser& ap, 111 113 int argc, … … 179 181 static void do_show_manager (const ArgParser& ap); 180 182 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); 182 184 static void do_show_pattern (const ArgParser& ap); 183 185 static void do_show_pattern_names (const ArgParser& ap); … … 186 188 static void do_show_project_author (const ArgParser& ap); 187 189 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); 189 191 static void do_show_set (const ArgParser& ap); 190 192 static void do_show_set_names (const ArgParser& ap); … … 192 194 static void do_show_sets (const ArgParser& ap); 193 195 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); 195 197 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); 197 199 static void do_show_version (const ArgParser& ap); 198 200 static void do_show_versions (const ArgParser& ap); … … 254 256 static void print_clean (PrintMode mode); 255 257 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 = ""); 257 261 static void print_symbol_names (PrintMode mode, const cmt_string& pattern = ""); 258 262 static void print_tabs (int tabs); -
CMT/HEAD/source/cmt_commands.cxx
r541 r547 584 584 } 585 585 } 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 } 586 614 else if (arg == "constituents_makefile") 587 615 { 588 616 fill_arguments (); 589 617 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; 590 623 } 591 624 else if (arg == "dependencies") … … 2235 2268 help_texts.add () = "build <option> : build actions. (Try cmt help build)"; 2236 2269 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)"; 2237 2271 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"; 2238 2273 help_texts.add () = "build dependencies : generate dependencies"; 2239 2274 help_texts.add () = "build library_links : build symbolic links towards all imported libraries"; … … 2335 2370 help.add (action_build, help_texts[action_build]); 2336 2371 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]); 2337 2373 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]); 2338 2375 help.add (action_build_dependencies, help_texts[action_build_dependencies]); 2339 2376 help.add (action_build_library_links, help_texts[action_build_library_links]); -
CMT/HEAD/source/cmt_generators.cxx
r527 r547 2524 2524 reset (); 2525 2525 2526 cmt_string file_name ;2526 cmt_string file_name, dir_name; 2527 2527 2528 2528 if (arguments.size () > 0) … … 2533 2533 arg.erase (0, 5); 2534 2534 file_name = arg; 2535 } 2536 else if (arg.substr (0, 8) == "-outdir=") 2537 { 2538 arg.erase (0, 8); 2539 dir_name = arg; 2535 2540 } 2536 2541 } … … 2550 2555 file_name += "make"; 2551 2556 } 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; 2552 2564 } 2553 2565 -
CMT/HEAD/source/cmt_parser.cxx
r541 r547 2106 2106 2107 2107 //---------------------------------------------------------- 2108 void 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 //---------------------------------------------------------- 2108 2242 void Cmt::do_build_constituents_makefile (const ArgParser& ap) 2109 2243 { … … 2114 2248 } 2115 2249 set_standard_macros (); 2250 2251 Generator::build_constituents_makefile (Me.m_current_package, ap.arguments); 2252 } 2253 2254 //---------------------------------------------------------- 2255 void 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 } 2116 2375 2117 2376 Generator::build_constituents_makefile (Me.m_current_package, ap.arguments); … … 4268 4527 4269 4528 //---------------------------------------------------------- 4270 void Cmt::do_show_path (const ArgParser& ap )4271 { 4272 Project::show_paths (ap.arguments );4529 void Cmt::do_show_path (const ArgParser& ap, ostream& out) 4530 { 4531 Project::show_paths (ap.arguments, out); 4273 4532 } 4274 4533 … … 4306 4565 4307 4566 //---------------------------------------------------------- 4308 void Cmt::do_show_setup (const ArgParser& ap) 4309 { 4310 cout << "----------> uses" << endl; 4311 do_show_uses (ap); 4567 void 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); 4312 4572 // This is temporary to ensure that Make - which runs "cmt show setup" - 4313 4573 // does not fail for packages with unresolved uses … … 4315 4575 CmtError::clear (); 4316 4576 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); 4322 4582 } 4323 4583 … … 4470 4730 4471 4731 //---------------------------------------------------------- 4472 void Cmt::do_show_tags (const ArgParser& /*ap*/ )4732 void Cmt::do_show_tags (const ArgParser& /*ap*/, ostream& out) 4473 4733 { 4474 4734 Tag::TagPtrVector tags = Tag::tags (); … … 4482 4742 if (tag != 0) 4483 4743 { 4484 tag->show (Me.m_quiet );4744 tag->show (Me.m_quiet, out); 4485 4745 } 4486 4746 } … … 4499 4759 4500 4760 //---------------------------------------------------------- 4501 void Cmt::do_show_uses (const ArgParser& /*ap*/ )4502 { 4503 Use::show_all ( );4761 void Cmt::do_show_uses (const ArgParser& /*ap*/, ostream& out) 4762 { 4763 Use::show_all (false, out); 4504 4764 } 4505 4765 … … 5982 6242 case action_broadcast : 5983 6243 case action_build_constituent_makefile : 6244 case action_build_constituent_config : 5984 6245 case action_build_constituents_makefile : 6246 case action_build_constituents_config : 5985 6247 case action_build_dependencies : 5986 6248 case action_build_library_links : … … 6095 6357 case action_broadcast : 6096 6358 case action_build_constituent_makefile : 6359 case action_build_constituent_config : 6097 6360 case action_build_constituents_makefile : 6361 case action_build_constituents_config : 6098 6362 case action_build_dependencies : 6099 6363 case action_build_library_links : … … 6200 6464 case action_broadcast : 6201 6465 case action_build_constituent_makefile : 6466 case action_build_constituent_config : 6202 6467 case action_build_constituents_makefile : 6468 case action_build_constituents_config : 6203 6469 case action_build_dependencies : 6204 6470 case action_build_library_links : … … 6317 6583 // case action_broadcast : 6318 6584 case action_build_constituent_makefile : 6585 case action_build_constituent_config : 6319 6586 case action_build_constituents_makefile : 6587 case action_build_constituents_config : 6320 6588 case action_build_dependencies : 6321 6589 case action_build_library_links : … … 6432 6700 do_build_constituent_makefile (ap); 6433 6701 break; 6702 case action_build_constituent_config : 6703 do_build_constituent_config (ap); 6704 break; 6434 6705 case action_build_constituents_makefile : 6435 6706 do_build_constituents_makefile (ap); 6707 break; 6708 case action_build_constituents_config : 6709 do_build_constituents_config (ap); 6436 6710 break; 6437 6711 case action_build_dependencies : … … 7051 7325 * in recursively read requirements files. 7052 7326 */ 7053 void Cmt::print_macros (PrintMode mode, const cmt_string& pattern) 7327 void Cmt::print_macros (PrintMode mode, const cmt_string& pattern, ostream& out) 7328 //void Cmt::print_macros (PrintMode mode, const cmt_string& pattern) 7054 7329 { 7055 7330 int number; … … 7084 7359 (symbol.type == Symbol::SymbolAction)) continue; 7085 7360 } 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)) 7087 7364 { 7088 7365 // Exclude scripts and actions … … 7098 7375 if (symbol.value_lists.size () < 1) continue; 7099 7376 7100 symbol.show_macro (mode); 7377 symbol.show_macro (mode, out); 7378 // symbol.show_macro (mode); 7101 7379 } 7102 7380 } … … 8247 8525 else 8248 8526 { 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) 8250 8529 CmtMessage::warning ("package " + import + 8251 8530 " cannot be imported (requested for " + -
CMT/HEAD/source/cmt_parser.h
r531 r547 223 223 224 224 action_build_constituent_makefile, 225 action_build_constituent_config, 225 226 action_build_constituents_makefile, 227 action_build_constituents_config, 226 228 action_build_dependencies, 227 229 action_build_library_links, -
CMT/HEAD/source/cmt_project.cxx
r541 r547 1423 1423 1424 1424 /*----------------------------------------------------------*/ 1425 void Project::show_paths (const CmtSystem::cmt_string_vector& arguments) 1425 void Project::show_paths (const CmtSystem::cmt_string_vector& arguments, 1426 ostream& out) 1426 1427 //void Project::show_paths () 1427 1428 { 1428 if (arguments.size () == 0) 1429 if (arguments.size () == 0 || 1430 Cmt::get_action () != action_show_path) 1429 1431 { 1430 1432 const ProjectPtrVector& Ordered = Project::ordered_projects (); … … 1439 1441 if (CmtSystem::test_directory (w)) 1440 1442 { 1441 cout << "# Add path " << w << " from " << s << endl;1443 out << "# Add path " << w << " from " << s << endl; 1442 1444 } 1443 1445 } … … 1456 1458 if (CmtSystem::test_directory (w)) 1457 1459 { 1458 cout << "# Create path " << w << " from " << s << endl;1460 out << "# Create path " << w << " from " << s << endl; 1459 1461 } 1460 1462 } -
CMT/HEAD/source/cmt_project.h
r541 r547 115 115 static void show_container (const cmt_string& path = ""); 116 116 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); 118 118 // static void show_paths (); 119 119 static const cmt_string& get_project_file_name (); -
CMT/HEAD/source/cmt_std.h
r274 r547 27 27 #include <iostream.h> 28 28 #include <fstream.h> 29 #include <sstream.h> 29 30 30 31 #define ios_base ios … … 37 38 #include <iostream> 38 39 #include <fstream> 40 #include <sstream> 39 41 40 42 #define cout std::cout … … 43 45 #define ofstream std::ofstream 44 46 #define ifstream std::ifstream 47 #define ostringstream std::ostringstream 45 48 #define istream std::istream 46 49 #define ostream std::ostream -
CMT/HEAD/source/cmt_symbol.cxx
r545 r547 719 719 720 720 if ((!Cmt::get_quiet ()) && 721 (action != action_build_tag_makefile)) 721 (action != action_build_constituents_config) && 722 (action != action_build_constituent_config)) 722 723 { 723 724 cmt_string s1; … … 1841 1842 1842 1843 //------------------------------------------------------------- 1843 void Symbol::show_macro (PrintMode mode) 1844 void Symbol::show_macro (PrintMode mode, ostream& out) 1845 //void Symbol::show_macro (PrintMode mode) 1844 1846 { 1845 1847 if (Cmt::get_debug ()) … … 1854 1856 if ((!Cmt::get_quiet ()) && 1855 1857 (action != action_build_tag_makefile) && 1858 (action != action_build_constituents_config) && 1859 (action != action_build_constituent_config) && 1856 1860 (action != action_show_macros) && 1857 1861 (action != action_show_actions) && 1858 1862 (action != action_show_sets)) 1859 1863 { 1860 cout << "#" << endl;1861 cout << "# Selection : " << endl;1864 out << "#" << endl; 1865 out << "# Selection : " << endl; 1862 1866 } 1863 1867 … … 1871 1875 (action == action_show_action) || 1872 1876 (action == action_build_tag_makefile) || 1877 (action == action_build_constituents_config) || 1878 (action == action_build_constituent_config) || 1873 1879 (action == action_load) || 1874 1880 (!Cmt::get_quiet ())) … … 1876 1882 if (mode == Make) 1877 1883 { 1878 cout << name << "=";1884 out << name << "="; 1879 1885 } 1880 1886 else 1881 1887 { 1882 cout << name << "='";1888 out << name << "='"; 1883 1889 } 1884 1890 } … … 1890 1896 expand (value); 1891 1897 } 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) 1893 1901 { 1894 1902 /* … … 1903 1911 } 1904 1912 1905 cout << value;1913 out << value; 1906 1914 1907 1915 if ((action == action_show_macro) || … … 1912 1920 (action == action_show_action) || 1913 1921 (action == action_build_tag_makefile) || 1922 (action == action_build_constituents_config) || 1923 (action == action_build_constituent_config) || 1914 1924 (action == action_load) || 1915 1925 (!Cmt::get_quiet ())) … … 1917 1927 if (mode != Make) 1918 1928 { 1919 cout << "'";1929 out << "'"; 1920 1930 } 1921 1931 #ifdef WIN32 1922 1932 else 1923 1933 { 1924 cout << " ";1934 out << " "; 1925 1935 } 1926 1936 #endif 1927 1937 } 1928 1938 1929 cout << endl;1939 out << endl; 1930 1940 } 1931 1941 } -
CMT/HEAD/source/cmt_symbol.h
r144 r547 120 120 cmt_string clean_macro_value () const; 121 121 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); 123 124 124 125 ValueBuilder* builder; -
CMT/HEAD/source/cmt_tag.cxx
r546 r547 716 716 717 717 /*----------------------------------------------------------*/ 718 void Tag::show_definition (bool quiet ) const718 void Tag::show_definition (bool quiet, ostream& out) const 719 719 { 720 720 static const cmt_string priority_text[] = { … … 730 730 if (m_name == "Default") return; 731 731 732 cout << m_name;732 out << m_name; 733 733 734 734 if (!quiet) … … 740 740 if (m_def_use != 0) 741 741 { 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 () << ")"; 745 745 } 746 746 } 747 747 else 748 748 { 749 cout << " (from " << m_context << ")";749 out << " (from " << m_context << ")"; 750 750 } 751 // cout << " (" << priority_text[m_priority] << ")";751 //out << " (" << priority_text[m_priority] << ")"; 752 752 753 753 if (m_tag_refs.size () > 0) … … 757 757 if (m_ref_uses.size () != 0) 758 758 { 759 cout << " package [";759 out << " package ["; 760 760 for (number = 0; number < m_ref_uses.size (); number++) 761 761 { 762 762 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 (); 765 765 } 766 cout << "]";766 out << "]"; 767 767 } 768 768 /* 769 769 if (m_set_use != 0) 770 770 { 771 cout << " package " << m_set_use->get_package_name ();771 out << " package " << m_set_use->get_package_name (); 772 772 } 773 773 */ 774 774 775 cout << " implies [";775 out << " implies ["; 776 776 777 777 for (number = 0; number < m_tag_refs.size (); number++) 778 778 { 779 779 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; 782 782 } 783 783 784 cout << "]";784 out << "]"; 785 785 } 786 786 … … 791 791 if (m_set_use != 0) 792 792 { 793 cout << " package " << m_set_use->get_package_name ();793 out << " package " << m_set_use->get_package_name (); 794 794 } 795 795 796 cout << " excludes [";796 out << " excludes ["; 797 797 798 798 for (number = 0; number < m_tag_excludes.size (); number++) 799 799 { 800 800 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; 803 803 } 804 804 805 cout << "]";805 out << "]"; 806 806 } 807 807 } 808 cout << endl;809 } 810 811 /*----------------------------------------------------------*/ 812 void Tag::show (bool quiet ) const813 { 814 if (is_primary () && is_selected ()) show_definition (quiet );808 out << endl; 809 } 810 811 /*----------------------------------------------------------*/ 812 void Tag::show (bool quiet, ostream& out) const 813 { 814 if (is_primary () && is_selected ()) show_definition (quiet, out); 815 815 } 816 816 -
CMT/HEAD/source/cmt_tag.h
r546 r547 52 52 void unmark (); 53 53 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; 56 58 bool is_selected () const; 57 59 bool is_primary () const; -
CMT/HEAD/source/cmt_use.cxx
r538 r547 364 364 365 365 //---------------------------------------------------------- 366 void Use::show_all (bool skip_discarded) 367 { 368 show_all ("use ", skip_discarded); 366 void Use::show_all (bool skip_discarded, ostream& out) 367 //void Use::show_all (bool skip_discarded) 368 { 369 show_all ("use ", skip_discarded, out); 369 370 } 370 371 … … 470 471 471 472 //---------------------------------------------------------- 472 void Use::show_all (const cmt_string& prefix, bool skip_discarded) 473 void Use::show_all (const cmt_string& prefix, bool skip_discarded, ostream& out) 474 //void Use::show_all (const cmt_string& prefix, bool skip_discarded) 473 475 { 474 476 static UsePtrVector& uses = get_ordered_uses (); … … 496 498 use = &(current ()); 497 499 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); 499 501 500 502 if (uses.size () > 0) … … 502 504 if (!Cmt::get_quiet ()) 503 505 { 504 cout << "#\n";505 cout << "# Selection :\n";506 out << "#\n"; 507 out << "# Selection :\n"; 506 508 } 507 509 … … 528 530 if (!Cmt::get_quiet ()) 529 531 { 530 cout << "# package " << use->get_package_name () <<532 out << "# package " << use->get_package_name () << 531 533 " " << use->version << " " << use->path << 532 534 " not found" << … … 549 551 } 550 552 551 cout << prefix << use->get_package_name ()553 out << prefix << use->get_package_name () 552 554 << " " << use->version; 553 555 … … 556 558 if (!Cmt::get_quiet ()) 557 559 { 558 cout << " (" << use->path << ")";560 out << " (" << use->path << ")"; 559 561 } 560 562 } 561 563 else 562 564 { 563 cout << " " << use->path;565 out << " " << use->path; 564 566 } 565 567 566 568 if (!Cmt::get_quiet ()) 567 569 { 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)"; 570 572 } 571 573 572 cout << endl;574 out << endl; 573 575 } 574 576 } … … 577 579 if (suse != 0 && !suse->discarded && !suse->m_hidden && suse->located ()) 578 580 { 579 cout << prefix << suse->get_package_name ()581 out << prefix << suse->get_package_name () 580 582 << " " << suse->version; 581 583 if (!Cmt::get_quiet ()) 582 584 { 583 cout << " (" << suse->path << ")";584 } 585 cout << endl;585 out << " (" << suse->path << ")"; 586 } 587 out << endl; 586 588 } 587 589 suse = Use::find (CmtSystem::get_user_context_package ()); 588 590 if (suse != 0 && !suse->discarded && !suse->m_hidden && suse->located ()) 589 591 { 590 cout << prefix << suse->get_package_name ()592 out << prefix << suse->get_package_name () 591 593 << " " << suse->version; 592 594 if (!Cmt::get_quiet ()) 593 595 { 594 cout << " (" << suse->path << ")";595 } 596 cout << endl;596 out << " (" << suse->path << ")"; 597 } 598 out << endl; 597 599 } 598 600 /* 599 601 if (Cmt::get_cmt_home () != "") 600 602 { 601 cout << prefix << CmtSystem::get_home_package () << " v0";603 out << prefix << CmtSystem::get_home_package () << " v0"; 602 604 if (!Cmt::get_quiet ()) 603 605 { 604 cout << " (" << Cmt::get_cmt_home () << ")";605 } 606 cout << endl;606 out << " (" << Cmt::get_cmt_home () << ")"; 607 } 608 out << endl; 607 609 } 608 610 609 611 if (Cmt::get_cmt_user_context () != "") 610 612 { 611 cout << prefix << CmtSystem::get_user_context_package () << " v0";613 out << prefix << CmtSystem::get_user_context_package () << " v0"; 612 614 if (!Cmt::get_quiet ()) 613 615 { 614 cout << " (" << Cmt::get_cmt_user_context () << ")";615 } 616 cout << endl;616 out << " (" << Cmt::get_cmt_user_context () << ")"; 617 } 618 out << endl; 617 619 } 618 620 */ … … 3951 3953 3952 3954 //---------------------------------------------------------- 3953 void Use::show_sub_uses (const cmt_string& request, bool skip_discarded) 3955 void 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) 3954 3957 { 3955 3958 Use* current = &(Use::current ()); … … 3963 3966 if (level > 0) 3964 3967 { 3965 cout << "# ";3966 for (n = 0; n < (level-1); n++) cout << " ";3968 out << "# "; 3969 for (n = 0; n < (level-1); n++) out << " "; 3967 3970 3968 3971 if (request == "") 3969 3972 { 3970 cout << "use " << get_package_name () << " " << specified_version;3973 out << "use " << get_package_name () << " " << specified_version; 3971 3974 3972 3975 if (this == current) 3973 3976 { 3974 cout << " (current)";3977 out << " (current)"; 3975 3978 } 3976 3979 else 3977 3980 { 3978 if (specified_path != "") cout << " " << specified_path;3981 if (specified_path != "") out << " " << specified_path; 3979 3982 } 3980 3983 } 3981 3984 else 3982 3985 { 3983 cout << "use " << request;3986 out << "use " << request; 3984 3987 } 3985 3988 3986 3989 if (version_alias != "") 3987 3990 { 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)"; 3998 4001 3999 4002 if (m_has_native_version) … … 4006 4009 { 4007 4010 cmt_string value = s->resolve_macro_value (); 4008 cout << " (native_version=" << value << ")";4011 out << " (native_version=" << value << ")"; 4009 4012 } 4010 4013 } 4011 4014 4012 cout << endl;4015 out << endl; 4013 4016 } 4014 4017 … … 4030 4033 use->auto_imports = sub_use_auto_imports[n]; 4031 4034 4032 use->show_sub_uses (request, skip_discarded );4035 use->show_sub_uses (request, skip_discarded, out); 4033 4036 4034 4037 use->initial_scope = saved_scope; -
CMT/HEAD/source/cmt_use.h
r536 r547 46 46 static void select_clients (const cmt_string& package, 47 47 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); 50 53 51 54 static Use& current (); … … 185 188 bool is_client (const cmt_string& package, 186 189 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); 188 193 bool select_alternate (); 189 194 Use* get_selected_version (); -
CMT/HEAD/src/Makefile.header
r535 r547 31 31 # Generic entry points for all targets 32 32 # 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) $@ 40 default :: all ; 38 41 39 42 check_config :: 40 43 @$(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 \ 44 45 test -z "$(cmtmsg)" || \ 45 46 echo "$(CMTMSGPREFIX)" "(Makefile.header) Configuration error(s). Please correct" >&2; \ 46 fi 47 fi; exit $${retval} 47 48 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 50 59 51 60 binclean :: … … 58 67 fi 59 68 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 63 73 64 74 .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 67 80 # @$(MAKE) --no-print-directory target="config $@" common_target 68 81 … … 70 83 # Capture all possible targets 71 84 # 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) 75 87 76 $(cmt_constituents_makefile) : $(cmt_local_tagfile) 88 #$(cmt_constituents_makefile) : $(cmt_local_tagfile) 89 90 ifndef QUICK 91 $(cmt_constituents_makefile) : check_config 92 else 93 $(cmt_constituents_makefile) : 94 endif 77 95 $(echo) "(Makefile.header) Rebuilding $@"; \ 78 96 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=$@; \ 80 98 retval=$$?; \ 81 if test $${retval} !=0; then \99 if test $${retval} -ne 0; then \ 82 100 test -z "$(cmtmsg)" || \ 83 101 echo "$(CMTMSGPREFIX)" "(Makefile.header) Cannot generate $@" >&2; \ … … 103 121 \rm $(cmt_local_setup); else \ 104 122 \mv -f $(cmt_local_setup) $(cmt_final_setup); fi 105 106 # && /bin/echo $@ ok107 # $(echo) CMTCONFIG=$(CMTCONFIG) ; \108 #109 123 110 124 # … … 150 164 # explicit rule not to remake 151 165 ${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 77 77 !if [$(echo) (NMakefile.header) Rebuilding $(cmt_constituents_makefile)] == 0 78 78 !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 80 81 !endif 81 82
Note: See TracChangeset
for help on using the changeset viewer.