mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-20 12:58:39 +00:00
38 lines
840 B
C#
38 lines
840 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.IO;
|
|
|
|
namespace Cosmos.Compiler.Builder
|
|
{
|
|
public class AssembleStep : BuilderStep
|
|
{
|
|
|
|
public AssembleStep (BuildOptions options)
|
|
: base(options)
|
|
{
|
|
}
|
|
|
|
|
|
override public void Execute()
|
|
{
|
|
Init();
|
|
|
|
buildFileUtils.RemoveFile(BuildPath + "output.obj");
|
|
var xFormat = "bin";
|
|
if (IsELF)
|
|
{
|
|
xFormat = "elf";
|
|
}
|
|
Global.Call(ToolsPath + @"nasm\nasm.exe", String.Format("-g -f {0} -o \"{1}\" \"{2}\"", xFormat, BuildPath + "output.obj", AsmPath + "main.asm"), BuildPath);
|
|
|
|
Finish();
|
|
}
|
|
|
|
|
|
public bool IsELF { get; set; }
|
|
|
|
|
|
}
|
|
}
|