added cabal build system

This commit is contained in:
2025-09-06 02:53:54 +01:00
parent 17a0263af3
commit 4fd4ef20ab
8 changed files with 62 additions and 18 deletions

14
app/Main.hs Normal file
View File

@@ -0,0 +1,14 @@
module Main where
import Parser
import Compiler
import System.Process
import System.IO
main :: IO ()
main = do
contents <- getContents
withFile "out.asm" WriteMode (\f -> compileZorth f $ parseZorth contents)
readProcess "nasm" ["-f", "elf64", "out.asm", "-o", "out.o"] ""
readProcess "ld" ["out.o", "-o", "a.out"] ""
return ()