# Makefile -- build rules for BOCK
# Written by Charles Briscoe-Smith; refer to the file ../LEGAL for details.

srcdir = @srcdir@
VPATH = @srcdir@

default: check

@SET_MAKE@

    CC = @CC@
CFLAGS = -Wall -Werror @CFLAGS@ @DEFS@ -I@srcdir@
 JCOMP = BOCK=../bock BOCKLIB=../lib sh ../jcomp

.DELETE_ON_ERROR:

.SUFFIXES: .java

check:
	@./do-checks
	@echo '***' All tests passed.

clean:
	$(RM) -r output core jlex jlex.c jlex.o sample.lex.java

distclean: clean
	$(RM) Makefile

jlex.c: jlex.java ../lib/* ../bock
	../bock -s JLex.Main -o jlex.c jlex.java ../lib/*
jlex.o: jlex.c
	gcc -Wall -Wmissing-prototypes -c jlex.c -o jlex.o
jlex: jlex.o
	gcc -o jlex jlex.o -lgc
