tinygo/Makefile
2018-04-13 02:12:36 +02:00

28 строки
501 Б
Makefile

# aliases
all: tgo
tgo: build/tgo
test: build/hello.o
.PHONY: all tgo test run-test clean
CFLAGS = -Wall -Werror -O2 -g -flto
build/tgo: *.go
@mkdir -p build
@go build -o build/tgo -i .
build/hello.o: build/tgo hello/hello.go
@./build/tgo -printir -o build/hello.o hello/hello.go
build/runtime.o: runtime/*.c runtime/*.h
clang $(CFLAGS) -c -o $@ runtime/*.c
build/hello: build/hello.o build/runtime.o
@clang $(CFLAGS) -o $@ $^
run-test: build/hello
@./build/hello
clean:
@rm -rf build