- Timestamp:
- Nov 18, 2008, 12:28:03 PM (16 years ago)
- Location:
- CMT/HEAD
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
CMT/HEAD/ChangeLog
r473 r474 1 2008-11-18 <rybkin@lal.in2p3.fr> 375 2 3 * source/cmt_generator.h: Introduce function CmtGenerator::fill_names_outputs 4 in order to fill the Make LINE macro taking in account the constituent 5 -k=regexp, -x=regexp options 6 * source/cmt_generator.cxx: Implement the CmtGenerator::fill_names_outputs 7 function 8 * source/cmt_generators.cxx: Make use of the CmtGenerator::fill_names_outputs 9 function to fill m_LINE. In function DependencyGenerator::build, allow for 10 the options specification Windows style (/option[:value]) as the Windows 11 command shell may not pass on -option=value with the = character 12 * mgr/fragments/dependencies: Restore passing the arguments on to the 13 $(build_dependencies) command (via $(LINE)) to allow for external tool use 14 * mgr/fragments/nmake/dependencies: idem, use the -out:file option (rather 15 than -out=file) 16 * mgr/cmt_build_deps.sh: Add and implement options -no_stamps (creating 17 stamps if not specified), -out=<dependencies file>. 18 Use the same preprocessor flags as those used in fragments c, c_library, 19 cpp, cpp_library. Treat the files with non-C or non-C++ extensions as C++ 20 files. Allow for the use of macro c_pp to specify the C preprocessor (the 21 tool used by default is cpp -M) 22 * mgr/cmt_filter3_version.sh: Minor correction in the description 23 * mgr/cmt_lsb_system_version.sh: Add script to retrieve the Linux 24 distribution info on LSB conformant systems in the format <distro>-<version> 25 * mgr/cmt_filter1_version.sh: Add script to keep the major version only (in 26 tags) 27 1 28 2008-11-02 <rybkin@lal.in2p3.fr> 374 2 29 -
CMT/HEAD/mgr/cmt_build_deps.sh
r79 r474 3 3 # 4 4 # This shell script emulates the behaviour of the 'cmt buid dependencies' operation 5 # but using cpp -Minstead5 # but using the tool specified by the $(c_pp) macro (or cpp -M) instead 6 6 # 7 7 #=============================================================== … … 16 16 # ends with a dependency to the stamp file 17 17 18 a=`eval cpp -M ${allflags} ${file} | \ 18 if [ -z "$c_pp" ]; then 19 c_pp="cpp -M" 20 fi 21 22 a=`eval ${c_pp} ${allflags} ${file} | \ 19 23 sed -e 's#[.]o:#_'"${suffix}"'_dependencies = #' -e 's#[\\]$##'` 20 24 21 25 if test ! `echo ${a} | wc -w` = "0"; then 22 echo -n ${a}26 line="`echo ${a}`" 23 27 else 24 echo -n"${file_name}_${suffix}_dependencies = ${file}"28 line="${file_name}_${suffix}_dependencies = ${file}" 25 29 fi 26 30 27 echo " \$(bin)${constituent}_deps/${file_name}_${suffix}.stamp" 31 if [ "$no_stamps" != yes ]; then 32 stamp_output_base=${constituent}_deps/${file_name}_${suffix}.stamp 33 stamp_output=${bin}${stamp_output_base} 34 line="${line} \$(bin)${stamp_output_base}" 28 35 29 36 # create or update the stamp file 30 31 touch ${bin}/${constituent}_deps/${file_name}_${suffix}.stamp 37 if [ -f "${stamp_output}" ]; then 38 read old_stamp <${stamp_output} 39 if [ "${line}" != "${old_stamp}" ]; then 40 /bin/rm -f ${stamp_output} 41 printf "${line}\n" >${stamp_output} 42 fi 43 else 44 printf "${line}\n" >${stamp_output} 45 fi 46 47 #touch ${bin}/${constituent}_deps/${file_name}_${suffix}.stamp 48 fi 49 printf "${line}\n" 32 50 } 33 51 … … 37 55 name=$1 38 56 shift 39 40 grep "^${name}=" ${tempmacros} | sed -e "s#^${name}=##"57 sed -n '/^'${name}'=/{s#^'${name}'=##p;q}' ${tempmacros} 58 # grep "^${name}=" ${tempmacros} | sed -e "s#^${name}=##" 41 59 } 42 60 … … 60 78 # Expected arguments: 61 79 # 1 : <constituent name> 62 # 2 : -all_sources80 # 2 : [ options: -all_sources | -no_stamps | -out=<dependencies file> ] 63 81 # 3... : <source file list> 64 82 # 65 83 #------------------------------------------------------------------------------------------ 66 84 85 [ $# -gt 0 ] || exit 67 86 constituent=$1 68 87 shift 69 88 70 all_sources=$1 71 shift 72 73 files=$* 89 n=0 90 for f; do 91 case ${f} in 92 -all_sources) all_sources=yes; n=`expr $n + 1` ;; 93 -no_stamps) no_stamps=yes; n=`expr $n + 1` ;; 94 -out=*) output=`expr "$f" : '-out=\(.*\)'`; n=`expr $n + 1` ;; 95 *) break ;; 96 esac 97 done 98 shift $n 74 99 75 100 #--------------- … … 77 102 # 78 103 tempprefix=/tmp/CMT$$ 79 if test ! "${TMP }" = ""; then80 tempprefix=${TMP }/CMT$$104 if test ! "${TMPDIR}" = ""; then 105 tempprefix=${TMPDIR}/CMT$$ 81 106 fi 82 107 … … 96 121 prepare_context 97 122 123 type=`cmt show constituent ${constituent} | cut -d' ' -f1` 124 case "${type}" in 125 application) type=app ;; 126 library) type=lib ;; 127 document) type=doc ;; 128 esac 129 98 130 incl=`macro_value includes` 99 131 100 132 cflags=`macro_value cflags` 133 pp_cflags=`macro_value pp_cflags` 134 use_pp_cflags=`macro_value use_pp_cflags` 135 const_pp_cflags=`macro_value ${constituent}_pp_cflags` 136 type_pp_cflags=`macro_value ${type}_${constituent}_pp_cflags` 137 use_cflags=`macro_value use_cflags` 101 138 const_cflags=`macro_value ${constituent}_cflags` 102 const_pp_cflags=`macro_value ${constituent}_pp_cflags`139 type_const_cflags=`macro_value ${type}_${constituent}_cflags` 103 140 104 141 cppflags=`macro_value cppflags` 142 pp_cppflags=`macro_value pp_cppflags` 143 use_pp_cppflags=`macro_value use_pp_cppflags` 144 const_pp_cppflags=`macro_value ${constituent}_pp_cppflags` 145 type_pp_cppflags=`macro_value ${type}_${constituent}_pp_cppflags` 146 use_cppflags=`macro_value use_cppflags` 105 147 const_cppflags=`macro_value ${constituent}_cppflags` 106 const_pp_cppflags=`macro_value ${constituent}_pp_cppflags` 107 108 bin=`macro_value bin` 148 type_const_cppflags=`macro_value ${type}_${constituent}_cppflags` 149 150 c_pp=`macro_value c_pp` 151 152 if [ "$output" ]; then 153 bin=`dirname $output`/ 154 elif [ -z "$bin" ]; then 155 bin=`macro_value bin` 156 fi 109 157 #-------------- 110 158 … … 112 160 # Prepare the directory for the stamp files 113 161 # 162 if [ "$no_stamps" != yes ]; then 114 163 mkdir -p ${bin}/${constituent}_deps 164 fi 115 165 #-------------- 116 166 … … 118 168 # Prepare the dependency file 119 169 # 170 if [ -z "$output" ]; then 120 171 output=${bin}${constituent}_dependencies.make 172 fi 121 173 #-------------- 122 174 … … 124 176 # Loop over source files (if any) 125 177 # 126 for f in `echo ${files}`; do178 for f; do 127 179 suffix=`echo ${f} | sed -e 's#.*[.]##'` 128 180 file_name=`basename ${f} .${suffix}` … … 130 182 # First remove the old dependency line from the output 131 183 184 if [ "$all_sources" != yes ]; then 132 185 if test -f ${output}; then 133 grep -v "${file_name}_${suffix}_dependencies" ${output} >t$$; mv t$$ ${output} 186 grep -v "${file_name}_${suffix}_dependencies" ${output} >${tempprefix}/t$$ 187 mv ${tempprefix}/t$$ ${output} 134 188 fi 135 136 echo "computing dependencies for ${file_name}.${suffix}"189 fi 190 # echo "computing dependencies for ${file_name}.${suffix}" 137 191 138 192 case ${suffix} in 139 c ) allflags="${incl} ${cflags} ${const_cflags} ${const_cpp_cflags}";; 140 C|cc|cxx|cpp ) allflags="${incl} ${cppflags} ${const_cppflags} ${const_cpp_cppflags}";; 193 c ) allflags="${incl} ${cflags} ${pp_cflags} ${use_pp_cflags} ${const_pp_cflags} ${type_pp_cflags} ${use_cflags} ${const_cflags} ${type_const_cflags}" ;; 194 C|cc|cxx|cpp ) allflags="${incl} ${cppflags} ${pp_cppflags} ${use_pp_cppflags} ${const_pp_cppflags} ${type_pp_cppflags} ${use_cppflags} ${const_cppflags} ${type_const_cppflags}" ;; 195 * ) allflags="-x c++ ${incl} ${cppflags} ${pp_cppflags} ${use_pp_cppflags} ${const_pp_cppflags} ${type_pp_cppflags} ${use_cppflags} ${const_cppflags} ${type_const_cppflags}" ;; 196 # c ) allflags="${incl} ${cflags} ${const_cflags} ${const_cpp_cflags}";; 197 # C|cc|cxx|cpp ) allflags="${incl} ${cppflags} ${const_cppflags} ${const_cpp_cppflags}";; 141 198 esac 142 143 echo "cpp -M ${allflags} ${f}"144 199 145 200 compute_dependencies ${f} >>${output} 146 201 done 147 202 #-------------- 148 149 150 -
CMT/HEAD/mgr/cmt_filter3_version.sh
r465 r474 12 12 # <some letters><field1><field2><field3> 13 13 # 14 # o only the first t wonumeric fields are kept14 # o only the first three numeric fields are kept 15 15 # o separators ('-' or '.') are all filtered out 16 16 # -
CMT/HEAD/mgr/fragments/dependencies
r469 r474 7 7 $(bin)${CONSTITUENT}_dependencies.make : ${LINE} $(use_requirements) $(cmt_final_setup_${CONSTITUENT}) 8 8 $(echo) "(${CONSTITUENT}.make) Rebuilding $@"; \ 9 $(build_dependencies) ${CONSTITUENT} -all_sources -out=$@ 9 $(build_dependencies) ${CONSTITUENT} -all_sources -out=$@ ${LINE} 10 10 endif 11 11 -
CMT/HEAD/mgr/fragments/nmake/dependencies
r472 r474 4 4 5 5 !if exist ("$(CMTROOT)/$(CMTBIN)/cmt.exe") 6 !if [$(build_dependencies) ${CONSTITUENT} -all_sources -out =$(bin)${CONSTITUENT}_dependencies.nmake] == 06 !if [$(build_dependencies) ${CONSTITUENT} -all_sources -out:$(bin)${CONSTITUENT}_dependencies.nmake ${LINE}] == 0 7 7 !endif 8 8 !else -
CMT/HEAD/source/cmt_generator.cxx
r467 r474 316 316 317 317 //-------------------------------------------------- 318 void CmtGenerator::fill_names_outputs () 319 { 320 bool first = true; 321 322 m_LINE = ""; 323 m_OBJS = ""; 324 325 for (int i = 0; i < m_source_files.size (); i++) 326 { 327 const SourceFile& file = m_source_files[i]; 328 const cmt_string name = file.name (); 329 const cmt_string output = file.output (); 330 331 if (output != "") 332 { 333 if (first) 334 { 335 first = false; 336 } 337 else 338 { 339 m_LINE += " "; 340 m_OBJS += " "; 341 } 342 m_LINE += name; 343 m_OBJS += output; 344 } 345 346 if (Cmt::get_debug ()) 347 { 348 cout << "CmtGenerator::fill_names_ outputs>" << endl; 349 cout << "name=" << name << " LINE=" << m_LINE << endl; 350 cout << "output=" << output << " OBJS=" << m_OBJS << endl; 351 } 352 } 353 } 354 355 //-------------------------------------------------- 318 356 void CmtGenerator::fill_outputs () 319 357 { -
CMT/HEAD/source/cmt_generator.h
r466 r474 56 56 void terminate (); 57 57 58 void fill_names_outputs (); 58 59 void fill_outputs (); 59 60 -
CMT/HEAD/source/cmt_generators.cxx
r469 r474 351 351 filter_path (m_FILEPATH.value); 352 352 353 /* 353 354 m_LINE = m_FULLNAME.value; 354 355 m_LINE += " "; 356 */ 355 357 356 358 filter_path (m_FULLNAME.value); 357 filter_path (m_LINE.value);359 // filter_path (m_LINE.value); 358 360 359 361 CmtSystem::get_suffix (name, m_FILESUFFIX.value); … … 394 396 if (m_PACKOS9) 395 397 { 396 os9sources += m_LINE; 398 // os9sources += m_LINE; 399 os9sources += m_FULLNAME.value; 397 400 os9sources += " "; 398 401 } … … 464 467 const cmt_vector<cmt_regexp>& selects = constituent.select_exprs; 465 468 466 m_LINE = "";469 // m_LINE = ""; 467 470 468 471 for (i = 0; i < sources.size (); i++) … … 496 499 } 497 500 501 /* 498 502 if (count > 0) 499 503 { … … 501 505 m_LINE += " "; 502 506 } 503 } 504 505 fill_outputs (); 507 */ 508 } 509 510 fill_names_outputs (); 511 //fill_outputs (); 506 512 507 513 prepare_use_context (); … … 942 948 const cmt_vector<cmt_regexp>& selects = constituent.select_exprs; 943 949 944 m_LINE = "";950 // m_LINE = ""; 945 951 946 952 for (i = 0; i < sources.size (); i++) … … 960 966 filter_path (full_name); 961 967 968 /* 962 969 if (count > 0) 963 970 { … … 965 972 m_LINE += " "; 966 973 } 974 */ 967 975 968 976 for (int j = 0; j < files.size (); j++) … … 977 985 } 978 986 979 fill_outputs (); 987 fill_names_outputs (); 988 // fill_outputs (); 980 989 981 990 prepare_use_context (); … … 2743 2752 // Get rid of files that may come from the makefile fragment 2744 2753 if (file_name.find ("requirements") != cmt_string::npos) source_number--; 2745 else if (file_name.substr (0, 5) == "-out=") 2746 { 2747 if (!all_sources) source_number--; 2754 else if (file_name.substr (0, 5) == "-out=" || 2755 file_name.substr (0, 5) == "-out:" || 2756 file_name.substr (0, 5) == "/out:" || 2757 file_name.substr (0, 5) == "/out=") 2758 { 2759 source_number--; 2748 2760 file_name.erase (0, 5); 2749 2761 m_output_file_name = file_name; 2750 2762 } 2751 2763 else if (file_name.find (".make") != cmt_string::npos) source_number--; 2752 else if (file_name == "-all_sources") 2764 else if (file_name == "-all_sources" || 2765 file_name == "/all_sources") 2753 2766 { 2754 2767 source_number = sources.size (); 2755 2768 all_sources = true; 2756 2769 } 2757 else if (file_name == "-no_stamps") 2758 { 2759 if (!all_sources) source_number--; 2770 else if (file_name == "-no_stamps" || 2771 file_name == "/no_stamps") 2772 { 2773 source_number--; 2760 2774 m_stamps = false; 2761 2775 }
Note: See TracChangeset
for help on using the changeset viewer.