# Makefile

# Allen Stoughton -- 1996

# if you want to use an ANSI C compiler other than GCC, change the following
# two lines as appropriate:
CC = gcc
CFLAGS = -O -DFLEX

# if you want to use Lex instead of Flex, (1) delete the option -DFLEX from
# CFLAGS (above) and (2) comment-out the following line:
LEX = flex
# (See interface.h for the effect of passing -DFLEX to CC)

# if you want to use Yacc instead of Bison, comment-out the following two
# lines:
YACC = bison
YFLAGS = -y

lambda: main.o parser.o mach_text_decl.o
	$(CC) $(CFLAGS) -o $@ main.o parser.o mach_text_decl.o

main.o: interface.h

parser.o: lexer.c interface.h

mach_text_decl.o: mach.c charstoc
	rm -f mach_text_decl.c
	./charstoc mach_text < mach.c > mach_text_decl.c
	$(CC) $(CFLAGS) -c mach_text_decl.c
	rm -f mach_text_decl.c

charstoc: charstoc.o
	$(CC) $(CFLAGS) -o $@ charstoc.o
