diff --git a/ChangeLog b/ChangeLog index bfe778c..d52fc16 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sat May 2 09:30:51 2009 Minero Aoki + + * net/loveruby/cflat/compiler/Compiler.java (commandMain): + refactoring: extract method: #buildTarget. + Thu Apr 30 22:53:10 2009 Minero Aoki * net/loveruby/cflat/compiler/CodeGenerator.java: remove unused diff --git a/net/loveruby/cflat/compiler/Compiler.java b/net/loveruby/cflat/compiler/Compiler.java index 699a6e1..d860c02 100644 --- a/net/loveruby/cflat/compiler/Compiler.java +++ b/net/loveruby/cflat/compiler/Compiler.java @@ -53,16 +53,7 @@ public class Compiler { } else { try { - for (SourceFile src : srcs) { - compileFile(src, opts); - } - if (! opts.isLinkRequired()) System.exit(0); - if (! opts.isGeneratingSharedLibrary()) { - generateExecutable(opts); - } - else { - generateSharedLibrary(opts); - } + buildTarget(srcs, opts); System.exit(0); } catch (CompileException ex) { @@ -91,6 +82,22 @@ public class Compiler { } } + // #@@range/buildTarget{ + protected void buildTarget(List srcs, Options opts) + throws CompileException { + for (SourceFile src : srcs) { + compileFile(src, opts); + } + if (! opts.isLinkRequired()) System.exit(0); + if (! opts.isGeneratingSharedLibrary()) { + generateExecutable(opts); + } + else { + generateSharedLibrary(opts); + } + } + // #@@} + protected void compileFile(SourceFile src, Options opts) throws CompileException { if (src.isCflatSource()) {