...
This commit is contained in:
1
example/.gitignore
vendored
1
example/.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
.build
|
||||
out.a
|
||||
out
|
||||
@@ -1,18 +1,16 @@
|
||||
CC = gcc
|
||||
NUBC = ../src/compiler/NubLang.CLI/bin/Debug/net9.0/nubc
|
||||
NUBC = ../compiler/NubLang.CLI/bin/Debug/net9.0/nubc
|
||||
|
||||
.build/out: .build/out.a
|
||||
$(CC) -ffreestanding -g -o .build/out .build/out.a
|
||||
out: out.a
|
||||
gcc -nostartfiles -o out x86_64.s out.a
|
||||
rm out.a
|
||||
|
||||
.build/out.a: $(NUBC) src/main.nub
|
||||
$(NUBC) src/main.nub
|
||||
out.a: $(NUBC) main.nub
|
||||
$(NUBC) main.nub
|
||||
|
||||
.PHONY: $(NUBC)
|
||||
$(NUBC):
|
||||
dotnet build ../src/compiler/NubLang.CLI/NubLang.CLI.csproj
|
||||
|
||||
run: .build/out
|
||||
./.build/out
|
||||
dotnet build ../compiler/NubLang.CLI/NubLang.CLI.csproj
|
||||
|
||||
clean:
|
||||
@rm -r .build 2>/dev/null || true
|
||||
@rm out 2>/dev/null || true
|
||||
@rm out.a 2>/dev/null || true
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
module main
|
||||
|
||||
extern func puts(text: cstring)
|
||||
|
||||
struct Test
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
func main(args: []cstring): i64
|
||||
{
|
||||
puts("test")
|
||||
|
||||
return 0
|
||||
}
|
||||
Reference in New Issue
Block a user