YFLAGS  = -dv -t -b y
CFLAGS  = -O
LFLAGS  =
LEX		= flex
YACC	= bison

SRC     = gram.y scan.l main.c
OBJ     = gram.o scan.o main.o
BIN		= /opt/local/bin/objc20

all:	objc20 test

$(BIN): $(OBJ)
	cc $(CFLAGS) -o $(BIN) $(OBJ)

scan.o:	y.tab.h

test:
	cpp -P -xc main.c | $(BIN)
	cpp -P -xobjective-c test.m | $(BIN)
	cpp -P -xobjective-c NSString.m | $(BIN)

clean:
	rm -rf build y.tab.h y.output *.o
	
src:	clean
	tar cvzf objc20.tgz Makefile *.m *.y *.c *.l *.xcodeproj ToDo

