Move string printing to runtime

This commit is contained in:
Ayke van Laethem
2018-04-11 20:41:09 +02:00
parent 7ffb73b407
commit d08ff64d1d
4 changed files with 105 additions and 33 deletions
+10 -5
View File
@@ -3,19 +3,24 @@ all: tgo
tgo: build/tgo
test: build/hello.o
.PHONY: all tgo test test-run clean
CFLAGS = -Wall -Werror -O2 -g -flto
.PHONY: all tgo test run-test clean
build/tgo: *.go
@mkdir -p build
@go build -o build/tgo -i .
build/hello.o: build/tgo hello/hello.go
@./build/tgo -printir -target x86_64-pc-linux-gnu -o build/hello.o hello/hello.go
@./build/tgo -printir -o build/hello.o hello/hello.go
build/hello: build/hello.o
@clang -o build/hello build/hello.o
build/runtime.o: runtime/*.c runtime/*.h
clang $(CFLAGS) -c -o $@ runtime/*.c
test-run: build/hello
build/hello: build/hello.o build/runtime.o
@clang $(CFLAGS) -o $@ $^
run-test: build/hello
@./build/hello
clean: