r4632@macbookpro: aamine | 2009-05-02 09:30:52 +0900

* net/loveruby/cflat/compiler/Compiler.java (commandMain): refactoring: extract method: #buildTarget.
 


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@4169 1b9489fe-b721-0410-924e-b54b9192deb8
This commit is contained in:
Minero Aoki 2009-05-03 14:46:07 +00:00
parent b8ed3ab439
commit 05e1bc273a
2 changed files with 22 additions and 10 deletions

View File

@ -1,3 +1,8 @@
Sat May 2 09:30:51 2009 Minero Aoki <aamine@loveruby.net>
* net/loveruby/cflat/compiler/Compiler.java (commandMain):
refactoring: extract method: #buildTarget.
Thu Apr 30 22:53:10 2009 Minero Aoki <aamine@loveruby.net>
* net/loveruby/cflat/compiler/CodeGenerator.java: remove unused

View File

@ -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<SourceFile> 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()) {