cli improvements
This commit is contained in:
4
example/.gitignore
vendored
4
example/.gitignore
vendored
@@ -1,2 +1,2 @@
|
||||
bin
|
||||
bin-int
|
||||
build
|
||||
out
|
||||
@@ -1,17 +1,18 @@
|
||||
CC = clang
|
||||
NUBC = ../src/compiler/NubLang.CLI/bin/Debug/net9.0/nubc
|
||||
|
||||
out: $(NUBC) main.nub
|
||||
$(NUBC) main.nub
|
||||
out: build/out.a
|
||||
$(CC) -o out build/out.a
|
||||
|
||||
build/out.a: $(NUBC) src/main.nub
|
||||
$(NUBC) src/main.nub
|
||||
|
||||
$(NUBC):
|
||||
dotnet build ../src/compiler/NubLang.CLI/NubLang.CLI.csproj
|
||||
|
||||
run: out
|
||||
out
|
||||
./out
|
||||
|
||||
clean:
|
||||
@rm -r build 2>/dev/null || true
|
||||
@rm out 2>/dev/null || true
|
||||
@rm out.a 2>/dev/null || true
|
||||
@find . -name "*.o" -type f -delete
|
||||
@find . -name "*.s" -type f -delete
|
||||
@find . -name "*.ssa" -type f -delete
|
||||
|
||||
8
example/src/main.nub
Normal file
8
example/src/main.nub
Normal file
@@ -0,0 +1,8 @@
|
||||
// c
|
||||
extern func puts(text: cstring)
|
||||
|
||||
func main(args: []cstring): i64
|
||||
{
|
||||
puts("Hello, World")
|
||||
return 0
|
||||
}
|
||||
Reference in New Issue
Block a user