projects/generate
changeset 8905 a6974b6041d9
parent 8393 302798e32478
child 10175 1119f6640ee6
equal deleted inserted replaced
8904:816692cc79fd 8905:a6974b6041d9
    22 
    22 
    23 # openttd_vs80.sln    is for MSVC 2005
    23 # openttd_vs80.sln    is for MSVC 2005
    24 # openttd_vs80.vcproj is for MSVC 2005
    24 # openttd_vs80.vcproj is for MSVC 2005
    25 # langs_vs80.vcproj   is for MSVC 2005
    25 # langs_vs80.vcproj   is for MSVC 2005
    26 # strgen_vs80.vcproj  is for MSVC 2005
    26 # strgen_vs80.vcproj  is for MSVC 2005
    27 
       
    28 # openttd.sln         is for MSVC 2003
       
    29 # openttd.vcproj      is for MSVC 2003
       
    30 # langs.vcproj        is for MSVC 2003
       
    31 # strgen.vcproj       is for MSVC 2003
       
    32 
       
    33 # openttd.tgt         is for WatCom
       
    34 
    27 
    35 
    28 
    36 
    29 
    37 # First, collect the list of Windows files
    30 # First, collect the list of Windows files
    38 sdl_config="1"
    31 sdl_config="1"
   108 					first_time = 1;
   101 					first_time = 1;
   109 				}
   102 				}
   110 
   103 
   111 				print "		<Filter";
   104 				print "		<Filter";
   112 				print "			Name=\\""$0"\\"";
   105 				print "			Name=\\""$0"\\"";
   113 				print "			Filter=\\"\\">";
   106 				print "			>";
   114 			}
   107 			}
   115 
   108 
   116 			next;
   109 			next;
   117 		}
   110 		}
   118 		/^$/ { next }
   111 		/^$/ { next }
   119 		{
   112 		{
   120 			if (deep == skip) {
   113 			if (deep == skip) {
   121 				gsub("	", "", $0);
   114 				gsub("	", "", $0);
   122 				gsub("/", "\\\\", $0);
   115 				gsub("/", "\\\\", $0);
   123 				print "			<File";
   116 				print "			<File";
   124 				print "				RelativePath=\\".\\\\'$file_prefix'"$0"\\">";
   117 				print "				RelativePath=\\".\\\\'$file_prefix'"$0"\\"";
       
   118 				print "				>";
   125 				print "			</File>";
   119 				print "			</File>";
   126 			}
   120 			}
   127 		}
   121 		}
   128 		END { print "		</Filter>"; }
   122 		END { print "		</Filter>"; }
   129 	'`"
   123 	'`"
   136 	for i in `ls $1`
   130 	for i in `ls $1`
   137 	do
   131 	do
   138 		i=`basename $i | sed s/.txt$//g`
   132 		i=`basename $i | sed s/.txt$//g`
   139 		RES="$RES
   133 		RES="$RES
   140 		<File
   134 		<File
   141 			RelativePath=\"..\\src\\lang\\"$i".txt\">
   135 			RelativePath=\"..\\src\\lang\\"$i".txt\"
       
   136 			>
   142 			<FileConfiguration
   137 			<FileConfiguration
   143 				Name=\"Debug|Win32\">
   138 				Name=\"Debug|Win32\"
       
   139 				>
   144 				<Tool
   140 				<Tool
   145 					Name=\"VCCustomBuildTool\"
   141 					Name=\"VCCustomBuildTool\"
   146 					Description=\"Generating "$i" language file\"
   142 					Description=\"Generating "$i" language file\"
   147 					CommandLine=\"..\\objs\\strgen\\strgen.exe -s ..\\src\\lang -d ..\\bin\\lang &quot;\$(InputPath)&quot;&#x0D;&#x0A;\"
   143 					CommandLine=\"..\\objs\\strgen\\strgen.exe -s ..\\src\\lang -d ..\\bin\\lang &quot;\$(InputPath)&quot;&#x0D;&#x0A;\"
   148 					AdditionalDependencies=\"\"
   144 					AdditionalDependencies=\"\"
   149 					Outputs=\"..\\bin\\lang\\"$i".lng\"/>
   145 					Outputs=\"..\\bin\\lang\\"$i".lng\"
       
   146 				/>
   150 			</FileConfiguration>
   147 			</FileConfiguration>
   151 		</File>"
   148 		</File>"
   152 	done
   149 	done
   153 
   150 
   154 	eval "$2=\"\$RES\""
   151 	eval "$2=\"\$RES\""
   163 		{
   160 		{
   164 			if (stop == 0) { print $0 }
   161 			if (stop == 0) { print $0 }
   165 		}
   162 		}
   166 	' > "$ROOT_DIR/projects/$2"
   163 	' > "$ROOT_DIR/projects/$2"
   167 
   164 
   168 	# The files-list
   165 	echo "$1" >> "$ROOT_DIR/projects/$2"
   169 	echo "$1" | awk -v type="$3" '
       
   170 		/&#x0D;&#x0A;/ {
       
   171 			if (type == "msvc2003") gsub("&#x0D;&#x0A;", "\n", $0);
       
   172 		}
       
   173 		/Filter="">/ {
       
   174 			if (type == "msvc2005") gsub("Filter=\"\">", ">", $0);
       
   175 		}
       
   176 		/"\/>/ {
       
   177 			if (type == "msvc2005") gsub("/>", "\n" substr($0, 1, index($0, $1) - 2) "/>", $0);
       
   178 		}
       
   179 		/">/ {
       
   180 			if (type == "msvc2005") gsub(">", "\n" substr($0, 1, index($0, $1) - 1) ">", $0);
       
   181 		}
       
   182 		{ print $0 }
       
   183 	' >> "$ROOT_DIR/projects/$2"
       
   184 
   166 
   185 	# Everything below the !!FILES!! marker
   167 	# Everything below the !!FILES!! marker
   186 	cat "$ROOT_DIR/projects/$2".in | tr '\r' '\n' | awk '
   168 	cat "$ROOT_DIR/projects/$2".in | tr '\r' '\n' | awk '
   187 		BEGIN { stop = 1; }
   169 		BEGIN { stop = 1; }
   188 		/^$/ { next }
   170 		/^$/ { next }
   197 safety_check "$ROOT_DIR/source.list"
   179 safety_check "$ROOT_DIR/source.list"
   198 
   180 
   199 load_main_data "$ROOT_DIR/source.list" openttd
   181 load_main_data "$ROOT_DIR/source.list" openttd
   200 load_lang_data "$ROOT_DIR/src/lang/*.txt" lang
   182 load_lang_data "$ROOT_DIR/src/lang/*.txt" lang
   201 
   183 
   202 generate "$openttd" "openttd.vcproj"      "msvc2003"
   184 generate "$openttd" "openttd_vs80.vcproj"
   203 generate "$openttd" "openttd_vs80.vcproj" "msvc2005"
   185 generate "$openttd" "openttd_vs90.vcproj"
   204 generate "$openttd" "openttd_vs90.vcproj" "msvc2005"
   186 generate "$lang" "langs_vs80.vcproj"
   205 generate "$lang" "langs.vcproj"           "msvc2003"
   187 generate "$lang" "langs_vs90.vcproj"
   206 generate "$lang" "langs_vs80.vcproj"      "msvc2005"
       
   207 generate "$lang" "langs_vs90.vcproj"      "msvc2005"