all : bootstrap goaway.c goaway .PHONY

self : goaway
	(cat rts.c && cat ${GALIBS} goaway.ga | ./goaway) > self.c

test : all .PHONY
	@sh fixperms.sh
	@GAFLAGS="" time tests/exercise

sloc : .PHONY
	@for x in bootstrap.c rts.c prelude.ga parsers.ga goaway.ga; do \
      printf '%-16s %d\n' $$x `./sloc $$x`; \
    done

bootstrap : bootstrap.c

GALIBS = prelude.ga parsers.ga
%.c : %.ga ${GALIBS} bootstrap rts.c
	(cat rts.c && cat ${GALIBS} $*.ga | ./bootstrap) > $*.c

.PHONY:
