# (C)opyright 1995 by Darren Reed.
#
# Redistribution and use in source and binary forms are permitted
# provided that this notice is preserved and due credit is given
# to the original author and the contributors.
#
YACC=yacc
LEX=lex
# for Linux and others without the above
#YACC=bison
#LEX=flex
#
CFLAGS=-pipe -g
CC=gcc
OBJS=lex.yy.o y.tab.o var.o main.o db.o
MODS=prcisco.o pripf.o pripfw.o pripfwa.o prfirew.o prscd.o

all: flc

flc: $(OBJS) $(MODS)
	$(CC) $(CFLAGS) $(OBJS) $(MODS) -o $@ -ll

.c.o:
	$(CC) $(CFLAGS) -c $(*).c -o $@

lex.yy.o: lex.yy.c

lex.yy.c: lex.l y.tab.h var.h misc.h
	$(LEX) lex.l

y.tab.o: y.tab.c

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

clean:
	/bin/rm -f *.o y.tab.* lex.yy.* yac.tab.* core flc

var.o: var.c var.h y.tab.h misc.h
pripf.o: pripf.c var.h misc.h
pripfw.o: pripfw.c var.h misc.h
pripfwa.o: pripfwa.c var.h misc.h
prcisco.o: prcisco.c var.h misc.h
prscd.o: prscd.c var.h misc.h
