equal
deleted
inserted
replaced
29 |
29 |
30 |
30 |
31 |
31 |
32 # First, collect the list of Windows files |
32 # First, collect the list of Windows files |
33 sdl_config="1" |
33 sdl_config="1" |
|
34 png_config="1" |
34 os="MSVC" |
35 os="MSVC" |
35 enable_dedicated="0" |
36 enable_dedicated="0" |
36 with_cocoa="0" |
37 with_cocoa="0" |
37 enable_directmusic="1" |
38 enable_directmusic="1" |
38 file_prefix="..\\\\src\\\\" |
39 file_prefix="..\\\\src\\\\" |
|
40 |
|
41 safety_check() { |
|
42 li="" |
|
43 for i in `cat $1 | grep -v "#\|ottdres.rc\|win32.cpp\|win32_v.cpp" | xargs -n 1 basename | sort`; do |
|
44 if [ "$li" = "$i" ]; then |
|
45 echo " !! ERROR !!" |
|
46 echo "" |
|
47 echo "The filename '$i' is already used in this project." |
|
48 echo "Because MSVC uses one single directory for all object files, it" |
|
49 echo "cannot handle filenames with the same name inside the same project." |
|
50 echo "Please rename either one of the file and try generating again." |
|
51 echo "" |
|
52 echo " !! ERROR !!" |
|
53 exit 1 |
|
54 fi |
|
55 li="$i" |
|
56 done |
|
57 } |
39 |
58 |
40 load_main_data() { |
59 load_main_data() { |
41 # Read the source.list and process it |
60 # Read the source.list and process it |
42 RES="`cat $1 | tr '\r' '\n' | awk ' |
61 RES="`cat $1 | tr '\r' '\n' | awk ' |
43 /^( *)#end/ { if (deep == skip) { skip -= 1; } deep -= 1; next; } |
62 /^( *)#end/ { if (deep == skip) { skip -= 1; } deep -= 1; next; } |
50 if (deep != skip) { deep += 1; next; } |
69 if (deep != skip) { deep += 1; next; } |
51 |
70 |
52 deep += 1; |
71 deep += 1; |
53 |
72 |
54 if ($0 == "SDL" && "'$sdl_config'" == "") { next; } |
73 if ($0 == "SDL" && "'$sdl_config'" == "") { next; } |
|
74 if ($0 == "PNG" && "'$png_config'" == "") { next; } |
55 if ($0 == "OSX" && "'$os'" != "OSX") { next; } |
75 if ($0 == "OSX" && "'$os'" != "OSX") { next; } |
56 if ($0 == "OS2" && "'$os'" != "OS2") { next; } |
76 if ($0 == "OS2" && "'$os'" != "OS2") { next; } |
57 if ($0 == "PSP" && "'$os'" != "PSP") { next; } |
77 if ($0 == "PSP" && "'$os'" != "PSP") { next; } |
58 if ($0 == "DEDICATED" && "'$enable_dedicated'" != "1") { next; } |
78 if ($0 == "DEDICATED" && "'$enable_dedicated'" != "1") { next; } |
59 if ($0 == "COCOA" && "'$with_cocoa'" == "0") { next; } |
79 if ($0 == "COCOA" && "'$with_cocoa'" == "0") { next; } |
165 if (stop == 2) { stop = 0 } |
185 if (stop == 2) { stop = 0 } |
166 } |
186 } |
167 ' >> "$ROOT_DIR/projects/$2" |
187 ' >> "$ROOT_DIR/projects/$2" |
168 } |
188 } |
169 |
189 |
|
190 safety_check "$ROOT_DIR/source.list" |
|
191 |
170 load_main_data "$ROOT_DIR/source.list" openttd |
192 load_main_data "$ROOT_DIR/source.list" openttd |
171 load_lang_data "$ROOT_DIR/src/lang/*.txt" lang |
193 load_lang_data "$ROOT_DIR/src/lang/*.txt" lang |
172 |
194 |
173 generate "$openttd" "openttd.vcproj" "msvc2003" |
195 generate "$openttd" "openttd.vcproj" "msvc2003" |
174 generate "$openttd" "openttd_vs80.vcproj" "msvc2005" |
196 generate "$openttd" "openttd_vs80.vcproj" "msvc2005" |