PROG=bgpq
SRCS=bgpq.c irrdi.c ro.c rpsl-ip.l sx_trace.c

CFLAGS+=-Wall @CFLAGS@ @DEFS@ -I.
LDADD+=@LIBS@

LEX=@LEX@
INSTALL=@INSTALL@

all: bgpq

bgpq: bgpq.o irrdi.o ro.o rpsl-ip.o sx_trace.o inet_aton.o utils.o
	$(CC) $(CFLAGS) bgpq.o irrdi.o ro.o rpsl-ip.o sx_trace.o inet_aton.o utils.o -o bgpq $(LDADD)

.c.o:
	$(CC) $(CFLAGS) -c $<

rpsl-ip.c: rpsl-ip.l
	$(LEX) $(LFLAGS) -t $< > $*.c

clean:
	@rm -f bgpq rpsl-ip.c *.o config.log config.status rpsl-ip.c bgpq.core

install: bgpq
	$(INSTALL) -s -m 755 bgpq @prefix@@bindir@
	$(INSTALL) -m 644 bgpq.8 @prefix@@mandir@/man8
