mirror of
https://github.com/pfusik/xasm.git
synced 2024-10-05 17:55:50 +00:00
parent
384643ab84
commit
a0bfe1366d
11
source/app.d
11
source/app.d
@ -19,6 +19,7 @@
|
|||||||
import std.algorithm;
|
import std.algorithm;
|
||||||
import std.array;
|
import std.array;
|
||||||
import std.conv;
|
import std.conv;
|
||||||
|
import std.file;
|
||||||
import std.math;
|
import std.math;
|
||||||
import std.path;
|
import std.path;
|
||||||
import std.stdio;
|
import std.stdio;
|
||||||
@ -40,7 +41,7 @@ string sourceFilename = null;
|
|||||||
bool[26] options;
|
bool[26] options;
|
||||||
string[26] optionParameters;
|
string[26] optionParameters;
|
||||||
string[] commandLineDefinitions = null;
|
string[] commandLineDefinitions = null;
|
||||||
string makeTarget;
|
string objectFilename = null;
|
||||||
string[] makeSources = null;
|
string[] makeSources = null;
|
||||||
|
|
||||||
int exitCode = 0;
|
int exitCode = 0;
|
||||||
@ -1084,7 +1085,7 @@ File openOutputFile(char letter, string defaultExt) {
|
|||||||
if (filename is null)
|
if (filename is null)
|
||||||
filename = sourceFilename.setExtension(defaultExt);
|
filename = sourceFilename.setExtension(defaultExt);
|
||||||
if (letter == 'o')
|
if (letter == 'o')
|
||||||
makeTarget = makeEscape(filename);
|
objectFilename = filename;
|
||||||
try {
|
try {
|
||||||
return File(filename, "wb");
|
return File(filename, "wb");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@ -2963,6 +2964,10 @@ int main(string[] args) {
|
|||||||
} catch (AssemblyError e) {
|
} catch (AssemblyError e) {
|
||||||
warning(e.msg, true);
|
warning(e.msg, true);
|
||||||
exitCode = 2;
|
exitCode = 2;
|
||||||
|
if (objectStream.isOpen) {
|
||||||
|
objectStream.close();
|
||||||
|
remove(objectFilename);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
listingStream.close();
|
listingStream.close();
|
||||||
objectStream.close();
|
objectStream.close();
|
||||||
@ -2973,7 +2978,7 @@ int main(string[] args) {
|
|||||||
writefln("%d bytes written to the object file", objectBytes);
|
writefln("%d bytes written to the object file", objectBytes);
|
||||||
}
|
}
|
||||||
if (getOption('m')) {
|
if (getOption('m')) {
|
||||||
writef("%s:", makeTarget);
|
writef("%s:", makeEscape(objectFilename));
|
||||||
foreach (filename; makeSources)
|
foreach (filename; makeSources)
|
||||||
writef(" %s", makeEscape(filename));
|
writef(" %s", makeEscape(filename));
|
||||||
write("\n\txasm");
|
write("\n\txasm");
|
||||||
|
Loading…
Reference in New Issue
Block a user