Mercurial > projects > dwt2
comparison rakefile @ 70:1a69be0afe99
Rakefile clean up for -J
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 08 Apr 2009 22:13:21 +0200 |
parents | 5ce9278ca82c |
children | 0a55d2d5a946 |
comparison
equal
deleted
inserted
replaced
69:bf0426bfc6e0 | 70:1a69be0afe99 |
---|---|
24 ########################################################################## | 24 ########################################################################## |
25 # Constants | 25 # Constants |
26 # | 26 # |
27 DIR_OBJ = File.expand_path("obj") | 27 DIR_OBJ = File.expand_path("obj") |
28 DIR_IMP = File.expand_path("imp") | 28 DIR_IMP = File.expand_path("imp") |
29 DIR_RES = File.expand_path("res") | |
29 DIR_LIB = File.expand_path("lib") | 30 DIR_LIB = File.expand_path("lib") |
30 DIR_BIN = File.expand_path("bin") | 31 DIR_BIN = File.expand_path("bin") |
31 FILE_RSP = File.expand_path("rsp") | 32 FILE_RSP = File.expand_path("rsp") |
32 ALL_RESDIRS = [ "base/res", "res" ] | |
33 | 33 |
34 LOG_STDOUT = File.expand_path("olog.txt") | 34 LOG_STDOUT = File.expand_path("olog.txt") |
35 LOG_STDERR = File.expand_path("elog.txt") | 35 LOG_STDERR = File.expand_path("elog.txt") |
36 | 36 |
37 | 37 |
50 EXEEXT = "" | 50 EXEEXT = "" |
51 PROG_LIB = "ar" | 51 PROG_LIB = "ar" |
52 end | 52 end |
53 PROG_DMD = "dmd#{EXEEXT}" | 53 PROG_DMD = "dmd#{EXEEXT}" |
54 | 54 |
55 ALL_RESDIRS << File.join(BASEDIR_SWT, "res" ) | |
56 | |
57 if isWindows | 55 if isWindows |
56 #LIBNAMES_BASIC = [ "dwt-base" ] | |
58 LIBNAMES_BASIC = [ "advapi32", "comctl32", "comdlg32", "gdi32", "kernel32", | 57 LIBNAMES_BASIC = [ "advapi32", "comctl32", "comdlg32", "gdi32", "kernel32", |
59 "shell32", "ole32", "oleaut32", "olepro32", "oleacc", | 58 "shell32", "ole32", "oleaut32", "olepro32", "oleacc", |
60 "user32", "usp10", "msimg32", "opengl32", "shlwapi", | 59 "user32", "usp10", "msimg32", "opengl32", "shlwapi", |
61 "zlib", "dwt-base" ] | 60 "zlib", "dwt-base" ] |
62 | 61 |
113 resdir_abs = File.expand_path( File.join( basedir, resdir )) | 112 resdir_abs = File.expand_path( File.join( basedir, resdir )) |
114 srcdir_abs = File.expand_path( File.join( basedir, srcdir )) | 113 srcdir_abs = File.expand_path( File.join( basedir, srcdir )) |
115 | 114 |
116 FileUtils.mkdir_p DIR_IMP | 115 FileUtils.mkdir_p DIR_IMP |
117 FileUtils.mkdir_p DIR_OBJ | 116 FileUtils.mkdir_p DIR_OBJ |
117 FileUtils.mkdir_p DIR_RES | |
118 FileUtils.cp FileList[ File.join(resdir_abs, "*" )], DIR_RES | |
118 | 119 |
119 rsp = File.new( FILE_RSP, "w+" ) | 120 rsp = File.new( FILE_RSP, "w+" ) |
120 rsp.puts "-H" | 121 rsp.puts "-H" |
121 #rsp.puts "-Hd#{DIR_IMP.to_path}" | 122 #rsp.puts "-Hd#{DIR_IMP.to_path}" |
122 rsp.puts "-I#{srcdir_abs.to_path}" | 123 rsp.puts "-I#{srcdir_abs.to_path}" |
123 rsp.puts "-I#{DIR_IMP.to_path}" | 124 rsp.puts "-I#{DIR_IMP.to_path}" |
124 rsp.puts "-J#{resdir_abs.to_path}" | 125 rsp.puts "-J#{DIR_RES.to_path}" |
125 if dcargs != nil | 126 if dcargs != nil |
126 rsp.puts dcargs | 127 rsp.puts dcargs |
127 end | |
128 ALL_RESDIRS.each do | dir | | |
129 rsp.puts "-J#{File.expand_path(dir).to_path}" | |
130 end | 128 end |
131 rsp.puts "-c" | 129 rsp.puts "-c" |
132 rsp.puts "-op" | 130 rsp.puts "-op" |
133 if isDebug | 131 if isDebug |
134 rsp.puts "-debug" | 132 rsp.puts "-debug" |
222 | 220 |
223 rsp = File.new( FILE_RSP, "w+" ) | 221 rsp = File.new( FILE_RSP, "w+" ) |
224 rsp.puts "-I#{srcdir_abs.to_path}" | 222 rsp.puts "-I#{srcdir_abs.to_path}" |
225 rsp.puts "-I#{DIR_IMP.to_path}" | 223 rsp.puts "-I#{DIR_IMP.to_path}" |
226 rsp.puts "-J#{resdir_abs.to_path}" | 224 rsp.puts "-J#{resdir_abs.to_path}" |
225 rsp.puts "-J#{DIR_RES.to_path}" | |
227 if isDebug | 226 if isDebug |
228 rsp.puts "-debug" | 227 rsp.puts "-debug" |
229 rsp.puts "-g" | 228 rsp.puts "-g" |
230 end | 229 end |
231 if dflags.size > 0 then | 230 if dflags.size > 0 then |
232 rsp.puts dflags | 231 rsp.puts dflags |
233 end | |
234 ALL_RESDIRS.each do | dir | | |
235 rsp.puts "-J#{File.expand_path(dir).to_path}" | |
236 end | 232 end |
237 | 233 |
238 rsp.puts "-op" | 234 rsp.puts "-op" |
239 rsp.puts "-od#{DIR_OBJ.to_path}" | 235 rsp.puts "-od#{DIR_OBJ.to_path}" |
240 applfile = File.join(DIR_BIN ,appnameprefix+appname+EXEEXT) | 236 applfile = File.join(DIR_BIN ,appnameprefix+appname+EXEEXT) |
246 if isWindows | 242 if isWindows |
247 rsp.puts "-L/NOM" | 243 rsp.puts "-L/NOM" |
248 libnames.each do | libname | | 244 libnames.each do | libname | |
249 rsp.puts "-L+#{libname}#{LIBEXT}" | 245 rsp.puts "-L+#{libname}#{LIBEXT}" |
250 end | 246 end |
251 rsp.puts "-L+dwt-base.lib" | |
252 rsp.puts "-L+#{BASEDIR_SWT}.lib" | |
253 rsp.puts "-L+#{DIR_LIB.to_path}\\" | 247 rsp.puts "-L+#{DIR_LIB.to_path}\\" |
254 else | 248 else |
255 rsp.puts "-L-L#{DIR_LIB.to_path}" | 249 rsp.puts "-L-L#{DIR_LIB.to_path}" |
256 libnames.reverse.each do | libname | | 250 libnames.reverse.each do | libname | |
257 absname = File.join( DIR_LIB, "#{libname}#{LIBEXT}" ); | 251 absname = File.join( DIR_LIB, "#{libname}#{LIBEXT}" ); |
289 puts "Cleaning" | 283 puts "Cleaning" |
290 FileUtils.rm_rf DIR_IMP | 284 FileUtils.rm_rf DIR_IMP |
291 FileUtils.rm_rf DIR_OBJ | 285 FileUtils.rm_rf DIR_OBJ |
292 FileUtils.rm_rf DIR_LIB | 286 FileUtils.rm_rf DIR_LIB |
293 FileUtils.rm_rf DIR_BIN | 287 FileUtils.rm_rf DIR_BIN |
288 FileUtils.rm_rf DIR_RES | |
294 FileUtils.rm FILE_RSP, :force => true | 289 FileUtils.rm FILE_RSP, :force => true |
295 FileUtils.rm LOG_STDOUT, :force => true | 290 FileUtils.rm LOG_STDOUT, :force => true |
296 FileUtils.rm LOG_STDERR, :force => true | 291 FileUtils.rm LOG_STDERR, :force => true |
297 end | 292 end |
298 | 293 |