# Makefile for Metalog

PROGRAM=metalog
CPPC=g++
CPPFLAGS=-g
LEX=flex
YACC=bison -y -t -v
LIBS=-ll
LD=g++
LDFLAGS=

OBJS=lex.yy.o y.tab.o main.o Atom.o Procedure.o Program.o

.SUFFIXES: .cc .c

all : metalog

metalog : $(OBJS)
	$(LD) $(LDFLAGS) $(OBJS) -o $(PROGRAM) $(LIBS)

# for gnu make use "%.o : %.cc" below
.cc.o :
	$(CPPC) $(CPPFLAGS) -c $<

# for gnu make use "%.o : %.c" below
.c.o :
	$(CPPC) $(CPPFLAGS) -c $<

y.tab.h y.tab.c : parse.y
	$(YACC) -d parse.y

lex.yy.c : lex.l
	$(LEX) lex.l

$(OBJS) : Makefile
lex.yy.o : y.tab.h

# Cleaning up.

clean:
	rm -f a.out core lex.yy.c y.tab.[hc] *~ *.o *.aux *.log *.dvi *.toc *.fasl \#*

# DO NOT DELETE THIS LINE -- make depend depends on it.
