GONTC = ../gontc
GFLAGS = -g -ugly

all: run-tests

opt:
	$(MAKE) GONTC=../gontc.opt

.SECONDARY: hello.gio test.gio

%.gio: %.gi $(GONTC)
	$(GONTC) $(GFLAGS) -c $<

%.o %.go: %.g %.gio $(GONTC)
	$(GONTC) -save-temps $(GFLAGS) -c $<

hello: hello.go
	$(GONTC) $^ -o $@

clean:
	rm -f *.o *.gio *.go test.ksi hello.ksi hello test-result core

run-tests:
	GONTC="$(GONTC) $(GFLAGS) -O3" perl tests
	@echo
	@echo "OK!"
