...
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
module "main"
|
||||
import "test"
|
||||
|
||||
export extern "puts" func puts(text: cstring)
|
||||
|
||||
struct Human
|
||||
{
|
||||
name: cstring
|
||||
age: u64
|
||||
}
|
||||
|
||||
func main(args: []cstring): i64
|
||||
{
|
||||
let me: main::Human = {
|
||||
name = "Oliver"
|
||||
age = 21
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
@@ -3,8 +3,8 @@ NUBC = ../compiler/NubLang.CLI/bin/Debug/net9.0/nubc
|
||||
out: .build/out.o
|
||||
gcc -nostartfiles -o out x86_64.s .build/out.o
|
||||
|
||||
.build/out.o: $(NUBC) main.nub
|
||||
$(NUBC) main.nub
|
||||
.build/out.o: $(NUBC) src/main.nub src/test.nub
|
||||
$(NUBC) src/main.nub src/test.nub
|
||||
|
||||
.PHONY: $(NUBC)
|
||||
$(NUBC):
|
||||
|
||||
14
example/src/main.nub
Normal file
14
example/src/main.nub
Normal file
@@ -0,0 +1,14 @@
|
||||
module "main"
|
||||
import "test"
|
||||
|
||||
export extern "puts" func puts(text: cstring)
|
||||
|
||||
export struct Test1
|
||||
{
|
||||
test2: ^test::Test2
|
||||
}
|
||||
|
||||
extern "main" func main(args: []cstring): i64
|
||||
{
|
||||
return 0
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
.globl _start
|
||||
_start:
|
||||
mov rdi, rsp
|
||||
call main.main
|
||||
call main
|
||||
mov rdi, rax
|
||||
mov rax, 60
|
||||
syscall
|
||||
|
||||
Reference in New Issue
Block a user